Skip to content

Commit

Permalink
Unify 'defaults'
Browse files Browse the repository at this point in the history
  • Loading branch information
alejoe91 committed Oct 26, 2023
1 parent 109b5b3 commit afb723b
Show file tree
Hide file tree
Showing 111 changed files with 1,182 additions and 1,189 deletions.
36 changes: 18 additions & 18 deletions src/spikeinterface/comparison/multicomparisons.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,22 +25,22 @@ class MultiSortingComparison(BaseMultiComparison, MixinSpikeTrainComparison):
----------
sorting_list: list
List of sorting extractor objects to be compared
name_list: list
name_list: list, default: None
List of spike sorter names. If not given, sorters are named as 'sorter0', 'sorter1', 'sorter2', etc.
delta_time: float
Number of ms to consider coincident spikes (default 0.4 ms)
match_score: float
Minimum agreement score to match units (default 0.5)
chance_score: float
Minimum agreement score to for a possible match (default 0.1)
n_jobs: int
delta_time: float, default: 0.4
Number of ms to consider coincident spikes
match_score: float, default: 0.5
Minimum agreement score to match units
chance_score: float, default: 0.1
Minimum agreement score to for a possible match
n_jobs: int, default: -1
Number of cores to use in parallel. Uses all available if -1
spiketrain_mode: str
spiketrain_mode: "union" | "intersection", default: "union"
Mode to extract agreement spike trains:
- 'union': spike trains are the union between the spike trains of the best matching two sorters
- 'intersection': spike trains are the intersection between the spike trains of the
- "union": spike trains are the union between the spike trains of the best matching two sorters
- "intersection": spike trains are the intersection between the spike trains of the
best matching two sorters
verbose: bool
verbose: bool, default: False
if True, output is verbose
Returns
Expand Down Expand Up @@ -309,13 +309,13 @@ class MultiTemplateComparison(BaseMultiComparison, MixinTemplateComparison):
----------
waveform_list: list
List of waveform extractor objects to be compared
name_list: list
name_list: list, default: None
List of session names. If not given, sorters are named as 'sess0', 'sess1', 'sess2', etc.
match_score: float
Minimum agreement score to match units (default 0.5)
chance_score: float
Minimum agreement score to for a possible match (default 0.1)
verbose: bool
match_score: float, default: 0.8
Minimum agreement score to match units
chance_score: float, default: 0.3
Minimum agreement score to for a possible match
verbose: bool, default: False
if True, output is verbose
Returns
Expand Down
94 changes: 47 additions & 47 deletions src/spikeinterface/comparison/paircomparisons.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,19 +111,19 @@ class SymmetricSortingComparison(BasePairSorterComparison):
The first sorting for the comparison
sorting2: SortingExtractor
The second sorting for the comparison
sorting1_name: str
sorting1_name: str, default: None
The name of sorter 1
sorting2_name: : str
sorting2_name: : str, default: None
The name of sorter 2
delta_time: float
Number of ms to consider coincident spikes (default 0.4 ms)
match_score: float
Minimum agreement score to match units (default 0.5)
chance_score: float
Minimum agreement score to for a possible match (default 0.1)
n_jobs: int
delta_time: float, default: 0.4
Number of ms to consider coincident spikes
match_score: float, default: 0.5
Minimum agreement score to match units
chance_score: float, default: 0.1
Minimum agreement score to for a possible match
n_jobs: int, default: -1
Number of cores to use in parallel. Uses all available if -1
verbose: bool
verbose: bool, default: False
If True, output is verbose
Returns
Expand All @@ -139,7 +139,6 @@ def __init__(
sorting1_name=None,
sorting2_name=None,
delta_time=0.4,
sampling_frequency=None,
match_score=0.5,
chance_score=0.1,
n_jobs=-1,
Expand Down Expand Up @@ -214,34 +213,35 @@ class GroundTruthComparison(BasePairSorterComparison):
The first sorting for the comparison
tested_sorting: SortingExtractor
The second sorting for the comparison
gt_name: str
gt_name: str, default: None
The name of sorter 1
tested_name: : str
tested_name: : str, default: None
The name of sorter 2
delta_time: float
Number of ms to consider coincident spikes (default 0.4 ms) match_score: float
Minimum agreement score to match units (default 0.5)
chance_score: float
Minimum agreement score to for a possible match (default 0.1)
redundant_score: float
Agreement score above which units are redundant (default 0.2)
overmerged_score: float
Agreement score above which units can be overmerged (default 0.2)
well_detected_score: float
Agreement score above which units are well detected (default 0.8)
exhaustive_gt: bool (default True)
delta_time: float, default: 0.4
Number of ms to consider coincident spikes
match_score: float, default: 0.5
Minimum agreement score to match units
chance_score: float, default: 0.1
Minimum agreement score to for a possible match
redundant_score: float, default: 0.2
Agreement score above which units are redundant
overmerged_score: float, default: 0.2
Agreement score above which units can be overmerged
well_detected_score: float, default: 0.8
Agreement score above which units are well detected
exhaustive_gt: bool, default: False
Tell if the ground true is "exhaustive" or not. In other world if the
GT have all possible units. It allows more performance measurement.
For instance, MEArec simulated dataset have exhaustive_gt=True
match_mode: 'hungarian', or 'best'
What is match used for counting : 'hungarian' or 'best match'.
n_jobs: int
match_mode: "hungarian" | "best", default: 'hungarian
The method to match units
n_jobs: int, default: -1
Number of cores to use in parallel. Uses all available if -1
compute_labels: bool
If True, labels are computed at instantiation (default False)
compute_misclassifications: bool
If True, misclassifications are computed at instantiation (default False)
verbose: bool
compute_labels: bool, default: False
If True, labels are computed at instantiation
compute_misclassifications: bool, default: False
If True, misclassifications are computed at instantiation
verbose: bool, default: False
If True, output is verbose
Returns
Expand Down Expand Up @@ -471,7 +471,7 @@ def get_well_detected_units(self, well_detected_score=None):
Parameters
----------
well_detected_score: float (default 0.8)
well_detected_score: float, default: None
The agreement score above which tested units
are counted as "well detected".
"""
Expand Down Expand Up @@ -507,7 +507,7 @@ def get_false_positive_units(self, redundant_score=None):
Parameters
----------
redundant_score: float (default 0.2)
redundant_score: float, default: None
The agreement score below which tested units
are counted as "false positive"" (and not "redundant").
"""
Expand Down Expand Up @@ -547,7 +547,7 @@ def get_redundant_units(self, redundant_score=None):
Parameters
----------
redundant_score=None: float (default 0.2)
redundant_score=None: float, default: None
The agreement score above which tested units
are counted as "redundant" (and not "false positive" ).
"""
Expand Down Expand Up @@ -582,7 +582,7 @@ def get_overmerged_units(self, overmerged_score=None):
Parameters
----------
overmerged_score: float (default 0.4)
overmerged_score: float, default: None
Tested units with 2 or more agreement scores above 'overmerged_score'
are counted as "overmerged".
"""
Expand Down Expand Up @@ -693,16 +693,16 @@ class TemplateComparison(BasePairComparison, MixinTemplateComparison):
The first waveform extractor to get templates to compare
we2 : WaveformExtractor
The second waveform extractor to get templates to compare
unit_ids1 : list, optional
List of units from we1 to compare, by default None
unit_ids2 : list, optional
List of units from we2 to compare, by default None
similarity_method : str, optional
Method for the similaroty matrix, by default "cosine_similarity"
sparsity_dict : dict, optional
Dictionary for sparsity, by default None
verbose : bool, optional
If True, output is verbose, by default False
unit_ids1 : list, default: None
List of units from we1 to compare
unit_ids2 : list, default: None
List of units from we2 to compare
similarity_method : str, default: "cosine_similarity"
Method for the similaroty matrix
sparsity_dict : dict, default: None
Dictionary for sparsity
verbose : bool, default: False
If True, output is verbose
Returns
-------
Expand Down
43 changes: 22 additions & 21 deletions src/spikeinterface/core/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,11 +171,11 @@ def set_property(self, key, values: Sequence, ids: Optional[Sequence] = None, mi
The property name
values : np.array
Array of values for the property
ids : list/np.array, optional
List of subset of ids to set the values, by default None
missing_value : object, optional
ids : list/np.array, default: None
List of subset of ids to set the values, default: None
missing_value : object, default: None
In case the property is set on a subset of values ('ids' not None),
it specifies the how the missing values should be filled, by default None.
it specifies the how the missing values should be filled.
The missing_value has to be specified for types int and unsigned int.
"""

Expand Down Expand Up @@ -320,18 +320,18 @@ def to_dict(
Parameters
----------
include_annotations: bool
If True, all annotations are added to the dict, by default False
include_properties: bool
If True, all properties are added to the dict, by default False
relative_to: str, Path, or None
If not None, files and folders are serialized relative to this path, by default None
include_annotations: bool, default: False
If True, all annotations are added to the dict
include_properties: bool, default: False
If True, all properties are added to the dict
relative_to: str, Path, or None, default: None
If not None, files and folders are serialized relative to this path
Used in waveform extractor to maintain relative paths to binary files even if the
containing folder / diretory is moved
folder_metadata: str, Path, or None
Folder with numpy `npy` files containing additional information (e.g. probe in BaseRecording) and properties.
recursive: bool
If True, all dicitionaries in the kwargs are expanded with `to_dict` as well, by default False.
recursive: bool, default: False
If True, all dicitionaries in the kwargs are expanded with `to_dict` as well
Returns
-------
Expand Down Expand Up @@ -866,21 +866,22 @@ def save_to_zarr(
Parameters
----------
name: str or None
name: str or None, default: None
Name of the subfolder in get_global_tmp_folder()
If 'name' is given, 'folder' must be None.
folder: str, Path, or None
folder: str, Path, or None, default: None
The folder used to save the zarr output. If the folder does not have a '.zarr' suffix,
it will be automatically appended.
storage_options: dict or None
storage_options: dict or None, default: None
Storage options for zarr `store`. E.g., if "s3://" or "gcs://" they can provide authentication methods, etc.
For cloud storage locations, this should not be None (in case of default values, use an empty dict)
channel_chunk_size: int or None
Channels per chunk. Default None (chunking in time only)
verbose: bool
If True (default), the output is verbose.
zarr_path: str, Path, or None
(Deprecated) Name of the zarr folder (.zarr).
channel_chunk_size: int or None, default: None
Channels per chunk
verbose: bool, default: True
If True, the output is verbose
zarr_path: str, Path, or None, default: None
(Deprecated) Name of the zarr folder (.zarr)
**save_kwargs: Keyword arguments for saving.
Returns
-------
Expand Down
32 changes: 16 additions & 16 deletions src/spikeinterface/core/baseevent.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,14 @@ def get_events(
Parameters
----------
channel_id : int or str, optional
The event channel id, by default None
segment_index : int, optional
The segment index, required for multi-segment objects, by default None
start_time : float, optional
The start time in seconds, by default None
end_time : float, optional
The end time in seconds, by default None
channel_id : int or str, default: None
The event channel id
segment_index : int or None, default: None
The segment index, required for multi-segment objects
start_time : float, default: None
The start time in seconds
end_time : float, default: None
The end time in seconds
Returns
-------
Expand All @@ -110,14 +110,14 @@ def get_event_times(
Parameters
----------
channel_id : int or str, optional
The event channel id, by default None
segment_index : int, optional
The segment index, required for multi-segment objects, by default None
start_time : float, optional
The start time in seconds, by default None
end_time : float, optional
The end time in seconds, by default None
channel_id : int or str, default: None
The event channel id
segment_index : int or None, default: None
The segment index, required for multi-segment objects
start_time : float, default: None
The start time in seconds
end_time : float, default: None
The end time in seconds
Returns
-------
Expand Down
Loading

0 comments on commit afb723b

Please sign in to comment.