-
Notifications
You must be signed in to change notification settings - Fork 63
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
Bug Fix: Update Pandas Offsets Usage #271
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## develop #271 +/- ##
===========================================
+ Coverage 75.31% 77.28% +1.96%
===========================================
Files 29 29
Lines 3760 3693 -67
===========================================
+ Hits 2832 2854 +22
+ Misses 928 839 -89 ☔ View full report in Codecov by Sentry. |
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.
Thanks for finding this change in the datetime offsets! This all looks good to me.
Just wanted to note that we made some updates to the 07_static_yaw_misalignment.ipynb notebook in the main branch that aren't in develop yet. Since the example notebooks are changed in this PR too, we should make sure all relevant updates to the notebook are kept when we release the next version.
Thanks for pointing that out, @ejsimley, I'll merge main back into develop, and update this PR again. |
Upgrading to new-style pandas time offsets will break the usage of old-style pandas time offsets that are passed through in OpenOA's API, or used outside of the API in user's code. For example, the "freq" argument in utils.qa.daylight_savings_plots, the "offset" argument in utils.timeseries.offset_to_seconds, and possibly the "time_resolution" argument in MonteCarloAEP. To remain consistent with our semantic versioning, we should provide the users a fall-back to the old-style offsets if needed. One way this could work is to add a note about this deprecation issue to the Readme, advising users to downgrade Pandas themselves, and then add custom support for the old-style frequencies in our API (could simply translate the old strings to the new ones). Or, alternatively, just pin Pandas below the version where this breaks for the 3.x line, silence the warning, and put this PR in the 4.x release. |
@jordanperr I was able to add in some support for the "old" style of offset strings without much extra lift. The catch is that it will output a deprecation warning pushing users to adopt the "new" style. I also added a test for the method that is applied to the |
This PR addresses the underlying issue causing all CI tests to fail in current PRs. The issue stems from a change in expected datetime offsets used in Pandas. From #269:
All underlying code that relied on the previously acceptable codes have been replaced. This will inevitably lead to a minor version bump due to some changes in usage.
Closes #269