Skip to main content

Ensemble based Reservoir Tool (ERT)

Project description

Build Status PyPI - Python Version Code Style Type checking codecov License: GPL v3

ert - Ensemble based Reservoir Tool - is designed for running ensembles of dynamical models such as reservoir models, in order to do sensitivity analysis and data assimilation. ert supports data assimilation using the Ensemble Smoother (ES), Ensemble Smoother with Multiple Data Assimilation (ES-MDA) and Iterative Ensemble Smoother (IES).

Installation

$ pip install ert
$ ert --help

or, for the latest development version (requires Python development headers):

$ pip install git+https://github.com/equinor/ert.git@main
$ ert --help

For examples and help with configuration, see the ert Documentation.

Developing

ert was originally written in C/C++ but most new code is Python.

Developing Python

You might first want to make sure that some system level packages are installed before attempting setup:

- pip
- python include headers
- (python) venv
- (python) setuptools
- (python) wheel

It is left as an exercise to the reader to figure out how to install these on their respective system.

To start developing the Python code, we suggest installing ert in editable mode into a virtual environment to isolate the install (substitute the appropriate way of sourcing venv for your shell):

# Create and enable a virtualenv
python3 -m venv my_virtualenv
source my_virtualenv/bin/activate

# Update build dependencies
pip install --upgrade pip wheel setuptools

# Download and install ert
git clone https://github.com/equinor/ert
cd ert
pip install --editable .

Test setup

Additional development packages must be installed to run the test suite:

pip install ".[dev]"
pytest tests/

Git LFS must be installed to get all the files. This is packaged as git-lfs on Ubuntu, Fedora or macOS Homebrew. For Equinor RGS node users, it is possible to use git from Red Hat Software Collections:

source /opt/rh/rh-git227/enable

test-data/block_storage is a submodule and must be checked out.

git submodule update --init --recursive

If you checked out submodules without having git lfs installed, you can force git lfs to run in all submodules with:

git submodule foreach "git lfs pull"

Style requirements

There are a set of style requirements, which are gathered in the pre-commit configuration, to have it automatically run on each commit do:

$ pip install pre-commit
$ pre-commit install

Trouble with setup

If you encounter problems during install, try deleting the _skbuild folder before reinstalling.

As a simple test of your ert installation, you may try to run one of the examples, for instance:

cd test-data/poly_example
# for non-gui trial run
ert test_run poly.ert
# for gui trial run
ert gui poly.ert

Note that in order to parse floating point numbers from text files correctly, your locale must be set such that . is the decimal separator, e.g. by setting

# export LC_NUMERIC=en_US.UTF-8

in bash (or an equivalent way of setting that environment variable for your shell).

Developing C++

C++ is the backbone of ert as in used extensively in important parts of ert. There's a combination of legacy code and newer refactored code. The end goal is likely that some core performance-critical functionality will be implemented in C++ and the rest of the business logic will be implemented in Python.

While running --editable will create the necessary Python extension module (src/ert/_clib.cpython-*.so), changing C++ code will not take effect even when reloading ert. This requires recompilation, which means reinstalling ert from scratch.

To avoid recompiling already-compiled source files, we provide the script/build script. From a fresh virtualenv:

git clone https://github.com/equinor/ert
cd ert
script/build

This command will update pip if necessary, install the build dependencies, compile ert and install in editable mode, and finally install the runtime requirements. Further invocations will only build the necessary source files. To do a full rebuild, delete the _skbuild directory.

Note: This will create a debug build, which is faster to compile and comes with debugging functionality enabled. The downside is that this makes the code unoptimised and slow. Debugging flags are therefore not present in builds of ert that we release on Komodo or PyPI. To build a release build for development, use script/build --release.

Notes

  1. If pip reinstallation fails during the compilation step, try removing the _skbuild directory.

  2. The default maximum number of open files is normally relatively low on MacOS and some Linux distributions. This is likely to make tests crash with mysterious error-messages. You can inspect the current limits in your shell by issuing the command ulimit -a. In order to increase maximum number of open files, run ulimit -n 16384 (or some other large number) and put the command in your .profile to make it persist.

