Expand unit testing with hypothesis and edge case coverage#88
Merged
Conversation
Add 46 new tests (109 total, up from 63) covering: - ExplainToolkit init edge cases: unfitted models, bare estimators, numpy arrays, non-contiguous indices, y as list/Series - PlotConfig API: set/get/reset, invalid keys, persistence - Return type consistency: all compute methods return xarray.Dataset, computation_time_seconds in attrs - Validation helpers: normalize_features/normalize_estimator_names with hypothesis property-based testing (random strings, lists) - to_skexplain_importance: 1D/2D arrays, SHAP sum, normalization - ALE property-based: varying n_features (2-8), n_bins (3-20), subsample fractions (0.1-1.0) via hypothesis - Permutation importance: rankings length matches n_vars, uniqueness of rankings - SAGE: basic, grouped, package availability check - IO round-trip: save/load netCDF preserves values - Grouping utilities: shape, scaling, local value grouping - Degenerate inputs: constant features, single-feature datasets, 2-sample minimal datasets - High-cardinality categorical ALE (issue #86 regression tests) Add hypothesis and sage-importance to requirements.txt for CI. Fix missing unittest import in test_interpret_curves.py. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
Add 46 new tests (109 total, up from 63) covering:
Add hypothesis and sage-importance to requirements.txt for CI. Fix missing unittest import in test_interpret_curves.py.