Skip to main content

eCalc™ is a software tool for calculation of energy demand and greenhouse gas (GHG) emissions from oil and gas production and processing.

Project description

eCalc Logo

CI Build License Code style: black PyPI - Python Version PyPI - Wheel PyPI - Implementation Pre-commit - Enabled

eCalc™

eCalc™ is a software tool for calculation of energy demand and greenhouse gas (GHG) emissions from oil and gas production and processing.

Note

eCalc™ is a work in progress and is by no means considered a finished and final product. We currently recommend to use the YAML API when using eCalc, and only fallback to the Python API when it is strictly needed.

Warning

The quality of the results produced by eCalc™ is highly dependent on the quality of the input data. Further, we do not make any guarantees and are not liable for the quality of results when using eCalc™.


eCalc Illustration


Reference Links


Introduction

eCalc™ is a software tool for calculation of energy demand and GHG emissions from oil and gas production and processing. It enables the cross-disciplinary collaboration required to achieve high-quality and transparent energy and GHG emission prognosis and decision support.

eCalc™ performs energy and emission calculations by integrating data, knowledge and future plans from different disciplines. This could be production and injection profiles from the reservoir engineer, characteristics of energy consuming equipment units such as gas turbines, compressors and pumps from the facility engineer, and emission factors for different fuels from the sustainability engineer. The main idea is using physical or data-driven models to relate production rates and pressures to the required processing energy and resulting emissions. Integrated bookkeeping for all emission sources is offered.

eCalc™ uses a bottom-up approach to give high-quality installation and portfolio level forecasts at the same time as detailed insights about the energy drivers and processing capacities for the individual installation.

Getting started

eCalc™ is both a Python library and has a command line interface (CLI) to use with eCalc YAML Models. We currently recommend using eCalc™ from the command line with eCalc YAML Models, since the Python API is about to change soon, but the YAML will be more or less stable and backwards compatible.

To get started, please refer to the eCalc™ Docs - Getting Started, or follow the quick guide below:

Prerequisites

  • Python, version 3.12 or higher
  • Java, version 8 or higher
  • Docker (Optional), Linux or MacOS

eCalc™ only supports Python 3, and will follow Komodo wrt. minimum requirement for Python, which currently is 3.12.

Installation

pip install libecalc
ecalc --version
ecalc selftest

Alternative using Docker:

docker build --target build -t ecalc .
docker run -it ecalc /bin/bash

Inside the docker container, run:

ecalc --version
ecalc selftest

Please refer to Docker Docs for details on how to use Docker.

Alternative using devcontainer:

In vscode:

  • Install extension "Dev Containers" and open command palette (ctrl+p or cmd+p or F1) and click "reopen in container" then click the alternative "eCalc Python Dev Environment".

In github codespaces:

  • In the repo click the "<> Code" button -> codespaces -> in the codespaces section click the ellipsis menu (three dots) -> click "New with options.." -> under "Dev container configuration" click and choose "eCalc Python Dev Environment" -> then click button "Create Codespace".

ecalc-selftest

Create and run your first model

Please refer to the https://equinor.github.io/ecalc/docs/about/modelling/setup/ on how to set up your own model with the YAML API and https://equinor.github.io/ecalc/docs/about/getting_started/cli/ on how to run it.

See Examples below to use one of our predefined examples.

Development and Contribution

For package management during development, we use uv. Read more here https://docs.astral.sh/uv/. In short, it can replace several tools like pip, pip-tools, pipx, poetry, pyenv, twine, virtualenv, and more. While staying being performant.

See https://docs.astral.sh/uv/getting-started/installation/ to install uv.

We welcome all kinds of contributions, including code, bug reports, issues, feature requests, and documentation. The preferred way of submitting a contribution is to either make an issue on GitHub or by forking the project on GitHub and making a pull request.

See Contribution Document on how to contribute.

See the Developer Guide for details.

Running tests

We use pytest for our tests, to run all tests

uv run pytest

Alternative with multithread (if xdist is installed):

uv run pytest -n auto

To update inline snapshots

uv run pytest -m "inlinesnapshot" --inline-snapshot=fix

Documentation

The documentation can be found at https://equinor.github.io/ecalc

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 Distribution

libecalc-13.2.0.tar.gz (31.5 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

libecalc-13.2.0-py3-none-any.whl (31.7 MB view details)

Uploaded Python 3

File details

Details for the file libecalc-13.2.0.tar.gz.

File metadata

  • Download URL: libecalc-13.2.0.tar.gz
  • Upload date:
  • Size: 31.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for libecalc-13.2.0.tar.gz
Algorithm Hash digest
SHA256 0630f0515313be272dc7f7bab1470d88f1320e725061ee32faa0e5b586a9a493
MD5 eaf42ec2bb8b5022d9a34afcdc4fedcc
BLAKE2b-256 d788cf07f617f2165a4cef51a6cbb3284c56c3bf0952eb49fab5153d36e992e7

See more details on using hashes here.

Provenance

The following attestation bundles were made for libecalc-13.2.0.tar.gz:

Publisher: publish-libecalc.yml on equinor/ecalc

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file libecalc-13.2.0-py3-none-any.whl.

File metadata

  • Download URL: libecalc-13.2.0-py3-none-any.whl
  • Upload date:
  • Size: 31.7 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for libecalc-13.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4684fbc1cba29107c9c2b9b177c54d8935b1c5916a6ae567c137123694bc2f0c
MD5 392172cc7efce45102263a0631c8e515
BLAKE2b-256 9018e837f2fb6b0910b61a70e579b48b19e2d9c230840132e18101d2ba080a1b

See more details on using hashes here.

Provenance

The following attestation bundles were made for libecalc-13.2.0-py3-none-any.whl:

Publisher: publish-libecalc.yml on equinor/ecalc

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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