1
- from typing import Any , Dict , List , Optional , Tuple , Union
1
+ from typing import Any , Optional , Union
2
2
3
3
import napari
4
4
import numpy .typing as npt
@@ -40,7 +40,7 @@ def draw(self) -> None:
40
40
self .axes .set_xlabel (x_axis_name )
41
41
self .axes .set_ylabel (y_axis_name )
42
42
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 ]:
44
44
"""
45
45
Get the plot data.
46
46
@@ -67,7 +67,7 @@ class ScatterWidget(ScatterBaseWidget):
67
67
n_layers_input = Interval (2 , 2 )
68
68
input_layer_types = (napari .layers .Image ,)
69
69
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 ]:
71
71
"""
72
72
Get the plot data.
73
73
@@ -106,7 +106,7 @@ def __init__(
106
106
107
107
self .layout ().addLayout (QVBoxLayout ())
108
108
109
- self ._selectors : Dict [str , QComboBox ] = {}
109
+ self ._selectors : dict [str , QComboBox ] = {}
110
110
for dim in ["x" , "y" ]:
111
111
self ._selectors [dim ] = QComboBox ()
112
112
# Re-draw when combo boxes are updated
@@ -147,7 +147,7 @@ def y_axis_key(self, key: str) -> None:
147
147
self ._selectors ["y" ].setCurrentText (key )
148
148
self ._draw ()
149
149
150
- def _get_valid_axis_keys (self ) -> List [str ]:
150
+ def _get_valid_axis_keys (self ) -> list [str ]:
151
151
"""
152
152
Get the valid axis keys from the layer FeatureTable.
153
153
@@ -186,7 +186,7 @@ def draw(self) -> None:
186
186
if self ._ready_to_scatter ():
187
187
super ().draw ()
188
188
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 ]:
190
190
"""
191
191
Get the plot data from the ``features`` attribute of the first
192
192
selected layer.
0 commit comments