@@ -24,22 +24,19 @@ def __init__(
24
24
napari_viewer : napari .viewer .Viewer ,
25
25
parent : Optional [QWidget ] = None ,
26
26
):
27
- print ("ScatterBase init" )
28
27
super ().__init__ (napari_viewer , parent = parent )
29
28
self .add_single_axes ()
30
29
31
30
def clear (self ) -> None :
32
31
"""
33
32
Clear the axes.
34
33
"""
35
- print ("ScatterBase clear" )
36
34
self .axes .clear ()
37
35
38
36
def draw (self ) -> None :
39
37
"""
40
38
Scatter the currently selected layers.
41
39
"""
42
- print ("ScatterBase draw" )
43
40
x , y , x_axis_name , y_axis_name = self ._get_data ()
44
41
45
42
if x .size > self ._threshold_to_switch_to_histogram :
@@ -94,7 +91,6 @@ def _get_data(self) -> Tuple[npt.NDArray[Any], npt.NDArray[Any], str, str]:
94
91
y_axis_name: str
95
92
The title to display on the y axis
96
93
"""
97
- print ("Scatter get data" )
98
94
x = self .layers [0 ].data [self .current_z ]
99
95
y = self .layers [1 ].data [self .current_z ]
100
96
x_axis_name = self .layers [0 ].name
@@ -123,14 +119,12 @@ def __init__(
123
119
napari_viewer : napari .viewer .Viewer ,
124
120
parent : Optional [QWidget ] = None ,
125
121
):
126
- print ("FeatureScatter init" )
127
122
super ().__init__ (napari_viewer , parent = parent )
128
123
129
124
self .layout ().addLayout (QVBoxLayout ())
130
125
131
126
self ._selectors : Dict [str , QComboBox ] = {}
132
127
for dim in ["x" , "y" ]:
133
- # pdb.set_trace()
134
128
self ._selectors [dim ] = QComboBox ()
135
129
# Re-draw when combo boxes are updated
136
130
self ._selectors [dim ].currentTextChanged .connect (self ._draw )
@@ -145,17 +139,13 @@ def x_axis_key(self) -> Union[str, None]:
145
139
"""
146
140
Key for the x-axis data.
147
141
"""
148
- # print('Feat x axis key @property')
149
142
if self ._selectors ["x" ].count () == 0 :
150
- print ("IF X self selectors count = 0" )
151
143
return None
152
144
else :
153
- # print('ELSE X self selectors currentText')
154
145
return self ._selectors ["x" ].currentText ()
155
146
156
147
@x_axis_key .setter
157
148
def x_axis_key (self , key : str ) -> None :
158
- print ("Feat x axis key @setter = " , key )
159
149
self ._selectors ["x" ].setCurrentText (key )
160
150
self ._draw ()
161
151
@@ -164,17 +154,13 @@ def y_axis_key(self) -> Union[str, None]:
164
154
"""
165
155
Key for the y-axis data.
166
156
"""
167
- # print('Feat y axis key @property')
168
157
if self ._selectors ["y" ].count () == 0 :
169
- print ("IF Y self selectors count = 0" )
170
158
return None
171
159
else :
172
- # print('ELSE Y self selectors currentText')
173
160
return self ._selectors ["y" ].currentText ()
174
161
175
162
@y_axis_key .setter
176
163
def y_axis_key (self , key : str ) -> None :
177
- print ("Feat y axis key @setter = " , key )
178
164
self ._selectors ["y" ].setCurrentText (key )
179
165
self ._draw ()
180
166
@@ -188,7 +174,6 @@ def _get_valid_axis_keys(self) -> List[str]:
188
174
The valid axis keys in the FeatureTable. If the table is empty
189
175
or there isn't a table, returns an empty list.
190
176
"""
191
- print ("Feat get valid axis keys" )
192
177
if len (self .layers ) == 0 or not (hasattr (self .layers [0 ], "features" )):
193
178
return []
194
179
else :
@@ -199,8 +184,6 @@ def _ready_to_scatter(self) -> bool:
199
184
Return True if selected layer has a feature table we can scatter with,
200
185
and the two columns to be scatterd have been selected.
201
186
"""
202
- # pdb.set_trace()
203
- print ("Feat ready to scatter" )
204
187
if not hasattr (self .layers [0 ], "features" ):
205
188
return False
206
189
@@ -217,7 +200,6 @@ def draw(self) -> None:
217
200
"""
218
201
Scatter two features from the currently selected layer.
219
202
"""
220
- print ("Feat draw" )
221
203
if self ._ready_to_scatter ():
222
204
super ().draw ()
223
205
@@ -238,8 +220,6 @@ def _get_data(self) -> Tuple[npt.NDArray[Any], npt.NDArray[Any], str, str]:
238
220
The title to display on the y axis. Returns
239
221
an empty string if nothing to plot.
240
222
"""
241
- # pdb.set_trace()
242
- print ("Feat get data" )
243
223
feature_table = self .layers [0 ].features
244
224
245
225
x = feature_table [self .x_axis_key ]
@@ -248,20 +228,15 @@ def _get_data(self) -> Tuple[npt.NDArray[Any], npt.NDArray[Any], str, str]:
248
228
x_axis_name = str (self .x_axis_key )
249
229
y_axis_name = str (self .y_axis_key )
250
230
251
- print ("x-axis = " , str (self .x_axis_key ))
252
- print ("y-axis = " , str (self .y_axis_key ))
253
-
254
231
return x , y , x_axis_name , y_axis_name
255
232
256
233
def on_update_layers (self ) -> None :
257
234
"""
258
235
Called when the layer selection changes by ``self.update_layers()``.
259
236
"""
260
237
# Clear combobox
261
- print ("Feat on update layers" )
262
238
for dim in ["x" , "y" ]:
263
239
while self ._selectors [dim ].count () > 0 :
264
240
self ._selectors [dim ].removeItem (0 )
265
241
# Add keys for newly selected layer
266
- # pdb.set_trace()
267
242
self ._selectors [dim ].addItems (self ._get_valid_axis_keys ())
0 commit comments