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

Not all valid TimeSeries objects can be serialized #671

Closed
vhirtham opened this issue Dec 17, 2021 · 1 comment · Fixed by #677
Closed

Not all valid TimeSeries objects can be serialized #671

vhirtham opened this issue Dec 17, 2021 · 1 comment · Fixed by #677
Labels
ASDF everything ASDF related (python + schemas) bug Something isn't working core weldx core classes and functions validation custom ASDF validators
Milestone

Comments

@vhirtham
Copy link
Collaborator

I am currently lacking the time to create a minimal reproducible example, but it seems like absolute times can not be serialized (correctly) with the current schema definition. You can see the problem in the file CSM_Multi_Pass_example_old in my scratch directory on the jupyter server. Just go to the cell that defines the function get_bead_data and change the lines

        curr_dat = w["UI"].U_HKS1
        curr = TimeSeries(Q_(curr_dat.data, "A"), Time(curr_dat.time).as_timedelta())

        volt_dat = w["UI"].I_HKS1
        volt = TimeSeries(Q_(volt_dat.data, "V"), Time(volt_dat.time).as_timedelta())

to

        curr_dat = w["UI"].U_HKS1
        curr = TimeSeries(Q_(curr_dat.data, "A"), curr_dat.time)

        volt_dat = w["UI"].I_HKS1
        volt = TimeSeries(Q_(volt_dat.data, "V"), volt_dat.time)

and run everything again from this cell on.

You will get a validation error during the serialization.

@vhirtham vhirtham added ASDF everything ASDF related (python + schemas) validation custom ASDF validators core weldx core classes and functions labels Dec 17, 2021
@CagtayFabry
Copy link
Member

CagtayFabry commented Dec 17, 2021

I guess it is the same error as this snippet:

import pandas as pd

from weldx import Q_, Time, TimeSeries, WeldxFile

data = Q_([1, 2, 3, 4], "m")
t = pd.date_range(start="2020-01-01", freq="1D", periods=4)
ts = TimeSeries(data, t)

WeldxFile(tree={"ts": ts}, mode="rw")

@CagtayFabry CagtayFabry added the bug Something isn't working label Dec 17, 2021
@CagtayFabry CagtayFabry added this to the 0.6.0 milestone Jan 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ASDF everything ASDF related (python + schemas) bug Something isn't working core weldx core classes and functions validation custom ASDF validators
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants