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

346 TimeSeries interp_time #353

Merged
merged 20 commits into from
Jun 25, 2021
Merged

Conversation

vhirtham
Copy link
Collaborator

@vhirtham vhirtham commented May 7, 2021

Changes

TimeSeries.interp_time now returns a new TimeSeries instead of an xarray.DataArray. Additionally, a warning is emitted when already interpolated data is interpolated another time.

Related Issues

Closes #346

Checks

  • updated CHANGELOG.md
  • updated tests
  • updated doc/
  • update example/tutorial notebooks
  • save interpolation counter to asdf?

@vhirtham vhirtham added the core weldx core classes and functions label May 7, 2021
@vhirtham vhirtham self-assigned this May 7, 2021
@vhirtham
Copy link
Collaborator Author

vhirtham commented May 7, 2021

The CI failures are mostly things that are already adjusted in the measurement chain PR. So I suggest we wait until this one is merged and fix the remaining errors then.

Also, I added an internal interpolation counter to emit a warning for interpolating the same data over and over again. Do we want to store the counter in a Weldx file too? Guess it would make sense.

@vhirtham vhirtham changed the title 346 ts interp time 346 TimeSeries interp_time May 7, 2021
@vhirtham vhirtham requested a review from CagtayFabry June 18, 2021 10:26
weldx/core.py Outdated Show resolved Hide resolved
weldx/core.py Outdated Show resolved Hide resolved
weldx/core.py Outdated Show resolved Hide resolved
vhirtham and others added 2 commits June 21, 2021 11:57
Co-authored-by: Cagtay Fabry <43667554+CagtayFabry@users.noreply.github.com>
@CagtayFabry
Copy link
Member

what do you think about adding a .time property to TimeSeries directly @vhirtham ? In line with LCS and similar classes

@vhirtham
Copy link
Collaborator Author

what do you think about adding a .time property to TimeSeries directly @vhirtham ? In line with LCS and similar classes

Not sure what you intend, cause the TimeSeries already has a time property (line 501)

@CagtayFabry
Copy link
Member

what do you think about adding a .time property to TimeSeries directly @vhirtham ? In line with LCS and similar classes

Not sure what you intend, cause the TimeSeries already has a time property (line 501)

exactly that, so disregard 😉
just wondering why we now need to call data_array.time here https://github.com/vhirtham/weldx/blob/3b06b74a800d2ac45b9794dfd81d49670d63f4e9/weldx/tests/test_core.py#L416-L419

@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@codecov
Copy link

codecov bot commented Jun 23, 2021

Codecov Report

Merging #353 (131d414) into master (ca354e1) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #353   +/-   ##
=======================================
  Coverage   97.43%   97.44%           
=======================================
  Files          86       86           
  Lines        5176     5196   +20     
=======================================
+ Hits         5043     5063   +20     
  Misses        133      133           
Impacted Files Coverage Δ
weldx/core.py 99.47% <100.00%> (+0.06%) ⬆️
weldx/util.py 98.75% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ca354e1...131d414. Read the comment docs.

@vhirtham vhirtham marked this pull request as ready for review June 23, 2021 14:07
@vhirtham vhirtham requested a review from CagtayFabry June 23, 2021 14:08
@vhirtham
Copy link
Collaborator Author

what do you think about adding a .time property to TimeSeries directly @vhirtham ? In line with LCS and similar classes

Not sure what you intend, cause the TimeSeries already has a time property (line 501)

exactly that, so disregard 😉
just wondering why we now need to call data_array.time here https://github.com/vhirtham/weldx/blob/3b06b74a800d2ac45b9794dfd81d49670d63f4e9/weldx/tests/test_core.py#L416-L419

The reason was that .time returns None if the internal time data has only one value, e.g the TS is constant. But we checked is the stored value matches the passed one. Don't know if that made sense, but I modified the test in favor of using .time

Copy link
Member

@CagtayFabry CagtayFabry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@vhirtham vhirtham merged commit 1999c8d into BAMWelDX:master Jun 25, 2021
@vhirtham vhirtham deleted the 346_TS_interp_time branch June 25, 2021 07:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core weldx core classes and functions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TimeSeries.interp_time should return a new TimeSeries
2 participants