Skip to content

Commit

Permalink
Some updates related to failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
Øyvind Lind-Johansen committed Apr 13, 2023
1 parent 23f8b41 commit 2ea4b94
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 4 deletions.
19 changes: 16 additions & 3 deletions tests/integration_tests/test_parameter_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,25 @@


def test_dataframe(testdata_folder) -> None:
# pylint: disable=protected-access
dframe = pd.read_csv(
testdata_folder / "reek_test_data" / "aggregated_data" / "parameters.csv"
)
component = ParameterFilter("test", dframe)
# pylint: disable=protected-access

expected_discrete_parameters = [
"FWL",
"MULTFLT_F1",
"INTERPOLATE_WO",
"COHIBA_MODEL_MODE",
"RMS_SEED",
]

component = ParameterFilter("test", dframe, include_sens_filter=False)
assert set(component._discrete_parameters) == set(expected_discrete_parameters)

component = ParameterFilter("test", dframe, include_sens_filter=True)
assert set(component._discrete_parameters) == set(
["FWL", "MULTFLT_F1", "INTERPOLATE_WO", "COHIBA_MODEL_MODE", "RMS_SEED"]
expected_discrete_parameters + ["SENSNAME"]
)

assert component.is_sensitivity_run is True
3 changes: 2 additions & 1 deletion webviz_subsurface/_components/parameter_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ def __init__(
dframe: pd.DataFrame,
reset_on_ensemble_update: bool = False,
display_header: bool = True,
include_sens_filter: bool = False,
) -> None:
"""
* **`uuid`:** Unique id (use the plugin id).
Expand All @@ -43,7 +44,7 @@ def __init__(
drop_constants=True,
keep_numeric_only=False,
drop_parameters_with_nan=True,
include_sens_filter=True,
include_sens_filter=include_sens_filter,
)
self._dframe = self._pmodel.dataframe
self._range_parameters = self._get_range_parameters()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,5 @@ def layout(self) -> List[Component]:
].copy(),
reset_on_ensemble_update=True,
display_header=False,
include_sens_filter=True,
).layout

0 comments on commit 2ea4b94

Please sign in to comment.