Add links to object source code in API Reference section#710
Add links to object source code in API Reference section#710genedan merged 9 commits intocasact:mainfrom
Conversation
…. Used to link documentation to source code.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #710 +/- ##
=======================================
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:
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit d362fb9. Configure here.
|
I guess now you'll see all the struggles I had trying to get bugbot to clear this one. Feel free to squash all the commits. |
|
hahaha you are doing great, it would've taken me muchhhh longerrrrr.... Let's hope everything shows up correctly on the doc site. :) |

Closes #709. This PR includes:
This is adapted from the Pandas' implementation:
https://github.com/pandas-dev/pandas/blob/ab90747e3dae0e69b1bdbf083820b8075689b34b/doc/source/conf.py#L646
I removed many of the error-handling blocks since at the moment, we just don't know what errors might occur and I don't want to include more than what we need. We can add them back if we encounter any problems.
Reviewing this might be a bit tricky since it's not part of the package API. My IDE debugger wasn't working properly so the way I tried to figure out what the function was doing was by feeding it the arguments
Which outputs:
https://github.com/casact/chainladder-python/blob/master/chainladder/methods/benktander.py#L8-L129
Note
Low Risk
Low risk: changes are isolated to documentation build tooling and pytest configuration, with no impact on the library runtime behavior. Main risk is broken doc builds if
linkcode_resolvecannot locate sources in some environments.Overview
Adds Sphinx
linkcodesupport to the Jupyter Book docs so API reference items can link directly to their GitHub source lines.This introduces a local Sphinx extension (
docs/_ext/ext_linkcode.py) that implementslinkcode_resolveby importing the target object, locating its source file/line range viainspect, and constructing a GitHub URL, plus a small unit test for the generated URL format. Pytest is configured inpyproject.tomlto discover tests underdocs/_ext.Reviewed by Cursor Bugbot for commit 4db19e2. Bugbot is set up for automated code reviews on this repo. Configure here.