Skip to main content

Actions Status Code Style: black

Stea

Stea is a HTTP client for Stea calculations, some documentation can be found in the stea/init.py file. The source code in this project is a Python package, to actually use it you will need to write your own executable script.

The main way to configure the stea client is through a yaml file, an example configuration file is shown here:

# The id of the project, which must already exist and be available in
# the stea database. In the Stea documentation this is called "AlternativeId".
project-id: 4782
project-version: 1


# All information in stea is versioned with a timestamp. When we request a
# calculation we must specify wich date we wish to use to fetch configuration
# information for assumptions like e.g. the oil price.
config-date: 2018-07-01 12:00:00


# The stea web client works by *adjusting* the profiles in an existing
# stea project which has already been defined. That implies that all
# profiles added in this configuration file should already be part of
# the project. To match the profiles specified here with the profiles in
# the project we must give a id for the profiles.

# The profiles keyword is used to enter profile data explicitly in the
# configuration file. Each profile is identified with an id from the
# existing stea project, a start date and the actual data.

profiles:
    23fc0639-453f-42ee-876c-1e7b94a4f2bb:
       start-date: 2018-01-01
       data: [100, 200, 300]

# Profiles which are calculated directly from an eclipse simulation are
# listed with the ecl-profiles key. Each profile is identified with an id
# from the stea project and an eclipe key like 'FOPT'. By default the stea
# client will calculate a profile from the full time range of the simulated
# data, but you can optionally use the keywords start-date and end-year to
# limit the time range. All data in the end-year is included.
ecl-profiles:
  bf063de9-453f-42ee-876c-1e7b94a4f2bb:
     ecl-key: FOPT

  91e7b94a4f2bb-453f-42ee-876c-bf063de:
     ecl-key: FGPT
     start-date: 2020-01-01
     end-year: 2030

  profile_comment_in_stea:
     ecl-key: FWPT
     glob_mult: 1.1

  another_profile_comment_in_stea:
     ecl-key: FWPT
     mult: [ 1.1, 2, 0 ]

# When you use the ecl-profiles keyword to update profiles feteched directly
# from an eclipse simulation you also need to set the ecl-case keyword to
# point to an existing eclipse summary case on disk
ecl-case: models/eclipse/ECL_CASE_016

# What do you want stea to calculate
results:
   - NPV

An minimal example script using the stea package could be:

#!/usr/bin/env python
import sys
import stea

def main(argv):
    if len(argv) == 2:
       fname = argv[1]
    else:
        raise AttributeError('Need yaml formatted configuration file as first commandline argument')

    stea_input = stea.SteaInput([fname])
    res = stea.calculate(stea_input)
    for res, value in res.results(stea.SteaKeys.CORPORATE).items():
        print("{res} : {value}".format(res=res, value=value))


if __name__ == "__main__":
   main(sys.argv)

Installation and usage

stea is available on pypi and can be installed using pip install stea.

# Install
pip install stea

Run tests

tox is used as the test facilitator, to run the full test suite:

# Test
pip install tox
tox

or to run it for a particular Python version (in this case Python 3.7):

# Test
pip install tox
tox -e py37

or to run it for a the current Python version:

# Test
pip install tox
tox -e py

pytest is used as the test runner, so for quicker iteration it is possible to run:

# Test
pytest

this requires that the test dependencies from test_requirements.txt are installed.

# Install test requirements
pip install -r test_requirements.txt

black is used as the code formatter, to run the style test:

pip install tox
tox -e style

Metadata

Release files for fmu-steaclient 0.7.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fmu-steaclient 0.7.6
File Size Uploaded Provenance Actions
fmu-steaclient-0.7.6.tar.gz 19.8 kB Without provenance Details for fmu-steaclient-0.7.6.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for fmu-steaclient 0.7.6
File Interpreter ABI Platform Actions
fmu_steaclient-0.7.6-py3-none-any.whl Python 3 none any Details for fmu_steaclient-0.7.6-py3-none-any.whl

Total release size: 34.9 kB

Release files / fmu-steaclient-0.7.6.tar.gz

Download URL fmu-steaclient-0.7.6.tar.gz
Size 19.8 kB
Tags Source
SHA-256 checksum
How to use checksums
d3ac234457ff69578fe5edd3b2ddd0ee7bd2cb0c1864a5c57b077aa3233dfcd9
BLAKE2b-256 checksum
How to use checksums
dd5def007881d9029d7731c7feb9286d8b12fc0efd44c63b5923a1959775a684
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.18

Release files / fmu_steaclient-0.7.6-py3-none-any.whl

Download URL fmu_steaclient-0.7.6-py3-none-any.whl
Size 15.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
05372698d09d112371c3ceef384918aa00c8b47fe5065fca3ed9d7d2dbaeb45b
BLAKE2b-256 checksum
How to use checksums
7425bc0af7b8a914e805c3860a5bdb580f1c742d28f43c5fc1051453c4190ee8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.18

Security for fmu-steaclient 0.7.6

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.7.6 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page