From e315c9b4d6809154d5a58623265a71999512e95e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98yvind=20Eide?= Date: Fri, 29 Nov 2024 12:02:01 +0100 Subject: [PATCH] Review comment --- docs/ert/reference/configuration/queue.rst | 13 +++++++++++++ src/ert/config/queue_config.py | 5 ----- tests/ert/unit_tests/config/test_queue_config.py | 10 +++++----- 3 files changed, 18 insertions(+), 10 deletions(-) diff --git a/docs/ert/reference/configuration/queue.rst b/docs/ert/reference/configuration/queue.rst index 49dcba922ba..6e299dc9611 100644 --- a/docs/ert/reference/configuration/queue.rst +++ b/docs/ert/reference/configuration/queue.rst @@ -158,6 +158,10 @@ The following is a list of available LSF configuration options: QUEUE_OPTION LSF LSF_QUEUE name_of_queue +.. note:: + It is preferred to use the generic option instead: + QUEUE_OPTION GENERIC QUEUE_NAME name_of_queue + .. _lsf_resource: .. topic:: LSF_RESOURCE @@ -264,6 +268,10 @@ The following is a list of all queue-specific configuration options: QUEUE_OPTION TORQUE QUEUE name_of_queue +.. note:: + It is preferred to use the generic option instead: + QUEUE_OPTION GENERIC QUEUE_NAME name_of_queue + .. _torque_cluster_label: .. topic:: CLUSTER_LABEL @@ -428,6 +436,10 @@ only the most necessary options have been added. QUEUE_OPTION SLURM PARTITION foo +.. note:: + It is preferred to use the generic option instead: + QUEUE_OPTION GENERIC QUEUE_NAME name_of_queue + .. _slurm_squeue_timeout: .. topic:: SQUEUE_TIMEOUT @@ -515,6 +527,7 @@ the `GENERIC` keyword. :: QUEUE_SYSTEM LSF QUEUE_OPTION GENERIC MAX_RUNNING 10 QUEUE_OPTION GENERIC SUBMIT_SLEEP 2 + QUEUE_OPTION GENERIC QUEUE_NAME some_name Is equivalent to:: diff --git a/src/ert/config/queue_config.py b/src/ert/config/queue_config.py index c147b3210dd..45a0f87e818 100644 --- a/src/ert/config/queue_config.py +++ b/src/ert/config/queue_config.py @@ -300,11 +300,6 @@ def from_dict(cls, config_dict: ConfigDict) -> QueueConfig: or (q_system == QueueSystem.SLURM and options[0] == "PARTITION") or (q_system == QueueSystem.TORQUE and options[0] == "QUEUE") ): - ConfigWarning.deprecation_warn( - f"Deprecated keyword: {options[0]} for QUEUE_OPTION {q_system}, use: " - f"QUEUE_OPTION GENERIC QUEUE_NAME {options[1] if len(options) >= 2 else ''}", - _raw_queue_options[i], - ) _raw_queue_options[i] = [ QueueSystemWithGeneric.GENERIC, "QUEUE_NAME", diff --git a/tests/ert/unit_tests/config/test_queue_config.py b/tests/ert/unit_tests/config/test_queue_config.py index 5d32de91acd..4652144ebb5 100644 --- a/tests/ert/unit_tests/config/test_queue_config.py +++ b/tests/ert/unit_tests/config/test_queue_config.py @@ -525,7 +525,7 @@ def test_default_activate_script_generation(expected, monkeypatch, venv): @pytest.mark.parametrize( - "queue_system, queue_option", + "queue_system, queue_option", ( ("LSF", "LSF_QUEUE"), ("TORQUE", "QUEUE"), @@ -533,9 +533,9 @@ def test_default_activate_script_generation(expected, monkeypatch, venv): ), ) def test_deprecated_queue_name_initialization(queue_system, queue_option): - with pytest.warns( - ConfigWarning, match="Deprecated .* use: QUEUE_OPTION GENERIC QUEUE_NAME" - ): + assert ( QueueConfig.from_dict( {"QUEUE_OPTION": [[queue_system, queue_option, "some_name"]]} - ) + ).queue_options.queue_name + == "some_name" + )