You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Some D-Flow FM MDU keywords are whitespace-separated list values and these are handled by the hydrolib.core.dflowfm.ini.util.get_split_string_on_delimiter_validator validator. This supports only one separator string, currently mostly " ".
For validating (i.e. loading) a model, we'd like to support multiple delimiters.
For serialization is OK to keep the current behavior: only one delimiter.
To Reproduce
Steps to reproduce the behavior:
Use unit test test_mdu_file_with_network_is_read_correctly() with test model tests/data/input/e02/c11_korte-woerden-1d/dimr_model/dflowfm/FlowFM.mdu
Change line
Cdbreakpoints = 0.00063 7.23d-003
to
Cdbreakpoints = 0.00063\t7.23d-003
(enter an actual tab character for \t)
3. Load the model
4. See validation appearing:
E FlowFM.mdu -> wind -> CdBreakpoints -> 0
E value is not a valid float (type=type_error.float)
Expected behavior
For loading/validating: multiple separator strings should be possible, Multiple consecutive separators in input string should be treated as one.
For serializing, use only one separator string. Possible approach could be to allow a list of strings to be set (in get_list_delimiter()), all used by get_split_string_on_delimiter_validator for validation, and only the first list element used by _convert_value() for serialization.
Version info (please complete the following information):
OS: N/A (tested on Windows)
Version: 0.8.0
The text was updated successfully, but these errors were encountered:
Describe the bug
Some D-Flow FM MDU keywords are whitespace-separated list values and these are handled by the
hydrolib.core.dflowfm.ini.util.get_split_string_on_delimiter_validator
validator. This supports only one separator string, currently mostly " ".For validating (i.e. loading) a model, we'd like to support multiple delimiters.
For serialization is OK to keep the current behavior: only one delimiter.
To Reproduce
Steps to reproduce the behavior:
test_mdu_file_with_network_is_read_correctly()
with test modeltests/data/input/e02/c11_korte-woerden-1d/dimr_model/dflowfm/FlowFM.mdu
to
(enter an actual tab character for \t)
3. Load the model
4. See validation appearing:
Expected behavior
For loading/validating: multiple separator strings should be possible, Multiple consecutive separators in input string should be treated as one.
For serializing, use only one separator string. Possible approach could be to allow a list of strings to be set (in
get_list_delimiter()
), all used byget_split_string_on_delimiter_validator
for validation, and only the first list element used by_convert_value()
for serialization.Version info (please complete the following information):
The text was updated successfully, but these errors were encountered: