Closed SCLaan closed 2 years ago
As discussed with @arthurvd, some of the keywords and sections are not "official", they are not mentioned in the D-Flow FM manual as supported features. However, they are part of the functionality that the kernel provides, so we decided that we will probably add the missing keywords and sections to the manual so that the kernel and hydrolib-core can officialy support them.
The reason why we are strict with extra sections in the MDU, is to gain more insight into users' models, like we have now with this issue.
Discussed this with @SCLaan:
[processes]
, [calibration]
and [veg]
are truly used. (and we so these are documented already, except for veg). I will extend the User Manual documentation for these all.[grw]
and [particles]
are not used by them, but at least [grw]
ias partially official functionality already.
Proposal: support also these two as blocks, but make them optional inside the FMModel (is that possible?) such that can be read/imported, but not saved when they are absent.Definition of [grw]
fields:
All optional:
Definition of [particles]
fields:
All optional:
@arthurvd I am pretty sure sections which are set to None are automatically skipped as part of the serialize (see this, which skips empty sections when converting the FM model to a Document). So this should work out of the box (I hope).
I see this was marked as done in July. Is anything known about when 0.4.0 will be released? I run into this issue a lot (grw pops up a lot!) and would love to see this fixed soon.
Hi @LisaWeijers, I think hydrolib-core release is planned in oktober/november. So that might be a little too long to wait for you. As we also got a request to release sooner from other users, I will discuss it with @arthurvd when he gets back from his holiday. I think it should be possible to release a stable version earlier.
In the mean time (if it blocks your work) you could try to use an installation from the main branch.
Thanks for the info, good to know, I will consider that alternative!
Describe the bug In hydrolib.core.io.mdu.models.FMModel, the following sections in the mdu are not recognized:
This causes the ValidationError: _extra fields not permitted (type=valueerror.extra)
To Reproduce test.mdu.txt Steps to reproduce the behavior: from hydrolib.core.io.mdu.models import FMModel model_path = Path(r'')
fm = FMModel(filepath=model_path)
Expected behavior No ValidationError when reading the mdu file. Optionally a warning for unkown sections that still have to be implemented.
Version info (please complete the following information):