Update to use recent MIKE IO and ModelSkill#8
Conversation
|
Hi Jesper, would you have time to take a look next week? |
Yes - maybe even today |
jsmariegaard
left a comment
There was a problem hiding this comment.
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.
Why only "FemEngineHD" here? "FemEngine" and "FemEngineSW" should work as well
There was a problem hiding this comment.
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.
Why only "FemEngineHD" here? "FemEngine" and "FemEngineSW" should work as well
There was a problem hiding this comment.
Here it is possible to use the alias mikeio.read_pfs(pfs_file).DA
As requested by @jaadhi.