Repository: napari/napari

Issue:
`multiple_viewer_widget.py` doesn't work on main branch
## 🐛 Bug

The [`examples/multiple_viewer_widget.py`](https://github.com/napari/napari/blob/main/examples/multiple_viewer_widget.py) script is broken on the main branch.

Exactly the same issue as #5778. The fix #5796 worked but it seems that it was merged on the 0.4.18 branch and not on the main?

Sorry to bother you with that, I have a script relying on this example 😄

## To Reproduce

Steps to reproduce the behavior:

1. `python examples/multiple_viewer_widget.py`
2. Open Sample -> napari builtins -> Cells

I have a stacktrace similar to #5778.
<!-- If you have a code sample, error messages, stack traces, please provide it here as well -->

## Expected behavior

It should open the image.

<!-- A clear and concise description of what you expected to happen. -->

## Environment

 - Please copy and paste the information at napari info option in help menubar here:
 
```
napari: 0.5.0a2.dev101+g3ab9cfbb.d20230811
Platform: Windows-10-10.0.22621-SP0
Python: 3.11.4 (tags/v3.11.4:d2340ef, Jun 7 2023, 05:45:37) [MSC v.1934 64 bit (AMD64)]
Qt: 5.15.2
PyQt5: 5.15.9
NumPy: 1.25.2
SciPy: 1.11.1
Dask: 2023.8.0
VisPy: 0.13.0
magicgui: 0.7.2
superqt: unknown
in-n-out: 0.1.8
app-model: 0.2.0
npe2: 0.7.2

OpenGL:
- GL version: 4.6.0 NVIDIA 536.23
- MAX_TEXTURE_SIZE: 32768

Screens:
- screen 1: resolution 1920x1080, scale 1.0

Settings path:
- C:\Users\jeanp\AppData\Local\napari\.venv_fb2b1f9dcb189b4357857792287bfb8c719ecb7c\settings.yaml
```

 - Any other relevant information:

## Additional context


<!-- Add any other context about the problem here. -->



Discussion:
#5796 was merged to the main, I will check and fix this. 
@jplumail Could you paste stack trace? It works when I checkout main. 
<details>
  <summary>Stacktrace</summary>

```
File "C:\Users\jeanp\code\napari\.venv\Lib\site-packages\napari\utils\events\event.py", line 763, in __call__
    self._invoke_callback(cb, event if pass_event else None)
  File "C:\Users\jeanp\code\napari\.venv\Lib\site-packages\napari\utils\events\event.py", line 788, in _invoke_callback
    cb(event)
  File "C:\Users\jeanp\code\napari\examples\multiple_viewer_widget.py", line 329, in _point_update
    model.dims.current_step = event.value
  File "C:\Users\jeanp\code\napari\.venv\Lib\site-packages\napari\utils\events\evented_model.py", line 315, in __setattr__
    self._super_setattr_(name, value)
  File "C:\Users\jeanp\code\napari\.venv\Lib\site-packages\napari\utils\events\evented_model.py", line 275, in _super_setattr_
    setter(self, value)
  File "C:\Users\jeanp\code\napari\.venv\Lib\site-packages\napari\components\dims.py", line 265, in current_step
    self.point = tuple(
  File "C:\Users\jeanp\code\napari\.venv\Lib\site-packages\napari\utils\events\evented_model.py", line 339, in __setattr__
    getattr(self.events, dep)(value=after_deps[dep])
  File "C:\Users\jeanp\code\napari\.venv\Lib\site-packages\napari\utils\events\event.py", line 763, in __call__
    self._invoke_callback(cb, event if pass_event else None)
  File "C:\Users\jeanp\code\napari\.venv\Lib\site-packages\napari\utils\events\event.py", line 788, in _invoke_callback
    cb(event)
  File "C:\Users\jeanp\code\napari\examples\multiple_viewer_widget.py", line 329, in _point_update
    model.dims.current_step = event.value
  File "C:\Users\jeanp\code\napari\.venv\Lib\site-packages\napari\utils\events\evented_model.py", line 315, in __setattr__
    self._super_setattr_(name, value)
  File "C:\Users\jeanp\code\napari\.venv\Lib\site-packages\napari\utils\events\evented_model.py", line 275, in _super_setattr_
    setter(self, value)
  File "C:\Users\jeanp\code\napari\.venv\Lib\site-packages\napari\components\dims.py", line 265, in current_step
    self.point = tuple(
  File "C:\Users\jeanp\code\napari\.venv\Lib\site-packages\napari\utils\events\evented_model.py", line 339, in __setattr__
    getattr(self.events, dep)(value=after_deps[dep])
  File "C:\Users\jeanp\code\napari\.venv\Lib\site-packages\napari\utils\events\event.py", line 763, in __call__
    self._invoke_callback(cb, event if pass_event else None)
  File "C:\Users\jeanp\code\napari\.venv\Lib\site-packages\napari\utils\events\event.py", line 788, in _invoke_callback
    cb(event)
  File "C:\Users\jeanp\code\napari\examples\multiple_viewer_widget.py", line 329, in _point_update
    model.dims.current_step = event.value
  File "C:\Users\jeanp\code\napari\.venv\Lib\site-packages\napari\utils\events\evented_model.py", line 315, in __setattr__
    self._super_setattr_(name, value)
  File "C:\Users\jeanp\code\napari\.venv\Lib\site-packages\napari\utils\events\evented_model.py", line 275, in _super_setattr_
    setter(self, value)
  File "C:\Users\jeanp\code\napari\.venv\Lib\site-packages\napari\components\dims.py", line 265, in current_step
    self.point = tuple(
  File "C:\Users\jeanp\code\napari\.venv\Lib\site-packages\napari\utils\events\evented_model.py", line 339, in __setattr__
    getattr(self.events, dep)(value=after_deps[dep])
  File "C:\Users\jeanp\code\napari\.venv\Lib\site-packages\napari\utils\events\event.py", line 763, in __call__
    self._invoke_callback(cb, event if pass_event else None)
  File "C:\Users\jeanp\code\napari\.venv\Lib\site-packages\napari\utils\events\event.py", line 788, in _invoke_callback
    cb(event)
  File "C:\Users\jeanp\code\napari\examples\multiple_viewer_widget.py", line 329, in _point_update
    model.dims.current_step = event.value
  File "C:\Users\jeanp\code\napari\.venv\Lib\site-packages\napari\utils\events\evented_model.py", line 315, in __setattr__
    self._super_setattr_(name, value)
  File "C:\Users\jeanp\code\napari\.venv\Lib\site-packages\napari\utils\events\evented_model.py", line 275, in _super_setattr_
    setter(self, value)
  File "C:\Users\jeanp\code\napari\.venv\Lib\site-packages\napari\components\dims.py", line 265, in current_step
    self.point = tuple(
  File "C:\Users\jeanp\code\napari\.venv\Lib\site-packages\napari\utils\events\evented_model.py", line 339, in __setattr__
    getattr(self.events, dep)(value=after_deps[dep])
  File "C:\Users\jeanp\code\napari\.venv\Lib\site-packages\napari\utils\events\event.py", line 763, in __call__
    self._invoke_callback(cb, event if pass_event else None)
  File "C:\Users\jeanp\code\napari\.venv\Lib\site-packages\napari\utils\events\event.py", line 788, in _invoke_callback
    cb(event)
  File "C:\Users\jeanp\code\napari\examples\multiple_viewer_widget.py", line 329, in _point_update
    model.dims.current_step = event.value
  File "C:\Users\jeanp\code\napari\.venv\Lib\site-packages\napari\utils\events\evented_model.py", line 315, in __setattr__
    self._super_setattr_(name, value)
  File "C:\Users\jeanp\code\napari\.venv\Lib\site-packages\napari\utils\events\evented_model.py", line 275, in _super_setattr_
    setter(self, value)
  File "C:\Users\jeanp\code\napari\.venv\Lib\site-packages\napari\components\dims.py", line 265, in current_step
    self.point = tuple(
  File "C:\Users\jeanp\code\napari\.venv\Lib\site-packages\napari\utils\events\evented_model.py", line 339, in __setattr__
    getattr(self.events, dep)(value=after_deps[dep])
  File "C:\Users\jeanp\code\napari\.venv\Lib\site-packages\napari\utils\events\event.py", line 763, in __call__
    self._invoke_callback(cb, event if pass_event else None)
  File "C:\Users\jeanp\code\napari\.venv\Lib\site-packages\napari\utils\events\event.py", line 790, in _invoke_callback
    cb()
  File "C:\Users\jeanp\code\napari\.venv\Lib\site-packages\napari\components\viewer_model.py", line 425, in _update_layers
    self._layer_slicer.submit(layers=layers, dims=self.dims)
  File "C:\Users\jeanp\code\napari\.venv\Lib\site-packages\napari\components\_layer_slicer.py", line 228, in submit
    layer._slice_dims(
  File "C:\Users\jeanp\code\napari\.venv\Lib\site-packages\napari\layers\base\base.py", line 1150, in _slice_dims
    self._refresh_sync()
  File "C:\Users\jeanp\code\napari\.venv\Lib\site-packages\napari\layers\base\base.py", line 1374, in _refresh_sync
    self.events.set_data()
  File "C:\Users\jeanp\code\napari\.venv\Lib\site-packages\napari\utils\events\event.py", line 763, in __call__
    self._invoke_callback(cb, event if pass_event else None)
  File "C:\Users\jeanp\code\napari\.venv\Lib\site-packages\napari\utils\events\event.py", line 790, in _invoke_callback
    cb()
  File "C:\Users\jeanp\code\napari\.venv\Lib\site-packages\napari\_vispy\layers\image.py", line 146, in _on_data_change
    self._on_matrix_change()
  File "C:\Users\jeanp\code\napari\.venv\Lib\site-packages\napari\_vispy\layers\base.py", line 217, in _on_matrix_change
    self._master_transform.matrix = affine_matrix
  File "C:\Users\jeanp\code\napari\.venv\Lib\site-packages\vispy\visuals\transforms\linear.py", line 402, in matrix
    self.update()
  File "C:\Users\jeanp\code\napari\.venv\Lib\site-packages\vispy\visuals\transforms\base_transform.py", line 148, in update
    self.changed(*args)
  File "C:\Users\jeanp\code\napari\.venv\Lib\site-packages\vispy\util\event.py", line 453, in __call__
    self._invoke_callback(cb, event)
  File "C:\Users\jeanp\code\napari\.venv\Lib\site-packages\vispy\util\event.py", line 471, in _invoke_callback
    _handle_exception(self.ignore_callback_errors,
  << caught exception here: >>
  File "C:\Users\jeanp\code\napari\.venv\Lib\site-packages\vispy\util\event.py", line 469, in _invoke_callback
    cb(event)
  File "C:\Users\jeanp\code\napari\.venv\Lib\site-packages\vispy\visuals\visual.py", line 267, in _transform_changed
    self.update()
  File "C:\Users\jeanp\code\napari\.venv\Lib\site-packages\vispy\scene\node.py", line 330, in update
    self.events.update()
  File "C:\Users\jeanp\code\napari\.venv\Lib\site-packages\vispy\util\event.py", line 426, in __call__
    event = self._prepare_event(*args, **kwargs)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RecursionError: maximum recursion depth exceeded

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\jeanp\code\napari\.venv\Lib\site-packages\vispy\util\event.py", line 469, in _invoke_callback
    cb(event)
  File "C:\Users\jeanp\code\napari\.venv\Lib\site-packages\vispy\util\event.py", line 453, in __call__
    self._invoke_callback(cb, event)
  File "C:\Users\jeanp\code\napari\.venv\Lib\site-packages\vispy\util\event.py", line 471, in _invoke_callback
    _handle_exception(self.ignore_callback_errors,
  File "C:\Users\jeanp\code\napari\.venv\Lib\site-packages\vispy\util\logs.py", line 307, in _handle_exception
    key = repr(cb) + repr(event)
          ^^^^^^^^
RecursionError: maximum recursion depth exceeded

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\jeanp\code\napari\.venv\Lib\site-packages\vispy\util\event.py", line 469, in _invoke_callback
    cb(event)
  File "C:\Users\jeanp\code\napari\.venv\Lib\site-packages\vispy\visuals\transforms\chain.py", line 210, in _subtr_changed
    self.update(ev)
  File "C:\Users\jeanp\code\napari\.venv\Lib\site-packages\vispy\visuals\transforms\base_transform.py", line 148, in update
    self.changed(*args)
  File "C:\Users\jeanp\code\napari\.venv\Lib\site-packages\vispy\util\event.py", line 453, in __call__
    self._invoke_callback(cb, event)
  File "C:\Users\jeanp\code\napari\.venv\Lib\site-packages\vispy\util\event.py", line 471, in _invoke_callback
    _handle_exception(self.ignore_callback_errors,
  File "C:\Users\jeanp\code\napari\.venv\Lib\site-packages\vispy\util\logs.py", line 307, in _handle_exception
    key = repr(cb) + repr(event)
                     ^^^^^^^^^^^
  File "C:\Users\jeanp\code\napari\.venv\Lib\site-packages\vispy\util\event.py", line 127, in __repr__
    for name in dir(self):
                ^^^^^^^^^
RecursionError: maximum recursion depth exceeded while calling a Python object

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\jeanp\code\napari\.venv\Lib\site-packages\vispy\util\event.py", line 469, in _invoke_callback
    cb(event)
  File "C:\Users\jeanp\code\napari\.venv\Lib\site-packages\vispy\visuals\transforms\chain.py", line 210, in _subtr_changed
    self.update(ev)
  File "C:\Users\jeanp\code\napari\.venv\Lib\site-packages\vispy\visuals\transforms\base_transform.py", line 148, in update
    self.changed(*args)
  File "C:\Users\jeanp\code\napari\.venv\Lib\site-packages\vispy\util\event.py", line 453, in __call__
    self._invoke_callback(cb, event)
  File "C:\Users\jeanp\code\napari\.venv\Lib\site-packages\vispy\util\event.py", line 471, in _invoke_callback
    _handle_exception(self.ignore_callback_errors,
  File "C:\Users\jeanp\code\napari\.venv\Lib\site-packages\vispy\util\logs.py", line 307, in _handle_exception
    key = repr(cb) + repr(event)
          ^^^^^^^^
  File "C:\Users\jeanp\code\napari\.venv\Lib\site-packages\vispy\visuals\transforms\chain.py", line 238, in __repr__
    tr = ",\n                 ".join(map(repr, self.transforms))
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\jeanp\code\napari\.venv\Lib\site-packages\vispy\visuals\transforms\chain.py", line 238, in __repr__
    tr = ",\n                 ".join(map(repr, self.transforms))
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RecursionError: maximum recursion depth exceeded
ERROR: Invoking <bound method ChainTransform._subtr_changed of <ChainTransform [MatrixTransform(matrix=[[1.0, 0.0, 0.0, 0.0],
                        [0.0, 1.0, 0.0, 0.0],
                        [0.0, 0.0, 1.0, 0.0],
                        [-0.5, -0.5, 0.0, 1.0]] at 0x23f279f1f50)] at 0x23f2cd865d0>> for Event
ERROR: Invoking <bound method ChainTransform._subtr_changed of <ChainTransform [<ChainTransform [MatrixTransform(matrix=[[1.0, 0.0, 0.0, 0.0],
                        [0.0, 1.0, 0.0, 0.0],
                        [0.0, 0.0, 1.0, 0.0],
                        [-0.5, -0.5, 0.0, 1.0]] at 0x23f279f1f50),
                 MatrixTransform(matrix=[[1.0, 0.0, 0.0, 0.0],
                        [0.0, 1.0, 0.0, 0.0],
                        [0.0, 0.0, 1.0, 0.0],
                        [0.0, 0.0, 0.0, 1.0]] at 0x23f2ccf95d0)] at 0x23f2cd67d10>] at 0x23f2cdf10d0>> repeat 2
ERROR: Invoking <bound method ChainTransform._subtr_changed of <ChainTransform [<ChainTransform [MatrixTransform(matrix=[[1.0, 0.0, 0.0, 0.0],      
                        [0.0, 1.0, 0.0, 0.0],
                        [0.0, 0.0, 1.0, 0.0],
                        [-0.5, -0.5, 0.0, 1.0]] at 0x23f279f1f50),
                 MatrixTransform(matrix=[[1.0, 0.0, 0.0, 0.0],
                        [0.0, 1.0, 0.0, 0.0],
                        [0.0, 0.0, 1.0, 0.0],
                        [0.0, 0.0, 0.0, 1.0]] at 0x23f2ce15750)] at 0x23f2cdc3bd0>] at 0x23f2ce2b190>> repeat 2
ERROR: Invoking <bound method ChainTransform._subtr_changed of <ChainTransform [<ChainTransform [MatrixTransform(matrix=[[1.0, 0.0, 0.0, 0.0],      
                        [0.0, 1.0, 0.0, 0.0],
                        [0.0, 0.0, 1.0, 0.0],
                        [-0.5, -0.5, 0.0, 1.0]] at 0x23f279f1f50),
                 MatrixTransform(matrix=[[1.0, 0.0, 0.0, 0.0],
                        [0.0, 1.0, 0.0, 0.0],
                        [0.0, 0.0, 1.0, 0.0],
                        [0.0, 0.0, 0.0, 1.0]] at 0x23f2ccf03d0)] at 0x23f2cda05d0>] at 0x23f2cdc3c90>> repeat 2
---------------------------------------------------------------------------
RecursionError                            Traceback (most recent call last)
File ~\code\napari\.venv\Lib\site-packages\napari\_qt\menus\file_menu.py:229, in FileMenu._rebuild_samples_menu.<locals>._add_sample(plg='napari', smp='cells3d', *_=(False,))
    227 def _add_sample(*_, plg=plugin_name, smp=samp_name):
    228     try:
--> 229         self._win._qt_viewer.viewer.open_sample(plg, smp)
        plg = 'napari'
        smp = 'cells3d'
        self._win = <napari._qt.qt_main_window.Window object at 0x0000023F19473750>
        self = <napari._qt.menus.file_menu.FileMenu object at 0x0000023F24D1D1B0>
    230     except MultipleReaderError as e:
    231         handle_gui_reading(
    232             e.paths,
    233             self._win._qt_viewer,
    234             stack=False,
    235         )

File ~\code\napari\.venv\Lib\site-packages\napari\components\viewer_model.py:1038, in ViewerModel.open_sample(self=Viewer(camera=Camera(center=(0.0, 127.5, 127.5),...ouse_drag_gen={}, _mouse_wheel_gen={}, keymap={}), plugin='napari', sample='cells3d', reader_plugin=None, **kwargs={})
   1036     added = []
   1037     for datum in data(**kwargs):
-> 1038         added.extend(self._add_layer_from_data(*datum))
        added = []
        datum = (<class 'numpy.ndarray'> (60, 2, 256, 256) uint16, {'channel_axis': 1, 'name': ['membrane', 'nuclei'], 'contrast_limits': [(1110, 23855), (1600, 50000)]})
        self = Viewer(camera=Camera(center=(0.0, 127.5, 127.5), zoom=0.37109375, angles=(0.0, 0.0, 90.0), perspective=0.0, mouse_pan=True, mouse_zoom=True), cursor=Cursor(position=(0.0, 1.0, 0.0), scaled=True, style=<CursorStyle.STANDARD: 'standard'>, size=1.0), dims=Dims(ndim=3, ndisplay=2, order=(0, 1, 2), axis_labels=('0', '1', '2'), range=(RangeTuple(start=0.0, stop=59.0, step=1.0), RangeTuple(start=0.0, stop=255.0, step=1.0), RangeTuple(start=0.0, stop=255.0, step=1.0)), margin_left=(0.0, 0.0, 0.0), margin_right=(0.0, 0.0, 0.0), point=(0.0, 0.0, 0.0), last_used=0), grid=GridCanvas(stride=1, shape=(-1, -1), enabled=False), layers=[<Image layer 'membrane' at 0x23f27a69e50>], help='', status='', tooltip=Tooltip(visible=False, text=''), theme='dark', title='napari', mouse_over_canvas=False, mouse_move_callbacks=[], mouse_drag_callbacks=[], mouse_double_click_callbacks=[], mouse_wheel_callbacks=[<function dims_scroll at 0x0000023F14366340>], _persisted_mouse_event={}, _mouse_drag_gen={}, _mouse_wheel_gen={}, keymap={})  
   1039     return added
   1040 if isinstance(data, (str, Path)):

File ~\code\napari\.venv\Lib\site-packages\napari\components\viewer_model.py:1457, in ViewerModel._add_layer_from_data(self=Viewer(camera=Camera(center=(0.0, 127.5, 127.5),...ouse_drag_gen={}, _mouse_wheel_gen={}, keymap={}), data=<class 'numpy.ndarray'> (60, 2, 256, 256) uint16, meta={'channel_axis': 1, 'contrast_limits': [(1110, 23855), (1600, 50000)], 'name': ['membrane', 'nuclei']}, layer_type='image')
   1455 try:
   1456     add_method = getattr(self, 'add_' + layer_type)
-> 1457     layer = add_method(data, **(meta or {}))
        add_method = <bound method ViewerModel.add_image of Viewer(camera=Camera(center=(0.0, 127.5, 127.5), zoom=0.37109375, angles=(0.0, 0.0, 90.0), perspective=0.0, mouse_pan=True, mouse_zoom=True), cursor=Cursor(position=(0.0, 1.0, 0.0), scaled=True, style=<CursorStyle.STANDARD: 'standard'>, size=1.0), dims=Dims(ndim=3, ndisplay=2, order=(0, 1, 2), axis_labels=('0', '1', '2'), range=(RangeTuple(start=0.0, stop=59.0, step=1.0), RangeTuple(start=0.0, stop=255.0, step=1.0), RangeTuple(start=0.0, stop=255.0, step=1.0)), margin_left=(0.0, 0.0, 0.0), margin_right=(0.0, 0.0, 0.0), point=(0.0, 0.0, 0.0), last_used=0), grid=GridCanvas(stride=1, shape=(-1, -1), enabled=False), layers=[<Image layer 'membrane' at 0x23f27a69e50>], help='', status='', tooltip=Tooltip(visible=False, text=''), theme='dark', title='napari', mouse_over_canvas=False, mouse_move_callbacks=[], mouse_drag_callbacks=[], mouse_double_click_callbacks=[], mouse_wheel_callbacks=[<function dims_scroll at 0x0000023F14366340>], _persisted_mouse_event={}, _mouse_drag_gen={}, _mouse_wheel_gen={}, keymap={})>
        data = <class 'numpy.ndarray'> (60, 2, 256, 256) uint16
        meta or {} = {'channel_axis': 1, 'name': ['membrane', 'nuclei'], 'contrast_limits': [(1110, 23855), (1600, 50000)]}
        meta = {'channel_axis': 1, 'name': ['membrane', 'nuclei'], 'contrast_limits': [(1110, 23855), (1600, 50000)]}
   1458 except TypeError as exc:
   1459     if 'unexpected keyword argument' not in str(exc):

File ~\code\napari\.venv\Lib\site-packages\napari\utils\migrations.py:59, in rename_argument.<locals>._wrapper.<locals>._update_from_dict(*args=(Viewer(camera=Camera(center=(0.0, 127.5, 127.5),...ouse_drag_gen={}, _mouse_wheel_gen={}, keymap={}), <class 'numpy.ndarray'> (60, 2, 256, 256) uint16), **kwargs={'channel_axis': 1, 'contrast_limits': [(1110, 23855), (1600, 50000)], 'name': ['membrane', 'nuclei']})
     57     kwargs = kwargs.copy()
     58     kwargs[to_name] = kwargs.pop(from_name)
---> 59 return func(*args, **kwargs)
        func = <function ViewerModel.add_image at 0x0000023F18D6D760>
        kwargs = {'channel_axis': 1, 'name': ['membrane', 'nuclei'], 'contrast_limits': [(1110, 23855), (1600, 50000)]}
        args = (Viewer(camera=Camera(center=(0.0, 127.5, 127.5), zoom=0.37109375, angles=(0.0, 0.0, 90.0), perspective=0.0, mouse_pan=True, mouse_zoom=True), cursor=Cursor(position=(0.0, 1.0, 0.0), scaled=True, style=<CursorStyle.STANDARD: 'standard'>, size=1.0), dims=Dims(ndim=3, ndisplay=2, order=(0, 1, 2), axis_labels=('0', '1', '2'), range=(RangeTuple(start=0.0, stop=59.0, step=1.0), RangeTuple(start=0.0, stop=255.0, step=1.0), RangeTuple(start=0.0, stop=255.0, step=1.0)), margin_left=(0.0, 0.0, 0.0), margin_right=(0.0, 0.0, 0.0), point=(0.0, 0.0, 0.0), last_used=0), grid=GridCanvas(stride=1, shape=(-1, -1), enabled=False), layers=[<Image layer 'membrane' at 0x23f27a69e50>], help='', status='', tooltip=Tooltip(visible=False, text=''), theme='dark', title='napari', mouse_over_canvas=False, mouse_move_callbacks=[], mouse_drag_callbacks=[], mouse_double_click_callbacks=[], mouse_wheel_callbacks=[<function dims_scroll at 0x0000023F14366340>], _persisted_mouse_event={}, _mouse_drag_gen={}, _mouse_wheel_gen={}, keymap={}), <class 'numpy.ndarray'> (60, 2, 256, 256) uint16)

File ~\code\napari\.venv\Lib\site-packages\napari\components\viewer_model.py:945, in ViewerModel.add_image(self=Viewer(camera=Camera(center=(0.0, 127.5, 127.5),...ouse_drag_gen={}, _mouse_wheel_gen={}, keymap={}), data=<class 'numpy.ndarray'> (60, 2, 256, 256) uint16, channel_axis=1, rgb=None, colormap=None, contrast_limits=[(1110, 23855), (1600, 50000)], gamma=1, interpolation2d='nearest', interpolation3d='linear', rendering='mip', depiction='volume', iso_threshold=None, attenuation=0.05, name=['membrane', 'nuclei'], metadata=None, scale=None, translate=None, rotate=None, shear=None, affine=None, opacity=1, blending=None, visible=True, multiscale=None, cache=True, plane=None, experimental_clipping_planes=None, custom_interpolation_kernel_2d=None)
    940 layerdata_list = split_channels(data, channel_axis, **kwargs)
    942 layer_list = [
    943     Image(image, **i_kwargs) for image, i_kwargs, _ in layerdata_list
    944 ]
--> 945 self.layers.extend(layer_list)
        layer_list = [<Image layer 'membrane' at 0x23f27a69e50>, <Image layer 'nuclei' at 0x23f2859dd50>]
        self.layers = [<Image layer 'membrane' at 0x23f27a69e50>]
        self = Viewer(camera=Camera(center=(0.0, 127.5, 127.5), zoom=0.37109375, angles=(0.0, 0.0, 90.0), perspective=0.0, mouse_pan=True, mouse_zoom=True), cursor=Cursor(position=(0.0, 1.0, 0.0), scaled=True, style=<CursorStyle.STANDARD: 'standard'>, size=1.0), dims=Dims(ndim=3, ndisplay=2, order=(0, 1, 2), axis_labels=('0', '1', '2'), range=(RangeTuple(start=0.0, stop=59.0, step=1.0), RangeTuple(start=0.0, stop=255.0, step=1.0), RangeTuple(start=0.0, stop=255.0, step=1.0)), margin_left=(0.0, 0.0, 0.0), margin_right=(0.0, 0.0, 0.0), point=(0.0, 0.0, 0.0), last_used=0), grid=GridCanvas(stride=1, shape=(-1, -1), enabled=False), layers=[<Image layer 'membrane' at 0x23f27a69e50>], help='', status='', tooltip=Tooltip(visible=False, text=''), theme='dark', title='napari', mouse_over_canvas=False, mouse_move_callbacks=[], mouse_drag_callbacks=[], mouse_double_click_callbacks=[], mouse_wheel_callbacks=[<function dims_scroll at 0x0000023F14366340>], _persisted_mouse_event={}, _mouse_drag_gen={}, _mouse_wheel_gen={}, keymap={})  
    947 return layer_list

File <frozen _collections_abc>:1099, in extend(self=[<Image layer 'membrane' at 0x23f27a69e50>], values=[<Image layer 'membrane'>, <Image layer 'nuclei'>])

File <frozen _collections_abc>:1078, in append(self=[<Image layer 'membrane' at 0x23f27a69e50>], value=<Image layer 'membrane'>)

File ~\code\napari\.venv\Lib\site-packages\napari\components\layerlist.py:152, in LayerList.insert(self=[<Image layer 'membrane' at 0x23f27a69e50>], index=0, value=<Image layer 'membrane'>)
    150 new_layer.events.extent.connect(self._clean_cache)
    151 new_layer.events._extent_augmented.connect(self._clean_cache)
--> 152 super().insert(index, new_layer)
        new_layer = <Image layer 'membrane' at 0x23f27a69e50>
        index = 0

File ~\code\napari\.venv\Lib\site-packages\napari\utils\events\containers\_selectable_list.py:66, in SelectableEventedList.insert(self=[<Image layer 'membrane' at 0x23f27a69e50>], index=0, value=<Image layer 'membrane'>)
     65 def insert(self, index: int, value: _T):
---> 66     super().insert(index, value)
        index = 0
        value = <Image layer 'membrane' at 0x23f27a69e50>
     67     if self._activate_on_insert:
     68         # Make layer selected and unselect all others
     69         self.selection.active = value

File ~\code\napari\.venv\Lib\site-packages\napari\utils\events\containers\_evented_list.py:205, in EventedList.insert(self=[<Image layer 'membrane' at 0x23f27a69e50>], index=0, value=<Image layer 'membrane'>)
    203 self.events.inserting(index=index)
    204 super().insert(index, value)
--> 205 self.events.inserted(index=index, value=value)
        index = 0
        value = <Image layer 'membrane' at 0x23f27a69e50>
        self.events.inserted = <napari.utils.events.event.EventEmitter object at 0x0000023F19455210>
        self.events = <napari.utils.events.event.EmitterGroup object at 0x0000023F19454950>
        self = [<Image layer 'membrane' at 0x23f27a69e50>]
    206 self._connect_child_emitters(value)

File ~\code\napari\.venv\Lib\site-packages\napari\utils\events\event.py:763, in EventEmitter.__call__(self=<napari.utils.events.event.EventEmitter object>, *args=(), **kwargs={'index': 0, 'value': <Image layer 'membrane'>})
    760     self._block_counter.update([cb])
    761     continue
--> 763 self._invoke_callback(cb, event if pass_event else None)
        event = <Event blocked=False handled=False native=None source=None sources=[] type='inserted'>
        self = <napari.utils.events.event.EventEmitter object at 0x0000023F19455210>
        cb = <bound method ViewerModel._on_add_layer of Viewer(camera=Camera(center=(0.0, 127.5, 127.5), zoom=0.37109375, angles=(0.0, 0.0, 90.0), perspective=0.0, mouse_pan=True, mouse_zoom=True), cursor=Cursor(position=(0.0, 1.0, 0.0), scaled=True, style=<CursorStyle.STANDARD: 'standard'>, size=1.0), dims=Dims(ndim=3, ndisplay=2, order=(0, 1, 2), axis_labels=('0', '1', '2'), range=(RangeTuple(start=0.0, stop=59.0, step=1.0), RangeTuple(start=0.0, stop=255.0, step=1.0), RangeTuple(start=0.0, stop=255.0, step=1.0)), margin_left=(0.0, 0.0, 0.0), margin_right=(0.0, 0.0, 0.0), point=(0.0, 0.0, 0.0), last_used=0), grid=GridCanvas(stride=1, shape=(-1, -1), enabled=False), layers=[<Image layer 'membrane' at 0x23f27a69e50>], help='', status='', tooltip=Tooltip(visible=False, text=''), theme='dark', title='napari', mouse_over_canvas=False, mouse_move_callbacks=[], mouse_drag_callbacks=[], mouse_double_click_callbacks=[], mouse_wheel_callbacks=[<function dims_scroll at 0x0000023F14366340>], _persisted_mouse_event={}, _mouse_drag_gen={}, _mouse_wheel_gen={}, keymap={})>
        pass_event = True
    764 if event.blocked:
    765     break

File ~\code\napari\.venv\Lib\site-packages\napari\utils\events\event.py:801, in EventEmitter._invoke_callback(self=<napari.utils.events.event.EventEmitter object>, cb=<bound method ViewerModel._on_add_layer of Viewe...use_drag_gen={}, _mouse_wheel_gen={}, keymap={})>, event=<Event blocked=False handled=False native=None source=None sources=[] type='inserted'>)
    799     self.disconnect(cb)
    800     return
--> 801 _handle_exception(
        self = <napari.utils.events.event.EventEmitter object at 0x0000023F19455210>
        event = <Event blocked=False handled=False native=None source=None sources=[] type='inserted'>
        cb = <bound method ViewerModel._on_add_layer of Viewer(camera=Camera(center=(0.0, 127.5, 127.5), zoom=0.37109375, angles=(0.0, 0.0, 90.0), perspective=0.0, mouse_pan=True, mouse_zoom=True), cursor=Cursor(position=(0.0, 1.0, 0.0), scaled=True, style=<CursorStyle.STANDARD: 'standard'>, size=1.0), dims=Dims(ndim=3, ndisplay=2, order=(0, 1, 2), axis_labels=('0', '1', '2'), range=(RangeTuple(start=0.0, stop=59.0, step=1.0), RangeTuple(start=0.0, stop=255.0, step=1.0), RangeTuple(start=0.0, stop=255.0, step=1.0)), margin_left=(0.0, 0.0, 0.0), margin_right=(0.0, 0.0, 0.0), point=(0.0, 0.0, 0.0), last_used=0), grid=GridCanvas(stride=1, shape=(-1, -1), enabled=False), layers=[<Image layer 'membrane' at 0x23f27a69e50>], help='', status='', tooltip=Tooltip(visible=False, text=''), theme='dark', title='napari', mouse_over_canvas=False, mouse_move_callbacks=[], mouse_drag_callbacks=[], mouse_double_click_callbacks=[], mouse_wheel_callbacks=[<function dims_scroll at 0x0000023F14366340>], _persisted_mouse_event={}, _mouse_drag_gen={}, _mouse_wheel_gen={}, keymap={})>
        (cb, event) = (<bound method ViewerModel._on_add_layer of Viewer(camera=Camera(center=(0.0, 127.5, 127.5), zoom=0.37109375, angles=(0.0, 0.0, 90.0), perspective=0.0, mouse_pan=True, mouse_zoom=True), cursor=Cursor(position=(0.0, 1.0, 0.0), scaled=True, style=<CursorStyle.STANDARD: 'standard'>, size=1.0), dims=Dims(ndim=3, ndisplay=2, order=(0, 1, 2), axis_labels=('0', '1', '2'), range=(RangeTuple(start=0.0, stop=59.0, step=1.0), RangeTuple(start=0.0, stop=255.0, step=1.0), RangeTuple(start=0.0, stop=255.0, step=1.0)), margin_left=(0.0, 0.0, 0.0), margin_right=(0.0, 0.0, 0.0), point=(0.0, 0.0, 0.0), last_used=0), grid=GridCanvas(stride=1, shape=(-1, -1), enabled=False), layers=[<Image layer 'membrane' at 0x23f27a69e50>], help='', status='', tooltip=Tooltip(visible=False, text=''), theme='dark', title='napari', mouse_over_canvas=False, mouse_move_callbacks=[], mouse_drag_callbacks=[], mouse_double_click_callbacks=[], mouse_wheel_callbacks=[<function dims_scroll at 0x0000023F14366340>], _persisted_mouse_event={}, _mouse_drag_gen={}, _mouse_wheel_gen={}, keymap={})>, <Event blocked=False handled=False native=None source=None sources=[] type='inserted'>)
    802     self.ignore_callback_errors,
    803     self.print_callback_errors,
    804     self,
    805     cb_event=(cb, event),
    806 )

File ~\code\napari\.venv\Lib\site-packages\napari\utils\events\event.py:788, in EventEmitter._invoke_callback(self=<napari.utils.events.event.EventEmitter object>, cb=<bound method ViewerModel._on_add_layer of Viewe...use_drag_gen={}, _mouse_wheel_gen={}, keymap={})>, event=<Event blocked=False handled=False native=None source=None sources=[] type='inserted'>)
    786 try:
    787     if event is not None:
--> 788         cb(event)
        event = <Event blocked=False handled=False native=None source=None sources=[] type='inserted'>
        cb = <bound method ViewerModel._on_add_layer of Viewer(camera=Camera(center=(0.0, 127.5, 127.5), zoom=0.37109375, angles=(0.0, 0.0, 90.0), perspective=0.0, mouse_pan=True, mouse_zoom=True), cursor=Cursor(position=(0.0, 1.0, 0.0), scaled=True, style=<CursorStyle.STANDARD: 'standard'>, size=1.0), dims=Dims(ndim=3, ndisplay=2, order=(0, 1, 2), axis_labels=('0', '1', '2'), range=(RangeTuple(start=0.0, stop=59.0, step=1.0), RangeTuple(start=0.0, stop=255.0, step=1.0), RangeTuple(start=0.0, stop=255.0, step=1.0)), margin_left=(0.0, 0.0, 0.0), margin_right=(0.0, 0.0, 0.0), point=(0.0, 0.0, 0.0), last_used=0), grid=GridCanvas(stride=1, shape=(-1, -1), enabled=False), layers=[<Image layer 'membrane' at 0x23f27a69e50>], help='', status='', tooltip=Tooltip(visible=False, text=''), theme='dark', title='napari', mouse_over_canvas=False, mouse_move_callbacks=[], mouse_drag_callbacks=[], mouse_double_click_callbacks=[], mouse_wheel_callbacks=[<function dims_scroll at 0x0000023F14366340>], _persisted_mouse_event={}, _mouse_drag_gen={}, _mouse_wheel_gen={}, keymap={})>
    789     else:
    790         cb()

File ~\code\napari\.venv\Lib\site-packages\napari\components\viewer_model.py:605, in ViewerModel._on_add_layer(self=Viewer(camera=Camera(center=(0.0, 127.5, 127.5),...ouse_drag_gen={}, _mouse_wheel_gen={}, keymap={}), event=<Event blocked=False handled=False native=None source=None sources=[] type='inserted'>)
    602 if len(self.layers) == 1:
    603     # set dims slider to the middle of all dimensions
    604     self.reset_view()
--> 605     self.dims._go_to_center_step()
        self = Viewer(camera=Camera(center=(0.0, 127.5, 127.5), zoom=0.37109375, angles=(0.0, 0.0, 90.0), perspective=0.0, mouse_pan=True, mouse_zoom=True), cursor=Cursor(position=(0.0, 1.0, 0.0), scaled=True, style=<CursorStyle.STANDARD: 'standard'>, size=1.0), dims=Dims(ndim=3, ndisplay=2, order=(0, 1, 2), axis_labels=('0', '1', '2'), range=(RangeTuple(start=0.0, stop=59.0, step=1.0), RangeTuple(start=0.0, stop=255.0, step=1.0), RangeTuple(start=0.0, stop=255.0, step=1.0)), margin_left=(0.0, 0.0, 0.0), margin_right=(0.0, 0.0, 0.0), point=(0.0, 0.0, 0.0), last_used=0), grid=GridCanvas(stride=1, shape=(-1, -1), enabled=False), layers=[<Image layer 'membrane' at 0x23f27a69e50>], help='', status='', tooltip=Tooltip(visible=False, text=''), theme='dark', title='napari', mouse_over_canvas=False, mouse_move_callbacks=[], mouse_drag_callbacks=[], mouse_double_click_callbacks=[], mouse_wheel_callbacks=[<function dims_scroll at 0x0000023F14366340>], _persisted_mouse_event={}, _mouse_drag_gen={}, _mouse_wheel_gen={}, keymap={})  
        self.dims = Dims(ndim=3, ndisplay=2, order=(0, 1, 2), axis_labels=('0', '1', '2'), range=(RangeTuple(start=0.0, stop=59.0, step=1.0), RangeTuple(start=0.0, stop=255.0, step=1.0), RangeTuple(start=0.0, stop=255.0, step=1.0)), margin_left=(0.0, 0.0, 0.0), margin_right=(0.0, 0.0, 0.0), point=(0.0, 0.0, 0.0), last_used=0)

File ~\code\napari\.venv\Lib\site-packages\napari\components\dims.py:450, in Dims._go_to_center_step(self=Dims(ndim=3, ndisplay=2, order=(0, 1, 2), axis_l...0, 0.0, 0.0), point=(0.0, 0.0, 0.0), last_used=0))
    449 def _go_to_center_step(self):
--> 450     self.current_step = [int((ns - 1) / 2) for ns in self.nsteps]
        self = Dims(ndim=3, ndisplay=2, order=(0, 1, 2), axis_labels=('0', '1', '2'), range=(RangeTuple(start=0.0, stop=59.0, step=1.0), RangeTuple(start=0.0, stop=255.0, step=1.0), RangeTuple(start=0.0, stop=255.0, step=1.0)), margin_left=(0.0, 0.0, 0.0), margin_right=(0.0, 0.0, 0.0), point=(0.0, 0.0, 0.0), last_used=0)

File ~\code\napari\.venv\Lib\site-packages\napari\utils\events\evented_model.py:315, in EventedModel.__setattr__(self=Dims(ndim=3, ndisplay=2, order=(0, 1, 2), axis_l...0, 0.0, 0.0), point=(0.0, 0.0, 0.0), last_used=0), name='current_step', value=[29, 127, 127])
    312         before_deps[dep] = getattr(self, dep, object())
    314 # set value using original setter
--> 315 self._super_setattr_(name, value)
        name = 'current_step'
        self = Dims(ndim=3, ndisplay=2, order=(0, 1, 2), axis_labels=('0', '1', '2'), range=(RangeTuple(start=0.0, stop=59.0, step=1.0), RangeTuple(start=0.0, stop=255.0, step=1.0), RangeTuple(start=0.0, stop=255.0, step=1.0)), margin_left=(0.0, 0.0, 0.0), margin_right=(0.0, 0.0, 0.0), point=(0.0, 0.0, 0.0), last_used=0)
        value = [29, 127, 127]
    317 # if different we emit the event with new value
    318 after = getattr(self, name)

File ~\code\napari\.venv\Lib\site-packages\napari\utils\events\evented_model.py:275, in EventedModel._super_setattr_(self=Dims(ndim=3, ndisplay=2, order=(0, 1, 2), axis_l...0, 0.0, 0.0), point=(0.0, 0.0, 0.0), last_used=0), name='current_step', value=[29, 127, 127])
    272     if setter is None:
    273         # raise same error as normal properties
    274         raise AttributeError(f"can't set attribute '{name}'")
--> 275     setter(self, value)
        setter = <function Dims.current_step at 0x0000023F143651C0>
        self = Dims(ndim=3, ndisplay=2, order=(0, 1, 2), axis_labels=('0', '1', '2'), range=(RangeTuple(start=0.0, stop=59.0, step=1.0), RangeTuple(start=0.0, stop=255.0, step=1.0), RangeTuple(start=0.0, stop=255.0, step=1.0)), margin_left=(0.0, 0.0, 0.0), margin_right=(0.0, 0.0, 0.0), point=(0.0, 0.0, 0.0), last_used=0)
        value = [29, 127, 127]
    276 else:
    277     super().__setattr__(name, value)

File ~\code\napari\.venv\Lib\site-packages\napari\components\dims.py:265, in Dims.current_step(self=Dims(ndim=3, ndisplay=2, order=(0, 1, 2), axis_l...0, 0.0, 0.0), point=(0.0, 0.0, 0.0), last_used=0), value=[29, 127, 127])
    263 @current_step.setter
    264 def current_step(self, value):
--> 265     self.point = tuple(
        self.point = (0.0, 0.0, 0.0)
        self = Dims(ndim=3, ndisplay=2, order=(0, 1, 2), axis_labels=('0', '1', '2'), range=(RangeTuple(start=0.0, stop=59.0, step=1.0), RangeTuple(start=0.0, stop=255.0, step=1.0), RangeTuple(start=0.0, stop=255.0, step=1.0)), margin_left=(0.0, 0.0, 0.0), margin_right=(0.0, 0.0, 0.0), point=(0.0, 0.0, 0.0), last_used=0)
        value = [29, 127, 127]
        self.range = (RangeTuple(start=0.0, stop=59.0, step=1.0), RangeTuple(start=0.0, stop=255.0, step=1.0), RangeTuple(start=0.0, stop=255.0, step=1.0))
    266         rng.start + point * rng.step
    267         for point, rng in zip(value, self.range)
    268     )

File ~\code\napari\.venv\Lib\site-packages\napari\utils\events\evented_model.py:339, in EventedModel.__setattr__(self=Dims(ndim=3, ndisplay=2, order=(0, 1, 2), axis_l...0, 0.0, 0.0), point=(0.0, 0.0, 0.0), last_used=0), name='point', value=(29.0, 127.0, 127.0))
    337     are_equal = pick_equality_operator(after_deps[dep])
    338 if not are_equal(after_deps[dep], value_):
--> 339     getattr(self.events, dep)(value=after_deps[dep])
        after_deps = {'current_step': (29, 127, 127)}
        dep = 'current_step'
        self = Dims(ndim=3, ndisplay=2, order=(0, 1, 2), axis_labels=('0', '1', '2'), range=(RangeTuple(start=0.0, stop=59.0, step=1.0), RangeTuple(start=0.0, stop=255.0, step=1.0), RangeTuple(start=0.0, stop=255.0, step=1.0)), margin_left=(0.0, 0.0, 0.0), margin_right=(0.0, 0.0, 0.0), point=(0.0, 0.0, 0.0), last_used=0)
        after_deps[dep] = (29, 127, 127)

File ~\code\napari\.venv\Lib\site-packages\napari\utils\events\event.py:763, in EventEmitter.__call__(self=<napari.utils.events.event.EventEmitter object>, *args=(), **kwargs={'value': (29, 127, 127)})
    760     self._block_counter.update([cb])
    761     continue
--> 763 self._invoke_callback(cb, event if pass_event else None)
        event = <Event blocked=False handled=False native=None source=None sources=[] type='current_step'>
        self = <napari.utils.events.event.EventEmitter object at 0x0000023F1944E690>
        cb = <bound method MultipleViewerWidget._point_update of <__main__.MultipleViewerWidget object at 0x0000023F24DB2CB0>>
        pass_event = True
    764 if event.blocked:
    765     break

File ~\code\napari\.venv\Lib\site-packages\napari\utils\events\event.py:801, in EventEmitter._invoke_callback(self=<napari.utils.events.event.EventEmitter object>, cb=<bound method MultipleViewerWidget._point_update of <__main__.MultipleViewerWidget object>>, event=<Event blocked=False handled=False native=None source=None sources=[] type='current_step'>)
    799     self.disconnect(cb)
    800     return
--> 801 _handle_exception(
        self = <napari.utils.events.event.EventEmitter object at 0x0000023F1944E690>
        event = <Event blocked=False handled=False native=None source=None sources=[] type='current_step'>
        cb = <bound method MultipleViewerWidget._point_update of <__main__.MultipleViewerWidget object at 0x0000023F24DB2CB0>>
        (cb, event) = (<bound method MultipleViewerWidget._point_update of <__main__.MultipleViewerWidget object at 0x0000023F24DB2CB0>>, <Event blocked=False handled=False native=None source=None sources=[] type='current_step'>)
    802     self.ignore_callback_errors,
    803     self.print_callback_errors,
    804     self,
    805     cb_event=(cb, event),
    806 )

File ~\code\napari\.venv\Lib\site-packages\napari\utils\events\event.py:788, in EventEmitter._invoke_callback(self=<napari.utils.events.event.EventEmitter object>, cb=<bound method MultipleViewerWidget._point_update of <__main__.MultipleViewerWidget object>>, event=<Event blocked=False handled=False native=None source=None sources=[] type='current_step'>)
    786 try:
    787     if event is not None:
--> 788         cb(event)
        event = <Event blocked=False handled=False native=None source=None sources=[] type='current_step'>
        cb = <bound method MultipleViewerWidget._point_update of <__main__.MultipleViewerWidget object at 0x0000023F24DB2CB0>>
    789     else:
    790         cb()

File ~\code\napari\examples\multiple_viewer_widget.py:329, in MultipleViewerWidget._point_update(self=<__main__.MultipleViewerWidget object>, event=<Event blocked=False handled=False native=None source=None sources=[] type='current_step'>)
    327 if model.dims is event.source:
    328     continue
--> 329 model.dims.current_step = event.value
        model = ViewerModel(camera=Camera(center=(0.0, 255.5, 255.5), zoom=0.5009765625, angles=(0.0, 0.0, 90.0), perspective=0.0, mouse_pan=True, mouse_zoom=True), cursor=Cursor(position=(1.0, 1.0), scaled=True, style=<CursorStyle.STANDARD: 'standard'>, size=1.0), dims=Dims(ndim=2, ndisplay=2, order=(0, 1), axis_labels=('0', '1'), range=(RangeTuple(start=0.0, stop=2.0, step=1.0), RangeTuple(start=0.0, stop=2.0, step=1.0)), margin_left=(0.0, 0.0), margin_right=(0.0, 0.0), point=(0.0, 0.0), last_used=0), grid=GridCanvas(stride=1, shape=(-1, -1), enabled=False), layers=[], help='', status='', tooltip=Tooltip(visible=False, text=''), theme='dark', title='model1', mouse_over_canvas=False, mouse_move_callbacks=[], mouse_drag_callbacks=[], mouse_double_click_callbacks=[], mouse_wheel_callbacks=[<function dims_scroll at 0x0000023F14366340>], _persisted_mouse_event={}, _mouse_drag_gen={}, _mouse_wheel_gen={}, keymap={})
        event.value = (29, 127, 127)
        model.dims = Dims(ndim=2, ndisplay=2, order=(0, 1), axis_labels=('0', '1'), range=(RangeTuple(start=0.0, stop=2.0, step=1.0), RangeTuple(start=0.0, stop=2.0, step=1.0)), margin_left=(0.0, 0.0), margin_right=(0.0, 0.0), point=(0.0, 0.0), last_used=0)
        event = <Event blocked=False handled=False native=None source=None sources=[] type='current_step'>

File ~\code\napari\.venv\Lib\site-packages\napari\utils\events\evented_model.py:315, in EventedModel.__setattr__(self=Dims(ndim=2, ndisplay=2, order=(0, 1), axis_labe..._right=(0.0, 0.0), point=(0.0, 0.0), last_used=0), name='current_step', value=(29, 127, 127))
    312         before_deps[dep] = getattr(self, dep, object())
    314 # set value using original setter
--> 315 self._super_setattr_(name, value)
        name = 'current_step'
        self = Dims(ndim=2, ndisplay=2, order=(0, 1), axis_labels=('0', '1'), range=(RangeTuple(start=0.0, stop=2.0, step=1.0), RangeTuple(start=0.0, stop=2.0, step=1.0)), margin_left=(0.0, 0.0), margin_right=(0.0, 0.0), point=(0.0, 0.0), last_used=0)
        value = (29, 127, 127)
    317 # if different we emit the event with new value
    318 after = getattr(self, name)

File ~\code\napari\.venv\Lib\site-packages\napari\utils\events\evented_model.py:275, in EventedModel._super_setattr_(self=Dims(ndim=2, ndisplay=2, order=(0, 1), axis_labe..._right=(0.0, 0.0), point=(0.0, 0.0), last_used=0), name='current_step', value=(29, 127, 127))
    272     if setter is None:
    273         # raise same error as normal properties
    274         raise AttributeError(f"can't set attribute '{name}'")
--> 275     setter(self, value)
        setter = <function Dims.current_step at 0x0000023F143651C0>
        self = Dims(ndim=2, ndisplay=2, order=(0, 1), axis_labels=('0', '1'), range=(RangeTuple(start=0.0, stop=2.0, step=1.0), RangeTuple(start=0.0, stop=2.0, step=1.0)), margin_left=(0.0, 0.0), margin_right=(0.0, 0.0), point=(0.0, 0.0), last_used=0)
        value = (29, 127, 127)
    276 else:
    277     super().__setattr__(name, value)

File ~\code\napari\.venv\Lib\site-packages\napari\components\dims.py:265, in Dims.current_step(self=Dims(ndim=2, ndisplay=2, order=(0, 1), axis_labe..._right=(0.0, 0.0), point=(0.0, 0.0), last_used=0), value=(29, 127, 127))
    263 @current_step.setter
    264 def current_step(self, value):
--> 265     self.point = tuple(
        self.point = (0.0, 0.0)
        self = Dims(ndim=2, ndisplay=2, order=(0, 1), axis_labels=('0', '1'), range=(RangeTuple(start=0.0, stop=2.0, step=1.0), RangeTuple(start=0.0, stop=2.0, step=1.0)), margin_left=(0.0, 0.0), margin_right=(0.0, 0.0), point=(0.0, 0.0), last_used=0)
        value = (29, 127, 127)
        self.range = (RangeTuple(start=0.0, stop=2.0, step=1.0), RangeTuple(start=0.0, stop=2.0, step=1.0))
    266         rng.start + point * rng.step
    267         for point, rng in zip(value, self.range)
    268     )

File ~\code\napari\.venv\Lib\site-packages\napari\utils\events\evented_model.py:339, in EventedModel.__setattr__(self=Dims(ndim=2, ndisplay=2, order=(0, 1), axis_labe..._right=(0.0, 0.0), point=(0.0, 0.0), last_used=0), name='point', value=(29.0, 127.0))
    337     are_equal = pick_equality_operator(after_deps[dep])
    338 if not are_equal(after_deps[dep], value_):
--> 339     getattr(self.events, dep)(value=after_deps[dep])
        after_deps = {'current_step': (2, 2)}
        dep = 'current_step'
        self = Dims(ndim=2, ndisplay=2, order=(0, 1), axis_labels=('0', '1'), range=(RangeTuple(start=0.0, stop=2.0, step=1.0), RangeTuple(start=0.0, stop=2.0, step=1.0)), margin_left=(0.0, 0.0), margin_right=(0.0, 0.0), point=(0.0, 0.0), last_used=0)
        after_deps[dep] = (2, 2)

File ~\code\napari\.venv\Lib\site-packages\napari\utils\events\event.py:763, in EventEmitter.__call__(self=<napari.utils.events.event.EventEmitter object>, *args=(), **kwargs={'value': (2, 2)})
    760     self._block_counter.update([cb])
    761     continue
--> 763 self._invoke_callback(cb, event if pass_event else None)
        event = <Event blocked=False handled=False native=None source=None sources=[] type='current_step'>
        self = <napari.utils.events.event.EventEmitter object at 0x0000023F24D53AD0>
        cb = <bound method MultipleViewerWidget._point_update of <__main__.MultipleViewerWidget object at 0x0000023F24DB2CB0>>
        pass_event = True
    764 if event.blocked:
    765     break

File ~\code\napari\.venv\Lib\site-packages\napari\utils\events\event.py:801, in EventEmitter._invoke_callback(self=<napari.utils.events.event.EventEmitter object>, cb=<bound method MultipleViewerWidget._point_update of <__main__.MultipleViewerWidget object>>, event=<Event blocked=False handled=False native=None source=None sources=[] type='current_step'>)
    799     self.disconnect(cb)
    800     return
--> 801 _handle_exception(
        self = <napari.utils.events.event.EventEmitter object at 0x0000023F24D53AD0>
        event = <Event blocked=False handled=False native=None source=None sources=[] type='current_step'>
        cb = <bound method MultipleViewerWidget._point_update of <__main__.MultipleViewerWidget object at 0x0000023F24DB2CB0>>
        (cb, event) = (<bound method MultipleViewerWidget._point_update of <__main__.MultipleViewerWidget object at 0x0000023F24DB2CB0>>, <Event blocked=False handled=False native=None source=None sources=[] type='current_step'>)
    802     self.ignore_callback_errors,
    803     self.print_callback_errors,
    804     self,
    805     cb_event=(cb, event),
    806 )

File ~\code\napari\.venv\Lib\site-packages\napari\utils\events\event.py:788, in EventEmitter._invoke_callback(self=<napari.utils.events.event.EventEmitter object>, cb=<bound method MultipleViewerWidget._point_update of <__main__.MultipleViewerWidget object>>, event=<Event blocked=False handled=False native=None source=None sources=[] type='current_step'>)
    786 try:
    787     if event is not None:
--> 788         cb(event)
        event = <Event blocked=False handled=False native=None source=None sources=[] type='current_step'>
        cb = <bound method MultipleViewerWidget._point_update of <__main__.MultipleViewerWidget object at 0x0000023F24DB2CB0>>
    789     else:
    790         cb()

File ~\code\napari\examples\multiple_viewer_widget.py:329, in MultipleViewerWidget._point_update(self=<__main__.MultipleViewerWidget object>, event=<Event blocked=False handled=False native=None source=None sources=[] type='current_step'>)
    327 if model.dims is event.source:
    328     continue
--> 329 model.dims.current_step = event.value
        model = Viewer(camera=Camera(center=(0.0, 127.5, 127.5), zoom=0.37109375, angles=(0.0, 0.0, 90.0), perspective=0.0, mouse_pan=True, mouse_zoom=True), cursor=Cursor(position=(0.0, 1.0, 0.0), scaled=True, style=<CursorStyle.STANDARD: 'standard'>, size=1.0), dims=Dims(ndim=3, ndisplay=2, order=(0, 1, 2), axis_labels=('0', '1', '2'), range=(RangeTuple(start=0.0, stop=59.0, step=1.0), RangeTuple(start=0.0, stop=255.0, step=1.0), RangeTuple(start=0.0, stop=255.0, step=1.0)), margin_left=(0.0, 0.0, 0.0), margin_right=(0.0, 0.0, 0.0), point=(0.0, 0.0, 0.0), last_used=0), grid=GridCanvas(stride=1, shape=(-1, -1), enabled=False), layers=[<Image layer 'membrane' at 0x23f27a69e50>], help='', status='', tooltip=Tooltip(visible=False, text=''), theme='dark', title='napari', mouse_over_canvas=False, mouse_move_callbacks=[], mouse_drag_callbacks=[], mouse_double_click_callbacks=[], mouse_wheel_callbacks=[<function dims_scroll at 0x0000023F14366340>], _persisted_mouse_event={}, _mouse_drag_gen={}, _mouse_wheel_gen={}, keymap={}) 
        event.value = (2, 2)
        model.dims = Dims(ndim=3, ndisplay=2, order=(0, 1, 2), axis_labels=('0', '1', '2'), range=(RangeTuple(start=0.0, stop=59.0, step=1.0), RangeTuple(start=0.0, stop=255.0, step=1.0), RangeTuple(start=0.0, stop=255.0, step=1.0)), margin_left=(0.0, 0.0, 0.0), margin_right=(0.0, 0.0, 0.0), point=(0.0, 0.0, 0.0), last_used=0)
        event = <Event blocked=False handled=False native=None source=None sources=[] type='current_step'>

    [... skipping similar frames: EventEmitter.__call__ at line 763 (367 times), EventedModel.__setattr__ at line 315 (367 times), EventedModel.__setattr__ at line 339 (367 times), EventEmitter._invoke_callback at line 801 (367 times), EventedModel._super_setattr_ at line 275 (367 times), Dims.current_step at line 265 (367 times), EventEmitter._invoke_callback at line 788 (366 times), MultipleViewerWidget._point_update at line 329 (366 times)]

File ~\code\napari\.venv\Lib\site-packages\napari\utils\events\event.py:788, in EventEmitter._invoke_callback(self=<napari.utils.events.event.EventEmitter object>, cb=<bound method MultipleViewerWidget._point_update of <__main__.MultipleViewerWidget object>>, event=<Event blocked=False handled=False native=None source=None sources=[] type='current_step'>)
    786 try:
    787     if event is not None:
--> 788         cb(event)
        event = <Event blocked=False handled=False native=None source=None sources=[] type='current_step'>
        cb = <bound method MultipleViewerWidget._point_update of <__main__.MultipleViewerWidget object at 0x0000023F24DB2CB0>>
    789     else:
    790         cb()

File ~\code\napari\examples\multiple_viewer_widget.py:329, in MultipleViewerWidget._point_update(self=<__main__.MultipleViewerWidget object>, event=<Event blocked=False handled=False native=None source=None sources=[] type='current_step'>)
    327 if model.dims is event.source:
    328     continue
--> 329 model.dims.current_step = event.value
        model = Viewer(camera=Camera(center=(0.0, 127.5, 127.5), zoom=0.37109375, angles=(0.0, 0.0, 90.0), perspective=0.0, mouse_pan=True, mouse_zoom=True), cursor=Cursor(position=(0.0, 1.0, 0.0), scaled=True, style=<CursorStyle.STANDARD: 'standard'>, size=1.0), dims=Dims(ndim=3, ndisplay=2, order=(0, 1, 2), axis_labels=('0', '1', '2'), range=(RangeTuple(start=0.0, stop=59.0, step=1.0), RangeTuple(start=0.0, stop=255.0, step=1.0), RangeTuple(start=0.0, stop=255.0, step=1.0)), margin_left=(0.0, 0.0, 0.0), margin_right=(0.0, 0.0, 0.0), point=(0.0, 0.0, 0.0), last_used=0), grid=GridCanvas(stride=1, shape=(-1, -1), enabled=False), layers=[<Image layer 'membrane' at 0x23f27a69e50>], help='', status='', tooltip=Tooltip(visible=False, text=''), theme='dark', title='napari', mouse_over_canvas=False, mouse_move_callbacks=[], mouse_drag_callbacks=[], mouse_double_click_callbacks=[], mouse_wheel_callbacks=[<function dims_scroll at 0x0000023F14366340>], _persisted_mouse_event={}, _mouse_drag_gen={}, _mouse_wheel_gen={}, keymap={}) 
        event.value = (0, 0)
        model.dims = Dims(ndim=3, ndisplay=2, order=(0, 1, 2), axis_labels=('0', '1', '2'), range=(RangeTuple(start=0.0, stop=59.0, step=1.0), RangeTuple(start=0.0, stop=255.0, step=1.0), RangeTuple(start=0.0, stop=255.0, step=1.0)), margin_left=(0.0, 0.0, 0.0), margin_right=(0.0, 0.0, 0.0), point=(0.0, 0.0, 0.0), last_used=0)
        event = <Event blocked=False handled=False native=None source=None sources=[] type='current_step'>

File ~\code\napari\.venv\Lib\site-packages\napari\utils\events\evented_model.py:315, in EventedModel.__setattr__(self=Dims(ndim=3, ndisplay=2, order=(0, 1, 2), axis_l...0, 0.0, 0.0), point=(0.0, 0.0, 0.0), last_used=0), name='current_step', value=(0, 0))
    312         before_deps[dep] = getattr(self, dep, object())
    314 # set value using original setter
--> 315 self._super_setattr_(name, value)
        name = 'current_step'
        self = Dims(ndim=3, ndisplay=2, order=(0, 1, 2), axis_labels=('0', '1', '2'), range=(RangeTuple(start=0.0, stop=59.0, step=1.0), RangeTuple(start=0.0, stop=255.0, step=1.0), RangeTuple(start=0.0, stop=255.0, step=1.0)), margin_left=(0.0, 0.0, 0.0), margin_right=(0.0, 0.0, 0.0), point=(0.0, 0.0, 0.0), last_used=0)
        value = (0, 0)
    317 # if different we emit the event with new value
    318 after = getattr(self, name)

File ~\code\napari\.venv\Lib\site-packages\napari\utils\events\evented_model.py:275, in EventedModel._super_setattr_(self=Dims(ndim=3, ndisplay=2, order=(0, 1, 2), axis_l...0, 0.0, 0.0), point=(0.0, 0.0, 0.0), last_used=0), name='current_step', value=(0, 0))
    272     if setter is None:
    273         # raise same error as normal properties
    274         raise AttributeError(f"can't set attribute '{name}'")
--> 275     setter(self, value)
        setter = <function Dims.current_step at 0x0000023F143651C0>
        self = Dims(ndim=3, ndisplay=2, order=(0, 1, 2), axis_labels=('0', '1', '2'), range=(RangeTuple(start=0.0, stop=59.0, step=1.0), RangeTuple(start=0.0, stop=255.0, step=1.0), RangeTuple(start=0.0, stop=255.0, step=1.0)), margin_left=(0.0, 0.0, 0.0), margin_right=(0.0, 0.0, 0.0), point=(0.0, 0.0, 0.0), last_used=0)
        value = (0, 0)
    276 else:
    277     super().__setattr__(name, value)

File ~\code\napari\.venv\Lib\site-packages\napari\components\dims.py:265, in Dims.current_step(self=Dims(ndim=3, ndisplay=2, order=(0, 1, 2), axis_l...0, 0.0, 0.0), point=(0.0, 0.0, 0.0), last_used=0), value=(0, 0))
    263 @current_step.setter
    264 def current_step(self, value):
--> 265     self.point = tuple(
        self.point = (0.0, 0.0, 0.0)
        self = Dims(ndim=3, ndisplay=2, order=(0, 1, 2), axis_labels=('0', '1', '2'), range=(RangeTuple(start=0.0, stop=59.0, step=1.0), RangeTuple(start=0.0, stop=255.0, step=1.0), RangeTuple(start=0.0, stop=255.0, step=1.0)), margin_left=(0.0, 0.0, 0.0), margin_right=(0.0, 0.0, 0.0), point=(0.0, 0.0, 0.0), last_used=0)
        value = (0, 0)
        self.range = (RangeTuple(start=0.0, stop=59.0, step=1.0), RangeTuple(start=0.0, stop=255.0, step=1.0), RangeTuple(start=0.0, stop=255.0, step=1.0))
    266         rng.start + point * rng.step
    267         for point, rng in zip(value, self.range)
    268     )

File ~\code\napari\.venv\Lib\site-packages\napari\utils\events\evented_model.py:339, in EventedModel.__setattr__(self=Dims(ndim=3, ndisplay=2, order=(0, 1, 2), axis_l...0, 0.0, 0.0), point=(0.0, 0.0, 0.0), last_used=0), name='point', value=(0.0, 0.0))
    337     are_equal = pick_equality_operator(after_deps[dep])
    338 if not are_equal(after_deps[dep], value_):
--> 339     getattr(self.events, dep)(value=after_deps[dep])
        after_deps = {'current_step': (0, 0, 0)}
        dep = 'current_step'
        self = Dims(ndim=3, ndisplay=2, order=(0, 1, 2), axis_labels=('0', '1', '2'), range=(RangeTuple(start=0.0, stop=59.0, step=1.0), RangeTuple(start=0.0, stop=255.0, step=1.0), RangeTuple(start=0.0, stop=255.0, step=1.0)), margin_left=(0.0, 0.0, 0.0), margin_right=(0.0, 0.0, 0.0), point=(0.0, 0.0, 0.0), last_used=0)
        after_deps[dep] = (0, 0, 0)

File ~\code\napari\.venv\Lib\site-packages\napari\utils\events\event.py:763, in EventEmitter.__call__(self=<napari.utils.events.event.EventEmitter object>, *args=(), **kwargs={'value': (0, 0, 0)})
    760     self._block_counter.update([cb])
    761     continue
--> 763 self._invoke_callback(cb, event if pass_event else None)
        event = <Event blocked=False handled=False native=None source=None sources=[] type='current_step'>
        self = <napari.utils.events.event.EventEmitter object at 0x0000023F1944E690>
        cb = <bound method ViewerModel._update_layers of Viewer(camera=Camera(center=(0.0, 127.5, 127.5), zoom=0.37109375, angles=(0.0, 0.0, 90.0), perspective=0.0, mouse_pan=True, mouse_zoom=True), cursor=Cursor(position=(0.0, 1.0, 0.0), scaled=True, style=<CursorStyle.STANDARD: 'standard'>, size=1.0), dims=Dims(ndim=3, ndisplay=2, order=(0, 1, 2), axis_labels=('0', '1', '2'), range=(RangeTuple(start=0.0, stop=59.0, step=1.0), RangeTuple(start=0.0, stop=255.0, step=1.0), RangeTuple(start=0.0, stop=255.0, step=1.0)), margin_left=(0.0, 0.0, 0.0), margin_right=(0.0, 0.0, 0.0), point=(0.0, 0.0, 0.0), last_used=0), grid=GridCanvas(stride=1, shape=(-1, -1), enabled=False), layers=[<Image layer 'membrane' at 0x23f27a69e50>], help='', status='', tooltip=Tooltip(visible=False, text=''), theme='dark', title='napari', mouse_over_canvas=False, mouse_move_callbacks=[], mouse_drag_callbacks=[], mouse_double_click_callbacks=[], mouse_wheel_callbacks=[<function dims_scroll at 0x0000023F14366340>], _persisted_mouse_event={}, _mouse_drag_gen={}, _mouse_wheel_gen={}, keymap={})>
        pass_event = False
    764 if event.blocked:
    765     break

File ~\code\napari\.venv\Lib\site-packages\napari\utils\events\event.py:801, in EventEmitter._invoke_callback(self=<napari.utils.events.event.EventEmitter object>, cb=<bound method ViewerModel._update_layers of View...use_drag_gen={}, _mouse_wheel_gen={}, keymap={})>, event=None)
    799     self.disconnect(cb)
    800     return
--> 801 _handle_exception(
        self = <napari.utils.events.event.EventEmitter object at 0x0000023F1944E690>
        event = None
        cb = <bound method ViewerModel._update_layers of Viewer(camera=Camera(center=(0.0, 127.5, 127.5), zoom=0.37109375, angles=(0.0, 0.0, 90.0), perspective=0.0, mouse_pan=True, mouse_zoom=True), cursor=Cursor(position=(0.0, 1.0, 0.0), scaled=True, style=<CursorStyle.STANDARD: 'standard'>, size=1.0), dims=Dims(ndim=3, ndisplay=2, order=(0, 1, 2), axis_labels=('0', '1', '2'), range=(RangeTuple(start=0.0, stop=59.0, step=1.0), RangeTuple(start=0.0, stop=255.0, step=1.0), RangeTuple(start=0.0, stop=255.0, step=1.0)), margin_left=(0.0, 0.0, 0.0), margin_right=(0.0, 0.0, 0.0), point=(0.0, 0.0, 0.0), last_used=0), grid=GridCanvas(stride=1, shape=(-1, -1), enabled=False), layers=[<Image layer 'membrane' at 0x23f27a69e50>], help='', status='', tooltip=Tooltip(visible=False, text=''), theme='dark', title='napari', mouse_over_canvas=False, mouse_move_callbacks=[], mouse_drag_callbacks=[], mouse_double_click_callbacks=[], mouse_wheel_callbacks=[<function dims_scroll at 0x0000023F14366340>], _persisted_mouse_event={}, _mouse_drag_gen={}, _mouse_wheel_gen={}, keymap={})>
        (cb, event) = (<bound method ViewerModel._update_layers of Viewer(camera=Camera(center=(0.0, 127.5, 127.5), zoom=0.37109375, angles=(0.0, 0.0, 90.0), perspective=0.0, mouse_pan=True, mouse_zoom=True), cursor=Cursor(position=(0.0, 1.0, 0.0), scaled=True, style=<CursorStyle.STANDARD: 'standard'>, size=1.0), dims=Dims(ndim=3, ndisplay=2, order=(0, 1, 2), axis_labels=('0', '1', '2'), range=(RangeTuple(start=0.0, stop=59.0, step=1.0), RangeTuple(start=0.0, stop=255.0, step=1.0), RangeTuple(start=0.0, stop=255.0, step=1.0)), margin_left=(0.0, 0.0, 0.0), margin_right=(0.0, 0.0, 0.0), point=(0.0, 0.0, 0.0), last_used=0), grid=GridCanvas(stride=1, shape=(-1, -1), enabled=False), layers=[<Image layer 'membrane' at 0x23f27a69e50>], help='', status='', tooltip=Tooltip(visible=False, text=''), theme='dark', title='napari', mouse_over_canvas=False, mouse_move_callbacks=[], mouse_drag_callbacks=[], mouse_double_click_callbacks=[], mouse_wheel_callbacks=[<function dims_scroll at 0x0000023F14366340>], _persisted_mouse_event={}, _mouse_drag_gen={}, _mouse_wheel_gen={}, keymap={})>, None)
    802     self.ignore_callback_errors,
    803     self.print_callback_errors,
    804     self,
    805     cb_event=(cb, event),
    806 )

File ~\code\napari\.venv\Lib\site-packages\napari\utils\events\event.py:790, in EventEmitter._invoke_callback(self=<napari.utils.events.event.EventEmitter object>, cb=<bound method ViewerModel._update_layers of View...use_drag_gen={}, _mouse_wheel_gen={}, keymap={})>, event=None)
    788         cb(event)
    789     else:
--> 790         cb()
        cb = <bound method ViewerModel._update_layers of Viewer(camera=Camera(center=(0.0, 127.5, 127.5), zoom=0.37109375, angles=(0.0, 0.0, 90.0), perspective=0.0, mouse_pan=True, mouse_zoom=True), cursor=Cursor(position=(0.0, 1.0, 0.0), scaled=True, style=<CursorStyle.STANDARD: 'standard'>, size=1.0), dims=Dims(ndim=3, ndisplay=2, order=(0, 1, 2), axis_labels=('0', '1', '2'), range=(RangeTuple(start=0.0, stop=59.0, step=1.0), RangeTuple(start=0.0, stop=255.0, step=1.0), RangeTuple(start=0.0, stop=255.0, step=1.0)), margin_left=(0.0, 0.0, 0.0), margin_right=(0.0, 0.0, 0.0), point=(0.0, 0.0, 0.0), last_used=0), grid=GridCanvas(stride=1, shape=(-1, -1), enabled=False), layers=[<Image layer 'membrane' at 0x23f27a69e50>], help='', status='', tooltip=Tooltip(visible=False, text=''), theme='dark', title='napari', mouse_over_canvas=False, mouse_move_callbacks=[], mouse_drag_callbacks=[], mouse_double_click_callbacks=[], mouse_wheel_callbacks=[<function dims_scroll at 0x0000023F14366340>], _persisted_mouse_event={}, _mouse_drag_gen={}, _mouse_wheel_gen={}, keymap={})>
    791 except Exception as e:  # noqa: BLE001
    792     # dead Qt object with living python pointer. not importing Qt
    793     # here... but this error is consistent across backends
    794     if (
    795         isinstance(e, RuntimeError)
    796         and 'C++' in str(e)
    797         and str(e).endswith(('has been deleted', 'already deleted.'))
    798     ):

File ~\code\napari\.venv\Lib\site-packages\napari\components\viewer_model.py:425, in ViewerModel._update_layers(self=Viewer(camera=Camera(center=(0.0, 127.5, 127.5),...ouse_drag_gen={}, _mouse_wheel_gen={}, keymap={}), layers=[<Image layer 'membrane' at 0x23f27a69e50>])
    417 """Updates the contained layers.
    418
    419 Parameters
   (...)
    422     List of layers to update. If none provided updates all.
    423 """
    424 layers = layers or self.layers
--> 425 self._layer_slicer.submit(layers=layers, dims=self.dims)
        layers = [<Image layer 'membrane' at 0x23f27a69e50>]
        self = Viewer(camera=Camera(center=(0.0, 127.5, 127.5), zoom=0.37109375, angles=(0.0, 0.0, 90.0), perspective=0.0, mouse_pan=True, mouse_zoom=True), cursor=Cursor(position=(0.0, 1.0, 0.0), scaled=True, style=<CursorStyle.STANDARD: 'standard'>, size=1.0), dims=Dims(ndim=3, ndisplay=2, order=(0, 1, 2), axis_labels=('0', '1', '2'), range=(RangeTuple(start=0.0, stop=59.0, step=1.0), RangeTuple(start=0.0, stop=255.0, step=1.0), RangeTuple(start=0.0, stop=255.0, step=1.0)), margin_left=(0.0, 0.0, 0.0), margin_right=(0.0, 0.0, 0.0), point=(0.0, 0.0, 0.0), last_used=0), grid=GridCanvas(stride=1, shape=(-1, -1), enabled=False), layers=[<Image layer 'membrane' at 0x23f27a69e50>], help='', status='', tooltip=Tooltip(visible=False, text=''), theme='dark', title='napari', mouse_over_canvas=False, mouse_move_callbacks=[], mouse_drag_callbacks=[], mouse_double_click_callbacks=[], mouse_wheel_callbacks=[<function dims_scroll at 0x0000023F14366340>], _persisted_mouse_event={}, _mouse_drag_gen={}, _mouse_wheel_gen={}, keymap={})  
        self._layer_slicer = <napari.components._layer_slicer._LayerSlicer object at 0x0000023F19457BD0>
        self.dims = Dims(ndim=3, ndisplay=2, order=(0, 1, 2), axis_labels=('0', '1', '2'), range=(RangeTuple(start=0.0, stop=59.0, step=1.0), RangeTuple(start=0.0, stop=255.0, step=1.0), RangeTuple(start=0.0, stop=255.0, step=1.0)), margin_left=(0.0, 0.0, 0.0), margin_right=(0.0, 0.0, 0.0), point=(0.0, 0.0, 0.0), last_used=0)
    426 # If the currently selected layer is sliced asynchronously, then the value
    427 # shown with this position may be incorrect. See the discussion for more details:
    428 # https://github.com/napari/napari/pull/5377#discussion_r1036280855
    429 position = list(self.cursor.position)

File ~\code\napari\.venv\Lib\site-packages\napari\components\_layer_slicer.py:228, in _LayerSlicer.submit(self=<napari.components._layer_slicer._LayerSlicer object>, layers=[<Image layer 'membrane' at 0x23f27a69e50>], dims=Dims(ndim=3, ndisplay=2, order=(0, 1, 2), axis_l...0, 0.0, 0.0), point=(0.0, 0.0, 0.0), last_used=0), force=False)
    226 # Then execute sync slicing tasks to run concurrent with async ones.
    227 for layer in sync_layers:
--> 228     layer._slice_dims(
        layer = <Image layer 'membrane' at 0x23f27a69e50>
        dims = Dims(ndim=3, ndisplay=2, order=(0, 1, 2), axis_labels=('0', '1', '2'), range=(RangeTuple(start=0.0, stop=59.0, step=1.0), RangeTuple(start=0.0, stop=255.0, step=1.0), RangeTuple(start=0.0, stop=255.0, step=1.0)), margin_left=(0.0, 0.0, 0.0), margin_right=(0.0, 0.0, 0.0), point=(0.0, 0.0, 0.0), last_used=0)
        force = False
        dims.point = (0.0, 0.0, 0.0)
        dims.ndisplay = 2
        dims.order = (0, 1, 2)
    229         dims.point, dims.ndisplay, dims.order, force=force
    230     )
    232 return task

File ~\code\napari\.venv\Lib\site-packages\napari\layers\base\base.py:1150, in Layer._slice_dims(self=<Image layer 'membrane'>, point=(0.0, 0.0, 0.0), ndisplay=2, order=(0, 1, 2), force=False)
   1148 if force or (self._slice_input != slice_input):
   1149     self._slice_input = slice_input
-> 1150     self._refresh_sync()
        self = <Image layer 'membrane' at 0x23f27a69e50>

File ~\code\napari\.venv\Lib\site-packages\napari\layers\base\base.py:1373, in Layer._refresh_sync(self=<Image layer 'membrane'>, event=None)       
   1371 logger.debug('Layer._refresh_sync: %s', self)
   1372 if self.visible:
-> 1373     self.set_view_slice()
        self = <Image layer 'membrane' at 0x23f27a69e50>
   1374     self.events.set_data()
   1375     self._update_thumbnail()

File ~\code\napari\.venv\Lib\site-packages\napari\layers\base\base.py:1113, in Layer.set_view_slice(self=<Image layer 'membrane'>)
   1111 def set_view_slice(self):
   1112     with self.dask_optimized_slicing():
-> 1113         self._set_view_slice()
        self = <Image layer 'membrane' at 0x23f27a69e50>

File ~\code\napari\.venv\Lib\site-packages\napari\layers\image\image.py:716, in _ImageBase._set_view_slice(self=<Image layer 'membrane'>)
    713 """Set the slice output based on this layer's current state."""
    714 # Skip if any non-displayed data indices are out of bounds.
    715 # This can happen when slicing layers with different extents.
--> 716 indices = self._slice_indices
        self = <Image layer 'membrane' at 0x23f27a69e50>
    717 for d in self._slice_input.not_displayed:
    718     if (indices[d] < 0) or (indices[d] > self._extent_data[1][d]):

File ~\code\napari\.venv\Lib\site-packages\napari\layers\base\base.py:914, in Layer._slice_indices(self=<Image layer 'membrane'>)
    910 if len(self._slice_input.not_displayed) == 0:
    911     # All dims are displayed dimensions
    912     return (slice(None),) * self.ndim
    913 return self._slice_input.data_indices(
--> 914     self._data_to_world.inverse,
        self._slice_input = _SliceInput(ndisplay=2, point=(0.0, 0.0, 0.0), order=(0, 1, 2))
        self = <Image layer 'membrane' at 0x23f27a69e50>
    915     getattr(self, '_round_index', True),
    916 )

File ~\code\napari\.venv\Lib\site-packages\napari\layers\base\base.py:1455, in Layer._data_to_world(self=<Image layer 'membrane'>)
   1446 @property
   1447 def _data_to_world(self) -> Affine:
   1448     """The transform from data to world coordinates.
   1449
   1450     This affine transform is composed from the affine property and the
   (...)
   1453     affine * (rotate * shear * scale + translate)
   1454     """
-> 1455     return self._transforms[1:3].simplified
        self._transforms = [<napari.utils.transforms.transforms.Affine object at 0x0000023F2E189DD0>, <napari.utils.transforms.transforms.CompositeAffine object at 0x0000023F285A6790>, <napari.utils.transforms.transforms.Affine object at 0x0000023F285A7410>, <napari.utils.transforms.transforms.Affine object at 0x0000023F27A684D0>]
        self = <Image layer 'membrane' at 0x23f27a69e50>

File ~\code\napari\.venv\Lib\site-packages\napari\utils\events\containers\_typed.py:148, in TypedMutableSequence.__getitem__(self=[<napari.utils.transforms.transforms.Affine obje....transforms.Affine object at 0x0000023F27A684D0>], key=slice(1, 3, None))
    145         raise KeyError(str(e)) from e
    147 result = self._list[key]
--> 148 return self.__newlike__(result) if isinstance(result, list) else result
        result = [<napari.utils.transforms.transforms.CompositeAffine object at 0x0000023F285A6790>, <napari.utils.transforms.transforms.Affine object at 0x0000023F285A7410>]
        self = [<napari.utils.transforms.transforms.Affine object at 0x0000023F2E189DD0>, <napari.utils.transforms.transforms.CompositeAffine object at 0x0000023F285A6790>, <napari.utils.transforms.transforms.Affine object at 0x0000023F285A7410>, <napari.utils.transforms.transforms.Affine object at 0x0000023F27A684D0>]

File ~\code\napari\.venv\Lib\site-packages\napari\utils\transforms\transforms.py:130, in TransformChain.__newlike__(self=[<napari.utils.transforms.transforms.Affine obje....transforms.Affine object at 0x0000023F27A684D0>], iterable=[<napari.utils.transforms.transforms.CompositeAffine object>, <napari.utils.transforms.transforms.Affine object>])
    129 def __newlike__(self, iterable):
--> 130     return TransformChain(iterable)
        TransformChain = <class 'napari.utils.transforms.transforms.TransformChain'>
        iterable = [<napari.utils.transforms.transforms.CompositeAffine object at 0x0000023F285A6790>, <napari.utils.transforms.transforms.Affine object at 0x0000023F285A7410>]

File ~\code\napari\.venv\Lib\site-packages\napari\utils\transforms\transforms.py:116, in TransformChain.__init__(self=<class 'napari.utils.transforms.transforms.TransformChain'> instance, transforms=[<napari.utils.transforms.transforms.CompositeAffine object>, <napari.utils.transforms.transforms.Affine object>])
    114 if transforms is None:
    115     transforms = []
--> 116 super().__init__(
        transforms = [<napari.utils.transforms.transforms.CompositeAffine object at 0x0000023F285A6790>, <napari.utils.transforms.transforms.Affine object at 0x0000023F285A7410>]
    117     data=transforms,
    118     basetype=Transform,
    119     lookup={str: lambda x: x.name},
    120 )
    121 # The above super().__init__() will not call Transform.__init__().
    122 # For that to work every __init__() called using super() needs to
    123 # in turn call super().__init__(). So we call it explicitly here.
    124 Transform.__init__(self)

File ~\code\napari\.venv\Lib\site-packages\napari\utils\events\containers\_evented_list.py:118, in EventedList.__init__(self=<class 'napari.utils.transforms.transforms.TransformChain'> instance, data=[<napari.utils.transforms.transforms.CompositeAffine object>, <napari.utils.transforms.transforms.Affine object>], basetype=<class 'napari.utils.transforms.transforms.Transform'>, lookup={<class 'str'>: <function TransformChain.__init__.<locals>.<lambda>>})
    115     self.events.add(**_events)
    116 else:
    117     # otherwise create a new one
--> 118     self.events = EmitterGroup(source=self, **_events)
        _events = {'inserting': None, 'inserted': None, 'removing': None, 'removed': None, 'moving': None, 'moved': None, 'changed': None, 'reordered': None}
        Exception trying to inspect frame. No more locals available.
    119 super().__init__(data, basetype=basetype, lookup=lookup)

File ~\code\napari\.venv\Lib\site-packages\napari\utils\events\event.py:975, in EmitterGroup.__init__(self=<napari.utils.events.event.EmitterGroup object>, source=<class 'napari.utils.transforms.transforms.TransformChain'> instance, auto_connect=False, **emitters={'changed': None, 'inserted': None, 'inserting': None, 'moved': None, 'moving': None, 'removed': None, 'removing': None, 'reordered': None})
    973 # whether the sub-emitters have been connected to the group:
    974 self._emitters_connected: bool = False
--> 975 self.add(**emitters)
        self = <napari.utils.events.event.EmitterGroup object at 0x0000023F2E1897D0>
        emitters = {'inserting': None, 'inserted': None, 'removing': None, 'removed': None, 'moving': None, 'moved': None, 'changed': None, 'reordered': None}

File ~\code\napari\.venv\Lib\site-packages\napari\utils\events\event.py:1044, in EmitterGroup.add(self=<napari.utils.events.event.EmitterGroup object>, auto_connect=False, **kwargs={'changed': None, 'inserted': None, 'inserting': None, 'moved': None, 'moving': None, 'removed': None, 'removing': None, 'reordered': None})
   1041     emitter = Event
   1043 if inspect.isclass(emitter) and issubclass(emitter, Event):  # type: ignore
-> 1044     emitter = EventEmitter(
        emitter = <class 'napari.utils.events.event.Event'>
        name = 'inserting'
        self = <napari.utils.events.event.EmitterGroup object at 0x0000023F2E1897D0>
   1045         source=self.source, type_name=name, event_class=emitter  # type: ignore
   1046     )
   1047 elif not isinstance(emitter, EventEmitter):
   1048     raise RuntimeError(
   1049         trans._(
   1050             'Emitter must be specified as either an EventEmitter instance or Event subclass. (got {name}={emitter})',
   (...)
   1054         )
   1055     )

File ~\code\napari\.venv\Lib\site-packages\napari\utils\migrations.py:59, in rename_argument.<locals>._wrapper.<locals>._update_from_dict(*args=(<napari.utils.events.event.EventEmitter object>,), **kwargs=<class 'dict'> instance)
     57     kwargs = kwargs.copy()
     58     kwargs[to_name] = kwargs.pop(from_name)
---> 59 return func(*args, **kwargs)
        func = <function EventEmitter.__init__ at 0x0000023F13BF23E0>
        Exception trying to inspect frame. No more locals available.

File ~\code\napari\.venv\Lib\site-packages\napari\utils\events\event.py:301, in EventEmitter.__init__(self=<napari.utils.events.event.EventEmitter object>, source=<class 'napari.utils.transforms.transforms.TransformChain'> instance, type_name='inserting', event_class=<class 'napari.utils.events.event.Event'>)
    299 # count number of times this emitter is blocked for each callback.
    300 self._blocked: Dict[Optional[Callback], int] = {None: 0}
--> 301 self._block_counter: _WeakCounter[Optional[Callback]] = _WeakCounter()
        self = <napari.utils.events.event.EventEmitter object at 0x0000023F2E213550>
        Callback = typing.Union[typing.Callable[[napari.utils.events.event.Event], NoneType], typing.Callable[[], NoneType]]
    303 # used to detect emitter loops
    304 self._emitting = False

File ~\code\napari\.venv\Lib\site-packages\napari\utils\events\event.py:232, in _WeakCounter.__init__(self=<napari.utils.events.event._WeakCounter object>)
    231 def __init__(self) -> None:
--> 232     self._counter = weakref.WeakKeyDictionary()
        self = <napari.utils.events.event._WeakCounter object at 0x0000023F2E213B10>
        weakref.WeakKeyDictionary = <class 'weakref.WeakKeyDictionary'>
    233     self._nonecount = 0

File ~\AppData\Local\Programs\Python\Python311\Lib\weakref.py:369, in WeakKeyDictionary.__init__(self=<WeakKeyDictionary>, dict=None)
    367 def __init__(self, dict=None):
    368     self.data = {}
--> 369     def remove(k, selfref=ref(self)):
        self = <WeakKeyDictionary at 0x23f2e211310>
        ref = <class 'weakref.ReferenceType'>
    370         self = selfref()
    371         if self is not None:

RecursionError: maximum recursion depth exceeded while calling a Python object
```
</details>
Thanks @Czaki !

I have a related issue concerning this script.

A script I work on based on `multiple_viewer_widget.py` adds a `Points` layer to the viewer. Like this:

```python
if __name__ == "__main__":
    from qtpy import QtCore, QtWidgets
    QtWidgets.QApplication.setAttribute(QtCore.Qt.AA_ShareOpenGLContexts)
    # above two lines are needed to allow to undock the widget with
    # additional viewers
    view = napari.Viewer()
    dock_widget = MultipleViewerWidget(view)
    cross = CrossWidget(view)

    view.window.add_dock_widget(dock_widget, name="Sample")
    view.window.add_dock_widget(cross, name="Cross", area="left")

    from napari.layers import Points
    view.add_layer(Points(ndim=3))

    napari.run()
```

It works fine on Linux with napari 0.4.18. But on Windows I get this strange error:

```
Traceback (most recent call last):
  File "C:\Users\jeanp\code\napari\examples\multiple_viewer_widget.py", line 465, in <module>
    view.add_layer(Points(ndim=3))
  File "C:\Users\jeanp\code\spfluo-app\.venv\Lib\site-packages\napari\components\viewer_model.py", line 652, in add_layer
    self.layers.append(layer)
  File "<frozen _collections_abc>", line 1078, in append
  File "C:\Users\jeanp\code\spfluo-app\.venv\Lib\site-packages\napari\components\layerlist.py", line 167, in insert
    super().insert(index, new_layer)
  File "C:\Users\jeanp\code\spfluo-app\.venv\Lib\site-packages\napari\utils\events\containers\_selectable_list.py", line 66, in insert
    super().insert(index, value)
  File "C:\Users\jeanp\code\spfluo-app\.venv\Lib\site-packages\napari\utils\events\containers\_evented_list.py", line 195, in insert
    self.events.inserted(index=index, value=value)
  File "C:\Users\jeanp\code\spfluo-app\.venv\Lib\site-packages\napari\utils\events\event.py", line 768, in __call__
    self._invoke_callback(cb, event if pass_event else None)
  File "C:\Users\jeanp\code\spfluo-app\.venv\Lib\site-packages\napari\utils\events\event.py", line 806, in _invoke_callback
    _handle_exception(
  File "C:\Users\jeanp\code\spfluo-app\.venv\Lib\site-packages\napari\utils\events\event.py", line 793, in _invoke_callback
    cb(event)
  File "C:\Users\jeanp\code\napari\examples\multiple_viewer_widget.py", line 349, in _layer_added
    event.index, copy_layer(event.value, "model1")
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\jeanp\code\napari\examples\multiple_viewer_widget.py", line 61, in copy_layer
    return copy_layer_le_4_16(layer, name)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\jeanp\code\napari\examples\multiple_viewer_widget.py", line 44, in copy_layer_le_4_16
    res_layer = deepcopy(layer)
                ^^^^^^^^^^^^^^^
  File "C:\Users\jeanp\AppData\Local\Programs\Python\Python311\Lib\copy.py", line 172, in deepcopy
    y = _reconstruct(x, memo, *rv)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\jeanp\AppData\Local\Programs\Python\Python311\Lib\copy.py", line 271, in _reconstruct
    state = deepcopy(state, memo)
            ^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\jeanp\AppData\Local\Programs\Python\Python311\Lib\copy.py", line 146, in deepcopy
    y = copier(x, memo)
        ^^^^^^^^^^^^^^^
  File "C:\Users\jeanp\AppData\Local\Programs\Python\Python311\Lib\copy.py", line 231, in _deepcopy_dict
    y[deepcopy(key, memo)] = deepcopy(value, memo)
                             ^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\jeanp\AppData\Local\Programs\Python\Python311\Lib\copy.py", line 172, in deepcopy
    y = _reconstruct(x, memo, *rv)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\jeanp\AppData\Local\Programs\Python\Python311\Lib\copy.py", line 271, in _reconstruct
    state = deepcopy(state, memo)
            ^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\jeanp\AppData\Local\Programs\Python\Python311\Lib\copy.py", line 146, in deepcopy
    y = copier(x, memo)
        ^^^^^^^^^^^^^^^
  File "C:\Users\jeanp\AppData\Local\Programs\Python\Python311\Lib\copy.py", line 231, in _deepcopy_dict
    y[deepcopy(key, memo)] = deepcopy(value, memo)
                             ^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\jeanp\AppData\Local\Programs\Python\Python311\Lib\copy.py", line 172, in deepcopy
    y = _reconstruct(x, memo, *rv)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\jeanp\AppData\Local\Programs\Python\Python311\Lib\copy.py", line 271, in _reconstruct
    state = deepcopy(state, memo)
            ^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\jeanp\AppData\Local\Programs\Python\Python311\Lib\copy.py", line 146, in deepcopy
    y = copier(x, memo)
        ^^^^^^^^^^^^^^^
  File "C:\Users\jeanp\AppData\Local\Programs\Python\Python311\Lib\copy.py", line 231, in _deepcopy_dict
    y[deepcopy(key, memo)] = deepcopy(value, memo)
                             ^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\jeanp\AppData\Local\Programs\Python\Python311\Lib\copy.py", line 161, in deepcopy
    rv = reductor(4)
         ^^^^^^^^^^^
AttributeError: type object '__mypyc_lambda__0___init___SignalInstance_obj' has no attribute '__mypyc_attrs__'
```



It is totally different error. I will try to check it later on Windows (I also use Linux). 
It looks like a bug in the build psygnal. 

Try: `pip install --no-binary psygnal psygnal==0.9.1 --force` 
@tlambert03 does this looks like a bug in psygnal?
> It is totally different error. I will try to check it later on Windows (I also use Linux). It looks like a bug in the build psygnal.
> 
> Try: `pip install --no-binary psygnal psygnal==0.9.1 --force`

Thanks it works !
will have a look!
unfortunately, I also wasn't able to reproduce this on a Windows machine, with the same package versions listed in the original post.  either with the `multiple_viewer_widget` example or with the modified `__main__` posted above.  @jplumail, have you tried to reproduce this in a fresh environment?
@tlambert03 did you tray with mypyc compiled version? (there are no wheels for linux)
oh interesting, looks like the conda distribution isn't compiling.  (I know there are no linux wheels and I'm not on linux anyway, but I assumed conda would be building the same wheels, will have to look into that separately).  I had created my environment with `conda create -n envname napari`, rebuilding with pip now
I just tried again in a fresh environment with venv+pip and I got the same bugs.
ok, yep!  creating with pip and with using the modified script from https://github.com/napari/napari/issues/6140#issuecomment-1674678046, I can reproduce,  thanks @jplumail!  will dig in
side-note @Czaki, if `deepcopy(some_layer)` is something you want to be able to do, it might be worth adding that to napari tests.  (I'll also make sure that psygnal stuff is deep-copiable)
fix in psygnal in https://github.com/pyapp-kit/psygnal/pull/222
The more I look into this the more i think that `deepcopy(some_layer)` is really quite a bug-prone process in napari at this point.  I can likely make this specific stack trace disappear, but I feel like deepcopying a layer is almost certain to lead to some unexpected results (if not straight out exceptions).  Among other reasons: [deepcopying ignores weakrefs](https://stackoverflow.com/a/46205191).  

so, consider all of the places in napari where weakrefs are used to prevent memory leaks and whatnot (as in psygnal).  When you deepcopy something (which, recall, implies _recursively_ copying all objects), then those weakrefs will turn into dead refs, which will either result in an exception only later when a callback is attempted, or will just result in a difficult-to-debug issue where just nothing happens:

<details>

```python
import weakref
from copy import copy, deepcopy
from typing import Any


class T:
    def __init__(self, obj) -> None:
        print("construct", id(obj))
        self._obj = weakref.ref(obj)

    def __reduce__(self) -> str | tuple[Any, ...]:
        return (T, (self._obj(),))


class O:
    pass


x = O()
t = T(x)

t1 = copy(t)
t2 = deepcopy(t)

print(t1._obj, t2._obj)
```

```
construct 4545628112
construct 4545628112
construct 4545990928
<weakref at 0x10ef2a840; to 'O' at 0x10ef0c7d0> <weakref at 0x10ef36c00; dead>
```

</details>

I *could* special case this by specifically implementing a `__deepcopy__` method to get around this and transfer the weakrefs to the copied method.  but a) that kinda breaks the assumption of a *deep* (recursive) copy and b) it seems risky: there's likely a good reason that deepcopy specifically ignored weakrefs.

