Add group-level outputs to PrePostNEGD.summary()#733
Add group-level outputs to PrePostNEGD.summary()#733drbenvincent wants to merge 5 commits intomainfrom
Conversation
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
Documentation build overview
Show files changed (3 files in total): 📝 3 modified | ➕ 0 added | ➖ 0 deleted
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #733 +/- ##
==========================================
+ Coverage 93.48% 93.49% +0.01%
==========================================
Files 75 75
Lines 11272 11291 +19
Branches 658 662 +4
==========================================
+ Hits 10538 10557 +19
Misses 544 544
Partials 190 190 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
d4af2f2 to
ccc25fb
Compare
Add experiment-specific summary statistics for PrePostNEGD by printing group-level sample sizes and pre/post means, and cover the new output in integration tests and the ANCOVA docs notebook. Closes #727 Co-authored-by: Cursor <cursoragent@cursor.com>
Execute the `round_to` path in `PrePostNEGD._group_level_summary_stats()` so Codecov patch coverage includes the new group-level summary logic. Co-authored-by: Cursor <cursoragent@cursor.com>
ccc25fb to
da3abb5
Compare
|
bugbot run |
PR SummaryLow Risk Overview The Written by Cursor Bugbot for commit ad14767. This will update automatically on new commits. Configure here. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
| if round_to is not None: | ||
| summary_df[["pre_mean", "post_mean"]] = summary_df[ | ||
| ["pre_mean", "post_mean"] | ||
| ].round(round_to) |
There was a problem hiding this comment.
Inconsistent rounding semantics within summary() output
Medium Severity
_group_level_summary_stats uses DataFrame.round(round_to) which interprets round_to as decimal places, while _causal_impact_summary_stat and print_coefficients use round_num() which interprets round_to as significant figures. When summary(round_to=2) is called, group-level means get rounded to 2 decimal places (e.g., 3.14) but the causal impact and coefficients get rounded to 2 significant figures (e.g., 3.1). This makes the single round_to parameter behave inconsistently within the same output.
Additional Locations (1)
There was a problem hiding this comment.
Good catch — this was indeed inconsistent. Fixed in 1fb0a82: _group_level_summary_stats now uses round_num() (significant figures) element-wise via .map(), matching the behavior of _causal_impact_summary_stat and print_coefficients. The integration test assertions were updated accordingly.
…oup-level stats _group_level_summary_stats was using DataFrame.round() (decimal places) while the rest of summary() uses round_num() (significant figures). This made the single round_to parameter behave inconsistently. Made-with: Cursor


Summary
PrePostNEGD.summary()with group-leveln,pre_mean, andpost_meanancova_pymc.ipynbso docs show updated summary outputTest plan
conda run -n CausalPy pytest causalpy/tests/test_integration_pymc_examples.py -k test_ancova -v --no-covconda run -n CausalPy pre-commit run --all-filesdocs/source/notebooks/ancova_pymc.ipynbCloses #727
Made with Cursor