Skip to content
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

Add test for API stability for a CausalPy example in Causal Inference and Discovery in Python by Aleksander Molak #407

Merged
merged 2 commits into from
Sep 16, 2024

Conversation

arthurmello
Copy link
Contributor

@arthurmello arthurmello commented Sep 10, 2024

Closes #356

  • Saves the original dataset in causalpy/data/gt_social_media_data.csv
  • Processes data in the same way as the original example
  • Asserts that WeightedSumFitter, SyntheticControl and the results plot all run without errors

📚 Documentation preview 📚: https://causalpy--407.org.readthedocs.build/en/407/

…config

[pre-commit.ci] pre-commit autoupdate
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.

Thanks @arthurmello ! The only change that's needed is to speed up the tests by asking for fewer samples. We do this in some of the other tests, such as test_integration_pymc_example.py. So we just need to define custom sample kwargs sample_kwargs = {"tune": 20, "draws": 20, "chains": 2, "cores": 2} and pass those in when the model object is first created.

While that is a slight deviation from the original code, it doesn't represent a meaningful change, and it speeds up the tests which is important both locally and remotely.

Copy link

codecov bot commented Sep 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.40%. Comparing base (4b0fcef) to head (f7c7c05).
Report is 10 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #407      +/-   ##
==========================================
+ Coverage   94.35%   94.40%   +0.05%     
==========================================
  Files          30       31       +1     
  Lines        1967     1985      +18     
==========================================
+ Hits         1856     1874      +18     
  Misses        111      111              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@arthurmello
Copy link
Contributor Author

@drbenvincent yes, it makes sense! I have included those, let me know if anything else is needed.

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.

Looks good to me :)

Thanks for the PR @arthurmello

@drbenvincent drbenvincent merged commit c584272 into pymc-labs:main Sep 16, 2024
8 checks passed
@drbenvincent drbenvincent added the devops DevOps related label Sep 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
devops DevOps related
Projects
None yet
2 participants