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

Fix/nan in resample #1350

Merged
merged 8 commits into from
Nov 15, 2022
Merged

Fix/nan in resample #1350

merged 8 commits into from
Nov 15, 2022

Conversation

madtoinou
Copy link
Collaborator

Fixes #1237.

Summary

Added kwargs to TimeSeries.resample to be able to pass arguments to the xarray.resample method and give the possibility to the user to shift the start of the resampling to avoid getting nan at the beginning of the resampled TimeSeries.

Other Information

Write an example in the docstring to cover the most likely usage, it might be too long...

@codecov-commenter
Copy link

codecov-commenter commented Nov 11, 2022

Codecov Report

Base: 93.88% // Head: 93.88% // No change to project coverage 👍

Coverage data is based on head (6384495) compared to base (8b457be).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1350   +/-   ##
=======================================
  Coverage   93.88%   93.88%           
=======================================
  Files          78       78           
  Lines        8508     8508           
=======================================
  Hits         7988     7988           
  Misses        520      520           
Impacted Files Coverage Δ
darts/timeseries.py 92.34% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Contributor

@hrzn hrzn left a comment

Choose a reason for hiding this comment

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

Looks great :) just got a minor suggestion on link formatting.

darts/timeseries.py Outdated Show resolved Hide resolved
to start the resampling and avoid nan at the first value of the resampled TimeSeries
(https://docs.xarray.dev/en/stable/generated/xarray.DataArray.resample.html)

Examples
Copy link
Contributor

Choose a reason for hiding this comment

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

I love this, thanks :)

madtoinou and others added 3 commits November 13, 2022 20:55
rephrasing of the docstring using hyperlink

Co-authored-by: Julien Herzen <julien@unit8.co>
@madtoinou madtoinou merged commit 4dc4930 into master Nov 15, 2022
@madtoinou madtoinou deleted the fix/nan-in-resample branch March 12, 2023 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] when resample a TS, first sample is nan in some situations.
3 participants