Skip to content

Tighten type hints and string formatting - #796

Merged
guillaume-vignal merged 5 commits into
MAIF:developfrom
guillaume-vignal:feature/fix_changes_requested
Oct 9, 2026
Merged

guillaume-vignal merged 5 commits into
MAIF:developfrom
guillaume-vignal:feature/fix_changes_requested

Conversation

@guillaume-vignal

@guillaume-vignal guillaume-vignal commented Oct 5, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes: #795

Summary

  • Narrow model class-label types and validation to integers, floats, or strings.
  • Make add_line_break accept strings only, and preserve numeric and missing feature values in plotting paths.
  • Document the LIME prediction callable and SHAP masker contracts.

Validation

  • Full test suite: 809 passed.
  • mypy shapash passed.
  • Pre-commit hooks passed.

@codecov

codecov Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.73684% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 79.96%. Comparing base (fe1c28c) to head (7befc45).

Files with missing lines Patch % Lines
shapash/utils/check.py 80.00% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #796      +/-   ##
===========================================
+ Coverage    79.63%   79.96%   +0.32%     
===========================================
  Files           59       59              
  Lines         7396     7403       +7     
  Branches      1553     1556       +3     
===========================================
+ Hits          5890     5920      +30     
+ Misses         928      915      -13     
+ Partials       578      568      -10     
Files with missing lines Coverage Δ
shapash/backend/base_backend.py 77.41% <ø> (ø)
shapash/backend/lime_backend.py 88.77% <ø> (ø)
shapash/backend/shap_backend.py 76.19% <100.00%> (+0.38%) ⬆️
shapash/decomposition/contributions.py 94.11% <ø> (ø)
shapash/explainer/consistency.py 86.44% <ø> (ø)
shapash/explainer/smart_plotter.py 77.88% <100.00%> (ø)
shapash/explainer/smart_predictor.py 82.10% <100.00%> (ø)
shapash/explainer/smart_state.py 92.15% <ø> (ø)
shapash/manipulation/select_lines.py 80.95% <ø> (ø)
shapash/plots/plot_bar_chart.py 90.34% <100.00%> (ø)
... and 6 more

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment thread shapash/backend/lime_backend.py Resolved
@milton-minervino

Copy link
Copy Markdown
Collaborator

and maybe you can follow codecov hint and cover the missing lines in shapash/utils/check.py to reach the 90% patch coverage threshold

@guillaume-vignal
guillaume-vignal changed the base branch from develop to master October 6, 2026 18:52
@guillaume-vignal
guillaume-vignal changed the base branch from master to develop October 6, 2026 18:53
@guillaume-vignal
guillaume-vignal merged commit 6b8d7a4 into MAIF:develop Oct 9, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Clarify Types and Contracts in Explanation Backends

2 participants