equinor / fmu-sumo

Interaction with Sumo in the FMU context
https://fmu-sumo.readthedocs.io/en/latest/
Apache License 2.0
0 stars 6 forks source link

Represent Realization and Iteration as virtual objects #312

Closed perolavsvendsen closed 1 week ago

perolavsvendsen commented 6 months ago

While Realization and Iteration (Ensemble) are not explicitly represented as objects in Sumo (no explicit metadata made by fmu-dataio), they are well known concepts, also in the context of results.

Needs a bit of discussions, and is likely to involve some breaking changes.

Suggest iteration and realization objects that programmatically behave similar to the case object, something like:

mycase = sumo.get_case_by_uuid(<uuid4>)
mycase.iterations
>> ["iter-0", "iter-1"]

myiteration = mycase.iterations["iter-0"]
myiteration.uuid
>> <uuid4>

myiteration.name
>> iter-0

# get all polygons under this iteration
myiteration.polygons
>> [Polygons, Polygons, Polygon, ...]

myiteration.realizations
>> [0,1,2,3,4,5,6, ...]

myrealization = myiteration.realizations[0]
myrealization.uuid
>> <uuid4>

myrealization.name
>> "realization-0"

# get parameters for this realization
myrealization.parameters

# get surfaces for this realization (similar as e.g. `case.surfaces`)
myrealization.surfaces
[Surface, Surface, Surface, ...]

This will also make for a more unified user experience, as this virtualization is already done in the front-end. We could for instance envision that the front-end could produce ready Python snippets for interacting with specific ensembles/iterations.

perolavsvendsen commented 6 months ago

Perhaps we create iteration and realization objects (similar to case) in Sumo when first child object is seen referencing an iteration?

equinor-ruaj commented 1 week ago

Also working on uploading separate Realization and Iteration objects: https://github.com/orgs/equinor/projects/517/views/2?sliceBy%5Bvalue%5D=equinor-ruaj&pane=issue&itemId=78417657 https://github.com/equinor/fmu-sumo-uploader/pull/83