Skip to content

Commit

Permalink
Port plot_confusion_matrix to new API.
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelgarcia committed Sep 19, 2023
1 parent 46c4ada commit e49071e
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 95 deletions.
3 changes: 0 additions & 3 deletions src/spikeinterface/widgets/_legacy_mpl_widgets/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@
# units on probe
from .unitprobemap import plot_unit_probe_map, UnitProbeMapWidget

# comparison related
from .confusionmatrix import plot_confusion_matrix, ConfusionMatrixWidget

from .multicompgraph import (
plot_multicomp_graph,
MultiCompGraphWidget,
Expand Down
91 changes: 0 additions & 91 deletions src/spikeinterface/widgets/_legacy_mpl_widgets/confusionmatrix.py

This file was deleted.

9 changes: 8 additions & 1 deletion src/spikeinterface/widgets/tests/test_widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,12 @@ def test_plot_agreement_matrix(self):
if backend not in self.skip_backends:
sw.plot_agreement_matrix(self.gt_comp)

def test_plot_confusion_matrix(self):
possible_backends = list(sw.AgreementMatrixWidget.get_possible_backends())
for backend in possible_backends:
if backend not in self.skip_backends:
sw.plot_confusion_matrix(self.gt_comp)



if __name__ == "__main__":
Expand All @@ -352,7 +358,8 @@ def test_plot_agreement_matrix(self):
# mytest.test_quality_metrics()
# mytest.test_template_metrics()
# mytest.test_amplitudes()
mytest.test_plot_agreement_matrix()
# mytest.test_plot_agreement_matrix()
mytest.test_plot_confusion_matrix()

# plt.ion()
plt.show()
3 changes: 3 additions & 0 deletions src/spikeinterface/widgets/widget_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from .all_amplitudes_distributions import AllAmplitudesDistributionsWidget
from .amplitudes import AmplitudesWidget
from .autocorrelograms import AutoCorrelogramsWidget
from .confusion_matrix import ConfusionMatrixWidget
from .crosscorrelograms import CrossCorrelogramsWidget
from .motion import MotionWidget
from .quality_metrics import QualityMetricsWidget
Expand All @@ -28,6 +29,7 @@
AllAmplitudesDistributionsWidget,
AmplitudesWidget,
AutoCorrelogramsWidget,
ConfusionMatrixWidget,
CrossCorrelogramsWidget,
MotionWidget,
QualityMetricsWidget,
Expand Down Expand Up @@ -82,6 +84,7 @@
plot_all_amplitudes_distributions = AllAmplitudesDistributionsWidget
plot_amplitudes = AmplitudesWidget
plot_autocorrelograms = AutoCorrelogramsWidget
plot_confusion_matrix = ConfusionMatrixWidget
plot_crosscorrelograms = CrossCorrelogramsWidget
plot_motion = MotionWidget
plot_quality_metrics = QualityMetricsWidget
Expand Down

0 comments on commit e49071e

Please sign in to comment.