Closed psobolewskiPhD closed 1 day ago
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 92.43%. Comparing base (
5527240
) to head (b8ee1c1
). Report is 3 commits behind head on main.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
I've modified things so that only in case of Shapes -> labels the src (shapes) layer is preserved and not pop'd. I actually had this come up in a workshop yesterday! We reached consensus that shapes->labels behaving differently was ok, because shapes is fundamentally different from a pixel layer like labels/image.
Here's the matching docs PR: https://github.com/napari/docs/pull/414
I updated this, the test, and the docs PR to cover float images not popped.
References and relevant issues
When you use the layerlist contextual menu to convert a layer, e.g. to labels, it pops the layer. I find this to rarely be the behavior I want. Worse yet, there is no easy undo of that the layer is just gone! I feel like being conservative is better -- I can always remove the previous layer myself if I truly con't want it.
Description
This PR drops the
pop
of the Shapes layer from the LayerList and instead the new Labels layer is appended above the layer being converted. I updated the test accordingly.The action calls a private function which isn't used anywhere else, so I don't think it needs any deprecation warnings. The existing docs are vague enough that there is no need to update anything. But I can do so, if folks think it's useful.
Additionally, because images with float data are also converted to int before convert to labels, I made that also not
pop
the original image layer, because it is not fully reversible.