Skip to content
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

Add longCulvert to the supported structure types #751

Open
MAfarrag opened this issue Feb 26, 2025 · 2 comments
Open

Add longCulvert to the supported structure types #751

MAfarrag opened this issue Feb 26, 2025 · 2 comments
Labels
extforce external forcing file conversion type: feature Brand new functionality

Comments

@MAfarrag
Copy link
Contributor

MAfarrag commented Feb 26, 2025

Is your feature request related to a problem? Please describe.
The test case f002_1D2D/c100_longculvert fails to load because the structure.ini file contains type=longCulvert, which is still missing in hydrolib-core.

Describe the solution you'd like

Original error message:
The error

  File "C:\gdrive\algorithms\deltares\HYDROLIB-core\hydrolib\core\basemodel.py", line 931, in __init__
    super().__init__(*args, **kwargs)
  File "C:\gdrive\algorithms\deltares\HYDROLIB-core\hydrolib\core\basemodel.py", line 91, in __init__
    raise ValidationError([ErrorWrapper(e, loc=identifier)], self.__class__)
pydantic.v1.error_wrappers.ValidationError: 2 validation errors for StructureModel
structures.ini -> structure -> 0
  Type of Structure with id=LC1 and type=longCulvert is not recognized. (type=value_error)
structures.ini -> structure -> 1
  Type of Structure with id=LC2 and type=longCulvert is not recognized. (type=value_error)

the structure file

[Structure]
# This structure should mimic another type-5 link which is directly in the _net.nc file.
    id                   = LC1
    type                 = longCulvert
    numCoordinates       = 2
    xCoordinates         = 6.515339 44.636787
    yCoordinates         = 25.151608 25.727361
    zCoordinates         = -0.3 -0.3
    frictionValue        = 0.035
    frictionType         = manning
    width                = 0.4
    height               = 0.2
    valveRelativeOpening = 1

[Structure]
# This structure is a siphon-like structure with higher bl/bobs in the middle, so after some time when waterlevels are lower, flow should stop.
    id                   = LC2
    type                 = longCulvert
    numCoordinates       = 5
    xCoordinates         = 5.788061 17.666924 24.515453 32.636715 42.212532
    yCoordinates         = 43.727764 43.727764 44.212616 44.455044 44.152008
    zCoordinates         = -0.3 -0.3 1.5 1.5 -0.3
    frictionValue        = 0.035
    frictionType         = manning
    width                = 0.4
    height               = 0.2
    valveRelativeOpening = 1

Additional context
Add any other context about the problem here.

@MAfarrag MAfarrag added type: bug Something isn't working extforce external forcing file conversion labels Feb 26, 2025
@MAfarrag
Copy link
Contributor Author

@arthurvd what should I do with this ? should I ignore the file as we are not converting the structure file now ?

@arthurvd
Copy link
Member

@arthurvd what should I do with this ? should I ignore the file as we are not converting the structure file now ?

We'll mark this as a known issue, and add the type=longCulvert soon. In our testbench we've only very few of these testcases, so we can convert them by hand (by first removing the structure file, converting the remaining model, and re-adding it again).

@arthurvd arthurvd changed the title structure.ini has Unknown keywords Add longCulvert to the supported structure types Feb 26, 2025
@arthurvd arthurvd added type: feature Brand new functionality and removed type: bug Something isn't working labels Feb 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
extforce external forcing file conversion type: feature Brand new functionality
Projects
None yet
Development

No branches or pull requests

2 participants