Skip to content

Commit 35a6055

Browse files
committed
add tests
1 parent 7fcecb5 commit 35a6055

File tree

1 file changed

+22
-9
lines changed

1 file changed

+22
-9
lines changed

src/spikeinterface/widgets/tests/test_widgets.py

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,14 @@ def test_plot_unit_waveforms(self):
190190
backend=backend,
191191
**self.backend_kwargs[backend],
192192
)
193+
# channel ids
194+
sw.plot_unit_waveforms(
195+
self.sorting_analyzer_sparse,
196+
channel_ids=self.sorting_analyzer_sparse.channel_ids[::3],
197+
unit_ids=unit_ids,
198+
backend=backend,
199+
**self.backend_kwargs[backend],
200+
)
193201
# test warning with "larger" sparsity
194202
with self.assertWarns(UserWarning):
195203
sw.plot_unit_waveforms(
@@ -205,18 +213,18 @@ def test_plot_unit_templates(self):
205213
for backend in possible_backends:
206214
if backend not in self.skip_backends:
207215
print(f"Testing backend {backend}")
208-
print("Dense")
216+
# dense
209217
sw.plot_unit_templates(self.sorting_analyzer_dense, backend=backend, **self.backend_kwargs[backend])
210218
unit_ids = self.sorting.unit_ids[:6]
211-
print("Dense + radius")
219+
# dense + radius
212220
sw.plot_unit_templates(
213221
self.sorting_analyzer_dense,
214222
sparsity=self.sparsity_radius,
215223
unit_ids=unit_ids,
216224
backend=backend,
217225
**self.backend_kwargs[backend],
218226
)
219-
print("Dense + best")
227+
# dense + best
220228
sw.plot_unit_templates(
221229
self.sorting_analyzer_dense,
222230
sparsity=self.sparsity_best,
@@ -225,15 +233,13 @@ def test_plot_unit_templates(self):
225233
**self.backend_kwargs[backend],
226234
)
227235
# test different shadings
228-
print("Sparse")
229236
sw.plot_unit_templates(
230237
self.sorting_analyzer_sparse,
231238
unit_ids=unit_ids,
232239
templates_percentile_shading=None,
233240
backend=backend,
234241
**self.backend_kwargs[backend],
235242
)
236-
print("Sparse2")
237243
sw.plot_unit_templates(
238244
self.sorting_analyzer_sparse,
239245
unit_ids=unit_ids,
@@ -242,8 +248,6 @@ def test_plot_unit_templates(self):
242248
backend=backend,
243249
**self.backend_kwargs[backend],
244250
)
245-
# test different shadings
246-
print("Sparse3")
247251
sw.plot_unit_templates(
248252
self.sorting_analyzer_sparse,
249253
unit_ids=unit_ids,
@@ -252,15 +256,14 @@ def test_plot_unit_templates(self):
252256
shade_templates=False,
253257
**self.backend_kwargs[backend],
254258
)
255-
print("Sparse4")
256259
sw.plot_unit_templates(
257260
self.sorting_analyzer_sparse,
258261
unit_ids=unit_ids,
259262
templates_percentile_shading=0.1,
260263
backend=backend,
261264
**self.backend_kwargs[backend],
262265
)
263-
print("Extra sparsity")
266+
# extra sparsity
264267
sw.plot_unit_templates(
265268
self.sorting_analyzer_sparse,
266269
sparsity=self.sparsity_strict,
@@ -269,6 +272,16 @@ def test_plot_unit_templates(self):
269272
backend=backend,
270273
**self.backend_kwargs[backend],
271274
)
275+
# channel ids
276+
sw.plot_unit_templates(
277+
self.sorting_analyzer_sparse,
278+
channel_ids=self.sorting_analyzer_sparse.channel_ids[::3],
279+
unit_ids=unit_ids,
280+
templates_percentile_shading=[1, 10, 90, 99],
281+
backend=backend,
282+
**self.backend_kwargs[backend],
283+
)
284+
272285
# test "larger" sparsity
273286
with self.assertWarns(UserWarning):
274287
sw.plot_unit_templates(

0 commit comments

Comments
 (0)