-
Notifications
You must be signed in to change notification settings - Fork 1
Update to use recent MIKE IO and ModelSkill #8
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
Conversation
Hi Jesper, would you have time to take a look next week? |
Yes - maybe even today |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a million for upgrading FMDAp, @ecomodeller
I think it is fine to merge as is, but the pfs parsing will now only work for FemEngineHD (as noted below). I tried to add a test for it but then bumped into a MIKE IO bug which I have now reported DHI/mikeio#801
In a future PR it would also be good to update to pyproject.toml instead of setup.py. I will add this as an issue instead.
fmdap/pfs.py
Outdated
self.data = pfs.data # PfsSection | ||
self.d = pfs.data.to_dict() # dictionary | ||
pfs = mikeio.PfsDocument(pfs_file) | ||
self.d = pfs.FemEngineHD.to_dict() # dictionary |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why only "FemEngineHD" here? "FemEngine" and "FemEngineSW" should work as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It could be done with
self.d = pfs.targets[0].to_dict()
If you want check if it is actually a FemEngine you could
if not "FemEngine" in self.names[0]:
raise ...
fmdap/diagnostic_collection.py
Outdated
"'DATA_ASSIMILATION_MODULE' section could not be found in pfs file!" | ||
) | ||
DA_type = d.get("METHOD", {}).get("type", 0) | ||
d = mikeio.read_pfs(pfs_file).FemEngineHD.DATA_ASSIMILATION_MODULE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why only "FemEngineHD" here? "FemEngine" and "FemEngineSW" should work as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here it is possible to use the alias mikeio.read_pfs(pfs_file).DA
As requested by @jaadhi.