Skip to content

Commit

Permalink
Do not use pandas dataframe as argument to webvizstore function (#1061)
Browse files Browse the repository at this point in the history
  • Loading branch information
HansKallekleiv authored Sep 29, 2022
1 parent 939fa89 commit f9662a2
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit f9662a2

Please sign in to comment.