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 ".[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 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-9.0.6-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (947.1 kB view details)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64

ert-9.0.6-cp312-cp312-macosx_11_0_arm64.whl (742.0 kB view details)

Uploaded CPython 3.12 macOS 11.0+ ARM64

ert-9.0.6-cp312-cp312-macosx_10_15_x86_64.whl (764.0 kB view details)

Uploaded CPython 3.12 macOS 10.15+ x86-64

ert-9.0.6-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (936.6 kB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

ert-9.0.6-cp311-cp311-macosx_11_0_arm64.whl (729.6 kB view details)

Uploaded CPython 3.11 macOS 11.0+ ARM64

ert-9.0.6-cp311-cp311-macosx_10_15_x86_64.whl (750.7 kB view details)

Uploaded CPython 3.11 macOS 10.15+ x86-64

ert-9.0.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (935.2 kB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

ert-9.0.6-cp310-cp310-macosx_11_0_arm64.whl (728.6 kB view details)

Uploaded CPython 3.10 macOS 11.0+ ARM64

ert-9.0.6-cp310-cp310-macosx_10_15_x86_64.whl (749.6 kB view details)

Uploaded CPython 3.10 macOS 10.15+ x86-64

ert-9.0.6-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (936.0 kB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

ert-9.0.6-cp39-cp39-macosx_10_15_x86_64.whl (749.7 kB view details)

Uploaded CPython 3.9 macOS 10.15+ x86-64

ert-9.0.6-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (936.0 kB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

ert-9.0.6-cp38-cp38-macosx_10_15_x86_64.whl (749.5 kB view details)

Uploaded CPython 3.8 macOS 10.15+ x86-64

File details

Details for the file ert-9.0.6-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for ert-9.0.6-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 6116763c32b00482314a3e9389c03a3cf6863c90c4d285c23c0ab47be8e51b0d
MD5 9d4c5c7efb6e49fcfd7b58b23380b4c6
BLAKE2b-256 1ee444a841fa64ecbd865f97c7592d2634558f1e91c402a2b6ab9e3dc2a3c5ad

See more details on using hashes here.

File details

Details for the file ert-9.0.6-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for ert-9.0.6-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 19cc29a5ffaba9726afaa49ada7cb9954f7f1bba5fcc26eefe8c906a0275ce06
MD5 6eb2aca7b62afe650c73a4b1f286dc8a
BLAKE2b-256 0f6e952e87233a9ff046e3e79dd8053b8cf67789e430c746df6a0ed6982e9ea9

See more details on using hashes here.

File details

Details for the file ert-9.0.6-cp312-cp312-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for ert-9.0.6-cp312-cp312-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 bbc01295ea4d8bdc173c7fc4f63bbf98aec1c86b4ec0067f5d1ed42dc17e3df3
MD5 64d5d4a008c15a78311eede414576a01
BLAKE2b-256 96a07bce804fad280134a4bd41b7cf6dd91d016be808b359351b212a43421ab0

See more details on using hashes here.

File details

Details for the file ert-9.0.6-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for ert-9.0.6-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1a3e7a9ab2bc3cf2c0a94d7a2ea9d0c4aa3ed3848167c4daf6a172be9622233f
MD5 6c4635f9d4982c86fe350052cbce2e5c
BLAKE2b-256 4e2601be1fe0a9e31cb62ad356a9fa56f5772a43eaf1c901b6385a62ecbb0b99

See more details on using hashes here.

File details

Details for the file ert-9.0.6-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for ert-9.0.6-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 32b6eeff055b426450458005a231c1a108ccc48a56f760a9b83f240384dc8d89
MD5 68deada2686f8972b0bd1ace4e4c1e35
BLAKE2b-256 d41c8b195676f3dfae71459ab19e6e755ec0c213b23351468d97a7bfb4b44a87

See more details on using hashes here.

File details

Details for the file ert-9.0.6-cp311-cp311-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for ert-9.0.6-cp311-cp311-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 b05664fb91496e66cf1ecda5041d6ddd25d061a3302e6e68b4d7182425a450fe
MD5 32d7a25c99637a8d30b79c079ff95140
BLAKE2b-256 c74801e9f02dcae0e7b105eeeb2a2197a619a1523b08176a0b3cc19108829b84

See more details on using hashes here.

File details

Details for the file ert-9.0.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for ert-9.0.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 bfd1b1bc55f5257c0c639686004128bb500712429e809c88c0712a1eb04e5fd3
MD5 05292592a70209ddcbfd067b6f1a59f4
BLAKE2b-256 772b28b3a5fb4930813bd6006452954aab42b30ccb956557c9664e8a81f2eeb3

See more details on using hashes here.

File details

Details for the file ert-9.0.6-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for ert-9.0.6-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 16e429177045a1c46e4de50842e8cbd7166122e1e72b6d92267ec96e88121cd2
MD5 f06497d948063819a6ae8e7d37ece5e9
BLAKE2b-256 8fe6bdfb8688c8130566718cdefe8c4acf5f14918fa018a45eaaee4588ae81d4

See more details on using hashes here.

File details

Details for the file ert-9.0.6-cp310-cp310-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for ert-9.0.6-cp310-cp310-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 f47d66f7c230189cc8bc25618ac3c49e324fcdc0e5d38e38ff8aa10095d00bec
MD5 b7eef7ab31b62c9dbf4c0b19a536d6ff
BLAKE2b-256 6b493f122f4446f40e3a20096e068b57a2714324d066f5b0a7e0c71c088b5f3b

See more details on using hashes here.

File details

Details for the file ert-9.0.6-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for ert-9.0.6-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 9cd7e438870fe395b2d33622f1b4b28505db0eb66ae23dd1e5811ba9ff7d061e
MD5 6afea39d48c95436189c0612ef58a4bd
BLAKE2b-256 3fd905b1cd82fb9745f996e6198a6a559c9c17140e916f6001dc920b3dec6450

See more details on using hashes here.

File details

Details for the file ert-9.0.6-cp39-cp39-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for ert-9.0.6-cp39-cp39-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 a27331c8e434a4fa3620f6ed7a22d54bdd389f1b70f21d8b5dbf3a8192c91cc7
MD5 bddce91945489a5accc5f50011a202b7
BLAKE2b-256 b6c0146f8d6c440abcba152215598a63bc98a6286ca65b7865233cd264c05851

See more details on using hashes here.

File details

Details for the file ert-9.0.6-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for ert-9.0.6-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 cc05039e06161e0173e1658996345e935852cbd0a11e17dd0ba751bd5900e8eb
MD5 5b14b57a57808020b6fd86d23a79b8db
BLAKE2b-256 4eaab7244606260f4bb2f74b2bcd16ad3880ad3f4ba63549b41aa7c977311489

See more details on using hashes here.

File details

Details for the file ert-9.0.6-cp38-cp38-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for ert-9.0.6-cp38-cp38-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 16760c19586548332cb51e34c5bab1251afac3b6fa5a5219d1e91d7df5b23d38
MD5 15b68a36b4f89dfa697e53081132c89d
BLAKE2b-256 5e5a890b3b23b3ba9b0247b4df00ffe4e45c4b50593923d4f992086115fc4ae9

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