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

Add weekly_to_daily functionality, move time handling functions to their own module #483

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

dylanhmorris
Copy link
Collaborator

Note that this will introduce a breaking change (since from pyrenew.convolve import daily_to_weekly will need to become from pyrenew.time import daily_to_weekly. We could go through a deprecation cycle but I think Pyrenew is a bit young for that. @damonbayer/@sbidari lmk if you disagree.

Copy link

codecov bot commented Feb 12, 2025

Codecov Report

Attention: Patch coverage is 76.92308% with 6 lines in your changes missing coverage. Please review.

Project coverage is 96.00%. Comparing base (bbaf1b9) to head (3178cfc).

Files with missing lines Patch % Lines
pyrenew/time.py 76.92% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #483      +/-   ##
==========================================
- Coverage   96.56%   96.00%   -0.57%     
==========================================
  Files          41       42       +1     
  Lines         962      975      +13     
==========================================
+ Hits          929      936       +7     
- Misses         33       39       +6     
Flag Coverage Δ
unittests 96.00% <76.92%> (-0.57%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

Thank you for your contribution @dylanhmorris 🚀! Your github-pages is ready for download 👉 here 👈!
(The artifact expires on 2025-02-19T15:51:07Z. You can re-generate it by re-running the workflow here.)

@sbidari
Copy link
Collaborator

sbidari commented Feb 12, 2025

Why isn't the weekly_values adjusted before repeating to create daily values in weekly_to_daily?

@dylanhmorris
Copy link
Collaborator Author

Why isn't the weekly_values adjusted before repeating to create daily values in weekly_to_daily?

For weekly_to_daily, all weekly values have to be assumed complete. So the key thing is to ensure that any partial starting week is only partially tiled, which the final [offset: ] operation accomplishes. If the user wishes to trim days off the ending week, they must do so manually. I suppose we could add an output_data_last_dow, but I'm not sure whether or not it would make the API clearer. Thoughts?

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.

2 participants