diff --git a/src/ert/config/everest_control.py b/src/ert/config/everest_control.py index 40c64581465..51673ed9506 100644 --- a/src/ert/config/everest_control.py +++ b/src/ert/config/everest_control.py @@ -147,7 +147,6 @@ class EverestControl(ParameterConfig): """ type: Literal["everest_parameters"] = "everest_parameters" - dimensionality: Literal[1] = 1 input_key: str forward_init: bool = False output_file: str = "" diff --git a/src/ert/config/field.py b/src/ert/config/field.py index 8d3e95f0671..895919031c8 100644 --- a/src/ert/config/field.py +++ b/src/ert/config/field.py @@ -40,7 +40,6 @@ class Field(ParameterConfig): type: Literal["field"] = "field" - dimensionality: Literal[3] = 3 ertbox_params: ErtboxParameters file_format: FieldFileFormat output_transformation: str | None = None diff --git a/src/ert/config/gen_kw_config.py b/src/ert/config/gen_kw_config.py index b1b3d69b87b..236d6a7984c 100644 --- a/src/ert/config/gen_kw_config.py +++ b/src/ert/config/gen_kw_config.py @@ -101,7 +101,6 @@ class _ParsedGenKwConfig: class GenKwConfig(ParameterConfig): type: Literal["gen_kw"] = "gen_kw" - dimensionality: Literal[1] = 1 distribution: DistributionSettings forward_init: bool = False update_strategy: LocalizationType | None = LocalizationType.GLOBAL diff --git a/src/ert/config/surface_config.py b/src/ert/config/surface_config.py index 2d6192d7d92..9500fdf4965 100644 --- a/src/ert/config/surface_config.py +++ b/src/ert/config/surface_config.py @@ -60,7 +60,6 @@ def __init__( class SurfaceConfig(ParameterConfig): type: Literal["surface"] = "surface" - dimensionality: Literal[2] = 2 ncol: int nrow: int xori: float diff --git a/src/ert/gui/plotting/ert_plots/cesp.py b/src/ert/gui/plotting/ert_plots/cesp.py index ce9ad457696..2cf14a370db 100644 --- a/src/ert/gui/plotting/ert_plots/cesp.py +++ b/src/ert/gui/plotting/ert_plots/cesp.py @@ -29,7 +29,6 @@ class CrossEnsembleStatisticsPlot: def __init__(self) -> None: - self.dimensionality = 1 self.requires_observations = False @staticmethod diff --git a/src/ert/gui/plotting/ert_plots/distribution.py b/src/ert/gui/plotting/ert_plots/distribution.py index 533fbd57d17..53f0d3b350e 100644 --- a/src/ert/gui/plotting/ert_plots/distribution.py +++ b/src/ert/gui/plotting/ert_plots/distribution.py @@ -20,7 +20,6 @@ class DistributionPlot: def __init__(self) -> None: - self.dimensionality = 1 self.requires_observations = False @staticmethod diff --git a/src/ert/gui/plotting/ert_plots/gaussian_kde.py b/src/ert/gui/plotting/ert_plots/gaussian_kde.py index ae5d117b5d7..33bf7bb2094 100644 --- a/src/ert/gui/plotting/ert_plots/gaussian_kde.py +++ b/src/ert/gui/plotting/ert_plots/gaussian_kde.py @@ -21,7 +21,6 @@ class GaussianKDEPlot: def __init__(self) -> None: - self.dimensionality = 1 self.requires_observations = False @staticmethod diff --git a/src/ert/gui/plotting/ert_plots/histogram.py b/src/ert/gui/plotting/ert_plots/histogram.py index ae0ac79bfc0..1040fc3611d 100644 --- a/src/ert/gui/plotting/ert_plots/histogram.py +++ b/src/ert/gui/plotting/ert_plots/histogram.py @@ -24,7 +24,6 @@ class HistogramPlot: def __init__(self) -> None: - self.dimensionality = 1 self.requires_observations = False @staticmethod diff --git a/src/ert/gui/plotting/ert_plots/misfits.py b/src/ert/gui/plotting/ert_plots/misfits.py index 86049f14932..a165b8b1d2e 100644 --- a/src/ert/gui/plotting/ert_plots/misfits.py +++ b/src/ert/gui/plotting/ert_plots/misfits.py @@ -36,7 +36,6 @@ class MisfitsPlot: """ def __init__(self) -> None: - self.dimensionality = 2 self.requires_observations = True @staticmethod diff --git a/src/ert/gui/plotting/ert_plots/statistics.py b/src/ert/gui/plotting/ert_plots/statistics.py index 7efd1b0c2d3..4b5564aa78b 100644 --- a/src/ert/gui/plotting/ert_plots/statistics.py +++ b/src/ert/gui/plotting/ert_plots/statistics.py @@ -26,7 +26,6 @@ class StatisticsPlot: def __init__(self) -> None: - self.dimensionality = 2 self.requires_observations = False @staticmethod diff --git a/src/ert/gui/plotting/ert_plots/std_dev.py b/src/ert/gui/plotting/ert_plots/std_dev.py index 4243df2ea0d..e37bc86f882 100644 --- a/src/ert/gui/plotting/ert_plots/std_dev.py +++ b/src/ert/gui/plotting/ert_plots/std_dev.py @@ -19,7 +19,6 @@ class StdDevPlot: def __init__(self) -> None: - self.dimensionality = 3 self.requires_observations = False def plot( diff --git a/src/ert/gui/plotting/everest_plots/everest_batch_objective_function_plot.py b/src/ert/gui/plotting/everest_plots/everest_batch_objective_function_plot.py index 44cd3692c57..5a3aaceddf1 100644 --- a/src/ert/gui/plotting/everest_plots/everest_batch_objective_function_plot.py +++ b/src/ert/gui/plotting/everest_plots/everest_batch_objective_function_plot.py @@ -36,7 +36,6 @@ class EverestBatchObjectiveFunctionPlot: """ def __init__(self) -> None: - self.dimensionality = 2 self.requires_observations = False def plot( diff --git a/src/ert/gui/plotting/everest_plots/everest_constraints_plot.py b/src/ert/gui/plotting/everest_plots/everest_constraints_plot.py index b9d60a8e8f0..276e702827b 100644 --- a/src/ert/gui/plotting/everest_plots/everest_constraints_plot.py +++ b/src/ert/gui/plotting/everest_plots/everest_constraints_plot.py @@ -34,7 +34,6 @@ class EverestConstraintsPlot: """ def __init__(self) -> None: - self.dimensionality = 2 self.requires_observations = False def plot( diff --git a/src/ert/gui/plotting/everest_plots/everest_controls_plot.py b/src/ert/gui/plotting/everest_plots/everest_controls_plot.py index df87d3807e0..6d612ccd369 100644 --- a/src/ert/gui/plotting/everest_plots/everest_controls_plot.py +++ b/src/ert/gui/plotting/everest_plots/everest_controls_plot.py @@ -34,7 +34,6 @@ class EverestControlsPlot: """ def __init__(self) -> None: - self.dimensionality = 2 self.requires_observations = False self.selected_controls: list[str] = [] diff --git a/src/ert/gui/plotting/everest_plots/everest_gradients_plot.py b/src/ert/gui/plotting/everest_plots/everest_gradients_plot.py index a7427eb75df..f9b8fbef83c 100644 --- a/src/ert/gui/plotting/everest_plots/everest_gradients_plot.py +++ b/src/ert/gui/plotting/everest_plots/everest_gradients_plot.py @@ -20,7 +20,6 @@ class EverestGradientsPlot: def __init__(self) -> None: - self.dimensionality = 2 self.requires_observations = False self.selected_controls: list[str] = [] diff --git a/src/ert/gui/plotting/everest_plots/everest_objective_function_plot.py b/src/ert/gui/plotting/everest_plots/everest_objective_function_plot.py index 345dcdf7e69..d0b90a466a1 100644 --- a/src/ert/gui/plotting/everest_plots/everest_objective_function_plot.py +++ b/src/ert/gui/plotting/everest_plots/everest_objective_function_plot.py @@ -33,7 +33,6 @@ class EverestObjectiveFunctionPlot: """ def __init__(self) -> None: - self.dimensionality = 2 self.requires_observations = False def plot( diff --git a/src/ert/gui/plotting/plot_api.py b/src/ert/gui/plotting/plot_api.py index 7819ec6bc7d..3a454fbbb0d 100644 --- a/src/ert/gui/plotting/plot_api.py +++ b/src/ert/gui/plotting/plot_api.py @@ -52,7 +52,6 @@ class PlotApiKeyDefinition(NamedTuple): key: str index_type: str | None observations: bool - dimensionality: int metadata: dict[Any, Any] filter_on: dict[Any, Any] | None = None parameter: ParameterConfig | None = None @@ -171,7 +170,6 @@ def parameters_api_key_defs(self) -> list[PlotApiKeyDefinition]: key=param_key, index_type=None, observations=False, - dimensionality=metadata["dimensionality"], metadata={"data_origin": metadata["type"]}, parameter=param_cfg, ) @@ -219,7 +217,6 @@ def update_keydef(plot_key_def: PlotApiKeyDefinition) -> None: key=subkey, index_type="VALUE", observations=has_obs, - dimensionality=2, metadata={ "data_origin": response_type, }, @@ -233,7 +230,6 @@ def update_keydef(plot_key_def: PlotApiKeyDefinition) -> None: key=key, index_type="VALUE", observations=has_obs, - dimensionality=2, metadata={"data_origin": response_type}, response=response_config, ) @@ -245,7 +241,6 @@ def update_keydef(plot_key_def: PlotApiKeyDefinition) -> None: key="total objective value", index_type="VALUE", observations=False, - dimensionality=2, metadata={"data_origin": "everest_batch_objectives"}, ) ) diff --git a/src/ert/gui/plotting/plot_window.py b/src/ert/gui/plotting/plot_window.py index c80b1a7c995..9a9dd1bd939 100644 --- a/src/ert/gui/plotting/plot_window.py +++ b/src/ert/gui/plotting/plot_window.py @@ -35,7 +35,6 @@ ENSEMBLE, ERT_PLOT_MAP, EVEREST_BATCH_OBJECTIVE_FUNCTION_PLOT, - EVEREST_CONSTRAINT_PLOT, EVEREST_CONTROLS_PLOT, EVEREST_GRADIENTS_PLOT, EVEREST_OBJECTIVE_FUNCTION_PLOT, @@ -46,6 +45,7 @@ SHARED_PLOT_MAP, STATISTICS, STD_DEV, + TABS_FOR_DATA_ORIGIN, ) from ert.gui.plotting.widgets.plot_side_panel import PlotSidePanel from ert.gui.utils import is_everest_application @@ -235,21 +235,10 @@ def __init__( self._central_tab.currentChanged.connect(self.current_tab_changed) self.log_plot_tab_usage(self._central_tab.tabText(0), default=True) - self._prev_key_dimensionality = -1 self._prev_key: str | None = None self._prev_key_origin: str | None = None - if self.is_everest: - self._default_tab_for_dimensionality = { - 1: self._widget_by_name(ENSEMBLE), - 2: self._widget_by_name(EVEREST_BATCH_OBJECTIVE_FUNCTION_PLOT), - 3: self._widget_by_name(ENSEMBLE), # Fallback - } - else: - self._default_tab_for_dimensionality = { - 1: self._widget_by_name(HISTOGRAM), - 2: self._widget_by_name(ENSEMBLE), - 3: self._widget_by_name(STD_DEV), - } + self._prev_available_tabs: frozenset[str] | None = None + self._default_tab_for_available_tabs: dict[frozenset[str], PlotWidget] = {} QApplication.setOverrideCursor(Qt.CursorShape.WaitCursor) try: @@ -436,19 +425,8 @@ def update_plot(self, layer: int | None = None) -> None: require_gradient=is_gradient_plot, ) - if ( - plot_widget._plotter.dimensionality == key_def.dimensionality - or ( - plot_widget.name - in { - EVEREST_BATCH_OBJECTIVE_FUNCTION_PLOT, - EVEREST_OBJECTIVE_FUNCTION_PLOT, - EVEREST_CONTROLS_PLOT, - EVEREST_GRADIENTS_PLOT, - EVEREST_CONSTRAINT_PLOT, - } - ) - or (key_def.metadata.get("data_origin") == "everest_batch_objectives") + if plot_widget.name in TABS_FOR_DATA_ORIGIN.get( + key_def.metadata.get("data_origin", ""), [] ): selected_ensembles = ( self._ensemble_selection_widget.get_selected_ensembles() @@ -772,37 +750,12 @@ def keySelected(self) -> None: available_widgets = [ widget for widget in self._plot_widgets - if widget._plotter.dimensionality == key_def.dimensionality + if widget.name + in TABS_FOR_DATA_ORIGIN.get(key_def.metadata.get("data_origin", ""), []) and (key_def.observations or not widget._plotter.requires_observations) - and not is_everest_specific_widget and (not is_observed_seismic or widget.name == MISFITS) ] - def everest_data_origin_check(origin: list[str]) -> bool: - return key_def.metadata.get("data_origin") in origin - - everest_plot_and_origin = [ - (EVEREST_OBJECTIVE_FUNCTION_PLOT, ["everest_objectives"]), - (EVEREST_BATCH_OBJECTIVE_FUNCTION_PLOT, ["everest_batch_objectives"]), - (EVEREST_CONSTRAINT_PLOT, ["everest_constraints"]), - (EVEREST_CONTROLS_PLOT, ["everest_parameters"]), - (EVEREST_GRADIENTS_PLOT, ["everest_constraints", "everest_objectives"]), - ] - - def everest_available_widget_selection( - widget_tuple_list: list[tuple[str, list[str]]], - ) -> None: - for widget_name, origin in widget_tuple_list: - widget = self._widget_by_name(widget_name) - if everest_data_origin_check(origin): - if widget not in available_widgets: - available_widgets.append(widget) - elif widget in available_widgets: - available_widgets.remove(widget) - - if self.is_everest: - everest_available_widget_selection(everest_plot_and_origin) - previous_widget = self._central_tab.currentWidget() # Enabling/disabling tab triggers the @@ -818,21 +771,25 @@ def everest_available_widget_selection( ) current_widget = self._central_tab.currentWidget() - if 0 < self._prev_key_dimensionality != key_def.dimensionality: + available_tabs = frozenset(widget.name for widget in available_widgets) + if ( + self._prev_available_tabs is not None + and self._prev_available_tabs != available_tabs + ): if isinstance(previous_widget, PlotWidget): - self._default_tab_for_dimensionality[self._prev_key_dimensionality] = ( + self._default_tab_for_available_tabs[self._prev_available_tabs] = ( previous_widget ) - current_widget = self._default_tab_for_dimensionality[ - key_def.dimensionality - ] + remembered_widget = self._default_tab_for_available_tabs.get(available_tabs) + if remembered_widget is not None: + current_widget = remembered_widget if current_widget not in available_widgets and available_widgets: current_widget = available_widgets[0] self._central_tab.setCurrentWidget(current_widget) self._central_tab.currentChanged.connect(self.current_tab_changed) - self._prev_key_dimensionality = key_def.dimensionality + self._prev_available_tabs = available_tabs self._prev_key = key_def.key self._prev_key_origin = key_def.metadata.get("data_origin") self.update_plot() diff --git a/src/ert/gui/plotting/shared_plots/ensemble.py b/src/ert/gui/plotting/shared_plots/ensemble.py index 9f05ba7073e..5cb5095e3fa 100644 --- a/src/ert/gui/plotting/shared_plots/ensemble.py +++ b/src/ert/gui/plotting/shared_plots/ensemble.py @@ -25,7 +25,6 @@ class EnsemblePlot: def __init__(self) -> None: - self.dimensionality = 2 self.requires_observations = False def plot( diff --git a/src/ert/gui/plotting/utils/plot_maps.py b/src/ert/gui/plotting/utils/plot_maps.py index 8ee1deceac4..a186be038ec 100644 --- a/src/ert/gui/plotting/utils/plot_maps.py +++ b/src/ert/gui/plotting/utils/plot_maps.py @@ -1,5 +1,6 @@ from collections.abc import Callable +from ert.config.known_response_types import KNOWN_ERT_RESPONSE_TYPES from ert.gui.plotting.ert_plots import ( CrossEnsembleStatisticsPlot, DistributionPlot, @@ -52,3 +53,24 @@ SHARED_PLOT_MAP: dict[str, Callable[[], Plotter]] = { ENSEMBLE: EnsemblePlot, } + +ERT_RESPONSE_ORIGINS: frozenset[str] = frozenset( + response_type.model_fields["type"].default + for response_type in KNOWN_ERT_RESPONSE_TYPES +) + +_ERT_RESPONSE_TABS = [ENSEMBLE, STATISTICS, MISFITS] + +TABS_FOR_DATA_ORIGIN: dict[str, list[str]] = { + "gen_kw": [HISTOGRAM, GAUSSIAN_KDE, DISTRIBUTION, CROSS_ENSEMBLE_STATISTICS], + "surface": _ERT_RESPONSE_TABS, + "field": [STD_DEV], + "everest_parameters": [EVEREST_CONTROLS_PLOT], + "everest_objectives": [ + EVEREST_OBJECTIVE_FUNCTION_PLOT, + EVEREST_GRADIENTS_PLOT, + ], + "everest_constraints": [EVEREST_CONSTRAINT_PLOT, EVEREST_GRADIENTS_PLOT], + "everest_batch_objectives": [EVEREST_BATCH_OBJECTIVE_FUNCTION_PLOT], + **dict.fromkeys(ERT_RESPONSE_ORIGINS, _ERT_RESPONSE_TABS), +} diff --git a/src/ert/gui/plotting/widgets/plot_widget.py b/src/ert/gui/plotting/widgets/plot_widget.py index 6daa4029d57..d9a451b1f03 100644 --- a/src/ert/gui/plotting/widgets/plot_widget.py +++ b/src/ert/gui/plotting/widgets/plot_widget.py @@ -38,7 +38,6 @@ class Plotter(Protocol): """Protocol for plot strategies used by PlotWidget.""" - dimensionality: int requires_observations: bool def plot( diff --git a/tests/ert/ui_tests/gui/test_breakthrough_visualization.py b/tests/ert/ui_tests/gui/test_breakthrough_visualization.py index f459b5bd8ef..c0af1f955e5 100644 --- a/tests/ert/ui_tests/gui/test_breakthrough_visualization.py +++ b/tests/ert/ui_tests/gui/test_breakthrough_visualization.py @@ -16,6 +16,7 @@ from ert.gui.plotting.utils.plot_maps import ( ENSEMBLE, STD_DEV, + TABS_FOR_DATA_ORIGIN, ) from ert.gui.plotting.widgets import DataTypeKeysWidget from ert.gui.tools.event_viewer import GUILogHandler @@ -71,7 +72,10 @@ def select_plotter_figure(plot_window: PlotWindow, key: str, plot_tab_name: str) found_selected_key = True assert central_tab.isTabEnabled(tab_index) central_tab.setCurrentWidget(tab) - assert key_def.dimensionality == tab._plotter.dimensionality + assert ( + tab.name + in TABS_FOR_DATA_ORIGIN[key_def.metadata["data_origin"]] + ) if plot_tab_name == STD_DEV: # we need a better resolution for box plots tab._figure.set_size_inches( diff --git a/tests/ert/ui_tests/gui/test_plotting_of_snake_oil.py b/tests/ert/ui_tests/gui/test_plotting_of_snake_oil.py index 92ab2da415e..1e5a68ba9c3 100644 --- a/tests/ert/ui_tests/gui/test_plotting_of_snake_oil.py +++ b/tests/ert/ui_tests/gui/test_plotting_of_snake_oil.py @@ -17,6 +17,7 @@ HISTOGRAM, STATISTICS, STD_DEV, + TABS_FOR_DATA_ORIGIN, ) from ert.gui.plotting.widgets import DataTypeKeysWidget, EnsembleSelectListWidget from ert.services import ErtServerController @@ -105,8 +106,10 @@ def plot_figure( if central_tab.isTabEnabled(widget_index): central_tab.setCurrentWidget(tab) assert ( - selected_key.dimensionality - == tab._plotter.dimensionality + tab.name + in TABS_FOR_DATA_ORIGIN[ + selected_key.metadata["data_origin"] + ] ) if plot_name == STD_DEV: # we need a better resolution for box plots @@ -117,8 +120,10 @@ def plot_figure( yield tab._figure.figure else: assert ( - selected_key.dimensionality - != tab._plotter.dimensionality + tab.name + not in TABS_FOR_DATA_ORIGIN[ + selected_key.metadata["data_origin"] + ] ) assert found_selected_key plot_window.close() diff --git a/tests/ert/ui_tests/gui/test_rft_visualizations.py b/tests/ert/ui_tests/gui/test_rft_visualizations.py index c470b5905ad..8df6516a1b5 100644 --- a/tests/ert/ui_tests/gui/test_rft_visualizations.py +++ b/tests/ert/ui_tests/gui/test_rft_visualizations.py @@ -17,6 +17,7 @@ from ert.gui.plotting.utils.plot_maps import ( ENSEMBLE, STATISTICS, + TABS_FOR_DATA_ORIGIN, ) from ert.gui.plotting.widgets import DataTypeKeysWidget, EnsembleSelectListWidget from ert.services import ErtServerController @@ -146,14 +147,18 @@ def plot_figure(qtbot: QtBot, request, rft_config: ErtConfig): if central_tab.isTabEnabled(widget_index): central_tab.setCurrentWidget(tab) assert ( - selected_key.dimensionality - == tab._plotter.dimensionality + tab.name + in TABS_FOR_DATA_ORIGIN[ + selected_key.metadata["data_origin"] + ] ) yield tab._figure.figure else: assert ( - selected_key.dimensionality - != tab._plotter.dimensionality + tab.name + not in TABS_FOR_DATA_ORIGIN[ + selected_key.metadata["data_origin"] + ] ) assert found_selected_key plot_window.close() diff --git a/tests/ert/unit_tests/dark_storage/test_http_endpoints.py b/tests/ert/unit_tests/dark_storage/test_http_endpoints.py index 25c5159c495..a5d05e7f73a 100644 --- a/tests/ert/unit_tests/dark_storage/test_http_endpoints.py +++ b/tests/ert/unit_tests/dark_storage/test_http_endpoints.py @@ -192,7 +192,6 @@ def test_get_ensemble_parameters(poly_example_tmp_dir, dark_storage_client): assert experiment_json["parameters"] == { "a": { - "dimensionality": 1, "distribution": { "max": 1.0, "min": 0.0, @@ -206,7 +205,6 @@ def test_get_ensemble_parameters(poly_example_tmp_dir, dark_storage_client): "update_strategy": "global", }, "b": { - "dimensionality": 1, "distribution": { "max": 2.0, "min": 0.0, @@ -220,7 +218,6 @@ def test_get_ensemble_parameters(poly_example_tmp_dir, dark_storage_client): "update_strategy": "global", }, "c": { - "dimensionality": 1, "distribution": { "max": 5.0, "min": 0.0, diff --git a/tests/ert/unit_tests/gui/plotting/ert_plots/test_misfits_plot.py b/tests/ert/unit_tests/gui/plotting/ert_plots/test_misfits_plot.py index 0acd9806814..519d9c85a75 100644 --- a/tests/ert/unit_tests/gui/plotting/ert_plots/test_misfits_plot.py +++ b/tests/ert/unit_tests/gui/plotting/ert_plots/test_misfits_plot.py @@ -55,7 +55,6 @@ def _make( index_type=None, metadata={"data_origin": data_origin}, observations=True, - dimensionality=2, ) return _make diff --git a/tests/ert/unit_tests/gui/tools/plot/conftest.py b/tests/ert/unit_tests/gui/tools/plot/conftest.py index 5c6244ee093..75e235dfe82 100644 --- a/tests/ert/unit_tests/gui/tools/plot/conftest.py +++ b/tests/ert/unit_tests/gui/tools/plot/conftest.py @@ -131,13 +131,11 @@ def mocked_requests_get(*args, **kwargs): "/ensembles/ens_id_1/parameters": [ { "name": "SNAKE_OIL_PARAM:BPR_138_PERSISTENCE", - "dimensionality": 1, "labels": [], "userdata": {"data_origin": "GEN_KW"}, }, { "name": "SNAKE_OIL_PARAM:OP1_DIVERGENCE_SCALE", - "dimensionality": 1, "labels": [], "userdata": {"data_origin": "GEN_KW"}, }, @@ -145,13 +143,11 @@ def mocked_requests_get(*args, **kwargs): "/ensembles/ens_id_3/parameters": [ { "name": "SNAKE_OIL_PARAM:BPR_138_PERSISTENCE", - "dimensionality": 1, "labels": [], "userdata": {"data_origin": "GEN_KW"}, }, { "name": "I_AM_A_PARAM", - "dimensionality": 1, "labels": [], "userdata": {"data_origin": "GEN_KW"}, }, @@ -159,7 +155,6 @@ def mocked_requests_get(*args, **kwargs): "/ensembles/ens_id_5/parameters": [ { "name": "I_AM_A_PARAM", - "dimensionality": 1, "labels": [], "userdata": {"data_origin": "GEN_KW"}, }, @@ -193,7 +188,6 @@ def mocked_requests_get(*args, **kwargs): "name": "BPR_138_PERSISTENCE", "forward_init": False, "update": True, - "dimensionality": 1, "distribution": {"name": "uniform", "min": 0.2, "max": 0.7}, "group": "SNAKE_OIL_PARAM", "input_source": "sampled", @@ -203,7 +197,6 @@ def mocked_requests_get(*args, **kwargs): "name": "OP1_DIVERGENCE_SCALE", "forward_init": False, "update": True, - "dimensionality": 1, "distribution": {"name": "uniform", "min": 0.5, "max": 1.5}, "group": "SNAKE_OIL_PARAM", "input_source": "sampled", @@ -213,7 +206,6 @@ def mocked_requests_get(*args, **kwargs): "name": "I_AM_A_PARAM", "forward_init": False, "update": True, - "dimensionality": 1, "distribution": {"name": "normal", "mean": 0.0, "std": 1.0}, "group": "SNAKE_OIL_PARAM", "input_source": "sampled", diff --git a/tests/ert/unit_tests/gui/tools/plot/test_data_type_keys_widget.py b/tests/ert/unit_tests/gui/tools/plot/test_data_type_keys_widget.py index b188138018a..2abb47a12b8 100644 --- a/tests/ert/unit_tests/gui/tools/plot/test_data_type_keys_widget.py +++ b/tests/ert/unit_tests/gui/tools/plot/test_data_type_keys_widget.py @@ -10,7 +10,6 @@ def create_key_def(key: str, data_origin: str = "summary") -> PlotApiKeyDefiniti key=key, index_type=None, observations=False, - dimensionality=1, metadata={"data_origin": data_origin}, ) diff --git a/tests/ert/unit_tests/gui/tools/plot/test_plot_api.py b/tests/ert/unit_tests/gui/tools/plot/test_plot_api.py index dc75bc93b91..12249a27d92 100644 --- a/tests/ert/unit_tests/gui/tools/plot/test_plot_api.py +++ b/tests/ert/unit_tests/gui/tools/plot/test_plot_api.py @@ -49,7 +49,6 @@ def test_key_def_structure(api: PlotApi): key_defs = api.parameters_api_key_defs + api.responses_api_key_defs fopr = next(x for x in key_defs if x.key == "FOPR") fopr_expected = { - "dimensionality": 2, "index_type": "VALUE", "key": "FOPR", "metadata": {"data_origin": "summary"}, @@ -64,7 +63,6 @@ def test_key_def_structure(api: PlotApi): bpr = next(x for x in key_defs if x.key == "BPR:1,3,8") bpr_expected = { - "dimensionality": 2, "index_type": "VALUE", "key": "BPR:1,3,8", "metadata": {"data_origin": "summary"}, @@ -82,7 +80,6 @@ def test_key_def_structure(api: PlotApi): ) bpr_parameter_expected = { - "dimensionality": 1, "index_type": None, "key": "SNAKE_OIL_PARAM:BPR_138_PERSISTENCE", "metadata": {"data_origin": "gen_kw"}, @@ -92,7 +89,6 @@ def test_key_def_structure(api: PlotApi): "name": "BPR_138_PERSISTENCE", "forward_init": False, "update": True, - "dimensionality": 1, "distribution": {"name": "uniform", "min": 0.2, "max": 0.7}, "group": "SNAKE_OIL_PARAM", "input_source": "sampled", diff --git a/tests/ert/unit_tests/gui/tools/plot/test_plot_window.py b/tests/ert/unit_tests/gui/tools/plot/test_plot_window.py index 3f0bbc9de41..c2d5e07cada 100644 --- a/tests/ert/unit_tests/gui/tools/plot/test_plot_window.py +++ b/tests/ert/unit_tests/gui/tools/plot/test_plot_window.py @@ -20,6 +20,7 @@ from ert.config.breakthrough_config import BreakthroughConfig from ert.config.distribution import RawSettings from ert.config.gen_kw_config import DataSource, GenKwConfig +from ert.config.summary_config import SummaryConfig from ert.gui.plotting.ert_plots.gaussian_kde import plotGaussianKDE from ert.gui.plotting.ert_plots.histogram import HistogramPlot from ert.gui.plotting.models import DataTypeSeparator @@ -31,12 +32,23 @@ ) from ert.gui.plotting.utils import PlotConfig, PlotContext from ert.gui.plotting.utils.plot_maps import ( + CROSS_ENSEMBLE_STATISTICS, DISTRIBUTION, ENSEMBLE, ERT_PLOT_MAP, + EVEREST_BATCH_OBJECTIVE_FUNCTION_PLOT, + EVEREST_CONSTRAINT_PLOT, + EVEREST_CONTROLS_PLOT, + EVEREST_GRADIENTS_PLOT, + EVEREST_OBJECTIVE_FUNCTION_PLOT, + EVEREST_PLOT_MAP, GAUSSIAN_KDE, HISTOGRAM, + MISFITS, + SHARED_PLOT_MAP, STATISTICS, + STD_DEV, + TABS_FOR_DATA_ORIGIN, ) from ert.gui.plotting.widgets import DataTypeKeysWidget from ert.gui.plotting.widgets.collapsible_section import CollapsibleSection @@ -49,21 +61,18 @@ index_type="VALUE", metadata={"data_origin": "everest_objectives"}, observations=False, - dimensionality=2, ), PlotApiKeyDefinition( "ctrl1", index_type=None, metadata={"data_origin": "everest_parameters"}, observations=False, - dimensionality=1, ), PlotApiKeyDefinition( "con1", index_type="VALUE", metadata={"data_origin": "everest_constraints"}, observations=False, - dimensionality=2, ), ] @@ -73,7 +82,6 @@ index_type="VALUE", metadata={"data_origin": "everest_observations"}, observations=True, - dimensionality=2, ) ] @@ -233,9 +241,8 @@ def test_that_plotting_gen_kw_parameter_with_negative_values_hides_log_scale_che plot_api_key_def_positive = PlotApiKeyDefinition( "gen_kw_a", index_type=None, - metadata={"data_origin": "GEN_KW"}, + metadata={"data_origin": "gen_kw"}, observations=False, - dimensionality=1, parameter=GenKwConfig( name="gen_kw_a", distribution={"name": "uniform", "min": 0, "max": 1} ), @@ -243,9 +250,8 @@ def test_that_plotting_gen_kw_parameter_with_negative_values_hides_log_scale_che plot_api_key_def_negative = PlotApiKeyDefinition( "gen_kw_b", index_type=None, - metadata={"data_origin": "GEN_KW"}, + metadata={"data_origin": "gen_kw"}, observations=False, - dimensionality=1, parameter=GenKwConfig( name="gen_kw_b", distribution={"name": "uniform", "min": -1, "max": 0} ), @@ -355,9 +361,8 @@ def test_that_history_and_observations_checkboxes_match_data_availability( key_def = PlotApiKeyDefinition( key, index_type="TIME", - metadata={"data_origin": "SUMMARY"}, + metadata={"data_origin": "summary"}, observations=observations_available, - dimensionality=1, response=MagicMock(type="summary"), ) mock_plot_api.responses_api_key_defs = [key_def] @@ -404,17 +409,15 @@ def test_that_history_and_observations_checkbox_state_update_when_switching_keys PlotApiKeyDefinition( "summary", index_type="TIME", - metadata={"data_origin": "SUMMARY"}, + metadata={"data_origin": "summary"}, observations=True, - dimensionality=1, response=MagicMock(type="summary"), ), PlotApiKeyDefinition( "summaryH", index_type="TIME", - metadata={"data_origin": "SUMMARY"}, + metadata={"data_origin": "summary"}, observations=False, - dimensionality=1, response=MagicMock(type="summary"), ), ] @@ -488,9 +491,8 @@ def record_observations_enabled(plot_config: PlotConfig, enabled: bool) -> None: key_def = PlotApiKeyDefinition( "summary", index_type="TIME", - metadata={"data_origin": "SUMMARY"}, + metadata={"data_origin": "summary"}, observations=True, - dimensionality=2, response=MagicMock(type="summary"), ) ensemble = EnsembleObject( @@ -634,9 +636,8 @@ def test_that_log_scale_state_is_preserved_when_switching_plot_tabs( key_def = PlotApiKeyDefinition( "gen_kw", index_type=None, - metadata={"data_origin": "GEN_KW"}, + metadata={"data_origin": "gen_kw"}, observations=False, - dimensionality=1, parameter=GenKwConfig( name="gen_kw", distribution={"name": "uniform", "min": 0, "max": 1}, @@ -723,7 +724,6 @@ def _plot_window_with_response_and_gen_kw_keys( index_type="VALUE", metadata={"data_origin": "gen_data"}, observations=False, - dimensionality=2, response=MagicMock(type="gen_data"), ) ] @@ -731,9 +731,8 @@ def _plot_window_with_response_and_gen_kw_keys( PlotApiKeyDefinition( "gen_kw", index_type=None, - metadata={"data_origin": "GEN_KW"}, + metadata={"data_origin": "gen_kw"}, observations=False, - dimensionality=1, parameter=GenKwConfig( name="gen_kw", distribution={"name": "uniform", "min": 0, "max": 1}, @@ -831,9 +830,8 @@ def test_that_density_tabs_show_log_scale_only_for_valid_gen_kw_values( key_def = PlotApiKeyDefinition( "gen_kw", index_type=None, - metadata={"data_origin": "GEN_KW"}, + metadata={"data_origin": "gen_kw"}, observations=False, - dimensionality=1, parameter=GenKwConfig( name="gen_kw", distribution={"name": "uniform", "min": 0.0, "max": 1.0}, @@ -899,9 +897,8 @@ def test_that_plot_window_ignores_negative_check_for_non_numeric_columns( plot_api_key_def = PlotApiKeyDefinition( "animal_type", index_type=None, - metadata={"data_origin": "GEN_KW"}, + metadata={"data_origin": "gen_kw"}, observations=False, - dimensionality=1, parameter=GenKwConfig( name="animal_type", distribution=RawSettings(), @@ -999,7 +996,6 @@ def _plot_with_axis_labels(figure: Figure, *_args, **_kwargs) -> None: axes.set_ylabel("Old y label") plotter = MagicMock() - plotter.dimensionality = 1 plotter.requires_observations = False plotter.plot.side_effect = _plot_with_axis_labels @@ -1047,7 +1043,6 @@ def _plot_with_title(figure: Figure, *_args, **_kwargs) -> None: axes.set_title("Old title") plotter = MagicMock() - plotter.dimensionality = 1 plotter.requires_observations = False plotter.plot.side_effect = _plot_with_title @@ -1090,7 +1085,6 @@ def test_that_hovering_editable_text_shows_it_as_clickable( monkeypatch.setattr(QToolTip, "showText", show_text) plotter = MagicMock() - plotter.dimensionality = 1 plotter.requires_observations = False def _plot_with_editable_text(figure: Figure, *_args, **_kwargs) -> None: @@ -1159,7 +1153,7 @@ def _create_plot_window_for_text_edit( plot_window = PlotWindow(config_file="", ens_path=Path(), parent=None) qtbot.addWidget(plot_window) plot_window.getSelectedKey = MagicMock( - return_value=MagicMock(key="some_key", dimensionality=1, metadata={}) + return_value=MagicMock(key="some_key", metadata={"data_origin": "gen_kw"}) ) return plot_window @@ -1325,9 +1319,8 @@ def test_that_clearing_custom_title_restores_key_title_when_rendering( PlotApiKeyDefinition( "some_key", index_type=None, - metadata={"data_origin": "GEN_KW"}, + metadata={"data_origin": "gen_kw"}, observations=False, - dimensionality=1, parameter=GenKwConfig( name="some_key", distribution=RawSettings(), @@ -1386,7 +1379,6 @@ def test_that_breakthrough_response_title_keeps_the_breakthrough_prefix( index_type=None, metadata={"data_origin": "summary"}, observations=False, - dimensionality=2, response=BreakthroughConfig(), ) ] @@ -1530,3 +1522,157 @@ def test_that_datatype_separators_are_never_set_as_default( def test_that_seismic_y_label_is_created(key, expected_y_label): label = make_seismic_y_label(key) assert label == expected_y_label + + +@pytest.mark.parametrize( + ("data_origin", "has_observations", "expected_enabled_tabs"), + [ + ( + "gen_kw", + False, + {HISTOGRAM, GAUSSIAN_KDE, DISTRIBUTION, CROSS_ENSEMBLE_STATISTICS}, + ), + ("field", False, {STD_DEV}), + ("summary", False, {ENSEMBLE, STATISTICS}), + ("summary", True, {ENSEMBLE, STATISTICS, MISFITS}), + ], +) +def test_that_enabled_plot_tabs_are_determined_by_the_data_origin_of_the_key( + data_origin: str, + has_observations: bool, + expected_enabled_tabs: set[str], + qtbot: QtBot, + monkeypatch: pytest.MonkeyPatch, +) -> None: + mock_plot_api_cls = MagicMock(spec=PlotApi) + mock_plot_api = MagicMock(spec=PlotApi) + mock_plot_api_cls.return_value = mock_plot_api + + storage_version = "0.0" + mock_plot_api.api_version = storage_version + monkeypatch.setattr( + "ert.gui.plotting.plot_window.get_storage_api_version", + lambda: storage_version, + ) + monkeypatch.setattr("ert.gui.plotting.plot_window.PlotApi", mock_plot_api_cls) + + is_parameter = data_origin in {"gen_kw", "field"} + key_def = PlotApiKeyDefinition( + "some_key", + index_type=None if is_parameter else "VALUE", + metadata={"data_origin": data_origin}, + observations=has_observations, + parameter=GenKwConfig( + name="some_key", + distribution={"name": "uniform", "min": 0, "max": 1}, + ) + if data_origin == "gen_kw" + else None, + response=None if is_parameter else SummaryConfig(keys=["some_key"]), + ) + mock_plot_api.parameters_api_key_defs = [key_def] if is_parameter else [] + mock_plot_api.responses_api_key_defs = [] if is_parameter else [key_def] + mock_plot_api.has_history_data.return_value = False + mock_plot_api.get_all_ensembles.return_value = [ + EnsembleObject( + "ensemble", + "ensemble", + False, + "experiment", + "2026-01-01T00:00:00", + ) + ] + + plot_window = PlotWindow(config_file="", ens_path=Path(), parent=None) + qtbot.addWidget(plot_window) + plot_window.show() + plot_window.getSelectedKey = MagicMock(return_value=key_def) + plot_window.keySelected() + + central_tab = plot_window._central_tab + enabled_tabs = { + central_tab.tabText(index) + for index in range(central_tab.count()) + if central_tab.isTabEnabled(index) + } + assert enabled_tabs == expected_enabled_tabs + + +@pytest.mark.parametrize( + ("data_origin", "expected_enabled_tabs"), + [ + ("everest_parameters", {EVEREST_CONTROLS_PLOT}), + ( + "everest_objectives", + {EVEREST_OBJECTIVE_FUNCTION_PLOT, EVEREST_GRADIENTS_PLOT}, + ), + ("everest_constraints", {EVEREST_CONSTRAINT_PLOT, EVEREST_GRADIENTS_PLOT}), + ("everest_batch_objectives", {EVEREST_BATCH_OBJECTIVE_FUNCTION_PLOT}), + ("summary", {ENSEMBLE}), + ], +) +def test_that_everest_data_origins_only_enable_their_own_plot_tabs( + data_origin: str, + expected_enabled_tabs: set[str], + qtbot: QtBot, + monkeypatch: pytest.MonkeyPatch, +) -> None: + mock_plot_api_cls = MagicMock(spec=PlotApi) + mock_plot_api = MagicMock(spec=PlotApi) + mock_plot_api_cls.return_value = mock_plot_api + + storage_version = "0.0" + mock_plot_api.api_version = storage_version + monkeypatch.setattr( + "ert.gui.plotting.plot_window.get_storage_api_version", + lambda: storage_version, + ) + monkeypatch.setattr("ert.gui.plotting.plot_window.PlotApi", mock_plot_api_cls) + monkeypatch.setattr( + "ert.gui.plotting.plot_window.is_everest_application", lambda: True + ) + + is_parameter = data_origin == "everest_parameters" + key_def = PlotApiKeyDefinition( + "some_key", + index_type=None if is_parameter else "VALUE", + metadata={"data_origin": data_origin}, + observations=False, + parameter=None, + response=SummaryConfig(keys=["some_key"]) if data_origin == "summary" else None, + ) + mock_plot_api.parameters_api_key_defs = [key_def] if is_parameter else [] + mock_plot_api.responses_api_key_defs = [] if is_parameter else [key_def] + mock_plot_api.has_history_data.return_value = False + mock_plot_api.get_all_ensembles.return_value = [ + EnsembleObject( + "ensemble", + "ensemble", + False, + "experiment", + "2026-01-01T00:00:00", + has_func_eval=True, + ) + ] + + plot_window = PlotWindow(config_file="", ens_path=Path(), parent=None) + qtbot.addWidget(plot_window) + plot_window.show() + plot_window.getSelectedKey = MagicMock(return_value=key_def) + plot_window.keySelected() + + central_tab = plot_window._central_tab + enabled_tabs = { + central_tab.tabText(index) + for index in range(central_tab.count()) + if central_tab.isTabEnabled(index) + } + assert enabled_tabs == expected_enabled_tabs + + +def test_that_every_plot_tab_is_reachable_from_exactly_the_known_data_origins() -> None: + tabs_in_plot_maps = set(ERT_PLOT_MAP) | set(EVEREST_PLOT_MAP) | set(SHARED_PLOT_MAP) + tabs_in_origin_table = { + tab for tabs in TABS_FOR_DATA_ORIGIN.values() for tab in tabs + } + assert tabs_in_origin_table == tabs_in_plot_maps diff --git a/tests/ert/unit_tests/run_models/snapshots/test_experiment_serialization/test_that_dumped_enif_matches_snapshot/heat_equationconfig.ert/config.json b/tests/ert/unit_tests/run_models/snapshots/test_experiment_serialization/test_that_dumped_enif_matches_snapshot/heat_equationconfig.ert/config.json index 3d66eca1591..c1c79d2a6f3 100644 --- a/tests/ert/unit_tests/run_models/snapshots/test_experiment_serialization/test_that_dumped_enif_matches_snapshot/heat_equationconfig.ert/config.json +++ b/tests/ert/unit_tests/run_models/snapshots/test_experiment_serialization/test_that_dumped_enif_matches_snapshot/heat_equationconfig.ert/config.json @@ -206,7 +206,6 @@ "name": "t", "forward_init": false, "update_strategy": "adaptive", - "dimensionality": 1, "distribution": { "name": "uniform", "min": 0.5, @@ -220,7 +219,6 @@ "name": "x", "forward_init": false, "update_strategy": "adaptive", - "dimensionality": 1, "distribution": { "name": "normal", "mean": 0.8, @@ -234,7 +232,6 @@ "name": "COND", "forward_init": true, "update_strategy": "adaptive", - "dimensionality": 3, "ertbox_params": { "nx": 50, "ny": 50, diff --git a/tests/ert/unit_tests/run_models/snapshots/test_experiment_serialization/test_that_dumped_enif_matches_snapshot/poly_examplepoly.ert/poly.json b/tests/ert/unit_tests/run_models/snapshots/test_experiment_serialization/test_that_dumped_enif_matches_snapshot/poly_examplepoly.ert/poly.json index c3ca13cf62e..f1942f2ba81 100644 --- a/tests/ert/unit_tests/run_models/snapshots/test_experiment_serialization/test_that_dumped_enif_matches_snapshot/poly_examplepoly.ert/poly.json +++ b/tests/ert/unit_tests/run_models/snapshots/test_experiment_serialization/test_that_dumped_enif_matches_snapshot/poly_examplepoly.ert/poly.json @@ -196,7 +196,6 @@ "name": "a", "forward_init": false, "update_strategy": "global", - "dimensionality": 1, "distribution": { "name": "uniform", "min": 0.0, @@ -210,7 +209,6 @@ "name": "b", "forward_init": false, "update_strategy": "global", - "dimensionality": 1, "distribution": { "name": "uniform", "min": 0.0, @@ -224,7 +222,6 @@ "name": "c", "forward_init": false, "update_strategy": "global", - "dimensionality": 1, "distribution": { "name": "uniform", "min": 0.0, diff --git a/tests/ert/unit_tests/run_models/snapshots/test_experiment_serialization/test_that_dumped_enif_matches_snapshot/snake_oilsnake_oil.ert/snake_oil.json b/tests/ert/unit_tests/run_models/snapshots/test_experiment_serialization/test_that_dumped_enif_matches_snapshot/snake_oilsnake_oil.ert/snake_oil.json index 9d465e25832..1d159eb3b11 100644 --- a/tests/ert/unit_tests/run_models/snapshots/test_experiment_serialization/test_that_dumped_enif_matches_snapshot/snake_oilsnake_oil.ert/snake_oil.json +++ b/tests/ert/unit_tests/run_models/snapshots/test_experiment_serialization/test_that_dumped_enif_matches_snapshot/snake_oilsnake_oil.ert/snake_oil.json @@ -172,7 +172,6 @@ "name": "BPR_555_PERSISTENCE", "forward_init": false, "update_strategy": "global", - "dimensionality": 1, "distribution": { "name": "uniform", "min": 0.1, @@ -186,7 +185,6 @@ "name": "BPR_138_PERSISTENCE", "forward_init": false, "update_strategy": "global", - "dimensionality": 1, "distribution": { "name": "uniform", "min": 0.2, @@ -200,7 +198,6 @@ "name": "OP1_PERSISTENCE", "forward_init": false, "update_strategy": "global", - "dimensionality": 1, "distribution": { "name": "uniform", "min": 0.01, @@ -214,7 +211,6 @@ "name": "OP1_OCTAVES", "forward_init": false, "update_strategy": "global", - "dimensionality": 1, "distribution": { "name": "uniform", "min": 3.0, @@ -228,7 +224,6 @@ "name": "OP1_DIVERGENCE_SCALE", "forward_init": false, "update_strategy": "global", - "dimensionality": 1, "distribution": { "name": "uniform", "min": 0.25, @@ -242,7 +237,6 @@ "name": "OP1_OFFSET", "forward_init": false, "update_strategy": "global", - "dimensionality": 1, "distribution": { "name": "uniform", "min": -0.1, @@ -256,7 +250,6 @@ "name": "OP2_PERSISTENCE", "forward_init": false, "update_strategy": "global", - "dimensionality": 1, "distribution": { "name": "uniform", "min": 0.1, @@ -270,7 +263,6 @@ "name": "OP2_OCTAVES", "forward_init": false, "update_strategy": "global", - "dimensionality": 1, "distribution": { "name": "uniform", "min": 5.0, @@ -284,7 +276,6 @@ "name": "OP2_DIVERGENCE_SCALE", "forward_init": false, "update_strategy": "global", - "dimensionality": 1, "distribution": { "name": "uniform", "min": 0.5, @@ -298,7 +289,6 @@ "name": "OP2_OFFSET", "forward_init": false, "update_strategy": "global", - "dimensionality": 1, "distribution": { "name": "uniform", "min": -0.2, diff --git a/tests/ert/unit_tests/run_models/snapshots/test_experiment_serialization/test_that_dumped_ensemble_experiment_matches_snapshot/heat_equationconfig.ert/config.json b/tests/ert/unit_tests/run_models/snapshots/test_experiment_serialization/test_that_dumped_ensemble_experiment_matches_snapshot/heat_equationconfig.ert/config.json index b2729ff5bc6..c1e2e3b4d17 100644 --- a/tests/ert/unit_tests/run_models/snapshots/test_experiment_serialization/test_that_dumped_ensemble_experiment_matches_snapshot/heat_equationconfig.ert/config.json +++ b/tests/ert/unit_tests/run_models/snapshots/test_experiment_serialization/test_that_dumped_ensemble_experiment_matches_snapshot/heat_equationconfig.ert/config.json @@ -190,7 +190,6 @@ "name": "t", "forward_init": false, "update_strategy": "adaptive", - "dimensionality": 1, "distribution": { "name": "uniform", "min": 0.5, @@ -204,7 +203,6 @@ "name": "x", "forward_init": false, "update_strategy": "adaptive", - "dimensionality": 1, "distribution": { "name": "normal", "mean": 0.8, @@ -218,7 +216,6 @@ "name": "COND", "forward_init": true, "update_strategy": "adaptive", - "dimensionality": 3, "ertbox_params": { "nx": 50, "ny": 50, diff --git a/tests/ert/unit_tests/run_models/snapshots/test_experiment_serialization/test_that_dumped_ensemble_experiment_matches_snapshot/poly_examplepoly.ert/poly.json b/tests/ert/unit_tests/run_models/snapshots/test_experiment_serialization/test_that_dumped_ensemble_experiment_matches_snapshot/poly_examplepoly.ert/poly.json index feed84452e8..6f7e57e835a 100644 --- a/tests/ert/unit_tests/run_models/snapshots/test_experiment_serialization/test_that_dumped_ensemble_experiment_matches_snapshot/poly_examplepoly.ert/poly.json +++ b/tests/ert/unit_tests/run_models/snapshots/test_experiment_serialization/test_that_dumped_ensemble_experiment_matches_snapshot/poly_examplepoly.ert/poly.json @@ -180,7 +180,6 @@ "name": "a", "forward_init": false, "update_strategy": "global", - "dimensionality": 1, "distribution": { "name": "uniform", "min": 0.0, @@ -194,7 +193,6 @@ "name": "b", "forward_init": false, "update_strategy": "global", - "dimensionality": 1, "distribution": { "name": "uniform", "min": 0.0, @@ -208,7 +206,6 @@ "name": "c", "forward_init": false, "update_strategy": "global", - "dimensionality": 1, "distribution": { "name": "uniform", "min": 0.0, diff --git a/tests/ert/unit_tests/run_models/snapshots/test_experiment_serialization/test_that_dumped_ensemble_experiment_matches_snapshot/snake_oilsnake_oil.ert/snake_oil.json b/tests/ert/unit_tests/run_models/snapshots/test_experiment_serialization/test_that_dumped_ensemble_experiment_matches_snapshot/snake_oilsnake_oil.ert/snake_oil.json index 29832d1b422..c78486569dd 100644 --- a/tests/ert/unit_tests/run_models/snapshots/test_experiment_serialization/test_that_dumped_ensemble_experiment_matches_snapshot/snake_oilsnake_oil.ert/snake_oil.json +++ b/tests/ert/unit_tests/run_models/snapshots/test_experiment_serialization/test_that_dumped_ensemble_experiment_matches_snapshot/snake_oilsnake_oil.ert/snake_oil.json @@ -156,7 +156,6 @@ "name": "BPR_555_PERSISTENCE", "forward_init": false, "update_strategy": "global", - "dimensionality": 1, "distribution": { "name": "uniform", "min": 0.1, @@ -170,7 +169,6 @@ "name": "BPR_138_PERSISTENCE", "forward_init": false, "update_strategy": "global", - "dimensionality": 1, "distribution": { "name": "uniform", "min": 0.2, @@ -184,7 +182,6 @@ "name": "OP1_PERSISTENCE", "forward_init": false, "update_strategy": "global", - "dimensionality": 1, "distribution": { "name": "uniform", "min": 0.01, @@ -198,7 +195,6 @@ "name": "OP1_OCTAVES", "forward_init": false, "update_strategy": "global", - "dimensionality": 1, "distribution": { "name": "uniform", "min": 3.0, @@ -212,7 +208,6 @@ "name": "OP1_DIVERGENCE_SCALE", "forward_init": false, "update_strategy": "global", - "dimensionality": 1, "distribution": { "name": "uniform", "min": 0.25, @@ -226,7 +221,6 @@ "name": "OP1_OFFSET", "forward_init": false, "update_strategy": "global", - "dimensionality": 1, "distribution": { "name": "uniform", "min": -0.1, @@ -240,7 +234,6 @@ "name": "OP2_PERSISTENCE", "forward_init": false, "update_strategy": "global", - "dimensionality": 1, "distribution": { "name": "uniform", "min": 0.1, @@ -254,7 +247,6 @@ "name": "OP2_OCTAVES", "forward_init": false, "update_strategy": "global", - "dimensionality": 1, "distribution": { "name": "uniform", "min": 5.0, @@ -268,7 +260,6 @@ "name": "OP2_DIVERGENCE_SCALE", "forward_init": false, "update_strategy": "global", - "dimensionality": 1, "distribution": { "name": "uniform", "min": 0.5, @@ -282,7 +273,6 @@ "name": "OP2_OFFSET", "forward_init": false, "update_strategy": "global", - "dimensionality": 1, "distribution": { "name": "uniform", "min": -0.2, diff --git a/tests/ert/unit_tests/run_models/snapshots/test_experiment_serialization/test_that_dumped_ensemble_smoother_matches_snapshot/heat_equationconfig.ert/config.json b/tests/ert/unit_tests/run_models/snapshots/test_experiment_serialization/test_that_dumped_ensemble_smoother_matches_snapshot/heat_equationconfig.ert/config.json index 137cd3f49f5..43acdc82cdc 100644 --- a/tests/ert/unit_tests/run_models/snapshots/test_experiment_serialization/test_that_dumped_ensemble_smoother_matches_snapshot/heat_equationconfig.ert/config.json +++ b/tests/ert/unit_tests/run_models/snapshots/test_experiment_serialization/test_that_dumped_ensemble_smoother_matches_snapshot/heat_equationconfig.ert/config.json @@ -206,7 +206,6 @@ "name": "t", "forward_init": false, "update_strategy": "adaptive", - "dimensionality": 1, "distribution": { "name": "uniform", "min": 0.5, @@ -220,7 +219,6 @@ "name": "x", "forward_init": false, "update_strategy": "adaptive", - "dimensionality": 1, "distribution": { "name": "normal", "mean": 0.8, @@ -234,7 +232,6 @@ "name": "COND", "forward_init": true, "update_strategy": "adaptive", - "dimensionality": 3, "ertbox_params": { "nx": 50, "ny": 50, diff --git a/tests/ert/unit_tests/run_models/snapshots/test_experiment_serialization/test_that_dumped_ensemble_smoother_matches_snapshot/poly_examplepoly.ert/poly.json b/tests/ert/unit_tests/run_models/snapshots/test_experiment_serialization/test_that_dumped_ensemble_smoother_matches_snapshot/poly_examplepoly.ert/poly.json index 2fd58f1c351..d6f645ddf67 100644 --- a/tests/ert/unit_tests/run_models/snapshots/test_experiment_serialization/test_that_dumped_ensemble_smoother_matches_snapshot/poly_examplepoly.ert/poly.json +++ b/tests/ert/unit_tests/run_models/snapshots/test_experiment_serialization/test_that_dumped_ensemble_smoother_matches_snapshot/poly_examplepoly.ert/poly.json @@ -196,7 +196,6 @@ "name": "a", "forward_init": false, "update_strategy": "global", - "dimensionality": 1, "distribution": { "name": "uniform", "min": 0.0, @@ -210,7 +209,6 @@ "name": "b", "forward_init": false, "update_strategy": "global", - "dimensionality": 1, "distribution": { "name": "uniform", "min": 0.0, @@ -224,7 +222,6 @@ "name": "c", "forward_init": false, "update_strategy": "global", - "dimensionality": 1, "distribution": { "name": "uniform", "min": 0.0, diff --git a/tests/ert/unit_tests/run_models/snapshots/test_experiment_serialization/test_that_dumped_ensemble_smoother_matches_snapshot/snake_oilsnake_oil.ert/snake_oil.json b/tests/ert/unit_tests/run_models/snapshots/test_experiment_serialization/test_that_dumped_ensemble_smoother_matches_snapshot/snake_oilsnake_oil.ert/snake_oil.json index 2e4e324f3ab..f6b1bed6911 100644 --- a/tests/ert/unit_tests/run_models/snapshots/test_experiment_serialization/test_that_dumped_ensemble_smoother_matches_snapshot/snake_oilsnake_oil.ert/snake_oil.json +++ b/tests/ert/unit_tests/run_models/snapshots/test_experiment_serialization/test_that_dumped_ensemble_smoother_matches_snapshot/snake_oilsnake_oil.ert/snake_oil.json @@ -172,7 +172,6 @@ "name": "BPR_555_PERSISTENCE", "forward_init": false, "update_strategy": "global", - "dimensionality": 1, "distribution": { "name": "uniform", "min": 0.1, @@ -186,7 +185,6 @@ "name": "BPR_138_PERSISTENCE", "forward_init": false, "update_strategy": "global", - "dimensionality": 1, "distribution": { "name": "uniform", "min": 0.2, @@ -200,7 +198,6 @@ "name": "OP1_PERSISTENCE", "forward_init": false, "update_strategy": "global", - "dimensionality": 1, "distribution": { "name": "uniform", "min": 0.01, @@ -214,7 +211,6 @@ "name": "OP1_OCTAVES", "forward_init": false, "update_strategy": "global", - "dimensionality": 1, "distribution": { "name": "uniform", "min": 3.0, @@ -228,7 +224,6 @@ "name": "OP1_DIVERGENCE_SCALE", "forward_init": false, "update_strategy": "global", - "dimensionality": 1, "distribution": { "name": "uniform", "min": 0.25, @@ -242,7 +237,6 @@ "name": "OP1_OFFSET", "forward_init": false, "update_strategy": "global", - "dimensionality": 1, "distribution": { "name": "uniform", "min": -0.1, @@ -256,7 +250,6 @@ "name": "OP2_PERSISTENCE", "forward_init": false, "update_strategy": "global", - "dimensionality": 1, "distribution": { "name": "uniform", "min": 0.1, @@ -270,7 +263,6 @@ "name": "OP2_OCTAVES", "forward_init": false, "update_strategy": "global", - "dimensionality": 1, "distribution": { "name": "uniform", "min": 5.0, @@ -284,7 +276,6 @@ "name": "OP2_DIVERGENCE_SCALE", "forward_init": false, "update_strategy": "global", - "dimensionality": 1, "distribution": { "name": "uniform", "min": 0.5, @@ -298,7 +289,6 @@ "name": "OP2_OFFSET", "forward_init": false, "update_strategy": "global", - "dimensionality": 1, "distribution": { "name": "uniform", "min": -0.2, diff --git a/tests/ert/unit_tests/run_models/snapshots/test_experiment_serialization/test_that_dumped_esmda_matches_snapshot/heat_equationconfig.ert/config.json b/tests/ert/unit_tests/run_models/snapshots/test_experiment_serialization/test_that_dumped_esmda_matches_snapshot/heat_equationconfig.ert/config.json index 8174f4cc898..8d3aa9e8177 100644 --- a/tests/ert/unit_tests/run_models/snapshots/test_experiment_serialization/test_that_dumped_esmda_matches_snapshot/heat_equationconfig.ert/config.json +++ b/tests/ert/unit_tests/run_models/snapshots/test_experiment_serialization/test_that_dumped_esmda_matches_snapshot/heat_equationconfig.ert/config.json @@ -206,7 +206,6 @@ "name": "t", "forward_init": false, "update_strategy": "adaptive", - "dimensionality": 1, "distribution": { "name": "uniform", "min": 0.5, @@ -220,7 +219,6 @@ "name": "x", "forward_init": false, "update_strategy": "adaptive", - "dimensionality": 1, "distribution": { "name": "normal", "mean": 0.8, @@ -234,7 +232,6 @@ "name": "COND", "forward_init": true, "update_strategy": "adaptive", - "dimensionality": 3, "ertbox_params": { "nx": 50, "ny": 50, diff --git a/tests/ert/unit_tests/run_models/snapshots/test_experiment_serialization/test_that_dumped_esmda_matches_snapshot/poly_examplepoly.ert/poly.json b/tests/ert/unit_tests/run_models/snapshots/test_experiment_serialization/test_that_dumped_esmda_matches_snapshot/poly_examplepoly.ert/poly.json index bced3c364b4..81f43c6c33e 100644 --- a/tests/ert/unit_tests/run_models/snapshots/test_experiment_serialization/test_that_dumped_esmda_matches_snapshot/poly_examplepoly.ert/poly.json +++ b/tests/ert/unit_tests/run_models/snapshots/test_experiment_serialization/test_that_dumped_esmda_matches_snapshot/poly_examplepoly.ert/poly.json @@ -196,7 +196,6 @@ "name": "a", "forward_init": false, "update_strategy": "global", - "dimensionality": 1, "distribution": { "name": "uniform", "min": 0.0, @@ -210,7 +209,6 @@ "name": "b", "forward_init": false, "update_strategy": "global", - "dimensionality": 1, "distribution": { "name": "uniform", "min": 0.0, @@ -224,7 +222,6 @@ "name": "c", "forward_init": false, "update_strategy": "global", - "dimensionality": 1, "distribution": { "name": "uniform", "min": 0.0, diff --git a/tests/ert/unit_tests/run_models/snapshots/test_experiment_serialization/test_that_dumped_esmda_matches_snapshot/snake_oilsnake_oil.ert/snake_oil.json b/tests/ert/unit_tests/run_models/snapshots/test_experiment_serialization/test_that_dumped_esmda_matches_snapshot/snake_oilsnake_oil.ert/snake_oil.json index 25aa33a81f8..dd729d4ff02 100644 --- a/tests/ert/unit_tests/run_models/snapshots/test_experiment_serialization/test_that_dumped_esmda_matches_snapshot/snake_oilsnake_oil.ert/snake_oil.json +++ b/tests/ert/unit_tests/run_models/snapshots/test_experiment_serialization/test_that_dumped_esmda_matches_snapshot/snake_oilsnake_oil.ert/snake_oil.json @@ -172,7 +172,6 @@ "name": "BPR_555_PERSISTENCE", "forward_init": false, "update_strategy": "global", - "dimensionality": 1, "distribution": { "name": "uniform", "min": 0.1, @@ -186,7 +185,6 @@ "name": "BPR_138_PERSISTENCE", "forward_init": false, "update_strategy": "global", - "dimensionality": 1, "distribution": { "name": "uniform", "min": 0.2, @@ -200,7 +198,6 @@ "name": "OP1_PERSISTENCE", "forward_init": false, "update_strategy": "global", - "dimensionality": 1, "distribution": { "name": "uniform", "min": 0.01, @@ -214,7 +211,6 @@ "name": "OP1_OCTAVES", "forward_init": false, "update_strategy": "global", - "dimensionality": 1, "distribution": { "name": "uniform", "min": 3.0, @@ -228,7 +224,6 @@ "name": "OP1_DIVERGENCE_SCALE", "forward_init": false, "update_strategy": "global", - "dimensionality": 1, "distribution": { "name": "uniform", "min": 0.25, @@ -242,7 +237,6 @@ "name": "OP1_OFFSET", "forward_init": false, "update_strategy": "global", - "dimensionality": 1, "distribution": { "name": "uniform", "min": -0.1, @@ -256,7 +250,6 @@ "name": "OP2_PERSISTENCE", "forward_init": false, "update_strategy": "global", - "dimensionality": 1, "distribution": { "name": "uniform", "min": 0.1, @@ -270,7 +263,6 @@ "name": "OP2_OCTAVES", "forward_init": false, "update_strategy": "global", - "dimensionality": 1, "distribution": { "name": "uniform", "min": 5.0, @@ -284,7 +276,6 @@ "name": "OP2_DIVERGENCE_SCALE", "forward_init": false, "update_strategy": "global", - "dimensionality": 1, "distribution": { "name": "uniform", "min": 0.5, @@ -298,7 +289,6 @@ "name": "OP2_OFFSET", "forward_init": false, "update_strategy": "global", - "dimensionality": 1, "distribution": { "name": "uniform", "min": -0.2, diff --git a/tests/ert/unit_tests/run_models/snapshots/test_experiment_serialization/test_that_dumped_single_test_run_matches_snapshot/heat_equationconfig.ert/config.json b/tests/ert/unit_tests/run_models/snapshots/test_experiment_serialization/test_that_dumped_single_test_run_matches_snapshot/heat_equationconfig.ert/config.json index 2ce5b1fd21b..3d5571f9a1b 100644 --- a/tests/ert/unit_tests/run_models/snapshots/test_experiment_serialization/test_that_dumped_single_test_run_matches_snapshot/heat_equationconfig.ert/config.json +++ b/tests/ert/unit_tests/run_models/snapshots/test_experiment_serialization/test_that_dumped_single_test_run_matches_snapshot/heat_equationconfig.ert/config.json @@ -91,7 +91,6 @@ "name": "t", "forward_init": false, "update_strategy": "adaptive", - "dimensionality": 1, "distribution": { "name": "uniform", "min": 0.5, @@ -105,7 +104,6 @@ "name": "x", "forward_init": false, "update_strategy": "adaptive", - "dimensionality": 1, "distribution": { "name": "normal", "mean": 0.8, @@ -119,7 +117,6 @@ "name": "COND", "forward_init": true, "update_strategy": "adaptive", - "dimensionality": 3, "ertbox_params": { "nx": 50, "ny": 50, diff --git a/tests/ert/unit_tests/run_models/snapshots/test_experiment_serialization/test_that_dumped_single_test_run_matches_snapshot/poly_examplepoly.ert/poly.json b/tests/ert/unit_tests/run_models/snapshots/test_experiment_serialization/test_that_dumped_single_test_run_matches_snapshot/poly_examplepoly.ert/poly.json index 1a4958cef0c..52b849d29db 100644 --- a/tests/ert/unit_tests/run_models/snapshots/test_experiment_serialization/test_that_dumped_single_test_run_matches_snapshot/poly_examplepoly.ert/poly.json +++ b/tests/ert/unit_tests/run_models/snapshots/test_experiment_serialization/test_that_dumped_single_test_run_matches_snapshot/poly_examplepoly.ert/poly.json @@ -81,7 +81,6 @@ "name": "a", "forward_init": false, "update_strategy": "global", - "dimensionality": 1, "distribution": { "name": "uniform", "min": 0.0, @@ -95,7 +94,6 @@ "name": "b", "forward_init": false, "update_strategy": "global", - "dimensionality": 1, "distribution": { "name": "uniform", "min": 0.0, @@ -109,7 +107,6 @@ "name": "c", "forward_init": false, "update_strategy": "global", - "dimensionality": 1, "distribution": { "name": "uniform", "min": 0.0, diff --git a/tests/ert/unit_tests/run_models/snapshots/test_experiment_serialization/test_that_dumped_single_test_run_matches_snapshot/snake_oilsnake_oil.ert/snake_oil.json b/tests/ert/unit_tests/run_models/snapshots/test_experiment_serialization/test_that_dumped_single_test_run_matches_snapshot/snake_oilsnake_oil.ert/snake_oil.json index 65a342f0db1..bf3464ad74d 100644 --- a/tests/ert/unit_tests/run_models/snapshots/test_experiment_serialization/test_that_dumped_single_test_run_matches_snapshot/snake_oilsnake_oil.ert/snake_oil.json +++ b/tests/ert/unit_tests/run_models/snapshots/test_experiment_serialization/test_that_dumped_single_test_run_matches_snapshot/snake_oilsnake_oil.ert/snake_oil.json @@ -132,7 +132,6 @@ "name": "BPR_555_PERSISTENCE", "forward_init": false, "update_strategy": "global", - "dimensionality": 1, "distribution": { "name": "uniform", "min": 0.1, @@ -146,7 +145,6 @@ "name": "BPR_138_PERSISTENCE", "forward_init": false, "update_strategy": "global", - "dimensionality": 1, "distribution": { "name": "uniform", "min": 0.2, @@ -160,7 +158,6 @@ "name": "OP1_PERSISTENCE", "forward_init": false, "update_strategy": "global", - "dimensionality": 1, "distribution": { "name": "uniform", "min": 0.01, @@ -174,7 +171,6 @@ "name": "OP1_OCTAVES", "forward_init": false, "update_strategy": "global", - "dimensionality": 1, "distribution": { "name": "uniform", "min": 3.0, @@ -188,7 +184,6 @@ "name": "OP1_DIVERGENCE_SCALE", "forward_init": false, "update_strategy": "global", - "dimensionality": 1, "distribution": { "name": "uniform", "min": 0.25, @@ -202,7 +197,6 @@ "name": "OP1_OFFSET", "forward_init": false, "update_strategy": "global", - "dimensionality": 1, "distribution": { "name": "uniform", "min": -0.1, @@ -216,7 +210,6 @@ "name": "OP2_PERSISTENCE", "forward_init": false, "update_strategy": "global", - "dimensionality": 1, "distribution": { "name": "uniform", "min": 0.1, @@ -230,7 +223,6 @@ "name": "OP2_OCTAVES", "forward_init": false, "update_strategy": "global", - "dimensionality": 1, "distribution": { "name": "uniform", "min": 5.0, @@ -244,7 +236,6 @@ "name": "OP2_DIVERGENCE_SCALE", "forward_init": false, "update_strategy": "global", - "dimensionality": 1, "distribution": { "name": "uniform", "min": 0.5, @@ -258,7 +249,6 @@ "name": "OP2_OFFSET", "forward_init": false, "update_strategy": "global", - "dimensionality": 1, "distribution": { "name": "uniform", "min": -0.2, diff --git a/tests/ert/unit_tests/storage/test_storage_migration.py b/tests/ert/unit_tests/storage/test_storage_migration.py index 8881424948c..d53e376852a 100644 --- a/tests/ert/unit_tests/storage/test_storage_migration.py +++ b/tests/ert/unit_tests/storage/test_storage_migration.py @@ -153,9 +153,9 @@ def test_that_storage_matches( assert experiment.parameter_configuration["PORO"].ertbox_params.nx == 2 assert experiment.parameter_configuration["PORO"].ertbox_params.ny == 3 assert experiment.parameter_configuration["PORO"].ertbox_params.nz == 4 - assert experiment.parameter_configuration["PORO"].dimensionality == 3 - assert experiment.parameter_configuration["BPR"].dimensionality == 1 - assert experiment.parameter_configuration["TOP"].dimensionality == 2 + assert experiment.parameter_configuration["PORO"].type == "field" + assert experiment.parameter_configuration["BPR"].type == "gen_kw" + assert experiment.parameter_configuration["TOP"].type == "surface" assert experiment.templates_configuration == [("\nBPR:\n", "params.txt")] df = ensemble.load_parameters("BPR")