This commit E3SM-Project/e3sm_diags@48426aa (#755) changes if type(p) == cls_type to if isinstance(p, cls_type). Apparently, both of these conditionals are not the same (source) and can return different boolean values. I changed if type(p) == cls_type because it is considered bad practice (Flake8 E721).
As a result, in v2.10.0, the results_dir config is not being copied from the first parameter (param) to the second parameter (qbo_param). This causes results_dir to be blank which cascades to the FileNotFoundError: [Errno 2] No such file or directory: '' and FileNotFoundError: [Errno 2] No such file or directory: '/prov/e3sm_diags_run.log'.
What did you expect to happen? Are there are possible answers you came across?
The fix is to change if isinstance(p, cls_type) to if type(p) is cls_type. I will open a separate PR for this and get a new e3sm_diags RC release out.
===== RUN E3SM DIAGS =====
2023-12-21 20:06:05,915 [ERROR]: run.py(run_diags:37) >> Error traceback:
Traceback (most recent call last):
File "/lcrc/soft/climate/e3sm-unified/base/envs/e3sm_unified_1.9.2rc2_chrysalis/lib/python3.10/site-packages/e3sm_diags/run.py", line 35, in run_diags
main(final_params)
File "/lcrc/soft/climate/e3sm-unified/base/envs/e3sm_unified_1.9.2rc2_chrysalis/lib/python3.10/site-packages/e3sm_diags/e3sm_diags_driver.py", line 362, in main
os.makedirs(parameters[0].results_dir, 0o755)
File "/lcrc/soft/climate/e3sm-unified/base/envs/e3sm_unified_1.9.2rc2_chrysalis/lib/python3.10/os.py", line 225, in makedirs
mkdir(name, mode)
FileNotFoundError: [Errno 2] No such file or directory: ''
Traceback (most recent call last):
File "/lcrc/group/e3sm/ac.forsyth2/zppy_test_complete_run_output/unified_1.9.2rc2/v2.LR.historical_0201/post/scripts/tmp.447067.MErK/e3sm.py", line 53, in <module>
runner.run_diags(params)
File "/lcrc/soft/climate/e3sm-unified/base/envs/e3sm_unified_1.9.2rc2_chrysalis/lib/python3.10/site-packages/e3sm_diags/run.py", line 38, in run_diags
move_log_to_prov_dir(final_params[0].results_dir)
File "/lcrc/soft/climate/e3sm-unified/base/envs/e3sm_unified_1.9.2rc2_chrysalis/lib/python3.10/site-packages/e3sm_diags/logger.py", line 104, in move_log_to_prov_dir
shutil.copy(LOG_FILENAME, provenance_dir)
File "/lcrc/soft/climate/e3sm-unified/base/envs/e3sm_unified_1.9.2rc2_chrysalis/lib/python3.10/shutil.py", line 417, in copy
copyfile(src, dst, follow_symlinks=follow_symlinks)
File "/lcrc/soft/climate/e3sm-unified/base/envs/e3sm_unified_1.9.2rc2_chrysalis/lib/python3.10/shutil.py", line 256, in copyfile
with open(dst, 'wb') as fdst:
FileNotFoundError: [Errno 2] No such file or directory: '/prov/e3sm_diags_run.log'
srun: error: chr-0493: task 0: Exited with exit code 1
What happened?
This commit E3SM-Project/e3sm_diags@
48426aa
(#755) changesif type(p) == cls_type
toif isinstance(p, cls_type)
. Apparently, both of these conditionals are not the same (source) and can return different boolean values. I changedif type(p) == cls_type
because it is considered bad practice (Flake8 E721).As a result, in v2.10.0, the
results_dir
config is not being copied from the first parameter (param
) to the second parameter (qbo_param
). This causesresults_dir
to be blank which cascades to theFileNotFoundError: [Errno 2] No such file or directory: ''
andFileNotFoundError: [Errno 2] No such file or directory: '/prov/e3sm_diags_run.log'
.What did you expect to happen? Are there are possible answers you came across?
The fix is to change
if isinstance(p, cls_type)
toif type(p) is cls_type
. I will open a separate PR for this and get a new e3sm_diags RC release out.Minimal Complete Verifiable Example (MVCE)
Relevant log output
Anything else we need to know?
Related to https://github.com/E3SM-Project/zppy/issues/538
Environment
v2.10.0 and
main