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.12-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (947.9 kB view details)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64

ert-8.4.12-cp312-cp312-macosx_11_0_arm64.whl (740.3 kB view details)

Uploaded CPython 3.12 macOS 11.0+ ARM64

ert-8.4.12-cp312-cp312-macosx_10_15_x86_64.whl (774.5 kB view details)

Uploaded CPython 3.12 macOS 10.15+ x86-64

ert-8.4.12-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (937.2 kB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

ert-8.4.12-cp311-cp311-macosx_11_0_arm64.whl (728.1 kB view details)

Uploaded CPython 3.11 macOS 11.0+ ARM64

ert-8.4.12-cp311-cp311-macosx_10_15_x86_64.whl (761.5 kB view details)

Uploaded CPython 3.11 macOS 10.15+ x86-64

ert-8.4.12-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (936.3 kB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

ert-8.4.12-cp310-cp310-macosx_11_0_arm64.whl (726.9 kB view details)

Uploaded CPython 3.10 macOS 11.0+ ARM64

ert-8.4.12-cp310-cp310-macosx_10_15_x86_64.whl (760.1 kB view details)

Uploaded CPython 3.10 macOS 10.15+ x86-64

ert-8.4.12-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (937.7 kB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

ert-8.4.12-cp39-cp39-macosx_10_15_x86_64.whl (760.2 kB view details)

Uploaded CPython 3.9 macOS 10.15+ x86-64

ert-8.4.12-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (937.1 kB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

ert-8.4.12-cp38-cp38-macosx_10_15_x86_64.whl (760.2 kB view details)

Uploaded CPython 3.8 macOS 10.15+ x86-64

File details

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

File metadata

File hashes

Hashes for ert-8.4.12-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8023a53bd0ec344af1e648c9be046c404a5296c56c5bf6524aa692b0746dc8d9
MD5 968bb302f965f10876aeeda081297aaf
BLAKE2b-256 09935119a1b43a97cfd817fbe2318ec947abb1ba3528287f04b8b28eb07bb09b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ert-8.4.12-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e1431222b05da05f008482cf1fa5feb652a67b7000397b57843f66bd1b8f4b44
MD5 2e6c5b44d0b9102b679ab324255d1253
BLAKE2b-256 c0c82c39eaad4dabbb81a0538cd5520492552f67c3ce363e16a5a5e7464606a6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ert-8.4.12-cp312-cp312-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 2db98010f73c03d2e9c7f367956e8bdab0019a8e829bcee86c6d1e4396ced25b
MD5 87f24eeefa272389f417549acf7e14f6
BLAKE2b-256 b113c2e5ddeecfe0cae1f34276d94c06dc5ab94c6f172ea1d9629cf40e971da2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ert-8.4.12-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ba552f8886c0c4e09700e1fc7f14b6540f808bec437e279650668d691eea8e9f
MD5 d38f52c7e0ed654d3983ff6ee103432c
BLAKE2b-256 3e441c9ef849c9c9419332f96f8b75c39e629aab0e6fbf6448d66754da7ad5eb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ert-8.4.12-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 5380f5c6e382d8796ced57d05147b7bb7c715ca3ebd9c4d65d13d5cfded3b3b0
MD5 2c6bc12423c18b3e2e474c10fc6f56aa
BLAKE2b-256 9eea022c7204353d18c75c678c76df0794edf53dc2de925ba4ba8d64b6ab0b0d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ert-8.4.12-cp311-cp311-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 a8526140aae883688632a5aa1101717079c6d802f6156d0f58c5b24b284719b6
MD5 14a948c71af7d58439ec1a7e07a055da
BLAKE2b-256 1a2ec3696c942de3551ff3edf258e4e8689f1398793df23e89957ce3b2f27d2e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ert-8.4.12-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 da6f87cd206459d89779866383ecdbd451b5054a2d91b6435fd0250e4038b6ea
MD5 e9886274884716a5b23f35da7513ce32
BLAKE2b-256 78bba865671a14635b77ef2e58309692bd73a3089470bb139a7a7deec25cf9ab

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ert-8.4.12-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 03e4b218bcab84109458eed2c8cae60e1ecc93388ebd6e0b9210bd2eec2b59a6
MD5 b12f35ab9d6e9e35c4f09956abff470a
BLAKE2b-256 3cffee6bb6551b19bfb6586397cb4fb768950ee94d7ff157b9d323a715d77c24

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ert-8.4.12-cp310-cp310-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 3d78c39c5298421a167c367447936767cea1497d340ade462d29a63b24e93120
MD5 5d7046fcbd30256b045393a9786efb2f
BLAKE2b-256 a30046a5682d2760207817ac099b1dec6e2b3a74b9daa5708a60c9a8cfc93aa0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ert-8.4.12-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 413e1142ec41901d23e079b62aa1a9f9767c905920018c55293de20b0031e1d8
MD5 e729a839fe9f676dd331b45ab029149a
BLAKE2b-256 f0d364bfc7b87eafe7d07566745b4e0e4c751414c1ef316cfb3a336b521add1c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ert-8.4.12-cp39-cp39-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 bd18775dc8940a3d285e7ee722d94605f4c15741c92383ee754d79b3abfda573
MD5 55b7f1f5d74274b9fccb1271c09eb7a5
BLAKE2b-256 a2d3c4872053c373709a4e8c550d2601f12892fb974b2f6914e90562910db750

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ert-8.4.12-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 48f9a2eb913bf28d4fdff2f730ef1b16219c9893cedd0797de9747ed6bd08da6
MD5 b54f8663777bf2d54999b6ca1a84183b
BLAKE2b-256 f96abc8a2af2f1af998bbaea0723dc8cd828472bacd20a26b378ff8ed512ef21

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ert-8.4.12-cp38-cp38-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 ffdec0bbf046381dc8c5867b0d8d40b77c841c8038894551a54145f951f4ea92
MD5 a6ce9854a4f8251bc540a144c55c2179
BLAKE2b-256 c6ebff386432a3b75d36e263b34872d69e8194aac1d5872731e5cc0c90df4c44

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