Skip to content

Conversation

@cetagostini
Copy link
Contributor

@cetagostini cetagostini commented Nov 26, 2025

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/

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.
@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@cetagostini cetagostini self-assigned this Nov 26, 2025
@codecov
Copy link

codecov bot commented Nov 26, 2025

Codecov Report

❌ Patch coverage is 98.02632% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 96.43%. Comparing base (e2ae2e8) to head (a15e17f).
⚠️ Report is 8 commits behind head on main.

Files with missing lines Patch % Lines
causalpy/pymc_models.py 93.68% 6 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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 drbenvincent marked this pull request as ready for review November 29, 2025 14:49
@drbenvincent drbenvincent linked an issue Nov 29, 2025 that may be closed by this pull request
1 task
Copy link
Collaborator

@drbenvincent drbenvincent left a 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?

@cetagostini cetagostini merged commit 20cc071 into main Nov 29, 2025
10 checks passed
@drbenvincent drbenvincent deleted the cetagostini/bsts_tech_debt_v0 branch November 30, 2025 00:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Pay off BSTS tech debt

3 participants