test ruff - #1201
Conversation
setting max sparse version
) The options refactor added Options._validate_option(), which checks names against the uppercase attribute keys. The Backends cell in triangle.ipynb still passed 'auto_sparse' and raised ValueError. (ARRAY_BACKEND was already corrected on experimental.) Closes #889.
Add Triangle constructor examples and expand _split_ult docstring for round-trip and direct import via options.ULT_VAL. Add test_create_triangle_with_ultimates. Closes #523. Co-authored-by: Cursor <cursoragent@cursor.com>
The options refactor made set_option validate names against uppercase keys. After #895 corrected 'auto_sparse' to 'AUTO_SPARSE', the call actually succeeds and leaves AUTO_SPARSE=False set globally for the rest of the notebook. Downstream the prism timeit cells reload the sample with no explicit backend, so they loaded dense and OOM-killed the doctest kernel (surfacing as the runner shutdown/cancel on Doctest 3.12). Previously the lowercase name raised ValueError, so the option never actually changed. Reset AUTO_SPARSE immediately after the demo, mirroring the cupy cell's reset_option(), so the sample loads sparse and the build completes.
docs: fix lowercase option names after options refactor (#889)
The Ultimates section sets ULT_VAL to 2050 to demonstrate the option but
never restores it. The mutated global then propagates to later cells, and
the Complete Triangles run-off cell raises:
ValueError: Could not convert object to NumPy timedelta
Add a reset_option('ULT_VAL') cell immediately after the demo so the global
returns to its default and downstream cells execute cleanly.
docs: reset ULT_VAL after demo in methods notebook
The new Pandas3 doctest job on experimental surfaced two notebook import/exec errors that do not appear in the pandas 2 build: - user_guide/development.ipynb raised TypeError: Cannot interpret '<StringDtype(...)>' as a data type from patsy 1.0.1, which calls np.issubdtype on pandas 3's new default str dtype. patsy 1.0.2 handles it. - getting_started/tutorials/stochastic-tutorial.ipynb raised TypeError: deprecate_kwarg() missing 1 required positional argument at 'import statsmodels.api'. statsmodels 0.14.5 re-exports pandas' deprecate_kwarg with the old signature; pandas 3 changed it. statsmodels 0.14.6 wraps it in a compat shim. Both are dependency-floor issues, not chainladder or notebook-content bugs. Refresh uv.lock so the Pandas3 job resolves the fixed versions. The remaining plot_munich.ipynb error (YearBegin period frequency) is a genuine pandas 3 plotting regression and is left for a separate fix.
build: floor patsy>=1.0.2 and statsmodels>=0.14.6 for pandas 3 (#889)
Add: inherited-members: to class_inherited autosummary template and remove the Inherited Methods autosummary table that only showed one-line summaries. Fixes #970. Co-authored-by: Cursor <cursoragent@cursor.com>
docs: show full inherited method docstrings on Triangle API page (#970)
docs: add docstrings for Triangle broadcast_axis, copy, reindex (#970)
Co-authored-by: Cursor <cursoragent@cursor.com>
* Add See Also links to core reserving methods * [DOCS] Group See Also links by model type
…shift test: rename duplicate test_shift function (fixes #1199)
Fixes valuation grain bug
Add Ruff and pre-commit checks
…nto #588_chapter8
Friedland Recreation Chapter 8
Pyright Type CompletenessView the full Project (full
Other symbols referenced but not exported by
Symbols without documentation:
Patch (exported symbols added or changed by this PR): 21.9% fully typed (16 / 73); 3 no longer exported
Patch symbol details
|
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.
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 6ca44ed. Configure here.
| @@ -0,0 +1,221 @@ | |||
| Accident Year,Calendar Year,Paid Claims,Reported Claims,Earned Premium,Scenario | |||
There was a problem hiding this comment.
Sample CSV has UTF-8 BOM
High Severity
friedland_uspp.csv begins with a UTF-8 BOM, so pd.read_csv in load_sample names the first column \ufeffAccident Year instead of Accident Year. That no longer matches the manifest, so cl.load_sample("friedland_uspp") fails and docs that load this sample break.
Reviewed by Cursor Bugbot for commit 6ca44ed. Configure here.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## loc_setter #1201 +/- ##
==============================================
+ Coverage 90.48% 91.48% +0.99%
==============================================
Files 91 91
Lines 5289 5552 +263
Branches 671 736 +65
==============================================
+ Hits 4786 5079 +293
+ Misses 359 338 -21
+ Partials 144 135 -9
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|


Summary of Changes
Related GitHub Issue(s)
Additional Context for Reviewers
Checklist
uv run pytest) and documentation changes (uv run --directory docs jb build . --builder=custom --custom-builder=doctest)Note
Medium Risk
Wide changes across Triangle semantics, sparse arrays, and stochastic apriori/Mack math, though heavily covered by new and updated tests. CI-only paths are low risk.
Overview
Adds Ruff in CI (changed-files only) and pre-push hooks (ruff + pytest), plus pytest/doctest workflow tweaks (concurrency, autosummary step, pandas 3 pin).
Triangle / core:
drop()gains pandas-stylecolumns/origin(origin drops trim empty dev periods, gh-1055);__iter__ = Noneso pandas does not iterate triangles in DataFrame cells (gh-142); sparse__array__densifies; sparse column__setitem__and arithmetic column-prep fixes; improved development grain for 1D annual/monthly data and ultimate round-trip docs/behavior;disposal_rate_triweight broadcasting fix.Adjustments / methods:
ParallelogramOLF(cumulative=True)for 1-centric rate levels (gh-922);pct_reported_/pct_unreported_on fitted development objects;apriori_sigmasampling uses lognormal (positive aprioris, #1143); Mack recursion/summary backend alignment;WeightedRegressionsigma definition adjusted.Workflow: new public
TriangleSelectorandVotingChainladderweight/ultimate shape handling; exportsTriangleSelector.Data & docs: consolidates Friedland samples (
friedland_us_auto,friedland_uspp, XYZ JSON, GL population); new Friedland chapters 8–10; sparsenanquantile/nanmedian; extensive test updates (sparse/numpy parametrization viaset_backend).Reviewed by Cursor Bugbot for commit 6ca44ed. Bugbot is set up for automated code reviews on this repo. Configure here.