-
Notifications
You must be signed in to change notification settings - Fork 3
Use functions from PyRenew time.py in pyrenew_hew_data.py
#742
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR refactors pyrenew_hew_data.py to use utility functions from PyRenew's time.py module instead of maintaining duplicate implementations locally. This improves code maintainability by leveraging shared library functions for common date/time operations.
Key Changes:
- Replaced local
get_n_data_days(),get_end_date(), and validation logic with PyRenew'sget_n_data_days(),get_end_date(),validate_mmwr_dates(), andcreate_date_time_spine()functions - Updated parameter naming from
n_datapointston_pointsto match PyRenew's API conventions - Updated test error message pattern to match the PyRenew validation function's error message
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| pyrenew_hew/pyrenew_hew_data.py | Removed duplicate date/time utility methods (~48 lines) and replaced their usages with PyRenew imports, simplifying the codebase and ensuring consistency with PyRenew's API |
| tests/test_pyrenew_hew_data.py | Updated error message regex from "Saturdays.*MMWR epiweek" to "MMWR dates must be Saturdays" to match PyRenew's validate_mmwr_dates() error message |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #742 +/- ##
==========================================
- Coverage 26.28% 25.88% -0.41%
==========================================
Files 26 26
Lines 2427 2411 -16
==========================================
- Hits 638 624 -14
+ Misses 1789 1787 -2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
damonbayer
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think the time functions are being exposed in pyrenew.
the problem is here: Line 61 in bb18afd
why did this get pinned to "v0.1.5" and should it be unpinned? |
I think you could release |
I drafted a release "v0.1.6" @damonbayer does this look OK? |
I did one more commit to increment the version number CDCgov/PyRenew#626 and released it. Thanks! |
Changes to
pyernew_hew_data.pyto use helper functions in PyRenew'stime.pywhere possible.