So, @Czaki,  I think your usage of deepcopy in multi_viewer needs to be reconsidered here as well.  I see this multi_viewer script as an interesting workaround to some deep problems in napari.  Specifically: the fact that it's so hard to simply spin up a second view on the viewer list model necessitated you actually creating two completely different models.  What _exactly_ should the implication be when deep copying a layer?  Should all of the callbacks connected to events be killed?  copied? what about weakrefs? etc...

In summary: while we can probably put a patch over this stack trace, I think it's just kicking the can down the road.  This is likely a bug-prone example/use-case in general
potential issues surrounding deepcopy of layers notwithstanding, psygnal 0.9.2 should fix the modified `multiple_viewer_widget` script described in https://github.com/napari/napari/issues/6140#issuecomment-1674678046. 
I'm not sure if that means this issue can be closed or not... but just fyi
Thanks @tlambert03 ! I just checked my script with the newest psygnal and it works.
This can be closed yes.

Resolving patch:
diff --git a/examples/multiple_viewer_widget.py b/examples/multiple_viewer_widget.py
--- a/examples/multiple_viewer_widget.py
+++ b/examples/multiple_viewer_widget.py
@@ -58,7 +58,7 @@ def copy_layer_le_4_16(layer: Layer, name: str = ""):
 
 
 def copy_layer(layer: Layer, name: str = ""):
-    if NAPARI_GE_4_16:
+    if not NAPARI_GE_4_16:
         return copy_layer_le_4_16(layer, name)
 
     res_layer = Layer.create(*layer.as_layer_data_tuple())


Test patch: