Delta Ensemble: Refresh calculated addresses for all realizations - #14576
Conversation
A delta ensemble creates summary addresses for all realizations of the source ensembles. When a calculation was created after this, only the realizations showing tree nodes had their addresses recreated. The other realizations had no calculated address, and RimDeltaSummaryCase::values() discarded the vector as being present in only one of the source ensembles. Only realization 0 was plotted until the project was reloaded. Add RifSummaryReaderInterface::refreshCalculatedAddresses() to recreate the addresses of the calculated readers without touching the native readers, and call it for all cases in an ensemble when calculations are updated.
kriben
left a comment
There was a problem hiding this comment.
I like it.
Agent found this:
- [P2] Deleting the final calculation leaves stale calculated addresses — ApplicationLibCode/ProjectDataModel/RimSummaryCalculationCollection.cpp:54
deleteCalculation() calls rebuildCaseMetaData() after removing the calculation, but updateDataDependingOnCalculations() immediately returns when the collection becomes empty. Consequently, the newly added ensemble refresh never runs, leaving deleted calculated addresses in readers and delta-case caches until another refresh or project reload. The test masks this by manually calling refreshCalculatedAddresses() after deletion at ApplicationLibCode/UnitTests/RifMultipleSummaryReaders-Test.cpp:93. Remove or adjust the early return and add an integration-level test for deleting the last calculation.
…ation is deleted deleteCalculation() removes the calculation before rebuildCaseMetaData() is called, and updateDataDependingOnCalculations() returned early for an empty collection. The addresses created by the last calculation were then left behind in the readers until the next refresh or a reload of the project. Perform one more update after the last calculation is deleted, and keep the early return for the case where no calculations have been present.
|
Thanks — the P2 finding was correct. Removing the early return altogether would force reader creation for every realization of every ensemble on project load when no calculations are present, so the collection now remembers whether the previous update had calculations, and performs one more update after the last one is deleted. Added |
Fixes #14559
A delta ensemble creates summary addresses for all realizations of the source ensembles, unlike a plain ensemble where addresses are created lazily.
RimDeltaSummaryCase::values()useshasAddress()on both source readers to detect vectors present in only one of the source ensembles, and this check is authoritative once the address set is non-empty.When a calculation was created after the delta ensemble,
RimSummaryCalculationCollection::updateDataDependingOnCalculations()recreated the addresses only for the cases showing tree nodes and for the case with most data objects in each ensemble. The remaining realizations never got the calculated address, so the delta case discarded the vector and only realization 0 was plotted. Reloading the project rebuilt the readers from scratch, which is why all realizations were present after a save and reload.RifSummaryReaderInterface::refreshCalculatedAddresses(), recreating the addresses of the calculated readers while leaving the native readers untouched. Does nothing if no addresses have been created, so lazily loaded realizations stay lazy.RimDeltaSummaryCaserebuilds the union of the source addresses and discards cached values for calculated vectors, as the values may have changed.RimSummaryEnsemble::onCalculationUpdated()refreshes the calculated addresses for all cases in the ensemble. No additional file access, ascaseWithMostDataObjects()already touches the reader of every case.