From 6b84333218f7c798e1e950cde1e4d3b214e5e21d Mon Sep 17 00:00:00 2001 From: Jon Holba Date: Mon, 21 Oct 2024 14:10:33 +0200 Subject: [PATCH] Disable modes that do parameter updates if there are no params to update If all parameters have UPDATE:FALSE set, then we should not let the user select any mode that does parameter updates. --- src/ert/cli/main.py | 6 +++++- src/ert/gui/simulation/experiment_panel.py | 8 ++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/ert/cli/main.py b/src/ert/cli/main.py index 288d048f8eb..8ac46e60748 100644 --- a/src/ert/cli/main.py +++ b/src/ert/cli/main.py @@ -74,7 +74,11 @@ def run_cli(args: Namespace, plugin_manager: Optional[ErtPluginManager] = None) f"To run {args.mode}, GEN_KW, FIELD or SURFACE parameters are needed. \n" f"Please add to file {args.config}" ) - + if not ( + True + in [p.update for p in ert_config.ensemble_config.parameter_configs.values()] + ): + ErtCliError(f"All parameters are set to UPDATE:FALSE in {args.config}") storage = open_storage(ert_config.ens_path, "w") if args.mode == WORKFLOW_MODE: diff --git a/src/ert/gui/simulation/experiment_panel.py b/src/ert/gui/simulation/experiment_panel.py index 53c59ea5f29..2b68f0f1a69 100644 --- a/src/ert/gui/simulation/experiment_panel.py +++ b/src/ert/gui/simulation/experiment_panel.py @@ -153,7 +153,9 @@ def __init__( ) experiment_type_valid = bool( - config.ensemble_config.parameter_configs and config.observations + True + in [p.update for p in config.ensemble_config.parameter_configs.values()] + and config.observations ) self.addExperimentConfigPanel( @@ -198,7 +200,9 @@ def addExperimentConfigPanel( sim_item = model.item(item_count) assert sim_item is not None sim_item.setEnabled(False) - sim_item.setToolTip("Both observations and parameters must be defined") + sim_item.setToolTip( + "Both observations and parameters must be defined.\nThere must be parameters to update." + ) style = self.style() assert style is not None sim_item.setIcon(