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.0b10-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (931.1 kB view details)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64

ert-10.2.0b10-cp312-cp312-macosx_11_0_arm64.whl (730.3 kB view details)

Uploaded CPython 3.12 macOS 11.0+ ARM64

ert-10.2.0b10-cp312-cp312-macosx_10_15_x86_64.whl (748.1 kB view details)

Uploaded CPython 3.12 macOS 10.15+ x86-64

ert-10.2.0b10-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (919.3 kB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

ert-10.2.0b10-cp311-cp311-macosx_11_0_arm64.whl (718.2 kB view details)

Uploaded CPython 3.11 macOS 11.0+ ARM64

ert-10.2.0b10-cp311-cp311-macosx_10_15_x86_64.whl (735.6 kB view details)

Uploaded CPython 3.11 macOS 10.15+ x86-64

ert-10.2.0b10-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (917.9 kB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

ert-10.2.0b10-cp310-cp310-macosx_10_15_x86_64.whl (734.3 kB view details)

Uploaded CPython 3.10 macOS 10.15+ x86-64

ert-10.2.0b10-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (918.2 kB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

ert-10.2.0b10-cp39-cp39-macosx_10_15_x86_64.whl (734.4 kB view details)

Uploaded CPython 3.9 macOS 10.15+ x86-64

ert-10.2.0b10-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (917.8 kB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

ert-10.2.0b10-cp38-cp38-macosx_10_15_x86_64.whl (734.2 kB view details)

Uploaded CPython 3.8 macOS 10.15+ x86-64

File details

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

File metadata

File hashes

Hashes for ert-10.2.0b10-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 cdc7e730873e88fcb2e5c45914c1682d3bdd3b6eec5cdca0be56eb739dd9602f
MD5 e248d98580aa577e7287717ab9f1759b
BLAKE2b-256 a63b4de53a266dd92c7aa5eaf321e51f7dc1dc79bfeb815deeb97caecf818b95

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ert-10.2.0b10-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 84d9c0c920a7e0800b9f9fef9ee050e16fe31f03f55f57fa942c2c1b7795bf38
MD5 e3718273f6162a575413c02193628437
BLAKE2b-256 2f552f1b1837f2a9e833ac7bf2dda892034c2fdaf8ecb1079239ab8648355b85

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ert-10.2.0b10-cp312-cp312-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 f149d65ac5d196977f07ef2aeb7a2ded3a081f62addcfaadf7daceabab9f53f5
MD5 f1a1e2ed9d3c9d68a539e1834a1862cc
BLAKE2b-256 05f802a87e06ab8cbba2e2f97c805ae3b5798a367194f225e8b20b21ee2cb511

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ert-10.2.0b10-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0e24be5c6132970f50b55e1a46be85b8be3b2983a9786d9473d0607c34879576
MD5 9e3926ab4da54a3e347ebbbf9af57546
BLAKE2b-256 db959de399b6a01dd2c47a8d728cd7cc17ae3b9ad6913392054d20d8c2696ef7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ert-10.2.0b10-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a171017ec3632d62cc6d3fd9dd3cde761e98bb1c25e4b50e1137113cf57e765e
MD5 0867c0a1a314a0c65776beffca1dc9d9
BLAKE2b-256 96c45baa554b407648509aa8216435515e9e90c4b731b21f34013f2a288c1ada

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ert-10.2.0b10-cp311-cp311-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 6b0a0fc03944125910a5a01cfd2c518811324b7e61de06efaa98443444e6fabe
MD5 af45d82a54472c16d6715e3c92e45d25
BLAKE2b-256 b01c90305f3a4100676a4f88ad3b1403868ecb81b8bd209743e398b015768fa9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ert-10.2.0b10-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 6c2c2d93eac60314cd44cd74744ad726964ec4ee30f954c5ec5299d27f35ffb1
MD5 513b4f886c496097ecceeb00ac33a832
BLAKE2b-256 27c524d56a5deadbbee8e1ebf98cc53414119198c0822b59a2be45e9253c407e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ert-10.2.0b10-cp310-cp310-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 fecefbfab3445291a3760a667fefb5eeccd14404a340f4de0db5a8531d457504
MD5 dad09b6208a958a243312d147c184040
BLAKE2b-256 0db1b7bdee149d5b84c20417b74ebd3d1d3348e74c2ea6456b352a0fcd1b630b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ert-10.2.0b10-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 6716982b02ea59fc556efdb15284a1b8cf31b7ee4ed19d56ae1242ff91ad4bf7
MD5 392e62bcaee7b93f08aefbd09d6f99e0
BLAKE2b-256 a2f362047ab10026e1bd140ca06f170e95e4245ca2326a751c389b1fba8792a3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ert-10.2.0b10-cp39-cp39-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 af94a025fd7c66e77b5046c9e29113cd10a288c1a6c53172ab5805831ab5c1b4
MD5 93c037fe7e4be855ed8320cddc6f3ba3
BLAKE2b-256 d1c9a5582c47303c579dd502e86198aecf5ac6b5aa7f798dc3d7954b1ebb674d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ert-10.2.0b10-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 31526fb845e4cdf3536268be85aedf63482ff96e4b80c9bbfd9e30817959c04d
MD5 122247de8fa1231c04e3e3e95e1df2e8
BLAKE2b-256 93da8523a608c609552145211fe0ce7cfa6c7d89d78466ab72d7b9eefbd73574

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ert-10.2.0b10-cp38-cp38-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 6911f328ac5cc134e8afc46a7b474ad2ccb4c91932e33094c31a7855ed977f60
MD5 4ef0cf814e4b7f01880fed5218c2f2a0
BLAKE2b-256 dea9639acc9f42563639d14ac541b7f3e7acce7e5747d40690587524bae6c921

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