Skip to content

Commit

Permalink
Disable modes that do parameter updates if there are no params to update
Browse files Browse the repository at this point in the history
If all parameters have UPDATE:FALSE set, then we should not let the user
select any mode that does parameter updates.
  • Loading branch information
JHolba committed Oct 21, 2024
1 parent ebc4d03 commit 6b84333
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
6 changes: 5 additions & 1 deletion src/ert/cli/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
8 changes: 6 additions & 2 deletions src/ert/gui/simulation/experiment_panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit 6b84333

Please sign in to comment.