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: 2 additions & 4 deletions .github/workflows/ci_pycopm_docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,11 @@ jobs:
run-pycopm-docker:
permissions:
contents: read
pull-requests: write
timeout-minutes: 30
runs-on: ubuntu-latest
runs-on: ubuntu-26.04

steps:
- name: Checkout repository
uses: actions/checkout@v4
- uses: actions/checkout@v5

- name: Build Docker image
run: docker build -t test-image .
Expand Down
10 changes: 4 additions & 6 deletions .github/workflows/ci_pycopm_macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,25 @@ jobs:
run-pycopm-macos:
permissions:
contents: read
pull-requests: write
timeout-minutes: 90
runs-on: macos-latest
runs-on: macos-26.04

steps:
- name: Checkout repository
uses: actions/checkout@v4
- uses: actions/checkout@v5

- name: Install OPM Flow
run: |
brew tap cssr-tools/opm
brew trust cssr-tools/opm
brew install cssr-tools/opm/opm-simulators -y

- name: Install python requirements
- name: Install pycopm and python requirements
run: |
python3 -m venv vpycopm
. vpycopm/bin/activate
echo "$PWD/vpycopm/bin" >> $GITHUB_PATH
pip install --upgrade pip setuptools wheel
pip install -e .
pip install .
pip install -r dev-requirements.txt

- name: Run the hello world example in pycopm
Expand Down
37 changes: 10 additions & 27 deletions .github/workflows/ci_pycopm_ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,36 +7,19 @@ jobs:
run-pycopm-ubuntu:
permissions:
contents: read
pull-requests: write
timeout-minutes: 30
runs-on: ubuntu-24.04
container:
image: ubuntu:26.04
runs-on: ubuntu-26.04

steps:
- name: Checkout repository
uses: actions/checkout@v4
- uses: actions/checkout@v5

- name: Install system dependencies
- name: Install Flow Simulator and ert dependency
run: |
apt-get update
DEBIAN_FRONTEND=noninteractive apt-get install -y \
python3 python3-pip python3-venv \
build-essential git curl ca-certificates \
software-properties-common \
octave \
mpi-default-bin \
freeglut3-dev \
libhdf5-dev

ln -s /usr/bin/python3 /usr/bin/python || true

- name: Install Flow Simulator
run: |
apt-get update
apt-add-repository ppa:opm/ppa
apt-get update
DEBIAN_FRONTEND=noninteractive apt-get install -y libopm-simulators-bin
sudo apt-get update
sudo apt-get install software-properties-common mpi-default-bin libhdf5-dev freeglut3-dev
sudo apt-add-repository ppa:opm/ppa
sudo apt-get update
sudo apt-get install libopm-simulators-bin

- name: Install python requirements
run: |
Expand All @@ -49,7 +32,7 @@ jobs:

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

Expand All @@ -74,4 +57,4 @@ jobs:
- name: Build documentation
run: |
cd docs
make html
make html SPHINXOPTS="-W"
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ Contributions are more than welcome using the fork and pull request approach

## Ground Rules

