Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unify 'defaults' and use of quotations across docstrings #2134

Merged
merged 45 commits into from
Oct 31, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
afb723b
Unify 'defaults'
alejoe91 Oct 26, 2023
ea957a4
sorters wip and fix imports
alejoe91 Oct 26, 2023
293d7a3
Update src/spikeinterface/core/waveform_tools.py
alejoe91 Oct 27, 2023
bd8f978
Update src/spikeinterface/core/waveform_tools.py
alejoe91 Oct 27, 2023
706df60
Update src/spikeinterface/core/waveform_tools.py
alejoe91 Oct 27, 2023
bae03d7
Update src/spikeinterface/core/waveform_tools.py
alejoe91 Oct 27, 2023
e147ffc
Update src/spikeinterface/widgets/amplitudes.py
alejoe91 Oct 27, 2023
a2daed3
Update src/spikeinterface/widgets/unit_waveforms.py
alejoe91 Oct 27, 2023
cf620cc
Update src/spikeinterface/extractors/mdaextractors.py
alejoe91 Oct 27, 2023
982bbc4
Update src/spikeinterface/extractors/mdaextractors.py
alejoe91 Oct 27, 2023
ec54133
Update src/spikeinterface/widgets/traces.py
alejoe91 Oct 27, 2023
e5e912f
Update src/spikeinterface/widgets/template_similarity.py
alejoe91 Oct 27, 2023
8671684
Update src/spikeinterface/widgets/traces.py
alejoe91 Oct 27, 2023
877842c
Update src/spikeinterface/extractors/mdaextractors.py
alejoe91 Oct 27, 2023
7b506bf
Update src/spikeinterface/extractors/neoextractors/tdt.py
alejoe91 Oct 27, 2023
9ce96cc
Update src/spikeinterface/extractors/neoextractors/tdt.py
alejoe91 Oct 27, 2023
4003c41
Update src/spikeinterface/extractors/neoextractors/spikeglx.py
alejoe91 Oct 27, 2023
bf47e09
Update src/spikeinterface/preprocessing/remove_artifacts.py
alejoe91 Oct 27, 2023
48aeba9
Update src/spikeinterface/extractors/neoextractors/spikeglx.py
alejoe91 Oct 27, 2023
86beb6c
Update src/spikeinterface/extractors/neoextractors/spikegadgets.py
alejoe91 Oct 27, 2023
0bc6e6c
Update src/spikeinterface/extractors/neoextractors/spikegadgets.py
alejoe91 Oct 27, 2023
d11e094
Update src/spikeinterface/preprocessing/filter.py
alejoe91 Oct 27, 2023
65d4941
Update src/spikeinterface/postprocessing/correlograms.py
alejoe91 Oct 27, 2023
47e813c
Update src/spikeinterface/preprocessing/remove_artifacts.py
alejoe91 Oct 27, 2023
79322db
Update src/spikeinterface/postprocessing/isi.py
alejoe91 Oct 27, 2023
9e212ae
Update src/spikeinterface/preprocessing/average_across_direction.py
alejoe91 Oct 27, 2023
55ee941
Update src/spikeinterface/preprocessing/directional_derivative.py
alejoe91 Oct 27, 2023
d576526
Update src/spikeinterface/preprocessing/directional_derivative.py
alejoe91 Oct 27, 2023
7bd9de8
Update src/spikeinterface/preprocessing/directional_derivative.py
alejoe91 Oct 27, 2023
67a2240
Update src/spikeinterface/preprocessing/depth_order.py
alejoe91 Oct 27, 2023
5bb9a70
sortingcomponents and more fixes
alejoe91 Oct 27, 2023
59f0d82
More quotation handling (core)
alejoe91 Oct 27, 2023
d6e1e0d
Final round of cleaning
alejoe91 Oct 27, 2023
c15d6d3
Add unsaved files
alejoe91 Oct 27, 2023
59a7588
Import hdbscan when needed and add ros3 to pytest.markers
alejoe91 Oct 27, 2023
2df79e5
Solve conflicts
alejoe91 Oct 30, 2023
f90a0b7
Solve conflicts
alejoe91 Oct 30, 2023
9998779
Update src/spikeinterface/core/baserecordingsnippets.py
alejoe91 Oct 31, 2023
6491b4b
Update src/spikeinterface/core/baserecordingsnippets.py
alejoe91 Oct 31, 2023
253979d
Update src/spikeinterface/core/baserecordingsnippets.py
alejoe91 Oct 31, 2023
87d8433
Update src/spikeinterface/core/job_tools.py
alejoe91 Oct 31, 2023
f6a995b
Update src/spikeinterface/core/job_tools.py
alejoe91 Oct 31, 2023
1d7bccf
Update src/spikeinterface/curation/curationsorting.py
alejoe91 Oct 31, 2023
b8e497e
Update src/spikeinterface/curation/sortingview_curation.py
alejoe91 Oct 31, 2023
8aa0f27
Update src/spikeinterface/core/core_tools.py
alejoe91 Oct 31, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading