docs: add ClarkLDF doctest examples#802
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #802 +/- ##
=======================================
Coverage 86.23% 86.23%
=======================================
Files 86 86
Lines 4947 4947
Branches 643 643
=======================================
Hits 4266 4266
Misses 484 484
Partials 197 197
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:
|
|
i went back and read a few pages from the pandas doc. a lot of them starts with a description of what a user is looking to accomplish, then goes through the details. but if we take the most curt example docstring I found on pandas, which is the xs function, the basic flow is still "user goal" -> "code implementation", rather than "in depth description of a parameter" -> "code implementation". could we do something similar with our examples? so instead of explaining the parameter, describe an issue then offer the parameter as the solution. |
e6eee62 to
9fc573e
Compare
| 1.917 | ||
| 1.912 | ||
|
|
||
| Provide exposure when the goal is a Cape Cod fit rather than a pure LDF |
There was a problem hiding this comment.
awkward phrasing. the intentionality of the user is to use cape cod. to use cape cod, the user can pass in a weight vector without additional parameters in the clarkldf transformer.
|
|
||
| .. testoutput:: | ||
|
|
||
| (6, 1) |
There was a problem hiding this comment.
the example text makes a claim about individual triangles being too sparse to fit. the actual code doesn't really make that apparent, or even show the results at all
| print(float(np.round(m_wei.ldf_.values[0, 0, 0, 0], 3))) | ||
|
|
||
| .. testoutput:: | ||
|
|
There was a problem hiding this comment.
too close to be a worthy choice of an example
Summary: Add focused ClarkLDF Sphinx doctest examples and make the numeric comparison robust to small platform/dependency drift by rounding the displayed LDF values. Split from the larger #786 work and intentionally excludes .github/workflows/sync-main-to-docs.yml. Refs #704
Note
Low Risk
Low risk: changes are limited to documentation/doctest additions and do not modify model logic or data handling.
Overview
Adds Sphinx doctest Examples to the
ClarkLDFdocstring covering (1) comparingloglogisticvsweibullgrowth curves, (2) usingsample_weightto trigger the Cape Cod method and exposeelr_, and (3) fitting withgroupbyto pool sparse segments.The doctests round printed numeric outputs to reduce platform/dependency drift in rendered docs and CI doctest runs.
Reviewed by Cursor Bugbot for commit 9fc573e. Bugbot is set up for automated code reviews on this repo. Configure here.