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

Providing incorrect file to any *Model returns an empty object instead of a crash #502

Open
veenstrajelmer opened this issue Apr 3, 2023 · 1 comment
Labels
domain: validation type: enhancement Improvements to existing functionality

Comments

@veenstrajelmer
Copy link
Collaborator

veenstrajelmer commented Apr 3, 2023

Describe the bug
Providing an incorrect file to any *Model class returns an empty object, while it would be clearer if an exception is raised.

To Reproduce
In the below example, the incorrect classes are called for reading this arbitrary file that should be read with hcdfm.XYNModel(). No warning/error is given, but instead an empty ObservationPointModel/ExtModel object is returned.

import hydrolib.core.dflowfm as hcdfm
file_xyn = 'obspoints_obs.xyn' #any file
data_xyn1 = hcdfm.ObservationPointModel(file_xyn)
data_xyn1 = hcdfm.ExtModel(file_xyn)

Version info (please complete the following information):

  • OS: Windows and Spyder
  • Version hydrolib-core from main branch
@priscavdsluis
Copy link
Contributor

priscavdsluis commented Apr 9, 2024

Might resolve #531 as well

@priscavdsluis priscavdsluis added type: enhancement Improvements to existing functionality domain: validation labels Apr 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain: validation type: enhancement Improvements to existing functionality
Projects
None yet
Development

No branches or pull requests

2 participants