Skip to content

run_sys_tests: Check Python environment for FatesColdTwoStream tests - #2326

Merged
slevis-lmwg merged 11 commits into
ESCOMP:masterfrom
samsrabin:check-pyenv-FatesColdTwoStream
Jan 25, 2024
Merged

slevis-lmwg merged 11 commits into
ESCOMP:masterfrom
samsrabin:check-pyenv-FatesColdTwoStream

Conversation

@samsrabin

@samsrabin samsrabin commented Jan 19, 2024 •

Copy link
Copy Markdown
Member

Description of changes

FatesColdTwoStream and FatesColdTwoStreamNoCompFixedBioGeo tests use the $FATESDIR/tools/modify_fates_paramfile.py script, which requires certain non-standard Python packages. Now, run_sys_tests will check for the availability of those packages.

Specific notes

Uses existing _try_systemtests() function (now generalized and renamed _check_py_env()).

Contributors other than yourself, if any: None

CTSM Issues Fixed (include github issue #): n/a

Are answers expected to change (and if so in what way)? No.

Any User Interface Changes (namelist or namelist defaults changes)? No.

Testing performed, if any:
Unloaded all modules on Izumi and tried to submit run_sys_tests using -s, -f, and -t arguments that requested those tests. It successfully errors, saying:

Traceback (most recent call last):
  File "/home/samrabin/ctsm_scale-mat-reqs/python/ctsm/run_sys_tests.py", line 731, in _check_py_env
    import tools.modify_fates_paramfile
  File "/home/samrabin/ctsm_scale-mat-reqs/python/ctsm/../../src/fates/tools/modify_fates_paramfile.py", line 26, in <module>
    import numpy as np
ModuleNotFoundError: No module named 'numpy'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "./run_sys_tests", line 20, in <module>
    main(cime_path=cime_path)
  File "/home/samrabin/ctsm_scale-mat-reqs/python/ctsm/run_sys_tests.py", line 93, in main
    extra_create_test_args=args.extra_create_test_args,
  File "/home/samrabin/ctsm_scale-mat-reqs/python/ctsm/run_sys_tests.py", line 252, in run_sys_tests
    _check_py_env(testname_list)
  File "/home/samrabin/ctsm_scale-mat-reqs/python/ctsm/run_sys_tests.py", line 733, in _check_py_env
    raise ModuleNotFoundError("modify_fates_paramfile" + err_msg) from err
ModuleNotFoundError: modify_fates_paramfile can't be loaded. Do you need to activate the ctsm_pylib conda environment?

It also works on Derecho.

black and pylint pass.

@samsrabin samsrabin added tag: simple bfb testing additions or changes to tests labels Jan 19, 2024
@samsrabin samsrabin self-assigned this Jan 19, 2024
@samsrabin
samsrabin marked this pull request as ready for review January 19, 2024 18:00
@samsrabin
samsrabin requested a review from ekluzek January 19, 2024 18:00
@samsrabin samsrabin added the PR status: awaiting review Work on this PR is paused while waiting for review. label Jan 19, 2024
Comment thread python/ctsm/run_sys_tests.py Resolved
@samsrabin

Copy link
Copy Markdown
Member Author

@ekluzek Done!

@samsrabin samsrabin added PR status: ready PR: this is ready to merge in, with all tests satisfactory and reviews complete and removed PR status: awaiting review Work on this PR is paused while waiting for review. labels Jan 22, 2024
@ESCOMP ESCOMP deleted a comment from ekluzek Jan 24, 2024
@slevis-lmwg
slevis-lmwg merged commit 2d7beef into ESCOMP:master Jan 25, 2024
samsrabin added a commit to samsrabin/CTSM that referenced this pull request Feb 12, 2024
@samsrabin samsrabin added simple b4b bit-for-bit labels Aug 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

b4b bit-for-bit PR status: ready PR: this is ready to merge in, with all tests satisfactory and reviews complete testing additions or changes to tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants