Add Friedland datasets to cl.load_sample()#730
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #730 +/- ##
==========================================
+ Coverage 85.13% 85.25% +0.11%
==========================================
Files 85 85
Lines 4911 4950 +39
Branches 630 645 +15
==========================================
+ Hits 4181 4220 +39
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:
|
kennethshsu
approved these changes
Apr 30, 2026
Collaborator
|
do we need to update manifest.in as well? i'm still not able to load_sample friedland locally |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #561. The Friedland datasets have been sitting around in the
utils/datafolder for quite some time, but haven't been loadable bycl.load_sample(). This PR enables that, updates the documentation, and also adds a unit test to make sure all of the supported datasets can load.I've also added cumulative claim columns to
friedland_us_industry_auto_caseandfriedland_xyz_case. These datasets previously had mixed cumulative/incremental columns which would be incompatible with theTriangleclass. This changes those samples to be just cumulative. Therefore,load_sample()won't be 1-to-1 with the text, but the old columns can still be derived and still remain in the original CSVs.Note
Medium Risk
Medium risk because it expands
load_sample()dataset-specific parsing rules and changes/removes several sample CSVs, which could break downstream users relying on prior sample names/column schemas.Overview
Adds support for loading the previously bundled Friedland sample datasets via
cl.load_sample()by introducing dataset-specific column/origin/development mappings (including semiannualfriedland_auto_freq_sevhandling) and improving the invalid-key error message.Updates sample CSVs to align with
Triangleexpectations by adding cumulativePaid Claimscolumns tofriedland_us_industry_auto_caseandfriedland_xyz_case, adjustingfriedland_auto_freq_sevhalf-year labels, and removing three olderfriedland_uspp_*increasing*CSV variants.Extends test coverage with a new unit test that iterates over all files in
utils/dataand asserts each can be loaded, and updates the sample-data documentation table to list the Friedland datasets and their attributes.Reviewed by Cursor Bugbot for commit 2932f75. Bugbot is set up for automated code reviews on this repo. Configure here.