Skip to content

Enforce BaseExperiment abstract methods#694

Open
drbenvincent wants to merge 4 commits intomainfrom
codex/issue-660-abc-enforcement
Open

Enforce BaseExperiment abstract methods#694
drbenvincent wants to merge 4 commits intomainfrom
codex/issue-660-abc-enforcement

Conversation

@drbenvincent
Copy link
Collaborator

Summary

  • make BaseExperiment inherit from ABC and relax abstract requirements based on supports flags
  • add explicit method stubs to experiments missing required abstract methods
  • add a test to enforce abstract-method instantiation failures

Testing

  • conda run -n CausalPy python -m pytest causalpy/tests/test_base_experiment_abc.py (fails: coverage fail-under=80 when running single test)

Closes #660

@drbenvincent drbenvincent marked this pull request as draft February 2, 2026 21:29
@read-the-docs-community
Copy link

read-the-docs-community bot commented Feb 2, 2026

Documentation build overview

📚 causalpy | 🛠️ Build #31333000 | 📁 Comparing 239273a against latest (156d3f7)


🔍 Preview build

Show files changed (23 files in total): 📝 23 modified | ➕ 0 added | ➖ 0 deleted
File Status
404.html 📝 modified
api/generated/causalpy.experiments.base.BaseExperiment.get_plot_data_bayesian.html 📝 modified
api/generated/causalpy.experiments.base.BaseExperiment.get_plot_data_ols.html 📝 modified
api/generated/causalpy.experiments.base.BaseExperiment.html 📝 modified
api/generated/causalpy.experiments.diff_in_diff.DifferenceInDifferences.get_plot_data_bayesian.html 📝 modified
api/generated/causalpy.experiments.diff_in_diff.DifferenceInDifferences.get_plot_data_ols.html 📝 modified
api/generated/causalpy.experiments.diff_in_diff.DifferenceInDifferences.html 📝 modified
api/generated/causalpy.experiments.instrumental_variable.InstrumentalVariable.get_plot_data_bayesian.html 📝 modified
api/generated/causalpy.experiments.instrumental_variable.InstrumentalVariable.get_plot_data_ols.html 📝 modified
api/generated/causalpy.experiments.instrumental_variable.InstrumentalVariable.html 📝 modified
api/generated/causalpy.experiments.inverse_propensity_weighting.InversePropensityWeighting.get_plot_data_bayesian.html 📝 modified
api/generated/causalpy.experiments.inverse_propensity_weighting.InversePropensityWeighting.get_plot_data_ols.html 📝 modified
api/generated/causalpy.experiments.inverse_propensity_weighting.InversePropensityWeighting.html 📝 modified
api/generated/causalpy.experiments.prepostnegd.PrePostNEGD.get_plot_data_bayesian.html 📝 modified
api/generated/causalpy.experiments.prepostnegd.PrePostNEGD.get_plot_data_ols.html 📝 modified
api/generated/causalpy.experiments.prepostnegd.PrePostNEGD.html 📝 modified
api/generated/causalpy.experiments.regression_discontinuity.RegressionDiscontinuity.get_plot_data_bayesian.html 📝 modified
api/generated/causalpy.experiments.regression_discontinuity.RegressionDiscontinuity.get_plot_data_ols.html 📝 modified
api/generated/causalpy.experiments.regression_discontinuity.RegressionDiscontinuity.html 📝 modified
api/generated/causalpy.experiments.regression_kink.RegressionKink.get_plot_data_bayesian.html 📝 modified
api/generated/causalpy.experiments.regression_kink.RegressionKink.get_plot_data_ols.html 📝 modified
api/generated/causalpy.experiments.regression_kink.RegressionKink.html 📝 modified
_modules/causalpy/experiments/base.html 📝 modified

@github-actions github-actions bot added the bug Something isn't working label Feb 9, 2026
@codecov
Copy link

codecov bot commented Feb 9, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.36%. Comparing base (156d3f7) to head (239273a).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #694   +/-   ##
=======================================
  Coverage   94.35%   94.36%           
=======================================
  Files          44       45    +1     
  Lines        7517     7529   +12     
  Branches      456      456           
=======================================
+ Hits         7093     7105   +12     
  Misses        262      262           
  Partials      162      162           

☔ 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.

@drbenvincent drbenvincent marked this pull request as ready for review February 9, 2026 19:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BaseExperiment abstract methods not enforced without ABC

1 participant