Skip to content

Commit ade9e08

Browse files
committed
renaming
1 parent 25d515b commit ade9e08

2 files changed

Lines changed: 16 additions & 16 deletions

File tree

src/spikeinterface/comparison/paircomparisons.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def __init__(
3333
match_score: float = 0.5,
3434
chance_score: float = 0.1,
3535
ensure_symmetry: bool = False,
36-
agreement_method: str = "from_count",
36+
agreement_method: str = "count",
3737
n_jobs: int = 1,
3838
verbose: bool = False,
3939
):
@@ -89,7 +89,7 @@ def _do_agreement(self):
8989

9090
# common to GroundTruthComparison and SymmetricSortingComparison
9191
# spike count for each spike train
92-
if self.agreement_method == "from_count":
92+
if self.agreement_method == "count":
9393
self.event_counts1 = do_count_event(self.sorting1)
9494
self.event_counts2 = do_count_event(self.sorting2)
9595

@@ -102,7 +102,7 @@ def _do_agreement(self):
102102
self.agreement_scores = make_agreement_scores_from_count(
103103
self.match_event_count, self.event_counts1, self.event_counts2
104104
)
105-
elif self.agreement_method == "distance_function":
105+
elif self.agreement_method == "distance":
106106

107107
self.agreement_scores = calculate_agreement_scores_with_distance(
108108
self.sorting1,
@@ -141,9 +141,9 @@ class SymmetricSortingComparison(BasePairSorterComparison):
141141
Minimum agreement score to match units
142142
chance_score : float, default: 0.1
143143
Minimum agreement score to for a possible match
144-
agreement_method : "from_count" | "distance_function", default: "from_count"
145-
The method to compute agreement scores. The "from_count" method computes agreement scores from spike counts.
146-
The "distance_function" method computes agreement scores from spike time distance functions.
144+
agreement_method : "count" | "distance", default: "count"
145+
The method to compute agreement scores. The "count" method computes agreement scores from spike counts.
146+
The "distance" method computes agreement scores from spike time distance functions.
147147
n_jobs : int, default: -1
148148
Number of cores to use in parallel. Uses all available if -1
149149
verbose : bool, default: False
@@ -164,7 +164,7 @@ def __init__(
164164
delta_time: float = 0.4,
165165
match_score: float = 0.5,
166166
chance_score: float = 0.1,
167-
agreement_method: str = "from_count",
167+
agreement_method: str = "count",
168168
n_jobs: int = -1,
169169
verbose: bool = False,
170170
):
@@ -187,7 +187,7 @@ def get_matching(self):
187187
return self.hungarian_match_12, self.hungarian_match_21
188188

189189
def get_matching_event_count(self, unit1, unit2):
190-
if self.agreement_method == "from_count":
190+
if self.agreement_method == "count":
191191
if (unit1 is not None) and (unit2 is not None):
192192
return self.match_event_count.at[unit1, unit2]
193193
else:
@@ -266,9 +266,9 @@ class GroundTruthComparison(BasePairSorterComparison):
266266
For instance, MEArec simulated dataset have exhaustive_gt=True
267267
match_mode : "hungarian" | "best", default: "hungarian"
268268
The method to match units
269-
agreement_method : "from_count" | "distance_function", default: "from_count"
270-
The method to compute agreement scores. The "from_count" method computes agreement scores from spike counts.
271-
The "distance_function" method computes agreement scores from spike time distance functions.
269+
agreement_method : "count" | "distance", default: "count"
270+
The method to compute agreement scores. The "count" method computes agreement scores from spike counts.
271+
The "distance" method computes agreement scores from spike time distance functions.
272272
n_jobs : int, default: -1
273273
Number of cores to use in parallel. Uses all available if -1
274274
compute_labels : bool, default: False
@@ -297,7 +297,7 @@ def __init__(
297297
overmerged_score: float = 0.2,
298298
chance_score: float = 0.1,
299299
exhaustive_gt: bool = False,
300-
agreement_method: str = "from_count",
300+
agreement_method: str = "count",
301301
n_jobs: int = -1,
302302
match_mode: str = "hungarian",
303303
compute_labels: bool = False,

src/spikeinterface/comparison/tests/test_symmetricsortingcomparison.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ def test_compare_two_sorters():
2424
],
2525
[0, 0, 5],
2626
)
27-
sc_from_counts = compare_two_sorters(sorting1, sorting2, agreement_method="from_count")
28-
sc_from_distance = compare_two_sorters(sorting1, sorting2, agreement_method="distance_function")
27+
sc_from_counts = compare_two_sorters(sorting1, sorting2, agreement_method="count")
28+
sc_from_distance = compare_two_sorters(sorting1, sorting2, agreement_method="distance")
2929

3030
np.testing.assert_array_equal(
3131
sc_from_counts.hungarian_match_12.to_numpy(),
@@ -50,8 +50,8 @@ def test_agreements():
5050
sorting2 = aggregate_units([sorting1, sorting_extra])
5151
sorting2 = sorting2.select_units(unit_ids=sorting2.unit_ids[np.random.permutation(len(sorting2.unit_ids))])
5252

53-
sc_from_counts = compare_two_sorters(sorting1, sorting2, agreement_method="from_count")
54-
sc_from_distance = compare_two_sorters(sorting1, sorting2, agreement_method="distance_function")
53+
sc_from_counts = compare_two_sorters(sorting1, sorting2, agreement_method="count")
54+
sc_from_distance = compare_two_sorters(sorting1, sorting2, agreement_method="distance")
5555

5656
np.testing.assert_array_equal(
5757
sc_from_counts.hungarian_match_12.to_numpy(),

0 commit comments

Comments
 (0)