Skip to content

Commit dcd64b2

Browse files
committed
some more numpydoc fixes
1 parent be7ce8d commit dcd64b2

11 files changed

Lines changed: 95 additions & 95 deletions

File tree

src/spikeinterface/comparison/basecomparison.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,9 @@ def compute_subgraphs(self):
6363
Computes subgraphs of connected components.
6464
Returns
6565
-------
66-
sg_object_names: list
66+
sg_object_names : list
6767
List of sorter names for each node in the connected component subgraph
68-
sg_units: list
68+
sg_units : list
6969
List of unit ids for each node in the connected component subgraph
7070
"""
7171
if self.clean_graph is not None:

src/spikeinterface/comparison/comparisontools.py

Lines changed: 55 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,16 @@ def count_matching_events(times1, times2, delta=10):
1414
1515
Parameters
1616
----------
17-
times1: list
17+
times1 : list
1818
List of spike train 1 frames
19-
times2: list
19+
times2 : list
2020
List of spike train 2 frames
21-
delta: int
21+
delta : int
2222
Number of frames for considering matching events
2323
2424
Returns
2525
-------
26-
matching_count: int
26+
matching_count : int
2727
Number of matching events
2828
"""
2929
times_concat = np.concatenate((times1, times2))
@@ -45,16 +45,16 @@ def compute_agreement_score(num_matches, num1, num2):
4545
4646
Parameters
4747
----------
48-
num_matches: int
48+
num_matches : int
4949
Number of matches
50-
num1: int
50+
num1 : int
5151
Number of events in spike train 1
52-
num2: int
52+
num2 : int
5353
Number of events in spike train 2
5454
5555
Returns
5656
-------
57-
score: float
57+
score : float
5858
Agreement score
5959
"""
6060
denom = num1 + num2 - num_matches
@@ -71,12 +71,12 @@ def do_count_event(sorting):
7171
7272
Parameters
7373
----------
74-
sorting: SortingExtractor
74+
sorting : SortingExtractor
7575
A sorting extractor
7676
7777
Returns
7878
-------
79-
event_count: pd.Series
79+
event_count : pd.Series
8080
Nb of spike by units.
8181
"""
8282
import pandas as pd
@@ -90,14 +90,14 @@ def count_match_spikes(times1, all_times2, delta_frames): # , event_counts1, ev
9090
9191
Parameters
9292
----------
93-
times1: array
93+
times1 : array
9494
Spike train 1 frames
95-
all_times2: list of array
95+
all_times2 : list of array
9696
List of spike trains from sorting 2
9797
9898
Returns
9999
-------
100-
matching_events_count: list
100+
matching_events_count : list
101101
List of counts of matching events
102102
"""
103103
matching_event_counts = np.zeros(len(all_times2), dtype="int64")
@@ -337,18 +337,18 @@ def make_agreement_scores(sorting1, sorting2, delta_frames, ensure_symmetry=True
337337
338338
Parameters
339339
----------
340-
sorting1: SortingExtractor
340+
sorting1 : SortingExtractor
341341
The first sorting extractor
342-
sorting2: SortingExtractor
342+
sorting2 : SortingExtractor
343343
The second sorting extractor
344-
delta_frames: int
344+
delta_frames : int
345345
Number of frames to consider spikes coincident
346-
ensure_symmetry: bool, default: True
346+
ensure_symmetry : bool, default: True
347347
If ensure_symmetry is True, then the algo is run two times by switching sorting1 and sorting2.
348348
And the minimum of the two results is taken.
349349
Returns
350350
-------
351-
agreement_scores: array (float)
351+
agreement_scores : array (float)
352352
The agreement score matrix.
353353
"""
354354
import pandas as pd
@@ -401,16 +401,16 @@ def make_possible_match(agreement_scores, min_score):
401401
402402
Parameters
403403
----------
404-
agreement_scores: pd.DataFrame
404+
agreement_scores : pd.DataFrame
405405
406-
min_score: float
406+
min_score : float
407407
408408
409409
Returns
410410
-------
411-
best_match_12: pd.Series
411+
best_match_12 : pd.Series
412412
413-
best_match_21: pd.Series
413+
best_match_21 : pd.Series
414414
415415
"""
416416
unit1_ids = np.array(agreement_scores.index)
@@ -442,16 +442,16 @@ def make_best_match(agreement_scores, min_score):
442442
443443
Parameters
444444
----------
445-
agreement_scores: pd.DataFrame
445+
agreement_scores : pd.DataFrame
446446
447-
min_score: float
447+
min_score : float
448448
449449
450450
Returns
451451
-------
452-
best_match_12: pd.Series
452+
best_match_12 : pd.Series
453453
454-
best_match_21: pd.Series
454+
best_match_21 : pd.Series
455455
456456
"""
457457
import pandas as pd
@@ -490,14 +490,14 @@ def make_hungarian_match(agreement_scores, min_score):
490490
----------
491491
agreement_scores: pd.DataFrame
492492
493-
min_score: float
493+
min_score : float
494494
495495
496496
Returns
497497
-------
498-
hungarian_match_12: pd.Series
498+
hungarian_match_12 : pd.Series
499499
500-
hungarian_match_21: pd.Series
500+
hungarian_match_21 : pd.Series
501501
502502
"""
503503
import pandas as pd
@@ -541,22 +541,22 @@ def do_score_labels(sorting1, sorting2, delta_frames, unit_map12, label_misclass
541541
542542
Parameters
543543
----------
544-
sorting1: SortingExtractor instance
544+
sorting1 : SortingExtractor instance
545545
The ground truth sorting
546-
sorting2: SortingExtractor instance
546+
sorting2 : SortingExtractor instance
547547
The tested sorting
548-
delta_frames: int
548+
delta_frames : int
549549
Number of frames to consider spikes coincident
550-
unit_map12: pd.Series
550+
unit_map12 : pd.Series
551551
Dict of matching from sorting1 to sorting2
552-
label_misclassification: bool
552+
label_misclassification : bool
553553
If True, misclassification errors are labelled
554554
555555
Returns
556556
-------
557-
labels_st1: dict of lists of np.array of str
557+
labels_st1 : dict of lists of np.array of str
558558
Contain score labels for units of sorting 1 for each segment
559-
labels_st2: dict of lists of np.array of str
559+
labels_st2 : dict of lists of np.array of str
560560
Contain score labels for units of sorting 2 for each segment
561561
"""
562562
unit1_ids = sorting1.get_unit_ids()
@@ -647,12 +647,12 @@ def compare_spike_trains(spiketrain1, spiketrain2, delta_frames=10):
647647
648648
Parameters
649649
----------
650-
spiketrain1, spiketrain2: numpy.array
650+
spiketrain1, spiketrain2 : numpy.array
651651
Times of spikes for the 2 spike trains.
652652
653653
Returns
654654
-------
655-
lab_st1, lab_st2: numpy.array
655+
lab_st1, lab_st2 : numpy.array
656656
Label of score for each spike
657657
"""
658658
lab_st1 = np.array(["UNPAIRED"] * len(spiketrain1))
@@ -684,19 +684,19 @@ def do_confusion_matrix(event_counts1, event_counts2, match_12, match_event_coun
684684
685685
Parameters
686686
----------
687-
event_counts1: pd.Series
687+
event_counts1 : pd.Series
688688
Number of event per units 1
689-
event_counts2: pd.Series
689+
event_counts2 : pd.Series
690690
Number of event per units 2
691-
match_12: pd.Series
691+
match_12 : pd.Series
692692
Series of matching from sorting1 to sorting2.
693693
Can be the hungarian or best match.
694-
match_event_count: pd.DataFrame
694+
match_event_count : pd.DataFrame
695695
The match count matrix given by make_match_count_matrix
696696
697697
Returns
698698
-------
699-
confusion_matrix: pd.DataFrame
699+
confusion_matrix : pd.DataFrame
700700
The confusion matrix
701701
index are units1 reordered
702702
columns are units2 redordered
@@ -746,19 +746,19 @@ def do_count_score(event_counts1, event_counts2, match_12, match_event_count):
746746
747747
Parameters
748748
----------
749-
event_counts1: pd.Series
749+
event_counts1 : pd.Series
750750
Number of event per units 1
751-
event_counts2: pd.Series
751+
event_counts2 : pd.Series
752752
Number of event per units 2
753-
match_12: pd.Series
753+
match_12 : pd.Series
754754
Series of matching from sorting1 to sorting2.
755755
Can be the hungarian or best match.
756-
match_event_count: pd.DataFrame
756+
match_event_count : pd.DataFrame
757757
The match count matrix given by make_match_count_matrix
758758
759759
Returns
760760
-------
761-
count_score: pd.DataFrame
761+
count_score : pd.DataFrame
762762
A table with one line per GT units and columns
763763
are tp/fn/fp/...
764764
"""
@@ -837,16 +837,16 @@ def make_matching_events(times1, times2, delta):
837837
838838
Parameters
839839
----------
840-
times1: list
840+
times1 : list
841841
List of spike train 1 frames
842-
times2: list
842+
times2 : list
843843
List of spike train 2 frames
844-
delta: int
844+
delta : int
845845
Number of frames for considering matching events
846846
847847
Returns
848848
-------
849-
matching_event: numpy array dtype = ["index1", "index2", "delta"]
849+
matching_event : numpy array dtype = ["index1", "index2", "delta"]
850850
1d of collision
851851
"""
852852
times_concat = np.concatenate((times1, times2))
@@ -894,14 +894,14 @@ def make_collision_events(sorting, delta):
894894
895895
Parameters
896896
----------
897-
sorting: SortingExtractor
897+
sorting : SortingExtractor
898898
The sorting extractor object for counting collision events
899-
delta: int
899+
delta : int
900900
Number of frames for considering collision events
901901
902902
Returns
903903
-------
904-
collision_events: numpy array
904+
collision_events : numpy array
905905
dtype = [('index1', 'int64'), ('unit_id1', 'int64'),
906906
('index2', 'int64'), ('unit_id2', 'int64'),
907907
('delta', 'int64')]

src/spikeinterface/curation/curation_format.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ def convert_from_sortingview_curation_format_v0(sortingview_dict, destination_fo
8787
8888
Returns
8989
-------
90-
curation_dict: dict
90+
curation_dict : dict
9191
A curation dictionary
9292
"""
9393

@@ -138,7 +138,7 @@ def curation_label_to_vectors(curation_dict):
138138
139139
Returns
140140
-------
141-
labels: dict of numpy vector
141+
labels : dict of numpy vector
142142
143143
"""
144144
unit_ids = list(curation_dict["unit_ids"])

src/spikeinterface/curation/curation_tools.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -106,18 +106,18 @@ def find_duplicated_spikes(
106106
107107
Parameters
108108
----------
109-
spike_train: np.ndarray
109+
spike_train : np.ndarray
110110
The spike train on which to look for duplicated spikes.
111-
censored_period: int
111+
censored_period : int
112112
The censored period for duplicates (in sample time).
113-
method: "keep_first" |"keep_last" | "keep_first_iterative" | "keep_last_iterative" |random", default: "random"
113+
method : "keep_first" |"keep_last" | "keep_first_iterative" | "keep_last_iterative" |random", default: "random"
114114
Method used to remove the duplicated spikes.
115-
seed: int | None
115+
seed : int | None
116116
The seed to use if method="random".
117117
118118
Returns
119119
-------
120-
indices_of_duplicates: np.ndarray
120+
indices_of_duplicates : np.ndarray
121121
The indices of spikes considered to be duplicates.
122122
"""
123123

src/spikeinterface/curation/splitunitsorting.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class SplitUnitSorting(BaseSorting):
1313
1414
Parameters
1515
----------
16-
sorting: BaseSorting
16+
sorting : BaseSorting
1717
The sorting object
1818
parent_unit_id : int
1919
Unit id of the unit to split

0 commit comments

Comments
 (0)