docs: fix lowercase option names after options refactor (#889)#895
docs: fix lowercase option names after options refactor (#889)#895SaguaroDev wants to merge 164 commits into
Conversation
playing around with rst
adding the rst to toc
* Improved docstring and added examples * Added the link ratios * docs: add doctest examples for correlation classes Adds Sphinx doctest Examples sections to DevelopmentCorrelation and ValuationCorrelation. Each example opens with the Mack chain-ladder assumption being tested, prints the full decision signal (statistic, confidence band, and boolean) rather than a single boolean, and ties the result back to the chain-ladder workflow. Refs casact#704 * docs: add BootstrapODPSample doctest examples Adds Sphinx doctest Examples section to the BootstrapODPSample class showing basic fit (resampled_triangles_.shape and scale_), downstream stochastic IBNR via Chainladder, and the effect of drop_high on scale_. Uses random_state=42 and n_sims=100 for deterministic, fast output. Refs casact#704 * docs: reframe drop_high example as sensitivity check Rewords the paragraph introducing the drop_high=True example to describe it as a leave-one-out sensitivity check on the column maxima rather than outlier removal, since drop_high mechanically removes the column max without any outlier test. Addresses review feedback on casact#836. * docs: move per-diagonal vs total mode note between testcode blocks Per @henrydingliu review on casact#844: opening paragraph now scoped to the calendar-effect concept; the per-diagonal vs whole-triangle distinction is introduced as a transition between the two testcode blocks. Refs casact#704 * docs: add README documenting docs build sources and outputs (refs casact#845) * Added the transformed link ratio triangle using fit_transform to examples * Removed the multiple testouputs * docs: address review feedback on docs README (refs casact#845) - Drop the jb build internals + duplicate warnings note (kennethshsu) - Rename 'tutorial notebooks' to 'onboarding and Quickstart notebooks' (kennethshsu) - Drop the 'What to edit for which part of the site' table and 'Known issues' section as redundant with the Source files table and casact#841 (kennethshsu) * [REFACTOR]: Remove repetitive code. Remove dead Python 3.8 code. Add missing unit tests. * [FIX]: Limit test to only those values meant to be changed. Use realistic values for changed options. * [DOCS]: Finish updating Options docstring. * [FIX]: Fix ending state of test. * [FIX]: Reset backend after sparse-only run. * [REFACTOR] Create template fixture for sample data sets. * [Fix]: Remove duplicate fixture. * [REFACTOR]: Move datetime defaults out of Options. Add validation to option getters and setters. Deprecate cl.array_backend() and cl.auto_sparse() * FIX: Apply Bugbot fix. * FIX: Apply Bugbot fix. * FIX: Apply Bugbot fix. * DOCS: Add docstring, clean up test. * DOCS: Update docstring. * Friedland Chapter 6 and half of Chapter 7 (casact#837) first batch of deliverables for friedland reconstruction * Delete docs/library/generated/chainladder.Development.rst --------- Co-authored-by: Kenneth Hsu <kennethshsu@gmail.com> Co-authored-by: priyam0k <87162535+priyam0k@users.noreply.github.com> Co-authored-by: Gene Dan <genedan@gmail.com>
The options refactor added _validate_option(), which checks the option
name against the uppercase attribute keys (ARRAY_BACKEND, AUTO_SPARSE,
ARRAY_PRIORITY, ULT_VAL). Two code cells in the Triangle user guide still
passed the old lowercase names, so they raised:
ValueError: Invalid option(s): array_backend. Must be one of
['ARRAY_BACKEND', 'AUTO_SPARSE', 'ARRAY_PRIORITY', 'ULT_VAL'].
Updated set_option('array_backend', ...) -> 'ARRAY_BACKEND' and
set_option('auto_sparse', ...) -> 'AUTO_SPARSE' to match the new API.
Closes casact#889.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## experimental #895 +/- ##
=============================================
Coverage 87.04% 87.04%
=============================================
Files 86 86
Lines 4986 4986
Branches 646 646
=============================================
Hits 4340 4340
Misses 456 456
Partials 190 190
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:
|
|
The red check here is the The #897 fixes that cell. It targets |
|
thanks for pushing doc changes through experimental first. dumb question. why does this seemingly similar valueerror on main does not trigger a doctest fail? given our desire to keep PRs incremental, i'd like to avoid piling up too many changes on experimental, which is currently sitting at a file diff count of 50 already. I will try to get experimental merged ASAP. but may take a bit before we merge this one. |
|
The lowercase MyST-NB executes every notebook ( The build continues past the warning and the job stays green. The error is real, demoted to a warning, dumped to
Mechanism: a notebook cell raising an exception is a warning, build stays green. A kernel/process crash kills the build, job goes red. |
|
@SaguaroDev can you turn this into a draft again? |
Closes #889.
The options refactor on
experimentaladdedOptions._validate_option(), which checks the option name against the uppercase attribute keys (ARRAY_BACKEND,AUTO_SPARSE,ARRAY_PRIORITY,ULT_VAL). Two code cells indocs/user_guide/triangle.ipynb(the "Other Parameters" / Backends section linked in the issue) still passed the old lowercase names, so they now raise:Fix:
cl.options.set_option('array_backend', 'cupy')->'ARRAY_BACKEND'cl.options.set_option('auto_sparse', False)->'AUTO_SPARSE'I grepped the whole
docs/tree forcl.options.*_option(calls — these two were the only stale ones;methods.ipynbalready uses the correct uppercase'ULT_VAL'. Notebook JSON validates after the edit.Targeting
experimentalsince that's where the refactor and the rendered docs in the issue live.Note
Low Risk
Changes are documentation, docstrings, and link generation only; the only functional user-facing fix is correct option keys in a notebook example.
Overview
Updates documentation so it matches the post-refactor options API:
triangle.ipynbnow callscl.options.set_optionwithARRAY_BACKENDandAUTO_SPARSEinstead of the removed lowercase names that triggerValueErrorunderOptions._validate_option().Beyond that fix, the PR is largely docs build and presentation: Sphinx autosummary templates under
docs/_templates/,numpydoc_show_class_members: False, and:template:names without.rstinapi.md; checked-in stubs underdocs/library/generated/are cleared so pages regenerate; linkcode handles properties and non-introspectable objects; user guide cards swapglue:figures for static images; Mack examples use grid cards;.gitignoreaddsdocs/library/generated/. Minor docstring cleanups inchainladder(no behavior change). One bibliography URL is updated.Reviewed by Cursor Bugbot for commit 3efc988. Bugbot is set up for automated code reviews on this repo. Configure here.