-
Notifications
You must be signed in to change notification settings - Fork 88
Refactor PyMC time series models to use xarray API #577
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
Unified the API for BayesianBasisExpansionTimeSeries and StateSpaceTimeSeries to accept xarray.DataArray inputs for X and y, with coordinates for datetime and treated units. Removed legacy numpy/datetime handling and updated internal conversion logic. Adjusted InterruptedTimeSeries and tests to use the new API, ensuring consistent handling of exogenous regressors and time indices. Improved error handling and warnings for coordinate mismatches and prediction inputs.
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #577 +/- ##
==========================================
+ Coverage 92.60% 96.43% +3.83%
==========================================
Files 34 35 +1
Lines 5354 5446 +92
==========================================
+ Hits 4958 5252 +294
+ Misses 396 194 -202 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Removed the _convert_timeseries_data helper and refactored BayesianBasisExpansionTimeSeries and StateSpaceTimeSeries to extract datetime and exogenous variable information directly from xarray DataArray coordinates. This improves API consistency, reduces reliance on external coords dicts, and ensures proper validation of input data. Updated test to use datetime values in obs_ind coordinate for compatibility with the new API.
drbenvincent
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.
Could be worth seeing if there is anything in #570 that's not dealt with. But from what I can tell most of it is?
Unified the API for BayesianBasisExpansionTimeSeries and StateSpaceTimeSeries to accept xarray.DataArray inputs for X and y, with coordinates for datetime and treated units. Removed legacy numpy/datetime handling and updated internal conversion logic. Adjusted InterruptedTimeSeries and tests to use the new API, ensuring consistent handling of exogenous regressors and time indices. Improved error handling and warnings for coordinate mismatches and prediction inputs.
Related to #570
📚 Documentation preview 📚: https://causalpy--577.org.readthedocs.build/en/577/