Repository navigation
Fix APLR wrappers' MRO with current aplr releases - #685
Merged
Merged
Conversation
Signed-off-by: Raashish Aggarwal <94279692+raashish1601@users.noreply.github.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #685 +/- ##
=======================================
Coverage 67.21% 67.21%
=======================================
Files 77 77
Lines 11735 11735
=======================================
Hits 7888 7888
Misses 3847 3847
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:
|
Contributor
Author
|
The test_powerlift failure isn't from this change: it fails the same way on main (scheduled run 37461974875, job 112265538002). sqlalchemy_utils still subclasses |
Collaborator
|
Thanks @raashish1601! |
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.
Recent
aplrreleases (10.27.0 here) makeaplr.APLRRegressorandaplr.APLRClassifiersubclasses of scikit-learn'sRegressorMixin/ClassifierMixinandBaseEstimator. On main the wrappers list those sklearn classes before the native class:so Python can't build an MRO and
import interpret.glassboxfails for anyone with a currentaplrinstalled:This is also why the scheduled interpret-CI runs on main currently fail at test collection.
The native class now comes first, as it did in 0.7.8 (
class APLRRegressor(APLRRegressorNative, RegressorMixin, ExplainerMixin)). This works whether or not the native class already derives from the sklearn classes, and with the stub used whenaplrisn't installed. The wrappers' own methods still take precedence, andget_params/set_paramsalready call the native class explicitly.Tests: with aplr 10.27.0,
tests/glassbox/test_aplr.pyfails to collect on main and passes with this change (69 passed, 43 skipped together withtest_aplr_utils.py). ruff format is clean.