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

xyz file with initial whitespace on lines is not correctly parsed by XYZmodel #415

Closed
veenstrajelmer opened this issue Nov 11, 2022 · 0 comments · Fixed by #458
Closed
Assignees
Labels
type: bug Something isn't working
Milestone

Comments

@veenstrajelmer
Copy link
Collaborator

Describe the bug
Initial whitespaces on each line in an xyz-file cause validation error:

   37115.2500000  419886.6875000     500.0000000

Reading a file like this, results in an error:

diffusivity_rivzee_v6.xyz -> points -> 1168853 -> x: y:37115.2500000 z:419886.6875000 -> x
  value is not a valid float (type=type_error.float)

x column is seen as y column etc.

To Reproduce

from pathlib import Path
try: #0.3.1 release
    from hydrolib.core.io.xyz.models import XYZModel
except: #main branch and next release #TODO: move to easy imports after https://github.com/Deltares/HYDROLIB-core/issues/410
    from hydrolib.core.io.dflowfm.xyz.models import XYZModel
#file_xyz = r'p:\11205258-006-kpp2020_rmm-g6\C_Work\08_RMM_FMmodel\geometry_j19_NL_6-v2\rmm_vzm_v1p1_initial_water_level.xyz'
file_xyz = r'p:\11206813-006-kpp2021_rmm-2d\C_Work\31_RMM_FMmodel\general\diffusivity_rivzee_v6.xyz'
data_xyz = XYZModel(Path(file_xyz))

Version info (please complete the following information):

  • OS: Windows and Spyder
  • Version hydrolib main branch
@veenstrajelmer veenstrajelmer changed the title xyz file is not correctly parsed by XYZmodel xyz file with initial whitespace on lines is not correctly parsed by XYZmodel Nov 11, 2022
@arthurvd arthurvd added this to To do in HYDROLIB-core via automation Mar 7, 2023
@arthurvd arthurvd added the type: bug Something isn't working label Mar 7, 2023
@arthurvd arthurvd added this to the Release 0.5 milestone Mar 7, 2023
@arthurvd arthurvd moved this from To do to In progress in HYDROLIB-core Mar 8, 2023
@arthurvd arthurvd moved this from In progress to Ready to review in HYDROLIB-core Mar 10, 2023
@tim-vd-aardweg tim-vd-aardweg moved this from Ready to review to Review in progress in HYDROLIB-core Mar 13, 2023
@tim-vd-aardweg tim-vd-aardweg self-assigned this Mar 13, 2023
@tim-vd-aardweg tim-vd-aardweg moved this from Review in progress to Test in HYDROLIB-core Mar 13, 2023
@tim-vd-aardweg tim-vd-aardweg moved this from Test to Review in progress in HYDROLIB-core Mar 13, 2023
@tim-vd-aardweg tim-vd-aardweg moved this from Review in progress to Test in HYDROLIB-core Mar 13, 2023
HYDROLIB-core automation moved this from Test to Done Mar 13, 2023
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
HYDROLIB-core
  
Done
Development

Successfully merging a pull request may close this issue.

3 participants