Skip to content

chore(docs): resolve ruff lint and format in Friedland Ch. 7 Part 2 (#1216) - #1340

Open
priyam0k wants to merge 3 commits into
mainfrom
chore/issue-1216-friedland-ruff
Open

chore(docs): resolve ruff lint and format in Friedland Ch. 7 Part 2 (#1216)#1340
priyam0k wants to merge 3 commits into
mainfrom
chore/issue-1216-friedland-ruff

Conversation

@priyam0k

@priyam0k priyam0k commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Summary of Changes

  • Lowercased function names in Friedland Chapter 7 Part 2 to resolve N802 violations and formatted the notebook with ruff format.
  • Removed docs/friedland/chapter_7_part_2.ipynb from per-file-ignores in pyproject.toml.

Related GitHub Issue(s)

Additional Context for Reviewers

All pre-commit ruff checks pass cleanly and all notebook cells run and pass locally.

Checklist

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

Note

Low Risk
Documentation and lint/format only; no library API or runtime behavior changes beyond longer doc CI notebook timeouts.

Overview
Brings Friedland Chapter 7 Part 2 in line with ruff by renaming exhibit helpers to lowercase (ex3sht10, ex4sht1, ex4sht6, etc.) and reformatting notebook cells, then drops that notebook from pyproject.toml per-file-ignores for N802.

Docs build reliability gets a bump: notebook execution timeout rises from 30s to 180s in _config.yml and conf.py, and prep_sphinx_conf.py pre-warms the matplotlib font cache on fresh runners. conf.py also picks up quote/style reflow from regeneration; prep_sphinx_conf.py uses a looser _DOCS_EXT_DIR marker so re-runs stay idempotent.

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

@github-actions

github-actions Bot commented Sep 11, 2026

Copy link
Copy Markdown

Pyright Type Completeness

View the full pyright --verifytypes output for this commit

Project (full chainladder package, at this PR's head): 15.1% of exported symbols fully typed (208 / 1380)

Known Ambiguous Unknown Total
Project (head) 208 111 1061 1380

Other symbols referenced but not exported by chainladder: 13

Known Ambiguous Unknown Total
Other (head) 3 1 9 13

Symbols without documentation:

  • Functions without docstring: 327
  • Functions without default param: 0
  • Classes without docstring: 10

Patch (exported symbols added or changed by this PR): no exported symbol type-completeness changes detected.

@codecov

codecov Bot commented Sep 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.76%. Comparing base (6b51f64) to head (36568df).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1340   +/-   ##
=======================================
  Coverage   91.76%   91.76%           
=======================================
  Files          96       96           
  Lines        5475     5475           
  Branches      706      706           
=======================================
  Hits         5024     5024           
  Misses        327      327           
  Partials      124      124           
Flag Coverage Δ
unittests 91.76% <ø> (ø)

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

☔ View full report in Codecov by Harness.
📢 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.

@henrydingliu

Copy link
Copy Markdown
Member
image

@priyam0k
priyam0k marked this pull request as draft September 11, 2026 10:43
@priyam0k
priyam0k force-pushed the chore/issue-1216-friedland-ruff branch from a198cd8 to 29c4e96 Compare September 12, 2026 12:37
@priyam0k priyam0k changed the title chore(docs): resolve ruff lint and format in Friedland Ch. 7 & 9 (#1216) chore(docs): resolve ruff lint and format in Friedland Ch. 7 Part 2 (#1216) Sep 12, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown

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.

Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 81459bd. Configure here.

Comment thread docs/conf.py
@priyam0k
priyam0k marked this pull request as ready for review September 12, 2026 13:39
Comment thread docs/_config.yml
# See https://jupyterbook.org/content/execute.html
execute:
execute_notebooks: force
timeout: 180

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

what happens when something times out?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think that screenshot with the KeyboardInterrupt is actually what happens when a cell times out

Jupyter Book kills any cell that takes longer than 30s. On RTD's fresh runner, building the font cache took just over 30s, so it interrupted the cell and skipped the rest of the notebook.

Upping the timeout to 180s gives it a safe buffer, and pre-warming the cache in prep_sphinx_conf.py fixes the slow cold start.

@henrydingliu henrydingliu self-assigned this Sep 12, 2026
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.

2 participants