Skip to content

Commit 2138a92

Browse files
committed
Small changes
1 parent 7a8c7e3 commit 2138a92

File tree

4 files changed

+40
-3
lines changed

4 files changed

+40
-3
lines changed

python/sphinx_docs/docs/common.rst

+18
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,22 @@
11
OPM Common Python Documentation
22
===============================
33

4+
Note on Import Paths
5+
--------------------
6+
7+
In this documentation, you may notice that some classes are referenced with their full import paths (e.g., opm.io.deck.DeckItem), while others are shown with just the class name. This distinction reflects how these classes are structured within the package:
8+
9+
- Fully Qualified Paths: Classes displayed with their full import paths can be directly imported from their respective modules. For example:
10+
.. code-block:: python
11+
12+
from opm.io.deck import DeckItem
13+
14+
15+
- Simplified Class Names: Classes displayed with just their names, e.g. Connectoin, are intended for internal use or may require additional context when importing. Refer to the specific module documentation for the correct import path if needed.
16+
17+
This structure allows for a organized and modular package, helping to easily access commonly used classes while maintaining clarity for internal components.
18+
19+
Documentation
20+
-------------
21+
422
.. opm_common_docstrings::

python/sphinx_docs/docs/flow-in-python.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -36,18 +36,16 @@ If you installed in a non-standard directory by specifying -DCMAKE_INSTALL_PREFI
3636
3737
PYTHONPATH=/opt/opm/lib/python3.11/site-packages python3 spe1case1.py
3838
39-
Here, spe1case1.py could be:
39+
Here, the example script spe1case1.py could be:
4040

4141
.. code-block:: python
4242
43-
import os
4443
from opm.simulators import BlackOilSimulator
4544
from opm.io.parser import Parser
4645
from opm.io.ecl_state import EclipseState
4746
from opm.io.schedule import Schedule
4847
from opm.io.summary import SummaryConfig
4948
50-
os.chdir("SPE1CASE1")
5149
deck = Parser().parse('SPE1CASE1.DATA')
5250
state = EclipseState(deck)
5351
schedule = Schedule( deck, state )
@@ -61,3 +59,5 @@ Here, spe1case1.py could be:
6159
sim.set_porosity(poro)
6260
sim.step()
6361
sim.step_cleanup()
62+
63+
where you could use the SPE1CASE1.DATA file from `the opm-test repository <https://github.com/OPM/opm-tests/tree/master/spe1>`_.

python/sphinx_docs/docs/index.rst

+5
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ There are two Python APIs within OPM Flow:
77
- running a Python script embedded in a simulation (see :doc:`embedded-python`)
88

99

10+
This site further contains the documentation of:
11+
12+
- the classes available from OPM Common (see :doc:`common`)
13+
- the classes available from OPM Simulators (see :doc:`simulators`)
14+
1015
Contents
1116
========
1217
.. toctree::
+14
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,18 @@
11
OPM Simulators Python Documentation
22
===================================
33

4+
Note on Import Paths
5+
--------------------
6+
7+
In this documentation, the BlackOilSimulator class is referenced with its full import path, i.e., opm.simulators.BlackOilSimulator. This reflects how the BlackOilSimulator class can be imported:
8+
9+
.. code-block:: python
10+
11+
from opm.simulators import BlackOilSimulator
12+
13+
14+
Documentation
15+
-------------
16+
17+
418
.. opm_simulators_docstrings::

0 commit comments

Comments
 (0)