Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/ci_pycopm_ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ jobs:
with:
fetch-depth: 0

- name: Set up Python 3.11
- name: Set up Python 3.12
uses: actions/setup-python@v2
with:
python-version: 3.11
python-version: 3.12

- name: Install Flow Simulator
run: |
Expand All @@ -45,7 +45,7 @@ jobs:

- name: Check code style and linting
run: |
black --check src/ tests/
black --target-version py312 --check src/ tests/
pylint src/ tests/
mypy --ignore-missing-imports src/ tests/

Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ Contributions are more than welcome using the fork and pull request approach
1. Work on your own fork of the main repo
1. In the main repo execute:
1. **pip install -r dev-requirements.txt** (this installs the [_dev-requirements.txt_](https://github.com/cssr-tools/pycopm/blob/main/dev-requirements.txt))
1. **black src/ tests/** (this formats the code)
1. **black --target-version py312 src/ tests/** (this formats the code)
1. **pylint src/ tests/** (this analyses the code, and might rise issues that need to be fixed before the pull request)
1. **mypy --ignore-missing-imports src/ tests/** (this is a static checker, and might rise issues that need to be fixed before the pull request)
1. **pytest --cov=pycopm --cov-report term-missing tests/** (this runs locally the tests, and might rise issues that need to be fixed before the pull request)
1. **pycopm -i examples/decks/HELLO_WORLD.DATA -c 5,5,1 -m all -o output** (this runs the hello world example, which succeeds if the file output/HELLO_WORLD_PYCOPM.EGRID is created)
1. **pushd docs & make html** (this generates the documentation, and might rise issues that need to be fixed before the pull request; if the build succeeds and if the contribution changes the documentation, then copy all content from the docs/_build/html/ folder and replace the files in the [_docs_](https://github.com/cssr-tools/pycopm/tree/main/docs) folder)
* Tip for Linux users: See the [_ci_pycopm_ubuntu.yml_](https://github.com/cssr-tools/pycopm/blob/main/.github/workflows/ci_pycopm_ubuntu.yml) script and the [_Actions_](https://github.com/cssr-tools/pycopm/actions) for installation of pycopm, OPM Flow (binary packages), and dependencies, as well as the execution of the seven previous steps in Ubuntu 24.04 using Python 3.11.
* Tip for Linux users: See the [_ci_pycopm_ubuntu.yml_](https://github.com/cssr-tools/pycopm/blob/main/.github/workflows/ci_pycopm_ubuntu.yml) script and the [_Actions_](https://github.com/cssr-tools/pycopm/actions) for installation of pycopm, OPM Flow (binary packages), and dependencies, as well as the execution of the seven previous steps in Ubuntu 24.04 using Python 3.12.
* Tip for macOS users: See the [_ci_pycopm_macos_.yml_](https://github.com/daavid00/OPM-Flow_macOS/blob/main/.github/workflows/ci_pycopm_macos.yml) script and the [_OPM-Flow_macOS Actions_](https://github.com/cssr-tools/pycopm/actions) for installation of pycopm, OPM Flow (source build), and dependencies, as well as running the tests and the hello world example in macOS 26 using Python3.13. Note that if you do not add the directory containing the OPM Flow executable to your system's PATH environment variable (e.g., export PATH=$PATH:/Users/yourname/pycopm/build/opm-simulators/bin), then you can pass this in the execution of the tests and pycopm using the flags **-f/--flow** (see [_ci_pycopm_macos.yml_](https://github.com/daavid00/OPM-Flow_macOS/blob/main/.github/workflows/ci_pycopm_macos.yml#L76)).
1. Squash your commits into a single commit (see this [_nice tutorial_](https://gist.github.com/lpranam/4ae996b0a4bc37448dc80356efbca7fa) if you are not familiar with this)
1. Push your commit and make a pull request
Expand Down
4 changes: 2 additions & 2 deletions docs/_sources/contributing.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ Contribute to the software
#. In the main repo execute:

#. **pip install -r dev-requirements.txt** (this installs the `dev-requirements.txt <https://github.com/cssr-tools/pycopm/blob/main/dev-requirements.txt>`_)
#. **black src/ tests/** (this formats the code)
#. **black --target-version py312 src/ tests/** (this formats the code)
#. **pylint src/ tests/** (this analyses the code, and might rise issues that need to be fixed before the pull request)
#. **mypy --ignore-missing-imports src/ tests/** (this is a static checker, and might rise issues that need to be fixed before the pull request)
#. **pytest --cov=pycopm --cov-report term-missing tests/** (this runs locally the tests, and might rise issues that need to be fixed before the pull request)
#. **pycopm -i examples/decks/HELLO_WORLD.DATA -c 5,5,1 -m all -o output** (this runs the hello world example, which succeeds if the file output/HELLO_WORLD_PYCOPM.EGRID is created)
#. **pushd docs & make html** (this generates the documentation, and might rise issues that need to be fixed before the pull request; if the build succeeds and if the contribution changes the documentation, then copy all content from the docs/_build/html/ folder and replace the files in the `docs <https://github.com/cssr-tools/pycopm/tree/main/docs>`_ folder)

.. tip::
See the `ci_pycopm_ubuntu.yml <https://github.com/cssr-tools/pycopm/blob/main/.github/workflows/ci_pycopm_ubuntu.yml>`_ script and the `Actions <https://github.com/cssr-tools/pycopm/actions>`_ for installation of pycopm, OPM Flow (binary packages), and dependencies, as well as the execution of the seven previous steps in Ubuntu 24.04 using Python 3.11.
See the `ci_pycopm_ubuntu.yml <https://github.com/cssr-tools/pycopm/blob/main/.github/workflows/ci_pycopm_ubuntu.yml>`_ script and the `Actions <https://github.com/cssr-tools/pycopm/actions>`_ for installation of pycopm, OPM Flow (binary packages), and dependencies, as well as the execution of the seven previous steps in Ubuntu 24.04 using Python 3.12.
For macOS users, see the `ci_pycopm_macos.yml <https://github.com/daavid00/OPM-Flow_macOS/blob/main/.github/workflows/ci_pycopm_macos.yml>`_ script and the `OPM-Flow_macOS Actions <https://github.com/cssr-tools/pycopm/actions>`_ for installation of pycopm, OPM Flow (source build), and dependencies, as well as running the tests and the hello world example in macOS 26 using Python3.13.
Note that if you do not add the directory containing the OPM Flow executable to your system's PATH environment variable (e.g., export PATH=$PATH:/Users/yourname/pycopm/build/opm-simulators/bin), then you can pass this in the execution of the tests and pycopm using the flags **-f/--flow** (see `this script <https://github.com/daavid00/OPM-Flow_macOS/blob/main/.github/workflows/ci_pycopm_macos.yml#L72>`_).

Expand Down
48 changes: 3 additions & 45 deletions docs/_sources/installation.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ in the terminal the following lines (which in turn should build flow in the fold
do git clone https://github.com/OPM/opm-$repo.git
mkdir build/opm-$repo
cd build/opm-$repo
cmake -DUSE_MPI=1 -DWITH_NDEBUG=1 -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="$CURRENT_DIRECTORY/build/opm-common;$CURRENT_DIRECTORY/build/opm-grid" $CURRENT_DIRECTORY/opm-$repo
cmake -DUSE_MPI=1 -DWITH_NDEBUG=1 -DCMAKE_BUILD_TYPE=Release $CURRENT_DIRECTORY/opm-$repo
if [[ $repo == simulators ]]; then
make -j5 flow
else
Expand All @@ -108,7 +108,7 @@ Brew formula for macOS
++++++++++++++++++++++
For macOS, there are no available binary packages, so OPM Flow needs to be built from source. Recently, a formula to build flow using brew has
been added in `https://github.com/cssr-tools/homebrew-opm <https://github.com/cssr-tools/homebrew-opm>`_.
Then, you can try to install flow (v2025.10) by simply typing:
Then, you can try to install flow (v2026.02) by simply typing:

.. code-block:: console

Expand All @@ -121,46 +121,4 @@ You can check if the installation of OPM Flow succeded by typing in the terminal

Source build in macOS
+++++++++++++++++++++
If you would like to build the latest OPM Flow from the master branch, then you can first install the prerequisites using brew:

.. code-block:: console

brew install cjson boost openblas suite-sparse python@3.13 cmake

In addition, it is recommended to uprade and update your macOS to the latest available versions (the following steps have
worked for macOS Tahoe 26.2.0 with Apple clang version 17.0.0). After the prerequisites are installed, then building OPM Flow
can be achieved with the following bash lines:

.. code-block:: console

CURRENT_DIRECTORY="$PWD"

for module in common geometry grid istl
do git clone https://gitlab.dune-project.org/core/dune-$module.git
cd dune-$module && git checkout v2.10.0 && cd ..
./dune-common/bin/dunecontrol --only=dune-$module cmake -DCMAKE_DISABLE_FIND_PACKAGE_MPI=1
./dune-common/bin/dunecontrol --only=dune-$module make -j5
done

mkdir build

for repo in common grid simulators
do git clone https://github.com/OPM/opm-$repo.git
mkdir build/opm-$repo && cd build/opm-$repo
cmake -DUSE_MPI=0 -DWITH_NDEBUG=1 -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="$CURRENT_DIRECTORY/dune-common/build-cmake;$CURRENT_DIRECTORY/dune-grid/build-cmake;$CURRENT_DIRECTORY/dune-geometry/build-cmake;$CURRENT_DIRECTORY/dune-istl/build-cmake;$CURRENT_DIRECTORY/build/opm-common;$CURRENT_DIRECTORY/build/opm-grid" $CURRENT_DIRECTORY/opm-$repo
if [[ $repo == simulators ]]; then
make -j5 flow
else
make -j5 opm$repo
fi
cd ../..
done

echo "export PATH=\$PATH:$CURRENT_DIRECTORY/build/opm-simulators/bin" >> ~/.zprofile
source ~/.zprofile

This builds OPM Flow, and it exports the path to the flow executable.

.. tip::
See `this repository <https://github.com/daavid00/OPM-Flow_macOS>`_ dedicated to build OPM Flow from source in the latest macOS (GitHub actions), and tested with **pycopm**.
If you still face problems, raise an issue in the GitHub repository, or you could also send an email to the maintainers.
See `this repository <https://github.com/daavid00/OPM-Flow_macOS>`_ dedicated to build OPM Flow from source in the latest macOS (GitHub actions), and tested with **pycopm**
4 changes: 2 additions & 2 deletions docs/contributing.html
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ <h2>Contribute to the software<a class="headerlink" href="#contribute-to-the-sof
<blockquote>
<div><ol class="arabic simple">
<li><p><strong>pip install -r dev-requirements.txt</strong> (this installs the <a class="reference external" href="https://github.com/cssr-tools/pycopm/blob/main/dev-requirements.txt">dev-requirements.txt</a>)</p></li>
<li><p><strong>black src/ tests/</strong> (this formats the code)</p></li>
<li><p><strong>black –target-version py312 src/ tests/</strong> (this formats the code)</p></li>
<li><p><strong>pylint src/ tests/</strong> (this analyses the code, and might rise issues that need to be fixed before the pull request)</p></li>
<li><p><strong>mypy –ignore-missing-imports src/ tests/</strong> (this is a static checker, and might rise issues that need to be fixed before the pull request)</p></li>
<li><p><strong>pytest –cov=pycopm –cov-report term-missing tests/</strong> (this runs locally the tests, and might rise issues that need to be fixed before the pull request)</p></li>
Expand All @@ -117,7 +117,7 @@ <h2>Contribute to the software<a class="headerlink" href="#contribute-to-the-sof
</ol>
<div class="admonition tip">
<p class="admonition-title">Tip</p>
<p>See the <a class="reference external" href="https://github.com/cssr-tools/pycopm/blob/main/.github/workflows/ci_pycopm_ubuntu.yml">ci_pycopm_ubuntu.yml</a> script and the <a class="reference external" href="https://github.com/cssr-tools/pycopm/actions">Actions</a> for installation of pycopm, OPM Flow (binary packages), and dependencies, as well as the execution of the seven previous steps in Ubuntu 24.04 using Python 3.11.
<p>See the <a class="reference external" href="https://github.com/cssr-tools/pycopm/blob/main/.github/workflows/ci_pycopm_ubuntu.yml">ci_pycopm_ubuntu.yml</a> script and the <a class="reference external" href="https://github.com/cssr-tools/pycopm/actions">Actions</a> for installation of pycopm, OPM Flow (binary packages), and dependencies, as well as the execution of the seven previous steps in Ubuntu 24.04 using Python 3.12.
For macOS users, see the <a class="reference external" href="https://github.com/daavid00/OPM-Flow_macOS/blob/main/.github/workflows/ci_pycopm_macos.yml">ci_pycopm_macos.yml</a> script and the <a class="reference external" href="https://github.com/cssr-tools/pycopm/actions">OPM-Flow_macOS Actions</a> for installation of pycopm, OPM Flow (source build), and dependencies, as well as running the tests and the hello world example in macOS 26 using Python3.13.
Note that if you do not add the directory containing the OPM Flow executable to your system’s PATH environment variable (e.g., export PATH=$PATH:/Users/yourname/pycopm/build/opm-simulators/bin), then you can pass this in the execution of the tests and pycopm using the flags <strong>-f/–flow</strong> (see <a class="reference external" href="https://github.com/daavid00/OPM-Flow_macOS/blob/main/.github/workflows/ci_pycopm_macos.yml#L72">this script</a>).</p>
</div>
Expand Down
45 changes: 3 additions & 42 deletions docs/installation.html
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ <h3>Source build in Linux/Windows<a class="headerlink" href="#source-build-in-li
<span class="go">do git clone https://github.com/OPM/opm-$repo.git</span>
<span class="go"> mkdir build/opm-$repo</span>
<span class="go"> cd build/opm-$repo</span>
<span class="go"> cmake -DUSE_MPI=1 -DWITH_NDEBUG=1 -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=&quot;$CURRENT_DIRECTORY/build/opm-common;$CURRENT_DIRECTORY/build/opm-grid&quot; $CURRENT_DIRECTORY/opm-$repo</span>
<span class="go"> cmake -DUSE_MPI=1 -DWITH_NDEBUG=1 -DCMAKE_BUILD_TYPE=Release $CURRENT_DIRECTORY/opm-$repo</span>
<span class="go"> if [[ $repo == simulators ]]; then</span>
<span class="go"> make -j5 flow</span>
<span class="go"> else</span>
Expand All @@ -184,7 +184,7 @@ <h3>Source build in Linux/Windows<a class="headerlink" href="#source-build-in-li
<span id="macos"></span><h3>Brew formula for macOS<a class="headerlink" href="#brew-formula-for-macos" title="Link to this heading"></a></h3>
<p>For macOS, there are no available binary packages, so OPM Flow needs to be built from source. Recently, a formula to build flow using brew has
been added in <a class="reference external" href="https://github.com/cssr-tools/homebrew-opm">https://github.com/cssr-tools/homebrew-opm</a>.
Then, you can try to install flow (v2025.10) by simply typing:</p>
Then, you can try to install flow (v2026.02) by simply typing:</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="go">brew install cssr-tools/opm/opm-simulators</span>
</pre></div>
</div>
Expand All @@ -196,46 +196,7 @@ <h3>Source build in Linux/Windows<a class="headerlink" href="#source-build-in-li
</section>
<section id="source-build-in-macos">
<h3>Source build in macOS<a class="headerlink" href="#source-build-in-macos" title="Link to this heading"></a></h3>
<p>If you would like to build the latest OPM Flow from the master branch, then you can first install the prerequisites using brew:</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="go">brew install cjson boost openblas suite-sparse python@3.13 cmake</span>
</pre></div>
</div>
<p>In addition, it is recommended to uprade and update your macOS to the latest available versions (the following steps have
worked for macOS Tahoe 26.2.0 with Apple clang version 17.0.0). After the prerequisites are installed, then building OPM Flow
can be achieved with the following bash lines:</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="go">CURRENT_DIRECTORY=&quot;$PWD&quot;</span>

<span class="go">for module in common geometry grid istl</span>
<span class="go">do git clone https://gitlab.dune-project.org/core/dune-$module.git</span>
<span class="go"> cd dune-$module &amp;&amp; git checkout v2.10.0 &amp;&amp; cd ..</span>
<span class="go"> ./dune-common/bin/dunecontrol --only=dune-$module cmake -DCMAKE_DISABLE_FIND_PACKAGE_MPI=1</span>
<span class="go"> ./dune-common/bin/dunecontrol --only=dune-$module make -j5</span>
<span class="go">done</span>

<span class="go">mkdir build</span>

<span class="go">for repo in common grid simulators</span>
<span class="go">do git clone https://github.com/OPM/opm-$repo.git</span>
<span class="go"> mkdir build/opm-$repo &amp;&amp; cd build/opm-$repo</span>
<span class="go"> cmake -DUSE_MPI=0 -DWITH_NDEBUG=1 -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=&quot;$CURRENT_DIRECTORY/dune-common/build-cmake;$CURRENT_DIRECTORY/dune-grid/build-cmake;$CURRENT_DIRECTORY/dune-geometry/build-cmake;$CURRENT_DIRECTORY/dune-istl/build-cmake;$CURRENT_DIRECTORY/build/opm-common;$CURRENT_DIRECTORY/build/opm-grid&quot; $CURRENT_DIRECTORY/opm-$repo</span>
<span class="go"> if [[ $repo == simulators ]]; then</span>
<span class="go"> make -j5 flow</span>
<span class="go"> else</span>
<span class="go"> make -j5 opm$repo</span>
<span class="go"> fi</span>
<span class="go"> cd ../..</span>
<span class="go">done</span>

<span class="go">echo &quot;export PATH=\$PATH:$CURRENT_DIRECTORY/build/opm-simulators/bin&quot; &gt;&gt; ~/.zprofile</span>
<span class="go">source ~/.zprofile</span>
</pre></div>
</div>
<p>This builds OPM Flow, and it exports the path to the flow executable.</p>
<div class="admonition tip">
<p class="admonition-title">Tip</p>
<p>See <a class="reference external" href="https://github.com/daavid00/OPM-Flow_macOS">this repository</a> dedicated to build OPM Flow from source in the latest macOS (GitHub actions), and tested with <strong>pycopm</strong>.
If you still face problems, raise an issue in the GitHub repository, or you could also send an email to the maintainers.</p>
</div>
<p>See <a class="reference external" href="https://github.com/daavid00/OPM-Flow_macOS">this repository</a> dedicated to build OPM Flow from source in the latest macOS (GitHub actions), and tested with <strong>pycopm</strong></p>
</section>
</section>
</section>
Expand Down
2 changes: 1 addition & 1 deletion docs/searchindex.js

Large diffs are not rendered by default.

Loading
Loading