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

Datablock of type np.array is not supported in TimeSeries object #322

Closed
veenstrajelmer opened this issue Aug 19, 2022 · 1 comment
Closed

Comments

@veenstrajelmer
Copy link
Collaborator

veenstrajelmer commented Aug 19, 2022

Describe the bug
Datablock of type np.array is not supported in TimeSeries object. It is easy to convert it to a list, but I would expect the hydrolib code would also be able to do that.

To Reproduce

import numpy as np
from hydrolib.core.io.bc.models import (
    QuantityUnitPair,
    TimeInterpolation,
    TimeSeries,
)
datablock = np.random.uniform(low=-40, high=130.3, size=(10,4))
steric = TimeSeries(
    name="east2_0001",
    quantityunitpair=[QuantityUnitPair(quantity="time", unit="seconds since 2022-01-01 00:00:00 +00:00"),
                      QuantityUnitPair(quantity="waterlevel", unit="m")],
    timeinterpolation=TimeInterpolation.linear,
    datablock=datablock,#.tolist(), 
)

Expected behavior
Can the datablock.tolist() method be applied in the hydrolib code in case of dtype==np.array ?

Version info (please complete the following information):

  • OS: Windows, Anaconda, Spyder
  • Version: 0.3.0

Additional context
Pick up this issue in combination with #307 .

priscavdsluis added a commit that referenced this issue Sep 2, 2022
priscavdsluis added a commit that referenced this issue Sep 2, 2022
* #332 first draft of branches.gui

* autoformat: isort & black

* #322: Add unit tests for Branch and update error message to user.

* autoformat: isort & black

* #322: Move existing validation to Branch object and add unit test for this.

* autoformat: isort & black

* #322: Small cleanup and add docs.

* #322: Add API reference docs.

Co-authored-by: xldeltares <xldeltares@users.noreply.github.com>
Co-authored-by: priscavdsluis <priscavdsluis@users.noreply.github.com>
@arthurvd arthurvd added this to To do in HYDROLIB-core via automation Oct 10, 2022
@arthurvd arthurvd added this to the Release 0.4 milestone Oct 10, 2022
@arthurvd arthurvd modified the milestones: Release 0.4, Release 0.5 Jan 23, 2023
@veenstrajelmer
Copy link
Collaborator Author

Discussed with @arthurvd that this is not relevant anymore. Maybe converter functions will be added to hydrolib-core in the future (#307)

HYDROLIB-core automation moved this from To do to Done Mar 16, 2023
@veenstrajelmer veenstrajelmer closed this as not planned Won't fix, can't repro, duplicate, stale Mar 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
HYDROLIB-core
  
Done
Development

No branches or pull requests

2 participants