Skip to content

docs: add ClarkLDF doctest examples#802

Open
EKtheSage wants to merge 2 commits into
casact:mainfrom
EKtheSage:docs/704-clarkldf-doctest-example
Open

docs: add ClarkLDF doctest examples#802
EKtheSage wants to merge 2 commits into
casact:mainfrom
EKtheSage:docs/704-clarkldf-doctest-example

Conversation

@EKtheSage
Copy link
Copy Markdown
Contributor

@EKtheSage EKtheSage commented May 16, 2026

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 ClarkLDF docstring covering (1) comparing loglogistic vs weibull growth curves, (2) using sample_weight to trigger the Cape Cod method and expose elr_, and (3) fitting with groupby to 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.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 16, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.23%. Comparing base (72b270c) to head (9fc573e).

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           
Flag Coverage Δ
unittests 86.23% <ø> (ø)

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.

@henrydingliu
Copy link
Copy Markdown
Collaborator

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.

@EKtheSage EKtheSage force-pushed the docs/704-clarkldf-doctest-example branch from e6eee62 to 9fc573e Compare May 17, 2026 04:20
1.917
1.912

Provide exposure when the goal is a Cape Cod fit rather than a pure LDF
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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::

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

too close to be a worthy choice of an example

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