Repository navigation
Keep infeasible categorical trials in plot_slice - #6932
Conversation
|
Could you add a minimal reproducible example (code and the resulting plot) showing infeasible trials missing from plot_slice with a categorical parameter? A before-and-after plot would help clarify the visual change. |
There was a problem hiding this comment.
Thanks for the PR. The test demonstrates the correct behavior, but currently runs 12 parameter combinations. Since they all exercise the same regression path, could we reduce this (for example, mixed feasible and infeasible categorical trials) to keep the test lightweight and make its intent clearer?
|
This pull request has not seen any recent activity. |
|
Thanks for the feedback. I reduced the parameterized matrix to a single focused mixed case with one feasible categorical trial ( |

Motivation
plot_slicesilently omits infeasible trials on categorical axes, including when every trial is infeasible. The Matplotlib backend retains these points.Description of the changes
Keep infeasible trial numbers alongside their x and y values. Categorical plotting zips these three lists to group points in category order; the empty trial-number list currently discards every infeasible point.
Add a focused regression test through the public plotting API with one feasible and one infeasible trial on a categorical axis.
Validation
f9618295) and passes with the fix.pytest tests/visualization_tests/test_slice.py -q: 53 passed, including both plotting backends.--follow-imports=silent. Fullmypy .reports one unrelated error atoptuna/visualization/_intermediate_values.py:95; the identical error reproduces on unmodified master with the same environment.Tested on Windows with Python 3.12.3, Plotly 7.1.0 and Matplotlib 3.11.2.
Checklist