Skip to content

Commit

Permalink
Replace local queue options property by creating on demand
Browse files Browse the repository at this point in the history
  • Loading branch information
oyvindeide committed Jan 10, 2025
1 parent dd77cf3 commit 60f5e6b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
6 changes: 1 addition & 5 deletions src/ert/config/queue_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,6 @@ class QueueConfig:
queue_options: (
LsfQueueOptions | TorqueQueueOptions | SlurmQueueOptions | LocalQueueOptions
) = pydantic.Field(default_factory=LocalQueueOptions, discriminator="name")
queue_options_test_run: LocalQueueOptions = field(default_factory=LocalQueueOptions)
stop_long_running: bool = False
max_runtime: int | None = None

Expand Down Expand Up @@ -299,7 +298,6 @@ def from_dict(cls, config_dict: ConfigDict) -> QueueConfig:
)

queue_options = all_validated_queue_options[selected_queue_system]
queue_options_test_run = all_validated_queue_options[QueueSystem.LOCAL]
queue_options.add_global_queue_options(config_dict)

if queue_options.project_code is None:
Expand All @@ -317,7 +315,6 @@ def from_dict(cls, config_dict: ConfigDict) -> QueueConfig:
max_submit,
selected_queue_system,
queue_options,
queue_options_test_run,
stop_long_running=bool(stop_long_running),
max_runtime=config_dict.get(ConfigKeys.MAX_RUNTIME),
)
Expand All @@ -328,8 +325,7 @@ def create_local_copy(self) -> QueueConfig:
self.realization_memory,
self.max_submit,
QueueSystem.LOCAL,
self.queue_options_test_run,
self.queue_options_test_run,
LocalQueueOptions(max_running=self.max_running),
stop_long_running=bool(self.stop_long_running),
max_runtime=self.max_runtime,
)
Expand Down
3 changes: 2 additions & 1 deletion src/ert/gui/simulation/experiment_panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
)
from ert.trace import get_trace_id

from ...config.queue_config import LocalQueueOptions
from ..summarypanel import SummaryPanel
from .combobox_with_description import QComboBoxWithDescription
from .ensemble_experiment_panel import EnsembleExperimentPanel
Expand Down Expand Up @@ -376,7 +377,7 @@ def populate_clipboard_debug_info(self) -> None:
queue_opts = self.config.queue_config.queue_options

if isinstance(self.get_current_experiment_type(), SingleTestRun):
queue_opts = self.config.queue_config.queue_options_test_run
queue_opts = LocalQueueOptions(max_running=1)

for field in fields(queue_opts):
field_value = getattr(queue_opts, field.name)
Expand Down

0 comments on commit 60f5e6b

Please sign in to comment.