Inplace volumes delta ensembles - #1865
Open
HansKallekleiv wants to merge 7 commits into
Open
Conversation
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.
…zation count differs
Contributor
There was a problem hiding this comment.
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.
Contributor
There was a problem hiding this comment.
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 Polarsstd()withddof=1; that result is null and is converted toNaN(inplace_results_df_utils.py:191,254). Delta statistical tables therefore disagree with regular backend tables for singleton groups. ReturnNaNwhencount < 2so the client-side aggregation actually matches the documented backend behavior.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.