Skip to main content

Ensemble based Reservoir Tool (ERT)

Project description

ert

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 "ert[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. This means that, for example, Eigen computations will be checked and will abort if preconditions aren't met (eg. when inverting a matrix, it will explicitly check that the matrix is square). 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 simulation.

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-8.4.0rc0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

ert-8.4.0rc0-cp311-cp311-macosx_11_0_arm64.whl (854.6 kB view details)

Uploaded CPython 3.11 macOS 11.0+ ARM64

ert-8.4.0rc0-cp311-cp311-macosx_10_15_x86_64.whl (913.4 kB view details)

Uploaded CPython 3.11 macOS 10.15+ x86-64

ert-8.4.0rc0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

ert-8.4.0rc0-cp310-cp310-macosx_11_0_arm64.whl (852.2 kB view details)

Uploaded CPython 3.10 macOS 11.0+ ARM64

ert-8.4.0rc0-cp310-cp310-macosx_10_15_x86_64.whl (910.9 kB view details)

Uploaded CPython 3.10 macOS 10.15+ x86-64

ert-8.4.0rc0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

ert-8.4.0rc0-cp39-cp39-macosx_10_15_x86_64.whl (911.0 kB view details)

Uploaded CPython 3.9 macOS 10.15+ x86-64

ert-8.4.0rc0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

ert-8.4.0rc0-cp38-cp38-macosx_10_15_x86_64.whl (910.9 kB view details)

Uploaded CPython 3.8 macOS 10.15+ x86-64

File details

Details for the file ert-8.4.0rc0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for ert-8.4.0rc0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d4bbfcdc90c99f66e9f378eb0d4a06870523346e3fe7802a494e0c574c8010c4
MD5 4f03f7609a267ef5c4965d60a44dbb0b
BLAKE2b-256 63007f264d5a8e9489271bb41727a77c717980340271125bd41887c912f2b96c

See more details on using hashes here.

File details

Details for the file ert-8.4.0rc0-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for ert-8.4.0rc0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f2fba273b2608469fe88e83f5882137f6c7781e4b510c66485057fa234208582
MD5 c06ea17b05a7730150d3eae22b853cb2
BLAKE2b-256 5ee9ac7381044dd5004d7ef4ef8c7c7b8059eb2bb66cfcd404252bbeb8c80169

See more details on using hashes here.

File details

Details for the file ert-8.4.0rc0-cp311-cp311-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for ert-8.4.0rc0-cp311-cp311-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 bd78d4122d210c864a80ee6a225063303db0e3cea3bd8e52b7f074b640794dac
MD5 4ee26e5b76f94e2a22e1ef733580e5bc
BLAKE2b-256 462dcfe5fa5172181c7c0396473c3a5c8789269370ecec2825d750a31e491205

See more details on using hashes here.

File details

Details for the file ert-8.4.0rc0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for ert-8.4.0rc0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 14d9da91e68f917020d080a6a2fb246083b62dd000cca82c2508d067138234d9
MD5 77e4109d93dcb4645911a696bd49c70b
BLAKE2b-256 a903ac325c1e0430260e333bd1bc70ce88dd9465c5f83b60536891acf06d1b45

See more details on using hashes here.

File details

Details for the file ert-8.4.0rc0-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for ert-8.4.0rc0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ffa7509707a3d133ebfaae27b4d7f0958c0e738bd80f05647d7c03c93787e70a
MD5 a829d0a9fcb0c96ad129bf4b46241420
BLAKE2b-256 df10cbc88b940fd65291e2d8debf9b2e0fb22b7f0d1a9913a75655447c34212c

See more details on using hashes here.

File details

Details for the file ert-8.4.0rc0-cp310-cp310-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for ert-8.4.0rc0-cp310-cp310-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 15221d0225ce982ed317555db29c00a4144027807e26eebc719bb0a6eb13c461
MD5 b9eb9ef2da7de8ea79f7b80597bd7b71
BLAKE2b-256 7cc490cce41c5f0064c4bf31e2622914c22f0cec2f9643520ef2c9f1f25c34ca

See more details on using hashes here.

File details

Details for the file ert-8.4.0rc0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for ert-8.4.0rc0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 7e77cbf4bc104efd5eb92618e894ce4b2023da5cf30226605be42c8b616c1b35
MD5 ca7599804673b2403f06d39fea49ffc2
BLAKE2b-256 6a8d5e337a660edf61371ec888ce2af479a73971b96478f3303237113e37a37a

See more details on using hashes here.

File details

Details for the file ert-8.4.0rc0-cp39-cp39-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for ert-8.4.0rc0-cp39-cp39-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 3ad965dc5c7612f0992175da28076b750247302393acc61133ec9c9532b1d67d
MD5 f9ae470e87f44c1060d377bea1f356d6
BLAKE2b-256 35c5207965c182452fc330655e2051c43253de4374ff3c691837ef6480a7dbd0

See more details on using hashes here.

File details

Details for the file ert-8.4.0rc0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for ert-8.4.0rc0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d1d0e7046388131150eb53cfc05a0d3f44ede7424a18284384bc9e50751a8526
MD5 0b6dc7f8f117d868ff7f44f126448eea
BLAKE2b-256 91ad692bbedd1d4bd5b53751558ba30ad3ef3b67ca4be1cf4ae6d7ad18a9799e

See more details on using hashes here.

File details

Details for the file ert-8.4.0rc0-cp38-cp38-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for ert-8.4.0rc0-cp38-cp38-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 aa15b1b925257a69bfd6aa222f57fce88857453df313393d885cb8240797b76f
MD5 699a20980f44cdfb1ae5c511e0c61b7b
BLAKE2b-256 646b87e74fea24b721bef4dc6bd6f6a56a8275d174cabf467404a9cbf07dfc36

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