1- from typing import Any , Dict , List , Optional , Tuple , Union
1+ from typing import Any , Optional , Union
22
33import napari
44import numpy .typing as npt
@@ -40,7 +40,7 @@ def draw(self) -> None:
4040 self .axes .set_xlabel (x_axis_name )
4141 self .axes .set_ylabel (y_axis_name )
4242
43- def _get_data (self ) -> Tuple [npt .NDArray [Any ], npt .NDArray [Any ], str , str ]:
43+ def _get_data (self ) -> tuple [npt .NDArray [Any ], npt .NDArray [Any ], str , str ]:
4444 """
4545 Get the plot data.
4646
@@ -67,7 +67,7 @@ class ScatterWidget(ScatterBaseWidget):
6767 n_layers_input = Interval (2 , 2 )
6868 input_layer_types = (napari .layers .Image ,)
6969
70- def _get_data (self ) -> Tuple [npt .NDArray [Any ], npt .NDArray [Any ], str , str ]:
70+ def _get_data (self ) -> tuple [npt .NDArray [Any ], npt .NDArray [Any ], str , str ]:
7171 """
7272 Get the plot data.
7373
@@ -106,7 +106,7 @@ def __init__(
106106
107107 self .layout ().addLayout (QVBoxLayout ())
108108
109- self ._selectors : Dict [str , QComboBox ] = {}
109+ self ._selectors : dict [str , QComboBox ] = {}
110110 for dim in ["x" , "y" ]:
111111 self ._selectors [dim ] = QComboBox ()
112112 # Re-draw when combo boxes are updated
@@ -147,7 +147,7 @@ def y_axis_key(self, key: str) -> None:
147147 self ._selectors ["y" ].setCurrentText (key )
148148 self ._draw ()
149149
150- def _get_valid_axis_keys (self ) -> List [str ]:
150+ def _get_valid_axis_keys (self ) -> list [str ]:
151151 """
152152 Get the valid axis keys from the layer FeatureTable.
153153
@@ -186,7 +186,7 @@ def draw(self) -> None:
186186 if self ._ready_to_scatter ():
187187 super ().draw ()
188188
189- def _get_data (self ) -> Tuple [npt .NDArray [Any ], npt .NDArray [Any ], str , str ]:
189+ def _get_data (self ) -> tuple [npt .NDArray [Any ], npt .NDArray [Any ], str , str ]:
190190 """
191191 Get the plot data from the ``features`` attribute of the first
192192 selected layer.
0 commit comments