- We use Black code formatting
- We use Pylint
- We use [_Black code formatting_](https://black.readthedocs.io/en/stable/)
- We use [_Pylint_](https://pylint.readthedocs.io/en/stable/)
- We document our code

## Contribute to the software

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 --target-version py312 src/ tests/** (this formats the code)
1. **black --target-version py314 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 --basetemp=test_outputs tests/ -n auto** (this runs locally the tests, and might rise issues that need to be fixed before the pull request)
Expand Down
8 changes: 4 additions & 4 deletions docs/_sources/contributing.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,17 @@ 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 --target-version py312 src/ tests/** (this formats the code)
#. **black \-\-target-version py314 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 --basetemp=test_outputs tests/ -n auto** (this runs locally the tests, 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 \-\-basetemp=test_outputs tests/ -n auto** (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 26.04 using Python 3.14.
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.14.
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>`_).
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>`_).

#. Squash your commits into a single commit (see this `nice tutorial <https://gist.github.com/lpranam/4ae996b0a4bc37448dc80356efbca7fa>`_ if you are not familiar with this)
#. Push your commit and make a pull request
Expand Down
4 changes: 3 additions & 1 deletion docs/_sources/examples.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ For additional examples demonstrating the applicability of **pycopm**, see the `

.. code-block:: bash

brew install cssr-tools/opm/resinsight
brew tap cssr-tools/opm
brew trust cssr-tools/opm
brew install cssr-tools/opm/resinsight -y

Then, you should be able to open resinsight by typing in the terminal **resinsight**. If you have issues installing ResInsight, `ParaView <https://www.paraview.org>`_ can be also used. However, you need to add the flag **\-\-enable-vtk-output=true**
to OPM Flow.
Expand Down
10 changes: 6 additions & 4 deletions docs/_sources/installation.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ supported either via source builds or through running a virtual machine.
.. tip::

See the `ci_pycopm_ubuntu.yml <https://github.com/cssr-tools/pycopm/blob/main/.github/workflows/ci_pycopm_ubuntu.yml>`_ script
for installation of OPM Flow (binary packages) and the pycopm package in Ubuntu.
for installation of OPM Flow (binary packages) and the pycopm package in Ubuntu 26.04 and Python 3.14.

Source build in Linux/Windows
+++++++++++++++++++++++++++++
Expand Down Expand Up @@ -116,11 +116,13 @@ 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 (v2026.02) by simply typing:
Then, you can try to install flow (v2026.07 interim release) by simply typing:

.. code-block:: console

brew install cssr-tools/opm/opm-simulators
brew tap cssr-tools/opm
brew trust cssr-tools/opm
brew install cssr-tools/opm/opm-simulators -y

You can check if the installation of OPM Flow succeded by typing in the terminal **flow \-\-help**.

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

Source build in macOS
+++++++++++++++++++++
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**
See `this repository <https://github.com/daavid00/OPM-Flow_macOS>`_ dedicated to build OPM Flow from source in macOS 26 (GitHub actions), and tested with **pycopm**
2 changes: 1 addition & 1 deletion 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 --target-version py312 src/ tests/</strong> (this formats the code)</p></li>
<li><p><strong>black --target-version py314 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 --basetemp=test_outputs tests/ -n auto</strong> (this runs locally the tests, and might rise issues that need to be fixed before the pull request)</p></li>
Expand Down
4 changes: 3 additions & 1 deletion docs/examples.html
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,9 @@ <h1>Examples<a class="headerlink" href="#examples" title="Link to this heading">
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>There are binary packages for Linux and Windows to install Resinsight, see the <a class="reference external" href="https://resinsight.org/releases/">ResInsight Documentation</a>. For macOS users, you could try to install it using <a class="reference external" href="https://brew.sh">brew</a> by executing:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>brew<span class="w"> </span>install<span class="w"> </span>cssr-tools/opm/resinsight
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>brew<span class="w"> </span>tap<span class="w"> </span>cssr-tools/opm
brew<span class="w"> </span>trust<span class="w"> </span>cssr-tools/opm
brew<span class="w"> </span>install<span class="w"> </span>cssr-tools/opm/resinsight<span class="w"> </span>-y
</pre></div>
</div>
<p>Then, you should be able to open resinsight by typing in the terminal <strong>resinsight</strong>. If you have issues installing ResInsight, <a class="reference external" href="https://www.paraview.org">ParaView</a> can be also used. However, you need to add the flag <strong>--enable-vtk-output=true</strong>
Expand Down
10 changes: 6 additions & 4 deletions docs/installation.html
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ <h3>Binary packages<a class="headerlink" href="#binary-packages" title="Link to
<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
for installation of OPM Flow (binary packages) and the pycopm package in Ubuntu.</p>
for installation of OPM Flow (binary packages) and the pycopm package in Ubuntu 26.04 and Python 3.14.</p>
</div>
</section>
<section id="source-build-in-linux-windows">
Expand Down Expand Up @@ -191,8 +191,10 @@ <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 (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>
Then, you can try to install flow (v2026.07 interim release) by simply typing:</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="go">brew tap cssr-tools/opm</span>
<span class="go">brew trust cssr-tools/opm</span>
<span class="go">brew install cssr-tools/opm/opm-simulators -y</span>
</pre></div>
</div>
<p>You can check if the installation of OPM Flow succeded by typing in the terminal <strong>flow --help</strong>.</p>
Expand All @@ -203,7 +205,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>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>
<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 macOS 26 (GitHub actions), and tested with <strong>pycopm</strong></p>
</section>
</section>
</section>
Expand Down
6 changes: 0 additions & 6 deletions docs/pycopm.utils.mapping_methods.html
Original file line number Diff line number Diff line change
Expand Up @@ -181,12 +181,6 @@
<dt class="sig sig-object py" id="pycopm.utils.mapping_methods.handle_dual">
<span class="sig-prename descclassname"><span class="pre">pycopm.utils.mapping_methods.</span></span><span class="sig-name descname"><span class="pre">handle_dual</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">dic</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#pycopm.utils.mapping_methods.handle_dual" title="Link to this definition"></a></dt>
<dd><p>Create the dual grid by extending it in the j-direction</p>
<dl class="simple">
<dt>Args:</dt><dd><p>dic (dict): Global dictionary</p>
</dd>
<dt>Returns:</dt><dd><p>dic (dict): Modified global dictionary</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
Expand Down
2 changes: 1 addition & 1 deletion docs/searchindex.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/text/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ 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 \-\-target-version py312 src/ tests/** (this formats the code)
#. **black \-\-target-version py314 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 \-\-basetemp=test_outputs tests/ -n auto** (this runs locally the tests, and might rise issues that need to be fixed before the pull request)
Expand Down
4 changes: 3 additions & 1 deletion docs/text/examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ For additional examples demonstrating the applicability of **pycopm**, see the `

.. code-block:: bash

brew install cssr-tools/opm/resinsight
brew tap cssr-tools/opm
brew trust cssr-tools/opm
brew install cssr-tools/opm/resinsight -y

Then, you should be able to open resinsight by typing in the terminal **resinsight**. If you have issues installing ResInsight, `ParaView <https://www.paraview.org>`_ can be also used. However, you need to add the flag **\-\-enable-vtk-output=true**
to OPM Flow.
Expand Down
10 changes: 6 additions & 4 deletions docs/text/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ supported either via source builds or through running a virtual machine.
.. tip::

See the `ci_pycopm_ubuntu.yml <https://github.com/cssr-tools/pycopm/blob/main/.github/workflows/ci_pycopm_ubuntu.yml>`_ script
for installation of OPM Flow (binary packages) and the pycopm package in Ubuntu.
for installation of OPM Flow (binary packages) and the pycopm package in Ubuntu 26.04 and Python 3.14.

Source build in Linux/Windows
+++++++++++++++++++++++++++++
Expand Down Expand Up @@ -116,11 +116,13 @@ 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 (v2026.02) by simply typing:
Then, you can try to install flow (v2026.07 interim release) by simply typing:

.. code-block:: console

brew install cssr-tools/opm/opm-simulators
brew tap cssr-tools/opm
brew trust cssr-tools/opm
brew install cssr-tools/opm/opm-simulators -y

You can check if the installation of OPM Flow succeded by typing in the terminal **flow \-\-help**.

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

Source build in macOS
+++++++++++++++++++++
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**
See `this repository <https://github.com/daavid00/OPM-Flow_macOS>`_ dedicated to build OPM Flow from source in macOS 26 (GitHub actions), and tested with **pycopm**
2 changes: 1 addition & 1 deletion src/pycopm/core/pycopm.py
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ def check_cmdargs(cmdargs):
!= 0
):
raise RuntimeError
except (FileNotFoundError, RuntimeError):
except FileNotFoundError, RuntimeError:
print(
f"\nThe OPM flow executable '-f {' '.join(cmd)}' is not available or not working.\n"
)
Expand Down