CHORE: Update workflows to test docs examples.#713
CHORE: Update workflows to test docs examples.#713genedan wants to merge 3 commits intocasact:mainfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #713 +/- ##
=======================================
Coverage 85.12% 85.12%
=======================================
Files 85 85
Lines 4909 4909
Branches 629 629
=======================================
Hits 4179 4179
Misses 521 521
Partials 209 209
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
No I do not, I think @jbogaardt is the only one with access to manage the doc site. |
|
And sorry for going back and forth here, are we deciding to go this route? Instead of keeping the imports, or should we continue the discussion in #704? |
|
I first intended for this to just include the new worfklow, but then it wouldn't pass because there are pre-existing errors that I had to patch. Unfortunately this will create merge conflict for #714. Once we come to a decision in #704, I can update this PR, and then @EKtheSage can update his. |
|
@kennethshsu, I updated the voting chainladder example to match the format we decided upon yesterday. This PR is ready for review. |
|
I've sent an invite to @genedan to join the readthedocs admin. Kenneth, it says your email isnt found so I assume you dont have a registered userid for readthedocs. Gene let me know if the invite doesn't work for whatever reason. |
…format (casact#704) - Switch from >>> doctest style to .. testsetup::/.. testcode::/.. testoutput:: per agreed convention in casact#704 / casact#713. - Move `import chainladder as cl` into testsetup block. - Update decay example to print ldf_ so the parameter's effect is observable. - Add an attachment_age example (parameter previously had no example). - Verified with sphinx-build -b doctest: 5 tests, 0 failures.
This PR adds a workflow to run
cd docs && uv run jb build . --builder=custom --custom-builder=doctest, which runs unit tests found within docstrings.If successful, we should see a failure in the checks regarding Voting Chainladder. When running locally, doctest found an error in an example there, so I'd expect to see it here.
@kennethshsu, do you know what Python version the readthedocs is running? I can update the workflow to reflect the correct version.
Note
Low Risk
Low risk: changes are limited to CI and documentation doctest formatting, with no runtime/library logic modifications. Main risk is potential CI instability if doctest outputs vary across environments or versions.
Overview
Adds a new GitHub Actions
doctestjob that installs thedocsextras and runsjupyter-bookwith a customdoctestbuilder, so doc examples are executed in CI.Enables
sphinx.ext.doctestin the docs config and rewrites select docstring examples (e.g.,TriangleandVotingChainladder) into explicit.. testsetup::/.. testcode::blocks with captured.. testoutput::, making their printed outputs part of the test surface.Reviewed by Cursor Bugbot for commit be1125a. Bugbot is set up for automated code reviews on this repo. Configure here.