-
Notifications
You must be signed in to change notification settings - Fork 5
Fix conversion to rolling compatible date time for some frequencies #59
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 conversion to rolling compatible date time for some frequencies #59
Conversation
…QS and QE, Y in some pandas versions)
Marsobad
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.
Tested and LGTM for quarterly and yearly data!
Thanks for the fix, I'll let you decide if it's worth fixing business days as well
| test | state | comment |
|---|---|---|
| quarterly data | ✅ | |
| semi annual | ✅ | |
| yearly data | ✅ | |
| business days | ❌ | let’s confirm we can extrapolate 1 business day = 7/5 calendar day |
| elif time_unit == 'quarters' or time_unit.startswith("Q"): | ||
| return 91 * time_step, 'days' | ||
| # There is no half year frequency, those are inferred as two quarters instead in infer_frequency() | ||
| elif time_unit == 'years' or time_unit.startswith("Y") or time_unit.startswith("A"): |
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.
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.
How did you manage to business days as your infered frequency ? :-D putting monday to friday repeatedly in the dataset ?
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 agree with the proposition otherwise, i'm just surprised it occured 😂
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 used the resampling recipe to have a frequency of 1 business day => https://staging-design.qa.managedinstances.dkucloud-dev.com/projects/MARINETIMESEROES/recipes/compute_business_days/
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'm having a go at this change, and in fact I don't think we should proceed with 7/5 days - the way the plugin works, if you window for example over 4 days with a business days dataset, we will in the end window over ceil(4 * 5/7) = 3 days.
Considering the user may not even realize we inferred business days in the first place, this seems very unintuitive, and I think I'd rather raise a clean error, WDYT ?
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.
yes, I agree!
Marsobad
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.
LGTM

QS and QE were missing, Y in some pandas versions is an alternative to A
Repro project :
DKU_TUT_VISUALIZATION_11.zip
The repro project uses a python recipe to generate data, here are various date arrays useful for testing cases :