Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RftPlotter fix: Handle correlate function returning NaN values #932

Merged
merged 5 commits into from
Jan 20, 2022
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)