[CHORE] Move options, deprecations into chainladder._config - #1276
Merged
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): 13 no longer exported
Patch symbol details
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1276 +/- ##
==========================================
+ Coverage 91.68% 91.70% +0.02%
==========================================
Files 93 96 +3
Lines 5447 5463 +16
Branches 704 704
==========================================
+ Hits 4994 5010 +16
Misses 328 328
Partials 125 125
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:
|
1 task
henrydingliu
reviewed
Sep 4, 2026
henrydingliu
reviewed
Sep 4, 2026
henrydingliu
reviewed
Sep 4, 2026
Member
|
a couple small nits. everything else looks good |
henrydingliu
approved these changes
Sep 5, 2026
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.
Summary of Changes
Moves options and deprecation utilities into a new folder,
_config. This is to adhere to the single-responsibility principle. i.e., each module should be responsible for one thing.The overall package
__init__.pyis now only responsible for defining the public API - with the exception of the__version__constant. I didn't have strong feelings about where to put that, and pandas just leaves it in__init__.py. I could move it too, if you want.Refactored
_dask_parallel_warned: bool = Falseto be a class, this allows it to better maintain state across multiple modules that use it when it's located in a deeper location than__init__.py. This pattern also matches how theOptionsclass maintains the state of its options, to keep things consistent.Related GitHub Issue(s)
#1145
Additional Context for Reviewers
Made some ruff fixes on existing files.
Checklist
uv run pytest) and documentation changes (uv run --directory docs jb build . --builder=custom --custom-builder=doctest)Note
Low Risk
Mostly a module move with re-exports preserving the public API; small internal state and type-guard changes are covered by existing option/deprecation tests.
Overview
Refactors package configuration out of the top-level
chainladder/__init__.pyinto a newchainladder/_configsubpackage (options.pyforOptions, datetime constants, andoptions;deprecation.pyfor backend deprecation helpers and_resolve_pat). The public surface stays the same:cl.options,cl.Options,__dt64_*, and the existing private re-exports onchainladderare unchanged.ARCHITECTURE.mddocuments the new_configlayout. Minor implementation tweaks: one-time dask parallel deprecation state is now_dask_parallel_state.warned(replacing module-level_dask_parallel_warned), andset_optionforARRAY_BACKENDonly warns on deprecated backends when the value is astr.Tests in
test_utilities.pywere updated for the new state object and formatted to satisfy ruff (the file’s per-file ignore entry was removed frompyproject.toml).Reviewed by Cursor Bugbot for commit 3f1986c. Bugbot is set up for automated code reviews on this repo. Configure here.