Skip to content

Commit

Permalink
RftPlotter fix: Handle correlate function returning NaN values (#932
Browse files Browse the repository at this point in the history
)
  • Loading branch information
lindjoha authored Jan 20, 2022
1 parent dab9469 commit 2011f0e
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- [#921](https://github.com/equinor/webviz-subsurface/pull/921) - Fixed bug with History Vectors in new `SimulationTimeSeries` plugin. Replaced hard coded realization number of 0, with first valid realization in provider.
- [#926](https://github.com/equinor/webviz-subsurface/pull/926) - `VolumetricAnalysis` - Fixed bug when building portables with aggregated (csvfile_vol) input.
- [#932](https://github.com/equinor/webviz-subsurface/pull/932) - `RftPlotter` - Fixed bug related to calculated correlations returnin NaN if the response variable has constant values.

## [0.2.9] - 2022-01-06

Expand Down
2 changes: 1 addition & 1 deletion webviz_subsurface/plugins/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
from ._reservoir_simulation_timeseries_regional import (
ReservoirSimulationTimeSeriesRegional,
)
from ._rft_plotter.rft_plotter import RftPlotter
from ._rft_plotter import RftPlotter
from ._running_time_analysis_fmu import RunningTimeAnalysisFMU
from ._segy_viewer import SegyViewer
from ._seismic_misfit import SeismicMisfit
Expand Down
1 change: 1 addition & 0 deletions webviz_subsurface/plugins/_rft_plotter/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from ._plugin import RftPlotter
1 change: 1 addition & 0 deletions webviz_subsurface/plugins/_rft_plotter/_business_logic.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,4 +317,5 @@ def correlate(df: pd.DataFrame, response: str) -> pd.Series:
series = df[response]
df = df.drop(columns=[response])
corrdf = df.corrwith(series)
corrdf.fillna(0, inplace=True)
return corrdf.reindex(corrdf.abs().sort_values().index)
4 changes: 2 additions & 2 deletions webviz_subsurface/plugins/_rft_plotter/_layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,8 @@ def main_layout(get_uuid: Callable, datamodel: RftPlotterDataModel) -> wcc.Tabs:
),
]

# It there is parameters, add the parameter response tab
if datamodel.parameters:
# It this is not a sensitivity run, add the parameter response tab
if not datamodel.param_model.sensrun:
tabs.append(
wcc.Tab(
label="RFT parameter response",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,5 +125,7 @@ def layout(self) -> wcc.Tabs:

def set_callbacks(self, app: Dash) -> None:
plugin_callbacks(app, self.uuid, self._datamodel)
if self._datamodel.parameters:

# It this is not a sensitivity run, add the parameter response callbacks
if not self._datamodel.param_model.sensrun:
paramresp_callbacks(app, self.uuid, self._datamodel)

0 comments on commit 2011f0e

Please sign in to comment.