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

Faster iteration over surfaces in case #327

Closed SteffenEq closed 2 months ago

SteffenEq commented 5 months ago

DynaGeo uses SumoExplorer to populate frontend filters for the users. When a user selects a case, sub-filters are populated (aggregation, attribute, realization etc.). This means iterating over case.surfaces and extracting metadata fields. This however can be quite time-consuming when iterating over large cases (~20k surfaces takes ~ 1 minute).

Is there a better way to obtain metadata for all surfaces in a case?

Thank you!

rwiker commented 5 months ago

Can you give some more details? Alternatively, take this to slack for further discussion?

adnejacobsen commented 5 months ago

The SurfaceCollection class has a set of properties for retrieving a list of unique values for various metadata fields. This will give you a list of aggregations that exists in the collection of surfaces:

aggs = case.surfaces.aggregations

Api reference: https://fmu-sumo.readthedocs.io/en/latest/apiref/fmu.sumo.explorer.objects.surface_collection.html

SteffenEq commented 5 months ago

Thanks! We're aware of the methods on SurfaceCollection, but having a list of e.g. aggregations does not necessarily let us filter the data. In short, for our application to filter surfaces, we need to know, for each surface, the value of aggregation, realization etc.

I'll take this discussion to the slack channel.