Skip to content

#789 doctest to codecov#906

Open
kennethshsu wants to merge 11 commits into
mainfrom
#789_doctest_to_codecov
Open

#789 doctest to codecov#906
kennethshsu wants to merge 11 commits into
mainfrom
#789_doctest_to_codecov

Conversation

@kennethshsu
Copy link
Copy Markdown
Collaborator

@kennethshsu kennethshsu commented Jun 2, 2026

Summary of Changes

Added doctest's result to codecov

Related GitHub Issue(s)

Closes #789

Additional Context for Reviewers

In addition to the above, I also added docs/library/generated/ to .gitignore to silence the untracked files that were generated, but also to untracked all generated files properly.

  • I passed tests locally for both code (uv run pytest) and documentation changes (uv run jb build docs --builder=custom --custom-builder=doctest)

Note

Low Risk
Changes are limited to CI, coverage reporting, and dependency lock metadata with no production runtime behavior changes.

Overview
CI now collects doctest coverage and uploads it to Codecov: the doctest job runs the Jupyter Book doctest build under coverage run (separate COVERAGE_FILE), emits coverage-doctest.xml, and adds a Codecov upload step. The main unit-test matrix installs --extra docs alongside test extras so doc-related deps align with that workflow.

Housekeeping adds coverage-doctest.xml to .gitignore and refreshes uv.lock (drops a direct numba dependency on the package, tightens the declared numpy constraint to >=2.0).

Reviewed by Cursor Bugbot for commit dbc9b0e. Bugbot is set up for automated code reviews on this repo. Configure here.

@kennethshsu kennethshsu marked this pull request as draft June 2, 2026 22:46
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 2ea3c64. Configure here.

Comment thread .github/workflows/pytest.yml Outdated
@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 2, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.12%. Comparing base (c2afe11) to head (dbc9b0e).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #906      +/-   ##
==========================================
+ Coverage   86.92%   88.12%   +1.19%     
==========================================
  Files          87       87              
  Lines        4942     4942              
  Branches      625      625              
==========================================
+ Hits         4296     4355      +59     
+ Misses        456      445      -11     
+ Partials      190      142      -48     
Flag Coverage Δ
unittests 88.12% <ø> (+1.19%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@kennethshsu kennethshsu marked this pull request as ready for review June 2, 2026 23:43
@kennethshsu
Copy link
Copy Markdown
Collaborator Author

This is cool, we got +1.19% from doctests coverage.

@kennethshsu kennethshsu self-assigned this Jun 3, 2026
@kennethshsu
Copy link
Copy Markdown
Collaborator Author

A bit more info where the increase is from:

2 lines covered by doctests not already covered by pytests:

File Line What
chainladder/tails/constant.py 150 TailConstant.fit branch when attachment_age is set
chainladder/core/pandas.py 327 .T property on the pandas wrapper (used by cdf_.T in chapter 7)

Docs-only; no runtime, config, or public API changes.

Clean-up
Deletes the 36 .rst stub files under docs/library/generated/.
Adds docs/library/generated/ to .gitignore, mirroring the existing docs/modules/generated/ entry one line above.
These files are emitted by sphinx.ext.autosummary on every docs build (autosummary_generate = True in docs/conf.py, driven by the eight :toctree: generated/ directives in docs/library/api.md), so committing them is redundant and the committed copies drift out of sync with what Sphinx actually produces.
Adds custom sphinx.ext.autosummary templates under docs/_templates/autosummary/: class.rst, class_inherited.rst, function.rst.
API class pages now list own methods inline, and inherited methods in a summary table (via Jinja logic in the templates)
Fixes the :template: names in docs/library/api.md to drop .rst (:template: class.rst → :template: class).
Sets numpydoc_show_class_members = False and templates_path = ['_templates'] in docs/_config.yml (and the generated docs/conf.py).
Guards docs/_ext/linkcode.py against property objects so inline members don't crash the build.
properties since removed. will keep this redundancy in place
Misc docstring bug fixes, from doctest warnings
@kennethshsu
Copy link
Copy Markdown
Collaborator Author

@henrydingliu did you mean to push to this branch?

@kennethshsu
Copy link
Copy Markdown
Collaborator Author

Ahh I think I see you basically pulled from main.

@kennethshsu
Copy link
Copy Markdown
Collaborator Author

@genedan you'll need to review this one now lol...

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.

Incorporate doctest to codecov

3 participants