Skip to content

Add Python API for importing SUMO ensembles via fmu-sumo package#910

Draft
Copilot wants to merge 6 commits into
devfrom
copilot/design-alternatives-summary-data
Draft

Add Python API for importing SUMO ensembles via fmu-sumo package#910
Copilot wants to merge 6 commits into
devfrom
copilot/design-alternatives-summary-data

Conversation

Copy link
Copy Markdown

Copilot AI commented Apr 16, 2026

ResInsight's direct Elastic search queries to SUMO are fragile. This adds a Python-driven integration path using the fmu-sumo package for metadata access, keeping ResInsight's existing parquet-based data loading intact.

Changes

  • RimcProject.h/cpp — New importSummaryEnsembleSumo scriptable PDM method on RimProject. Accepts case_id, case_name, ensemble_name, vector_names, and realization_ids from Python; creates a RimSummarySumoDataSource + RimSummaryEnsembleSumo and registers them in the project. Auto-exposed to Python as project.import_summary_ensemble_sumo(...).

  • RimCloudDataSourceCollection — Added addSumoDataSource() to support programmatic data source creation outside the UI workflow.

  • sumo_ensemble_import.py — Example script demonstrating the pattern: fmu-sumo handles case/ensemble discovery and metadata (the fragile part), ResInsight handles lazy parquet loading.

Usage

from fmu.sumo.explorer import Explorer
import rips

sumo = Explorer(env="prod")
cases = sumo.cases.filter(asset="Drogon")
case = cases[0]
iteration = case.iterations[0]

realization_ids = [str(r) for r in iteration.realizations]
vector_names = [col for col in iteration.tables.filter(tagname="summary")[0].column_names
                if col not in {"DATE", "REAL", "ENSEMBLE"}]

project = rips.Instance.find().project
ensemble = project.import_summary_ensemble_sumo(
    case_id=case.uuid,
    case_name=case.name,
    ensemble_name=iteration.name,
    vector_names=vector_names,
    realization_ids=realization_ids,
)

Copilot AI linked an issue Apr 16, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Suggest designs for ResInsight and SUMO communication Add Python API for importing SUMO ensembles via fmu-sumo package Apr 16, 2026
Copilot AI requested a review from magnesj April 16, 2026 20:24
@magnesj magnesj force-pushed the copilot/design-alternatives-summary-data branch from 2c9c3f3 to 06a0060 Compare April 30, 2026 08:07
Copilot AI and others added 5 commits May 5, 2026 15:56
Make RimSummaryEnsembleSumo scriptable so the generated Python class
is emitted, add the missing RimSummaryCaseMainCollection include in
RimcProject.cpp, and update the example script to the current
fmu-sumo Explorer API (ensembles/realizationids/columns).
@magnesj magnesj force-pushed the copilot/design-alternatives-summary-data branch from 7fe78f1 to cda7c3c Compare May 6, 2026 06:46
Avoid two Python parameters appearing with the same 'Name' label by
giving m_name an explicit script keyword. This exposes the ensemble
name as the more natural 'name' Python attribute and disambiguates it
from m_nameAndItemCount.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Design alternatives for summary data from SUMO

2 participants