Type fix: tuple to list in DynamicalCoreConfig#90
Conversation
romanc
left a comment
There was a problem hiding this comment.
Looks okay to me. An alternative I see is to change DEFAULT_DYCORE_NML_GROUPS to be a list instead of a tuple. That would also avoid the need to copy it into a list. Your choice.
And if you want to be sure the type error doesn't come back in the future, you could add a simple test case, creating a dycore config from_f90nml(), similar to what exists in test_config_from_yaml.py
|
or - and I just though about that - if
those two also avoid the copy from one type to another (which isn't really necessary since all that is done is iterating over all elements, which can be done for |
|
I think that modifying f90nml_as_dict() to use Sequence[str] instead of list[str] is better than my solution in this PR. However, there are a lot of changes going on in NDSL at the moment, so I'm going to try to push this one for now to get the pyshield namelist changes in. Then, I'll circle back to make the change afterwards. |
Description
A type fix in
DynamicalCoreConfig.from_f90nml().Without this fix, there are failures in Pace linting checks.
How Has This Been Tested?
CI tests
Checklist: