Skip to main content

Python package for interacting with Sumo in an FMU setting

Project description

Documentation Status

fmu-sumo

This package is intended for interaction with Sumo within the FMU (Fast Model Update(TM)) ecosystem.

Explorer

:warning: OpenVDS does not publish builds for MacOS. You can still use the Explorer without OpenVDS, but some Cube methods will not work.

Explore and retrieve data from Sumo.

from fmu.sumo.explorer import Explorer

sumo = Explorer()

Example: Find cases

# List of all available cases
cases = sumo.cases

# Get filter values
cases.statuses
cases.users
cases.fields

# Apply filters
cases = cases.filter(status=["keep", "offical"], user="peesv", field="Drogon")

for case in cases:
    print(case.id)
    print(case.name)

# select case
case = cases[0]

Example: Retrieve case objects

Get objects within a case through case.[CONTEXT].[OBJECT_TYPE].

Realized data
# All realized surface objects in case
surfs = case.realization.surfaces

# Get filter values
surfs.names
surfs.tagnames
surfs.iterations

# Apply filters
surfs = surfs.filter(name="surface_name", tagname="surface_tagname", iteration=0)

# Get surface
surf = surfs[0]

# Metadata
surf.id
surf.name
surf.tagname
surf.iteration
surf.realization

# Binary
surf.blob

# Get xtgeo.RegularSurface
reg = surf.to_regular_surface()
reg.quickplot()
Aggregated data
# All aggregated surfaces in case
surfs = case.aggregation.surfaces

# Get filter values
surfs.names
surfs.tagnames
surfs.iterations
surfs.operations

# Apply filters
surfs = surfs.filter(name="surface_name", tagname="surface_tagname", iteration=0, operation="mean")

# Get surface
surf = surfs[0]
Observed data
# All observed surfaces in case
surfs = case.observation.surfaces

# Get filter values
surfs.names
surfs.tagnames

# Apply filters
surfs = surfs.filter(name="surface_name", tagname="surface_tagname")

# Get surfaces
surf = surfs[0]

Uploader

Upload data from FMU to Sumo

Concepts

SumoConnection: The SumoConnection object represents the connection to Sumo, and will handle authentication etc when initiated. This object uses the Sumo python wrapper under the hood.

CaseOnDisk: The CaseOnDisk object represents an ensemble of reservoir model realisations. The object relates to the case metadata. Individual files belonging to the case are represented as FileOnDisk objects.

FileOnDisk: The FileOnDisk object represents a single file in an FMU case, stored on the local disk.

workflow for uploading during ERT runs

HOOK (presim) workflow registering the case:

from fmu.sumo import uploader

# Establish connection to Sumo
connection = sumo.SumoConnection()

# Initiate the case object
case = sumo.CaseOnDisk(
    case_metadata_path="/path/to/case_metadata.yml",
    sumo_connection=sumo_connection
    )

# Register the case on Sumo
# This uploads case metadata to Sumo
case.register()

FORWARD_JOB uploading data (can be repeated multiple times during a workflow):

from fmu.sumo import uploader

# Establish connection to Sumo
connection = sumo.SumoConnection()

# Initiate the case object
case = sumo.CaseOnDisk(
    case_metadata_path="/path/to/case_metadata",
    sumo_connection=sumo_connection
    )

# Add file-objects to the case
case.add_files("/globable/path/to/files/*.gri")

# Upload case data objects (files)
case.upload()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fmu-sumo-0.4.0.tar.gz (18.1 MB view details)

Uploaded Source

Built Distribution

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

fmu_sumo-0.4.0-py3-none-any.whl (56.8 kB view details)

Uploaded Python 3

File details

Details for the file fmu-sumo-0.4.0.tar.gz.

File metadata

  • Download URL: fmu-sumo-0.4.0.tar.gz
  • Upload date:
  • Size: 18.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for fmu-sumo-0.4.0.tar.gz
Algorithm Hash digest
SHA256 c92147a82a0418ca1a0fcaa84dbed4ca6bfb655f36d701e005346c210c4c5fab
MD5 4903a74418dc6f15deb030c55df37ffb
BLAKE2b-256 6bb13b8285c53fb67150c199cbb9ff6f09a93baed89ce30f12d8f8f0ca53e1a1

See more details on using hashes here.

File details

Details for the file fmu_sumo-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: fmu_sumo-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 56.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for fmu_sumo-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7aeeb2f80e11ea03fbe787013fb2fe41e0aaf5ca0db362bec447d8c57aff4d1d
MD5 b3a3e6af020a7c61faadf045286214c7
BLAKE2b-256 30e9e959abd218a8198c50462bb8d137e2293999c801c466f3e99628600f2569

See more details on using hashes here.

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