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
I received a faulty bc file from a client, which I got working with help from the HYDROLIB-core validation, but the error messages I got can be clearer.
To Reproduce
The (simplified) bc-file Velocity3D_west_small.bc looks like this:
Time-interpolation = linear
Vertical position type = percentage from bed
Vertical position = 3.6, 27.7
Quantity = time
Unit = seconds since 1994-01-01 00:00:00
Quantity = velocitybnd
Unit = m/s
verticalPositionIndex = 1
Quantity = velocitybnd
Unit = m/s
verticalPositionIndex = 2
16858800 -0.005 0.000
16869600 -0.003 -0.003
16880400 0.003 -0.003
16891200 0.017 0.011
16902000 0.017 0.016
16912800 0.002 0.010
The file can be read+validated with HYDROLIB-core with this code:
import hydrolib.core.dflowfm as hcdfm
file_bc = 'Velocity3D_west_small.bc'
fm_bc = hcdfm.ForcingModel(file_bc)
A clear error message is thrown:
ValidationError: 1 validation error for ForcingModel
Velocity3D_west_small.bc -> forcing -> 0 -> west_0001 -> __root__
vertPositions is not provided (type=value_error)
Action: replace Vertical position with vertPositions and try again. In the uxuy example bc-file, this quantity is named Vertical position specification
Another error message is thrown:
ValidationError: 1 validation error for ForcingModel
Velocity3D_west_small.bc -> forcing -> 0 -> west_0001 -> __root__
Vertical position index should be between 1 and 2, but None was given (type=value_error)
After a bit of puzzling, I figured out that verticalPositionIndex should be replaced with vertPositionIndex. In the uxuy example bc-file, this quantity is named Vertical position. This is confusingly similar to vertPositions above.
After replacing, we get this error message:
ValidationError: 1 validation error for ForcingModel
Velocity3D_west_small.bc -> forcing -> 0 -> west_0001 -> vertPositions -> 0
value is not a valid float (type=type_error.float)
I figured that the comma's should be removed from the Vertpositions value.
Expected behavior
A bit clearer error messages, so the user knows what should be changed. Also, the similarity of vertPositions and Vertical position (which are the indices and the position values) is a bit confusing.
Version info (please complete the following information):
OS: Windows
Version HYDROLIB-core 0.5.2
The text was updated successfully, but these errors were encountered:
Describe the bug
I received a faulty bc file from a client, which I got working with help from the HYDROLIB-core validation, but the error messages I got can be clearer.
To Reproduce
The (simplified) bc-file
Velocity3D_west_small.bc
looks like this:The file can be read+validated with HYDROLIB-core with this code:
A clear error message is thrown:
Action: replace
Vertical position
withvertPositions
and try again. In the uxuy example bc-file, this quantity is namedVertical position specification
Another error message is thrown:
After a bit of puzzling, I figured out that
verticalPositionIndex
should be replaced withvertPositionIndex
. In the uxuy example bc-file, this quantity is namedVertical position
. This is confusingly similar tovertPositions
above.After replacing, we get this error message:
I figured that the comma's should be removed from the
Vertpositions
value.Expected behavior
A bit clearer error messages, so the user knows what should be changed. Also, the similarity of
vertPositions
andVertical position
(which are the indices and the position values) is a bit confusing.Version info (please complete the following information):
The text was updated successfully, but these errors were encountered: