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
patching of fortran types only works for first occurence #149
Comments
Sorry for taking so long to reply, this came in at a busy time for me. I can replicate this. Although I will try to find some time to look into this. |
We are using
I'm guessing you want the same behaviour from |
Hi @ccarouge! I agree this is mostly like the same issue. I (finally) had a look here and it seems that the aggressive The scanner has become such a mess that I can't even pretend to understand what is going on, but this patch does appear to fix the issue:
I can sort of guess what is happening here: derived type contents should not be At worst, I can just apply this patch and hope that it fixes the problem. |
I've pushed this fix. Hopefully it is actually a fix. I'll do an updated release soon. |
Thanks @marshallward. For the moment, we found a workaround in pydantic: # ======================================================
# Copyright (c) 2017 - 2022 Samuel Colvin and other contributors
# from https://github.com/pydantic/pydantic/blob/fd2991fe6a73819b48c906e3c3274e8e47d0f761/pydantic/utils.py#L200
KeyType = TypeVar('KeyType')
def deep_update(mapping: Dict[KeyType, Any], *updating_mappings: Dict[KeyType, Any]) -> Dict[KeyType, Any]:
updated_mapping = mapping.copy()
for updating_mapping in updating_mappings:
for k, v in updating_mapping.items():
if k in updated_mapping and isinstance(updated_mapping[k], dict) and isinstance(v, dict):
updated_mapping[k] = deep_update(updated_mapping[k], v)
else:
updated_mapping[k] = v
return updated_mapping
# ====================================================== This seems to work for our use. But happy to use the |
Given the namelist file
setup.nml
and the patch
the call
does not patch anything.
However, patching the first occurrence of
test%
insetup.nml
worksThe text was updated successfully, but these errors were encountered: