diff --git a/.idea/METplus.iml b/.idea/METplus.iml index 54d4a167a4..1644746a0c 100644 --- a/.idea/METplus.iml +++ b/.idea/METplus.iml @@ -3,6 +3,7 @@ + diff --git a/docs/Users_Guide/getting_started.rst b/docs/Users_Guide/getting_started.rst index 258fe225a1..812669e807 100644 --- a/docs/Users_Guide/getting_started.rst +++ b/docs/Users_Guide/getting_started.rst @@ -463,10 +463,22 @@ METplus in Apptainer Apptainer (formerly Singularity) can also be used to run METplus. Images can be pulled from DockerHub using Apptainer commands. -If running on the NCAR Casper cluster, be sure to first load the Apptainer module via:: +If running on the NCAR Casper cluster, +be sure to first load the Apptainer module via:: module load apptainer +It is recommended to set the **APPTAINER_TMPDIR** environment variable to a +directory where the user has write permissions to prevent issues with temporary +files exceeding the size of the /tmp directory. +See the +`Apptainer documentation `_ +for more information. + +Example:: + + export APPTAINER_TMP_DIR=/d1/${USER}/apptainer_tmp + Navigate to a working directory and pull an image from DockerHub, e.g.:: apptainer pull docker://dtcenter/metplus:5.1-latest diff --git a/internal/tests/pytests/run_metplus/test_run_metplus.py b/internal/tests/pytests/run_metplus/test_run_metplus.py index 6567e2d8e7..a550d8cd7a 100644 --- a/internal/tests/pytests/run_metplus/test_run_metplus.py +++ b/internal/tests/pytests/run_metplus/test_run_metplus.py @@ -20,6 +20,12 @@ NEW_OUTPUT_BASE = os.path.join(TEST_OUTPUT_DIR, 'run_metplus') OUTPUT_BASE_OVERRIDE = f"config.OUTPUT_BASE={NEW_OUTPUT_BASE}" +# test that a list of values specified in a command line config override +# will no longer cause an error in the run. The list can be specified without +# quotes if no spaces are present or with quotes if spaces are present +LIST_CONFIG_OVERRIDE_1 = 'config.LEAD_SEQ=3H,6H' +LIST_CONFIG_OVERRIDE_2 = 'config.LEAD_SEQ="3H, 6H"' + @pytest.mark.run_metplus def test_run_metplus_exists(): """! Check that run_metplus.py script exists """ @@ -31,6 +37,10 @@ def test_run_metplus_exists(): ([RUN_METPLUS], 2), ([RUN_METPLUS, EXAMPLE_CONF], 2), ([RUN_METPLUS, EXAMPLE_CONF, MINIMUM_CONF, OUTPUT_BASE_OVERRIDE], 0), + ([RUN_METPLUS, '-c', EXAMPLE_CONF, MINIMUM_CONF, OUTPUT_BASE_OVERRIDE], 0), + ([RUN_METPLUS, EXAMPLE_CONF, MINIMUM_CONF, LIST_CONFIG_OVERRIDE_1], 0), + ([RUN_METPLUS, EXAMPLE_CONF, MINIMUM_CONF, LIST_CONFIG_OVERRIDE_2], 0), + ([RUN_METPLUS, EXAMPLE_CONF, MINIMUM_CONF, '--fake-arg'], 1), ] ) @pytest.mark.run_metplus diff --git a/ush/run_metplus.py b/ush/run_metplus.py index b7a99274ad..b266988530 100755 --- a/ush/run_metplus.py +++ b/ush/run_metplus.py @@ -78,24 +78,9 @@ def get_config_inputs_from_command_line(): if any(arg in sys.argv for arg in help_args): usage() - # pull out command line arguments - config_inputs = [] - for arg in sys.argv[1:]: - if arg.startswith('-'): - # ignore -c and --config since they are now optional - if arg == '-c' or arg == '--config' or arg == '-config': - continue - - # error/exit if an argument that is not supported was used - print('ERROR: Invalid argument: %s.' % arg) - usage() - - # split up comma separated lists into individual items - # and add each to list of arguments - # NOTE: to support lists in a config variable override, - # this logic will have to be enhanced - # i.e. config.PROCESS_LIST=PCPCombine,GridStat - config_inputs.extend(arg.split(',')) + # pull out command line arguments, removing deprecated config arguments + config_args = ('-c', '--config', '-config') + config_inputs = [arg for arg in sys.argv[1:] if arg not in config_args] # if no valid config_inputs were found, print usage and exit if not config_inputs: