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 Dec 19, 2024
1 parent d275a36 commit 064ee28
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 @@ -269,7 +269,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

@no_type_check
Expand Down Expand Up @@ -310,7 +309,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 Down Expand Up @@ -345,7 +343,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),
)

Expand All @@ -355,8 +352,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),
)

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 064ee28

Please sign in to comment.