Running C++ tests

The C++ code and tests require resdata. As long as you have pip install resdata'd into your Python virtualenv all should work.

# Create and enable a virtualenv
python3 -m venv my_virtualenv
source my_virtualenv/bin/activate

# Install build dependencies
pip install pybind11 conan cmake resdata

# Build ert and tests
mkdir build && cd build
cmake ../src/clib -DCMAKE_BUILD_TYPE=Debug
make -j$(nproc)

# Run tests
ctest --output-on-failure

Example usage

Basic ert test

To test if ert itself is working, go to test-data/poly_example and start ert by running poly.ert with ert gui

cd test-data/poly_example
ert gui poly.ert

This opens up the ert graphical user interface. Finally, test ert by starting and successfully running the experiment.

ert with a reservoir simulator

To actually get ert to work at your site you need to configure details about your system; at the very least this means you must configure where your reservoir simulator is installed. In addition you might want to configure e.g. queue system in the site-config file, but that is not strictly necessary for a basic test.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

ert-10.2.0b11-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (931.2 kB view details)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64

ert-10.2.0b11-cp312-cp312-macosx_11_0_arm64.whl (730.4 kB view details)

Uploaded CPython 3.12 macOS 11.0+ ARM64

ert-10.2.0b11-cp312-cp312-macosx_10_15_x86_64.whl (748.2 kB view details)

Uploaded CPython 3.12 macOS 10.15+ x86-64

