[Bug]: Fix default diagnostic parameters not being copied correctly to parent CoreParameter
resulting in AttributeError
#777
Labels
bug
Bug fix (will increment patch version)
What happened?
I ran into this issue when trying to run
ex1.py
with default diagnostics on e3sm_diags >=2.10.0 andmain
.In #747, some code was refactored in
_get_parameters_with_api_and_cfg()
to only getcfg_params
once.e3sm_diags/e3sm_diags/run.py
Lines 168 to 172 in c8ffba9
Then a
deepcopy()
is performed oncfg_params
over every iteration offor set_name in self.sets_to_run
.e3sm_diags/e3sm_diags/run.py
Lines 189 to 199 in c8ffba9
I wanted to improve performance by only instantiating
cfg_params
once because it should not change. However, this change seemed to cause an issue where the default diagnostic parameters are not being copied to the parentCoreParameter
object, resulting inAttributeError
(look at log).What did you expect to happen? Are there are possible answers you came across?
The fix is to move the conditional that sets
cfg_params
back into the for loop as it was prior to #747. Example below:Minimal Complete Verifiable Example (MVCE)
Relevant log output
Anything else we need to know?
No response
Environment
e3sm_diags >=2.10.0 and
main
The text was updated successfully, but these errors were encountered: