Skip to content

Fix/interaction plot violin points - #838

Open
guillaume-vignal wants to merge 1 commit into
MAIF:developfrom
guillaume-vignal:fix/interaction-plot-violin-points
Open

guillaume-vignal wants to merge 1 commit into
MAIF:developfrom
guillaume-vignal:fix/interaction-plot-violin-points

Conversation

@guillaume-vignal

Copy link
Copy Markdown
Collaborator

Fixes: #837

Before:
image

After:
image

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@guillaume-vignal guillaume-vignal added the bug Something isn't working label Nov 13, 2026
@codecov

codecov Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 80.00000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 86.21%. Comparing base (6f10e31) to head (5f83830).

Files with missing lines Patch % Lines
shapash/plots/plot_contribution.py 80.00% 1 Missing and 1 partial ⚠️

❌ Your patch check has failed because the patch coverage (80.00%) is below the target coverage (90.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #838      +/-   ##
===========================================
+ Coverage    86.20%   86.21%   +0.01%     
===========================================
  Files          115      115              
  Lines        11864    11872       +8     
  Branches      2161     2163       +2     
===========================================
+ Hits         10227    10236       +9     
- Misses         996      998       +2     
+ Partials       641      638       -3     
Files with missing lines Coverage Δ
shapash/plots/plot_contribution.py 87.61% <80.00%> (-0.01%) ⬇️

... and 3 files 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.

@guillaume-vignal
guillaume-vignal changed the base branch from master to develop November 13, 2026 10:48
for trace in fig.data:
if trace.fill != "toself":
trace.customdata = interaction_customdata
trace_customdata = trace.customdata.tolist()

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need a list here? if yes can you explain why? otherwise I don't think the whole loop is needed

Comment on lines +151 to +155
color_column = col_name
if color_column == x_name:
color_column = f"{col_name}__color"
while color_column in (x_name, y_name, "__x_hover__"):
color_column += "_"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you think this is really necessary? you could simply add a fixed internal column name such as __color__ (as it is already done for __x_hover__) inside data_df and labels:

color_column = "__color__"
data_df = pd.DataFrame({
    x_name: x_series.values,
    y_name: y_series.values,
    color_column: col_values.values.flatten(),
    "__x_hover__": x_values_hover.values.flatten(),
})
labels = {"__x_hover__": x_name, color_column: col_name}

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix interactions plot

2 participants