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 daily_to_weekly function #478

Conversation

sbidari
Copy link
Collaborator

@sbidari sbidari commented Dec 26, 2024

No description provided.

Copy link

codecov bot commented Dec 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.56%. Comparing base (a63c4ea) to head (57a60c9).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #478      +/-   ##
==========================================
+ Coverage   96.52%   96.56%   +0.04%     
==========================================
  Files          41       41              
  Lines         949      962      +13     
==========================================
+ Hits          916      929      +13     
  Misses         33       33              
Flag Coverage Δ
unittests 96.56% <100.00%> (+0.04%) ⬆️

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

github-actions bot commented Dec 26, 2024

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

Copy link
Collaborator

@dylanhmorris dylanhmorris left a comment

Choose a reason for hiding this comment

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

Perhaps I've misread, but this appears to use ISO epiweeks (Monday start, Sunday end). Much of our work will involve USA epiweeks (Sunday start, Saturday end). That said, it looks to me as though it would not be much extra work to make this into a general daily-to-weekly function (i.e. both the start dow of the weekly aggregates and the start dow of the input timeseries are configurable).

Agree / disagree @sbidari?

pyrenew/convolve.py Outdated Show resolved Hide resolved
pyrenew/convolve.py Outdated Show resolved Hide resolved
pyrenew/convolve.py Outdated Show resolved Hide resolved
pyrenew/convolve.py Outdated Show resolved Hide resolved
@sbidari sbidari changed the title add daily_to_epiweekly function add daily_to_weekly function Dec 30, 2024
@sbidari
Copy link
Collaborator Author

sbidari commented Dec 30, 2024

Ready for re-review @dylanhmorris

@sbidari sbidari requested a review from dylanhmorris December 30, 2024 18:46
Copy link
Collaborator

@dylanhmorris dylanhmorris left a comment

Choose a reason for hiding this comment

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

A few wording suggestions. Implementation looks good! Thanks @sbidari!

pyrenew/convolve.py Outdated Show resolved Hide resolved
pyrenew/convolve.py Outdated Show resolved Hide resolved
pyrenew/convolve.py Outdated Show resolved Hide resolved
pyrenew/convolve.py Outdated Show resolved Hide resolved
pyrenew/convolve.py Outdated Show resolved Hide resolved
test/test_daily_to_weekly.py Outdated Show resolved Hide resolved
@sbidari sbidari requested a review from dylanhmorris December 30, 2024 19:52
pyrenew/convolve.py Outdated Show resolved Hide resolved
pyrenew/convolve.py Outdated Show resolved Hide resolved
Data converted to weekly values starting
with the first full week available.
"""
if input_data_first_dow < 0 or input_data_first_dow > 6:
Copy link
Collaborator

Choose a reason for hiding this comment

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

In the future we may want to enforce integer-like values more strongly or conversely expand to support arrays of different potentially, but I think this is fine for now.

@dylanhmorris dylanhmorris enabled auto-merge (squash) December 30, 2024 20:08
@dylanhmorris dylanhmorris merged commit bbaf1b9 into main Dec 30, 2024
8 checks passed
@dylanhmorris dylanhmorris deleted the 477-aggregate-daily-predicted-incident-hospitalization-to-epiweekly branch December 30, 2024 20:12
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.

Aggregate daily predicted incident hospitalization to epiweekly
2 participants