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

run_sys_tests: Check Python environment for FatesColdTwoStream tests #2326

Merged
merged 11 commits into from
Jan 25, 2024

Conversation

samsrabin
Copy link
Contributor

@samsrabin samsrabin commented Jan 19, 2024

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 easy to fix, bit-for-bit type: tests 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 added the PR status: awaiting review Work on this PR is paused while waiting for review. label Jan 19, 2024
@samsrabin samsrabin added this to In progress - master in Upcoming tags Jan 19, 2024
@ekluzek ekluzek removed this from In progress - master in Upcoming tags Jan 22, 2024
@samsrabin
Copy link
Contributor Author

@ekluzek Done!

@samsrabin samsrabin added PR status: ready PR: author feels this is ready to merge in 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
2 checks passed
samsrabin added a commit to samsrabin/CTSM that referenced this pull request Feb 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR status: ready PR: author feels this is ready to merge in tag: simple bfb easy to fix, bit-for-bit type: tests additions or changes to tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants