Repository navigation
[BUG] Fix _pattern not set on older pickles - #1465
henrydingliu wants to merge 15 commits into
Conversation
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): 23.1% fully typed (3 / 13); 4 no longer exported
Patch symbol details
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1465 +/- ##
==========================================
+ Coverage 94.84% 95.08% +0.24%
==========================================
Files 99 101 +2
Lines 6424 6535 +111
Branches 811 821 +10
==========================================
+ Hits 6093 6214 +121
+ Misses 212 203 -9
+ Partials 119 118 -1
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:
|
|
I'm doing a pre-thanksgiving clean-up. converting this to draft to address bugbot |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ 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 1e01be8. Configure here.

Summary of Changes
added new path in
is_patternwhen _pattern is unsetuploaded pickles from older cl versions and added test
consolidated IO tests into new test_io.py (test_utilities.py had too many tests; it wasn't efficient to navigate or test during development)
Related GitHub Issue(s)
closes #1462
AI/LLM Usage
IDE auto-complete for docstring
Additional Context for Reviewers
Submitter's Checklist
[FIX],[FEAT],[DOCS],[TST],[CHORE], or[BRK]).Reviewer's Checklist
Note
Low Risk
Localized deserialization shim and safer property defaults; no auth or data-path changes beyond making older pickles load correctly.
Overview
Fixes backward compatibility when loading Triangle pickles created before the internal pattern flag was stored as
_patterninstead ofis_pattern.Runtime behavior:
read_picklenow migrates legacy__dict__entries (is_pattern→_pattern) afterdill.load.Triangle.is_patterndefaults viagetattr(..., "_pattern", False), andalign_patternchecksself.is_patternso restored objects behave like newly constructed ones.Tests & repo hygiene: JSON and pickle round-trip tests (including new backward-compatibility coverage against committed
chainladder/utils/data/raa*.pklfixtures) move intochainladder/core/tests/test_io.py, with corresponding tests removed fromtest_utilities.py..gitignoreis updated so those sample.pklfiles can be versioned despite the global*.pklignore.Minor formatting-only edits in
triangle.pyand utility test docstrings are also included.Reviewed by Cursor Bugbot for commit 99f4cc4. Bugbot is set up for automated code reviews on this repo. Configure here.