Skip to content

Commit 79f0206

Browse files
committed
Respond to Joe review
1 parent 9d3aa2a commit 79f0206

4 files changed

Lines changed: 4 additions & 69 deletions

File tree

src/spikeinterface/qualitymetrics/tests/conftest.py

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@
55
create_sorting_analyzer,
66
)
77

8-
job_kwargs = dict(n_jobs=-1, progress_bar=True, chunk_duration="1s")
8+
job_kwargs = dict(n_jobs=2, progress_bar=True, chunk_duration="1s")
99

1010

11-
def _small_sorting_analyzer():
11+
@pytest.fixture(scope="module")
12+
def small_sorting_analyzer():
1213
recording, sorting = generate_ground_truth_recording(
1314
durations=[2.0],
1415
num_units=10,
@@ -35,12 +36,7 @@ def _small_sorting_analyzer():
3536

3637

3738
@pytest.fixture(scope="module")
38-
def small_sorting_analyzer():
39-
return _small_sorting_analyzer()
40-
41-
42-
def _sorting_analyzer_simple():
43-
39+
def sorting_analyzer_simple():
4440
# we need high firing rate for amplitude_cutoff
4541
recording, sorting = generate_ground_truth_recording(
4642
durations=[
@@ -73,16 +69,3 @@ def _sorting_analyzer_simple():
7369
sorting_analyzer.compute("spike_amplitudes", **job_kwargs)
7470

7571
return sorting_analyzer
76-
77-
78-
@pytest.fixture(scope="module")
79-
def sorting_analyzer_simple():
80-
sorting_analyzer = get_sorting_analyzer(seed=2205)
81-
return sorting_analyzer
82-
83-
return sorting_analyzer
84-
85-
86-
@pytest.fixture(scope="module")
87-
def sorting_analyzer_simple():
88-
return _sorting_analyzer_simple()

src/spikeinterface/qualitymetrics/tests/test_metrics_functions.py

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -536,40 +536,3 @@ def test_calculate_sd_ratio(sorting_analyzer_simple):
536536
assert np.all(list(sd_ratio.keys()) == sorting_analyzer_simple.unit_ids)
537537
# @aurelien can you check this, this is not working anymore
538538
# assert np.allclose(list(sd_ratio.values()), 1, atol=0.25, rtol=0)
539-
540-
541-
if __name__ == "__main__":
542-
543-
test_unit_structure_in_output(small_sorting_analyzer)
544-
test_unit_id_order_independence(small_sorting_analyzer)
545-
546-
test_synchrony_counts_no_sync()
547-
test_synchrony_counts_one_sync()
548-
test_synchrony_counts_one_quad_sync()
549-
test_synchrony_counts_not_all_units()
550-
551-
test_mahalanobis_metrics()
552-
test_lda_metrics()
553-
test_nearest_neighbors_metrics()
554-
test_silhouette_score_metrics()
555-
test_simplified_silhouette_score_metrics()
556-
557-
test_calculate_firing_rate_num_spikes(sorting_analyzer_simple)
558-
test_calculate_snrs(sorting_analyzer)
559-
test_calculate_amplitude_cutoff(sorting_analyzer)
560-
test_calculate_presence_ratio(sorting_analyzer)
561-
test_calculate_amplitude_median(sorting_analyzer)
562-
test_calculate_sliding_rp_violations(sorting_analyzer)
563-
test_calculate_drift_metrics(sorting_analyzer)
564-
test_synchrony_metrics(sorting_analyzer)
565-
test_synchrony_metrics_unit_id_subset(sorting_analyzer)
566-
test_synchrony_metrics_no_unit_ids(sorting_analyzer)
567-
test_calculate_firing_range(sorting_analyzer)
568-
test_calculate_amplitude_cv_metrics(sorting_analyzer)
569-
test_calculate_sd_ratio(sorting_analyzer)
570-
571-
sorting_analyzer_violations = _sorting_analyzer_violations()
572-
# print(sorting_analyzer_violations)
573-
test_calculate_isi_violations(sorting_analyzer_violations)
574-
test_calculate_sliding_rp_violations(sorting_analyzer_violations)
575-
test_calculate_rp_violations(sorting_analyzer_violations)

src/spikeinterface/qualitymetrics/tests/test_pca_metrics.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,3 @@ def test_calculate_pc_metrics(small_sorting_analyzer):
2222
assert not np.all(np.isnan(res2[metric_name].values))
2323

2424
assert np.array_equal(res1[metric_name].values, res2[metric_name].values)
25-
26-
27-
if __name__ == "__main__":
28-
29-
test_calculate_pc_metrics(small_sorting_analyzer)

src/spikeinterface/qualitymetrics/tests/test_quality_metric_calculator.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -245,9 +245,3 @@ def test_empty_units(sorting_analyzer_simple):
245245
# for metric_name in metrics.columns:
246246
# # NaNs are skipped
247247
# assert np.allclose(metrics[metric_name].dropna(), metrics_par[metric_name].dropna())
248-
249-
if __name__ == "__main__":
250-
251-
test_compute_quality_metrics(sorting_analyzer_simple)
252-
test_compute_quality_metrics_recordingless(sorting_analyzer_simple)
253-
test_empty_units(sorting_analyzer_simple)

0 commit comments

Comments
 (0)