Skip to content

Inplace volumes delta ensembles - #1865

Open
HansKallekleiv wants to merge 7 commits into
equinor:mainfrom
HansKallekleiv:pr/inplace-volumes-delta-ensembles
Open

Inplace volumes delta ensembles#1865
HansKallekleiv wants to merge 7 commits into
equinor:mainfrom
HansKallekleiv:pr/inplace-volumes-delta-ensembles

Conversation

@HansKallekleiv

Copy link
Copy Markdown
Collaborator

Adds delta ensembles to InplaceVolumesNew and InplaceVolumesTable.
The delta calculations is currently done in the frontend.
We can consider moving it to backend for performance in a later PR. Should be combined with some refactoring of the backend code.

Widens the inplace volumes filter to accept delta ensembles and computes the
per-realization difference (comparison - reference) client-side, matched per
(realization, selector) tuple. No new backend endpoints are required.

Table definitions are fetched for both constituent ensembles so comparability
and available results validate across the pair.

Note: the difference is matched on realization number, which is only meaningful
when the two ensembles are realization-aligned. A warning is emitted when the
constituent realization sets differ.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds frontend-computed delta ensembles to the inplace-volumes table and new visualization modules.

Changes:

  • Fetches constituent ensemble data and computes per-realization deltas and statistics.
  • Adds delta selection, persistence, labels, warnings, and data-channel support.
  • Adds unit tests and shared statistical utilities.

Reviewed changes

Copilot reviewed 40 out of 40 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
frontend/tests/unit/InplaceVolumesStatisticalTableUtils.test.ts Tests client-side statistical aggregation.
frontend/tests/unit/InplaceVolumesDeltaTableUtils.test.ts Tests delta subtraction and memoization.
frontend/src/modules/InplaceVolumesTable/view/view.tsx Supplies ensemble context for warnings.
frontend/src/modules/InplaceVolumesTable/view/utils/tableComponentUtils.ts Formats regular and delta ensemble names.
frontend/src/modules/InplaceVolumesTable/view/hooks/useMakeViewStatusWriterMessages.ts Adds delta-related warnings.
frontend/src/modules/InplaceVolumesTable/view/atoms/queryAtoms.ts Merges regular and delta query results.
frontend/src/modules/InplaceVolumesTable/view/atoms/derivedAtoms.ts Separates regular and delta selections.
frontend/src/modules/InplaceVolumesTable/settings/settings.tsx Enables delta ensemble selection.
frontend/src/modules/InplaceVolumesTable/settings/persistence.ts Deserializes both ensemble identifier types.
frontend/src/modules/InplaceVolumesTable/settings/atoms/queryAtoms.ts Fetches metadata for delta constituents.
frontend/src/modules/InplaceVolumesTable/settings/atoms/persistableFixableAtoms.ts Persists and fixes delta selections.
frontend/src/modules/InplaceVolumesPlot/view/atoms/queryAtoms.ts Uses renamed query-option factory.
frontend/src/modules/InplaceVolumesPlot/view/atoms/derivedAtoms.ts Restricts legacy plots to regular ensembles.
frontend/src/modules/InplaceVolumesPlot/settings/settings.tsx Filters synchronized delta selections.
frontend/src/modules/InplaceVolumesNew/view/view.tsx Supplies ensemble context for warnings.
frontend/src/modules/InplaceVolumesNew/view/utils/TableBuilder.ts Uses shared statistics implementation.
frontend/src/modules/InplaceVolumesNew/view/utils/statistics.ts Removes superseded local statistics utilities.
frontend/src/modules/InplaceVolumesNew/view/utils/plotly/histogram.ts Uses shared statistics.
frontend/src/modules/InplaceVolumesNew/view/utils/plotly/distribution.ts Uses shared statistics.
frontend/src/modules/InplaceVolumesNew/view/utils/plotly/box.ts Uses shared statistics.
frontend/src/modules/InplaceVolumesNew/view/utils/plotly/bar.ts Uses shared statistics.
frontend/src/modules/InplaceVolumesNew/view/utils/GroupedTableData.ts Supports delta labels and colors.
frontend/src/modules/InplaceVolumesNew/view/hooks/usePublishToDataChannels.ts Publishes delta ensemble data.
frontend/src/modules/InplaceVolumesNew/view/hooks/useMakeViewStatusWriterMessages.ts Adds delta-related warnings.
frontend/src/modules/InplaceVolumesNew/view/atoms/queryAtoms.ts Merges regular and delta data.
frontend/src/modules/InplaceVolumesNew/view/atoms/derivedAtoms.ts Builds regular and delta query inputs.
frontend/src/modules/InplaceVolumesNew/settings/settings.tsx Enables delta selection.
frontend/src/modules/InplaceVolumesNew/settings/persistence.ts Restores delta identifiers.
frontend/src/modules/InplaceVolumesNew/settings/atoms/queryAtoms.ts Fetches constituent metadata.
frontend/src/modules/InplaceVolumesNew/settings/atoms/persistableFixableAtoms.ts Persists delta selections.
frontend/src/modules/_shared/utils/math/statistics.ts Centralizes statistical calculations.
frontend/src/modules/_shared/InplaceVolumes/types.ts Extends table types for deltas.
frontend/src/modules/_shared/InplaceVolumes/TableDefinitionsAccessor.ts Validates delta constituents.
frontend/src/modules/_shared/InplaceVolumes/statisticalTableUtils.ts Aggregates deltas into statistics.
frontend/src/modules/_shared/InplaceVolumes/selectorColumnUtils.ts Adds selector encoding helpers.
frontend/src/modules/_shared/InplaceVolumes/queryHooks.ts Fetches and combines delta constituent data.
frontend/src/modules/_shared/InplaceVolumes/deltaTableUtils.ts Computes per-realization differences.
frontend/src/modules/_shared/InplaceVolumes/deltaEnsembleWarnings.ts Generates delta data-loss warnings.
frontend/src/modules/_shared/components/InplaceVolumesFilterComponent/inplaceVolumesFilterComponent.tsx Makes delta selection configurable.
frontend/src/framework/types/inplaceVolumesFilterSettings.ts Allows delta identifiers in filters.
Suppressed comments (1)

frontend/src/modules/_shared/utils/math/statistics.ts:75

  • For a group containing one valid realization, Polars' sample standard deviation (std() with ddof=1) is undefined/NaN, but this returns 0. This makes client-computed delta statistics disagree with the regular statistical table for single-realization groups.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread frontend/src/modules/_shared/utils/math/statistics.ts
Comment thread frontend/src/modules/_shared/InplaceVolumes/queryHooks.ts Outdated
Comment thread frontend/src/modules/_shared/InplaceVolumes/deltaTableUtils.ts

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 40 out of 40 changed files in this pull request and generated no new comments.

Suppressed comments (1)

frontend/src/modules/_shared/utils/math/statistics.ts:86

  • For a group with exactly one finite realization, this returns stdDev = 0, but the backend uses Polars std() with ddof=1; that result is null and is converted to NaN (inplace_results_df_utils.py:191,254). Delta statistical tables therefore disagree with regular backend tables for singleton groups. Return NaN when count < 2 so the client-side aggregation actually matches the documented backend behavior.

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.

2 participants