ert-10.2.0b11-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (919.4 kB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

ert-10.2.0b11-cp311-cp311-macosx_11_0_arm64.whl (718.3 kB view details)

Uploaded CPython 3.11 macOS 11.0+ ARM64

ert-10.2.0b11-cp311-cp311-macosx_10_15_x86_64.whl (735.7 kB view details)

Uploaded CPython 3.11 macOS 10.15+ x86-64

ert-10.2.0b11-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (918.0 kB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

ert-10.2.0b11-cp310-cp310-macosx_10_15_x86_64.whl (734.4 kB view details)

Uploaded CPython 3.10 macOS 10.15+ x86-64

ert-10.2.0b11-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (918.3 kB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

ert-10.2.0b11-cp39-cp39-macosx_10_15_x86_64.whl (734.5 kB view details)

Uploaded CPython 3.9 macOS 10.15+ x86-64

ert-10.2.0b11-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (917.9 kB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

ert-10.2.0b11-cp38-cp38-macosx_10_15_x86_64.whl (734.3 kB view details)

Uploaded CPython 3.8 macOS 10.15+ x86-64

File details

Details for the file ert-10.2.0b11-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for ert-10.2.0b11-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 6f6c21cfaae3d3eee178a274deb2f833294bc54e08b21f54685c39e4a2df395b
MD5 153ccd2f99b92f305e72483715783c47
BLAKE2b-256 1be88f7448cdd853f1bc3f4cae4548b2ebd417811081d988695f3e39460cf9dc

See more details on using hashes here.

File details

Details for the file ert-10.2.0b11-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for ert-10.2.0b11-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6a283669d83131ee9e7211f9c9601e49e67b68db480ae513812b8224303f899a
MD5 0a584bbe93267869ea41fc662bbddfc5
BLAKE2b-256 875e7325c6122fede8815f14021ef5d851ef6cbf13ae5e2a5ba2bac3c96fa378

See more details on using hashes here.

File details

Details for the file ert-10.2.0b11-cp312-cp312-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for ert-10.2.0b11-cp312-cp312-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 c520c59e5e888584ad10d774b474922def8d7c3bf473dd48b6e43a886b59af5d
MD5 c58884425755ee8ccb4436777a484239
BLAKE2b-256 155dc0d3b0109e4705c0bbfe4221bd31d5ce7f187b2f01bafad537fa70a785cc

See more details on using hashes here.

File details

Details for the file ert-10.2.0b11-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for ert-10.2.0b11-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a0b6984c1cf0c10047f1659080f106033127eebf47e81eb756291a7ba56c9c98
MD5 b34b80c154ffcdf8795e064eab681ea3
BLAKE2b-256 23a6effd7988573b853b2e6cf2c2cc238508599bfb3510bfd120064bcea6ce35

See more details on using hashes here.

File details

Details for the file ert-10.2.0b11-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for ert-10.2.0b11-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 188f07627e6d5f95aa001a36cfd8256541243f673d3603ef07457d8de9883d4e
MD5 d224f0b93c1bd4d6a7f57d43c99d85ab
BLAKE2b-256 69f97b7db7642c6c4573a4724715b936d722cadcd0283df8c5ddba89ebf0f4cd

See more details on using hashes here.

File details

Details for the file ert-10.2.0b11-cp311-cp311-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for ert-10.2.0b11-cp311-cp311-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 17a53642cf5cf7e74ec1cb8480b727f5e2e5781ea02119307afd03044ec6a392
MD5 0ad5c11f713e3f0d42e078d86378a239
BLAKE2b-256 70be0df2e3b44d896a14f1f45f0237b842628a55725cddced182fa0303b6d3fa

See more details on using hashes here.

File details

Details for the file ert-10.2.0b11-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for ert-10.2.0b11-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a06aa339a4b2a1d6782fc22b96ecd0f3df499a49d686d93dcc57a184fd0c0281
MD5 2a3973d8dfd2dcfd54b5b2fadc3b4081
BLAKE2b-256 dac5ae9202df2f2a14ed43b293a1bcb91c09a52ac5ce922098c9090d4d84f990

See more details on using hashes here.

File details

Details for the file ert-10.2.0b11-cp310-cp310-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for ert-10.2.0b11-cp310-cp310-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 e7a0cdfb0d921de153f39167877546c739f30abbb960a23a5d85afbd4da7302c
MD5 b078f961872f365a6379687a73907cdc
BLAKE2b-256 342406389a3e68ebae2efa5e6a75f473644de3b9ec17a27d9f97609f277c5c55

See more details on using hashes here.

File details

Details for the file ert-10.2.0b11-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for ert-10.2.0b11-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e73dff52dfb9d09a2ae4d9aafd4119f80b24ca34eb1805ff441f0cbd71cf9c5d
MD5 92015beb2c15af2d5c93931a6d41ec2b
BLAKE2b-256 91eb776d780326ca165e56e19228aed11c74d1f415ca09eadcc8fb569ea63ed6

See more details on using hashes here.

File details

Details for the file ert-10.2.0b11-cp39-cp39-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for ert-10.2.0b11-cp39-cp39-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 1947821ed9c2823040bdca5a6fd3e454f3acca32fe0712453ee5b86aa65964cb
MD5 d102fc41c0f0ed43bdfe4ef9402c3018
BLAKE2b-256 fe22243fda1dea980eafd351ff31fa1cc86c449147fa11e5a10d01b1a1d3a9c7

See more details on using hashes here.

File details

Details for the file ert-10.2.0b11-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for ert-10.2.0b11-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c2e862511991816a1d5f97252c563c137a546d8ea6cd9b3e5e9d36e05893ccd0
MD5 0ced79d139d8a0830b8c8de868731fcc
BLAKE2b-256 9ba8015561352311ff47d41068960d6558d2d6b32071dd5f317dc7ade20a26f9

See more details on using hashes here.

File details

Details for the file ert-10.2.0b11-cp38-cp38-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for ert-10.2.0b11-cp38-cp38-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 bc182eb6efe10435d7de406e63cfe7f397f548c22d0c3579af09509543cc30f3
MD5 10b284e125bb6429c55cb1730e467baf
BLAKE2b-256 91d39ee03a3ef6ce91729adc0f496eee42a607560702e175d41eeac78e23451b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page