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
65 changes: 65 additions & 0 deletions .github/workflows/ci_pycopm_docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Docker

on:
push:
branches:
- main

jobs:
run-pycopm-docker:
permissions:
contents: read
pull-requests: write
timeout-minutes: 30
runs-on: ubuntu-latest

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

- name: Build Docker image
run: docker build -t test-image .

- name: Run the hello world example in pycopm
run: |
docker run --rm \
-u root \
-v ${{ github.workspace }}:/workspace \
-w /workspace \
test-image \
bash -c "
pycopm -i examples/decks/HELLO_WORLD.DATA \
-c 5,5,1 -m all -o output
"

- name: Check if the example run
run: |
file="${{ github.workspace }}/output/HELLO_WORLD_PYCOPM.EGRID"
if [ -f "$file" ]; then
echo "pycopm succeeded"
else
echo "pycopm failed"
exit 1
fi

- name: Run input.toml which uses ERT
run: |
docker run --rm \
-u root \
-v ${{ github.workspace }}:/workspace \
-w /workspace \
test-image \
bash -c "
pycopm -i examples/configurations/drogon/input.toml \
-o ert
"

- name: Check if input.toml using ERT run
run: |
file="${{ github.workspace }}/ert/postprocessing/hm_missmatch.png"
if [ -f "$file" ]; then
echo "pycopm using ERT succeeded"
else
echo "pycopm using ERT failed"
exit 1
fi
59 changes: 59 additions & 0 deletions .github/workflows/ci_pycopm_macos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: macOS

on:
push:
branches:
- main

jobs:
run-pycopm-macos:
permissions:
contents: read
pull-requests: write
timeout-minutes: 60
runs-on: macos-latest

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

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

- name: Install 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 -r dev-requirements.txt

- name: Run the hello world example in pycopm
run: |
pycopm -i examples/decks/HELLO_WORLD.DATA -c 5,5,1 -m all -o output

- name: Check if the example run
run: |
file="${{ github.workspace }}/output/HELLO_WORLD_PYCOPM.EGRID"
if [ -f "$file" ]; then
echo "pycopm succeeded"
else
echo "pycopm failed"
exit 1
fi

- name: Run input.toml which uses ERT
run: |
pycopm -i examples/configurations/drogon/input.toml -o ert

- name: Check if input.toml using ERT run
run: |
file="${{ github.workspace }}/ert/postprocessing/hm_missmatch.png"
if [ -f "$file" ]; then
echo "pycopm using ERT succeeded"
else
echo "pycopm using ERT failed"
exit 1
fi
10 changes: 5 additions & 5 deletions .github/workflows/ci_pycopm_ubuntu.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
name: Run pycopm in Ubuntu
name: Ubuntu

on:
push:
branches:
- main
pull_request:

jobs:
run-pycopm-local:
run-pycopm-ubuntu:
permissions:
contents: read
pull-requests: write
timeout-minutes: 30
runs-on: ubuntu-24.04
container:
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Contributions are more than welcome using the fork and pull request approach
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)
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.12.
* 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 26.04 using Python 3.14.
* 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.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 [_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
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[![Build Status](https://github.com/cssr-tools/pycopm/actions/workflows/ci_pycopm_ubuntu.yml/badge.svg)](https://github.com/cssr-tools/pycopm/actions/workflows/ci_pycopm_ubuntu.yml)
[![Build Status](https://github.com/daavid00/OPM-Flow_macOS/actions/workflows/ci_pycopm_macos.yml/badge.svg)](https://github.com/daavid00/OPM-Flow_macOS/actions/workflows/ci_pycopm_macos.yml)
[![Build Status](https://github.com/cssr-tools/pycopm/actions/workflows/ci_pycopm_macos.yml/badge.svg)](https://github.com/cssr-tools/pycopm/actions/workflows/ci_pycopm_macos.yml)
[![Build Status](https://github.com/cssr-tools/pycopm/actions/workflows/ci_pycopm_docker.yml/badge.svg)](https://github.com/cssr-tools/pycopm/actions/workflows/ci_pycopm_docker.yml)
<a href="https://www.python.org/"><img src="https://img.shields.io/badge/python-3.11%20to%203.14-blue.svg"></a>
[![Code style](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)
[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)
Expand Down
2 changes: 1 addition & 1 deletion docs/_sources/contributing.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Contribute to the software
#. **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.12.
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>`_).

Expand Down
2 changes: 1 addition & 1 deletion docs/contributing.html
Original file line number Diff line number Diff line change
Expand Up @@ -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.12.
<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 26.04 using Python 3.14.
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.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 <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
2 changes: 1 addition & 1 deletion docs/text/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Contribute to the software
#. **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.12.
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>`_).

Expand Down
Loading