Closed Czaki closed 2 weeks ago
Attention: Patch coverage is 95.12195%
with 12 lines
in your changes are missing coverage. Please review.
Project coverage is 92.43%. Comparing base (
4d33e78
) to head (2521f4e
). Report is 1 commits behind head on main.
Files | Patch % | Lines |
---|---|---|
napari/layers/base/_test_util_sample_layer.py | 73.52% | 9 Missing :warning: |
napari/_qt/_qapp_model/qactions/_layer.py | 96.42% | 3 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
For now, it is not only scale/transform but also shear, rotate and affine.
I have updated attached video to current state
@Czaki in the interest of only having one file per menu, would you consider putting these actions with the non-Qt layer actions? I know clipboard does not make sense headless, ~but also the actions do not require anything Qt~. Darn, I just saw clipboard needs Qt. I guess we should think about whether the non-Qt layer actions are actually useful to have headless.
The reason for one file: is easier to find, and we can put the submenus with the single action file (see #6848)
cc @DragaDoncila
Darn, I just saw clipboard needs Qt.
It needs Qt or additional dependecy
I guess we should think about whether the non-Qt layer actions are actually useful to have headless.
When we finally start implementing another fronted, such split will allow to notice which actions need to be reimplemented.
The reason for one file: is easier to find, and we can put the submenus with the single action file (see #6848)
I do not have a strong opinion about organization. I think that you may have better intuition. We may refactor it.
References and relevant issues
alternative to #6862
Description
This PR implements coping spatial information between layers using a clipboard.
https://github.com/napari/napari/assets/3826210/e6a476a3-45f9-4f6e-bcfc-462a7ff7662d
In this PR I have implemented coping spatial information between layers using clipboard. When coping data to the clipboard, it copies data in two formats:
application/octet-stream
When pasting, the code first checks if proper binary data are available in the buffer if yes, then it is using unpickled dict. If there is no binary buffer, the code tries to deserialize JSON into dict and use values from here.
I kept JSON as fallback as it simplifies debug.
These approaches allow copying information between two viewer instances, even from different process.
This may be improved by using cbor instead of JSON, but it will add additional dependency. https://pypi.org/project/cbor2/
It is part of #6780