Skip to content

Commit ce25837

Browse files
lindjohaØyvind Lind-Johansen
and
Øyvind Lind-Johansen
authored
Sensitivity filter in RftPlotter parameter response view (#1211)
* Param respone view always added, sensitivity filter and some small fixes * changelog entry * Fixed CHANGELOG * typing error in changelog --------- Co-authored-by: Øyvind Lind-Johansen <olind@equinor.com>
1 parent b1ce253 commit ce25837

File tree

7 files changed

+22
-12
lines changed

7 files changed

+22
-12
lines changed

CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [UNRELEASED] - YYYY-MM-DD
99

10+
### Changed
11+
12+
- [#1211](https://github.com/equinor/webviz-subsurface/pull/1211) - `RftPlotter`: Parameter response view always displayed, also for sensitivity ensembles. Instead it is now possible to filter on SENSNAME.
13+
14+
### Added
15+
- [#1207](https://github.com/equinor/webviz-subsurface/pull/1207) - New functionality in `ParameterAnalysis`: observations, resampling frequency and sensitivity filter.
16+
1017
## [0.2.18] - 2023-04-12
1118

1219
### Changed
@@ -17,7 +24,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1724

1825
### Added
1926
- [#1199](https://github.com/equinor/webviz-subsurface/pull/1199) - Added more statistical options to the WellOverview tab in `WellAnalysis`, and the possibility to see injection rates.
20-
- [#1207](https://github.com/equinor/webviz-subsurface/pull/1207) - New functionality in `ParameterAnalysis`: observations, resampling frequency and sensitivity filter.
2127

2228
## [0.2.17] - 2023-01-18
2329

webviz_subsurface/plugins/_rft_plotter/_plugin.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,10 +122,9 @@ def __init__(
122122
self.add_view(MapView(self._datamodel), self.Ids.MAP_VIEW)
123123
self.add_view(MisfitPerRealView(self._datamodel), self.Ids.MISFIT_PER_REAL_VIEW)
124124
self.add_view(SimVsObsView(self._datamodel), self.Ids.SIM_VS_OBS_VIEW)
125-
if not self._datamodel.param_model.sensrun:
126-
self.add_view(
127-
ParameterResponseView(self._datamodel), self.Ids.PARAMETER_RESPONSE_VIEW
128-
)
125+
self.add_view(
126+
ParameterResponseView(self._datamodel), self.Ids.PARAMETER_RESPONSE_VIEW
127+
)
129128

130129
def add_webvizstore(self) -> List[Tuple[Callable, List[Dict]]]:
131130
return self._datamodel.webviz_store

webviz_subsurface/plugins/_rft_plotter/_utils/_formation_figure.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ def add_formation(self, df: pd.DataFrame, fill_color: bool = True) -> None:
157157
"name": row["ZONE"],
158158
"y0": row[top_col],
159159
"y1": row[base_col],
160-
"line": dict(color="#646567", width=1.0),
160+
"line": {"color": "#646567", "width": 1.0},
161161
"fillcolor": formation_colors[
162162
list(df["ZONE"].unique()).index(row["ZONE"])
163163
]

webviz_subsurface/plugins/_rft_plotter/_views/_map_view/_utils/_map_figure.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ def __init__(self, ertdf: pd.DataFrame, ensemble: str, zones: List[str]) -> None
1111
self._ertdf = (
1212
ertdf.loc[(ertdf["ENSEMBLE"] == ensemble) & (ertdf["ZONE"].isin(zones))]
1313
.groupby(["WELL", "DATE", "ENSEMBLE"])
14-
.aggregate("mean")
14+
.mean(numeric_only=False)
1515
.reset_index()
1616
)
1717

webviz_subsurface/plugins/_rft_plotter/_views/_parameter_response_view/_settings/_parameter_filter.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,18 @@ class ParameterFilterSettings(SettingsGroupABC):
1212
class Ids(StrEnum):
1313
PARAM_FILTER = "param-filter"
1414

15-
def __init__(self, parameter_df: pd.DataFrame, mc_ensembles: List[str]) -> None:
15+
def __init__(self, parameter_df: pd.DataFrame, ensembles: List[str]) -> None:
1616
super().__init__("Parameter Filter")
1717
self._parameter_df = parameter_df
18-
self._mc_ensembles = mc_ensembles
18+
self._ensembles = ensembles
1919

2020
def layout(self) -> List[Component]:
2121
return ParameterFilter(
2222
uuid=self.register_component_unique_id(self.Ids.PARAM_FILTER),
2323
dframe=self._parameter_df[
24-
self._parameter_df["ENSEMBLE"].isin(self._mc_ensembles)
24+
self._parameter_df["ENSEMBLE"].isin(self._ensembles)
2525
].copy(),
2626
reset_on_ensemble_update=True,
2727
display_header=False,
28+
include_sens_filter=True,
2829
).layout

webviz_subsurface/plugins/_rft_plotter/_views/_parameter_response_view/_settings/_selections.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def layout(self) -> List[Component]:
6969
label="Parameter",
7070
id=self.register_component_unique_id(self.Ids.PARAM),
7171
options=[{"label": param, "value": param} for param in self._params],
72-
clearable=False,
72+
clearable=True,
7373
value=None,
7474
),
7575
]

webviz_subsurface/plugins/_rft_plotter/_views/_parameter_response_view/_view.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def __init__(self, datamodel: RftPlotterDataModel) -> None:
3333
self.add_settings_group(
3434
ParameterFilterSettings(
3535
parameter_df=self._datamodel.param_model.dataframe,
36-
mc_ensembles=self._datamodel.param_model.mc_ensembles,
36+
ensembles=self._datamodel.param_model.ensembles,
3737
),
3838
self.Ids.PARAMETER_FILTER,
3939
)
@@ -220,6 +220,10 @@ def _update_paramresp_graphs(
220220
# This happens if there are multiple ensembles and one of the ensembles
221221
# doesn't have non-constant parameters.
222222
return ["The selected ensemble has no non-constant parameters."] * 3
223+
if df.shape[0] <= 1:
224+
# This happens if f.ex it is filtered on a sensitivity with only one
225+
# realization.
226+
return ["Too few realizations to calculate correlations"] * 3
223227

224228
if corrtype == CorrType.SIM_VS_PARAM or param is None:
225229
corrseries = correlate(df[ens_params + [current_key]], current_key)

0 commit comments

Comments
 (0)