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

CrossDefModel validation should not require any friction specification #205

Closed
arthurvd opened this issue Jan 29, 2022 · 0 comments · Fixed by #206
Closed

CrossDefModel validation should not require any friction specification #205

arthurvd opened this issue Jan 29, 2022 · 0 comments · Fixed by #206
Assignees
Labels
type: bug Something isn't working
Milestone

Comments

@arthurvd
Copy link
Member

Describe the bug
Initially reported by @LisaWeijers in #199. When reading a cross section definition that has not any friction specification, the validation currently fails. This is wrong, because D-HYDRO always has default values for the frictionId(s).

To Reproduce
Steps to reproduce the behavior:

  1. Take example file crsdef.ini.txt (rename to .ini)
  2. Load the file using:
from hydrolib.core.io.crosssection.models import CrossDefModel
crossdef_new = CrossDefModel(modeldir / "crsdef.ini")
  1. See error
Exception has occurred: ValidationError
796 validation errors for CrossDefModel
crsdef.ini -> definition -> 1389 -> KBR-1468 -> __root__
  Cross section is missing any friction specification. (type=value_error)

Expected behavior
Validation error should not occur, empty frictionId/Type/Value is allowed.

Version info (please complete the following information):

  • OS: Windows (N/A)
  • Version: 0.2.0
@arthurvd arthurvd added the type: bug Something isn't working label Jan 29, 2022
@arthurvd arthurvd added this to the 0.2.1 milestone Jan 29, 2022
@arthurvd arthurvd self-assigned this Jan 29, 2022
arthurvd added a commit that referenced this issue Mar 11, 2022
fix(parser): allow empty friction specification in all crossdef types.

Fixes issue #205.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant