diff --git a/CHANGELOG.md b/CHANGELOG.md index 24f74bf10..179c66950 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,8 +13,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed +- [#1061](https://github.com/equinor/webviz-subsurface/pull/1061) - Removed a pandas dataframe as function argument from a webvizstore decorated function as it can cause incompabilities between different environments. - [#1114](https://github.com/equinor/webviz-subsurface/pull/1114) - Fixed an exception in `MapViewerFMU` when a map does not exist. - - [#1118](https://github.com/equinor/webviz-subsurface/pull/1118) - `MapViewerFMU` - Removed `zoom` and `bounds` props from `DeckGLMap` as they are now automatically calculated. - [#1094](https://github.com/equinor/webviz-subsurface/pull/1094) - Fixed issues with ambiguous truth of `pandas.Series` in `EnsembleSummaryProvider`. - [#1107](https://github.com/equinor/webviz-subsurface/pull/1107) - Fixed bug in `ParameterResponseCorrelation` that caused the plugin to fail if the `response_filters` parameter was not given. diff --git a/webviz_subsurface/plugins/_property_statistics/models/property_statistics_model.py b/webviz_subsurface/plugins/_property_statistics/models/property_statistics_model.py index 562043bb1..ec5451438 100644 --- a/webviz_subsurface/plugins/_property_statistics/models/property_statistics_model.py +++ b/webviz_subsurface/plugins/_property_statistics/models/property_statistics_model.py @@ -95,6 +95,10 @@ def selectors_has_value(self, value: str = "Total") -> bool: def properties(self) -> List[str]: return list(self.dataframe["PROPERTY"].unique()) + @property + def zones(self) -> List[str]: + return list(self.dataframe["ZONE"].unique()) + @property def sources(self) -> List[str]: return list(self.dataframe["SOURCE"].unique()) diff --git a/webviz_subsurface/plugins/_property_statistics/property_statistics.py b/webviz_subsurface/plugins/_property_statistics/property_statistics.py index cacc96cd0..16dda75e9 100644 --- a/webviz_subsurface/plugins/_property_statistics/property_statistics.py +++ b/webviz_subsurface/plugins/_property_statistics/property_statistics.py @@ -204,7 +204,8 @@ def __init__( self._surface_renaming = surface_renaming if surface_renaming else {} self._surface_table = generate_surface_table( - statistics_dframe=self._pmodel.dataframe, + zones=self._pmodel.zones, + properties=self._pmodel.properties, ensembles=self._pmodel.ensembles, surface_folders=self._surface_folders, surface_renaming=self._surface_renaming, @@ -244,7 +245,8 @@ def add_webvizstore(self) -> List[Tuple[Callable, list]]: generate_surface_table, [ { - "statistics_dframe": self._pmodel.dataframe, + "zones": self._pmodel.zones, + "properties": self._pmodel.properties, "ensembles": self._pmodel.ensembles, "surface_folders": self._surface_folders, "surface_renaming": self._surface_renaming, diff --git a/webviz_subsurface/plugins/_property_statistics/utils/surface.py b/webviz_subsurface/plugins/_property_statistics/utils/surface.py index d9c901a25..4997bb375 100644 --- a/webviz_subsurface/plugins/_property_statistics/utils/surface.py +++ b/webviz_subsurface/plugins/_property_statistics/utils/surface.py @@ -32,14 +32,13 @@ def surface_from_zone_prop( @webvizstore def generate_surface_table( - statistics_dframe: pd.DataFrame, + zones: List[str], + properties: List[str], ensembles: List, surface_renaming: Dict, surface_folders: Optional[Dict], ) -> pd.DataFrame: surface_folders = {} if not surface_folders else surface_folders - zones = statistics_dframe["ZONE"].unique() - properties = statistics_dframe["PROPERTY"].unique() statistics = ["mean", "stddev", "min", "max", "p10", "p90"] surface_table = [] for ensemble in ensembles: