-
Notifications
You must be signed in to change notification settings - Fork 3
Add generic date range parsing utility to common_utils #820
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
Co-authored-by: SamuelBrand1 <[email protected]>
Co-authored-by: SamuelBrand1 <[email protected]>
Co-authored-by: SamuelBrand1 <[email protected]>
Co-authored-by: SamuelBrand1 <[email protected]>
Co-authored-by: SamuelBrand1 <[email protected]>
Co-authored-by: SamuelBrand1 <[email protected]>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## epiautogp #820 +/- ##
============================================
Coverage ? 48.64%
============================================
Files ? 36
Lines ? 3316
Branches ? 0
============================================
Hits ? 1613
Misses ? 1703
Partials ? 0
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:
|
SamuelBrand1
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.
Actually, this this was good first pass!
|
@damonbayer @dylanhmorris I've looked at this and I think the test covers the required behaviour and the code looks ok to me and not too bloat. For context, the "exclude some periods" behaviour I use for |
|
We have wanted to enable something like this for some time in the PyRenew models: #409. Perhaps we should commit some of the relevant parts (like |
|
@copilot Can you change the base target of this branch to |
@copilot pay attention to this comment when addressing the previous instruction. |
Extracted the generic date range parsing utility function from the epiautogp-specific implementation and moved it to pipelines/common_utils.py where it can be reused by other forecasting models (e.g., PyRenew models as mentioned in issue #409). The function parses comma-separated date ranges in 'start:end' format (e.g., "2024-01-15:2024-01-20,2024-03-01:2024-03-07") and returns a list of (start_date, end_date) tuples. This will enable multiple models to exclude periods with known reporting problems. The epiautogp-specific implementation will be added in a later PR. Co-authored-by: SamuelBrand1 <[email protected]>
I've moved |
|
I'm not confident in copilot refiddling this PR, so I'm closing it in favour of #824 and then go past the |
Per feedback, this PR extracts a generic date range parsing utility function to
pipelines/common_utils.pyfor reuse across multiple forecasting models. This addresses the need for date exclusion functionality mentioned in issue #409 for PyRenew models.Changes
parse_exclude_date_ranges()topipelines/common_utils.py"2024-01-15:2024-01-20,2024-03-01:2024-03-07"list[tuple[date, date]]of inclusive date rangesUsage
The function includes robust validation:
:separator)Future Use
This utility will be used in a separate PR to implement the period exclusion functionality for EpiAutoGP (related to the original issue about extra data options for
epiautogpdata conversion). The generic location incommon_utils.pyallows any forecasting model to benefit from this functionality.Original prompt
epiautogpdata conversion #763💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.