Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify in config_dict_generator #6664

Merged
merged 2 commits into from
Nov 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/ert/config/queue_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,11 @@ def from_dict(cls, config_dict: ConfigDict) -> QueueConfig:
" you are effectively replacing the default value provided."
)

if option_name == "SUBMIT_SLEEP" and selected_queue_system == queue_system:
if (
option_name == "SUBMIT_SLEEP"
and selected_queue_system == queue_system
and values
):
submit_sleep = float(values[0])

for queue_system_val in queue_options:
Expand Down
6 changes: 1 addition & 5 deletions tests/unit_tests/config/config_dict_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,6 @@ def memory_with_unit_lsf(draw):
}


def valid_queue_options(queue_system: QueueSystem):
return ["MAX_RUNNING"] + VALID_QUEUE_OPTIONS[queue_system]


def valid_queue_values(option_name, queue_system):
if option_name in queue_string_options[queue_system]:
return words
Expand All @@ -142,7 +138,7 @@ def valid_queue_values(option_name, queue_system):
@st.composite
def queue_options(draw, systems):
queue_system = draw(systems)
name = draw(st.sampled_from(valid_queue_options(queue_system)))
name = draw(st.sampled_from(VALID_QUEUE_OPTIONS[queue_system]))
do_set = draw(booleans)
if do_set:
return [queue_system, name, draw(valid_queue_values(name, queue_system))]
Expand Down
Loading