Skip to content

Commit

Permalink
Merge pull request #3076 from chrishalcrow/update-extractors-docstrings
Browse files Browse the repository at this point in the history
Docstrings extractors update, fix PR01 and PR02 #3016
  • Loading branch information
alejoe91 authored Jun 27, 2024
2 parents 8af4b53 + efede13 commit be1e527
Show file tree
Hide file tree
Showing 17 changed files with 49 additions and 27 deletions.
2 changes: 1 addition & 1 deletion doc/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ Non-NEO-based
.. autofunction:: read_bids
.. autofunction:: read_cbin_ibl
.. autofunction:: read_combinato
.. autofunction:: read_ibl_streaming_recording
.. autofunction:: read_ibl_recording
.. autofunction:: read_hdsort
.. autofunction:: read_herdingspikes
.. autofunction:: read_kilosort
Expand Down
2 changes: 1 addition & 1 deletion doc/modules/extractors.rst
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ For raw recording formats, we currently support:
* **Biocam HDF5** :py:func:`~spikeinterface.extractors.read_biocam()`
* **CED** :py:func:`~spikeinterface.extractors.read_ced()`
* **EDF** :py:func:`~spikeinterface.extractors.read_edf()`
* **IBL streaming** :py:func:`~spikeinterface.extractors.read_ibl_streaming_recording()`
* **IBL streaming** :py:func:`~spikeinterface.extractors.read_ibl_recording()`
* **Intan** :py:func:`~spikeinterface.extractors.read_intan()`
* **MaxWell** :py:func:`~spikeinterface.extractors.read_maxwell()`
* **MCS H5** :py:func:`~spikeinterface.extractors.read_mcsh5()`
Expand Down
4 changes: 3 additions & 1 deletion src/spikeinterface/extractors/cbin_ibl.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,11 @@ class CompressedBinaryIblExtractor(BaseRecording):
load_sync_channel : bool, default: False
Load or not the last channel (sync).
If not then the probe is loaded.
stream_name : str, default: "ap".
stream_name : {"ap", "lp"}, default: "ap".
Whether to load AP or LFP band, one
of "ap" or "lp".
cbin_file : str or None, default None
The cbin file of the recording. If None, searches in `folder_path` for file.
Returns
-------
Expand Down
2 changes: 1 addition & 1 deletion src/spikeinterface/extractors/herdingspikesextractors.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class HerdingspikesSortingExtractor(BaseSorting):
Parameters
----------
folder_path : str or Path
file_path : str or Path
Path to the ALF folder.
load_unit_info : bool, default: True
Whether to load the unit info from the file.
Expand Down
2 changes: 1 addition & 1 deletion src/spikeinterface/extractors/iblextractors.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class IblRecordingExtractor(BaseRecording):
stream_name : str
The name of the stream to load for the session.
These can be retrieved from calling `StreamingIblExtractor.get_stream_names(session="<your session ID>")`.
load_sync_channels : bool, default: false
load_sync_channel : bool, default: false
Load or not the last channel (sync).
If not then the probe is loaded.
cache_folder : str or None, default: None
Expand Down
5 changes: 5 additions & 0 deletions src/spikeinterface/extractors/neoextractors/alphaomega.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ def map_to_neo_kwargs(cls, folder_path, lsx_files=None):
class AlphaOmegaEventExtractor(NeoBaseEventExtractor):
"""
Class for reading events from AlphaOmega MPX file format
Parameters
----------
folder_path : str or Path-like
The folder path to the AlphaOmega events.
"""

mode = "folder"
Expand Down
1 change: 0 additions & 1 deletion src/spikeinterface/extractors/neoextractors/biocam.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ def __init__(
electrode_width=None,
stream_id=None,
stream_name=None,
block_index=None,
all_annotations=False,
):
neo_kwargs = self.map_to_neo_kwargs(file_path)
Expand Down
4 changes: 3 additions & 1 deletion src/spikeinterface/extractors/neoextractors/blackrock.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ class BlackrockRecordingExtractor(NeoBaseRecordingExtractor):
If there are several streams, specify the stream name you want to load.
all_annotations : bool, default: False
Load exhaustively all annotations from neo.
use_names_as_ids : bool, default: False
If False, use default IDs inherited from Neo. If True, use channel names as IDs.
"""

mode = "file"
Expand All @@ -37,7 +40,6 @@ def __init__(
file_path,
stream_id=None,
stream_name=None,
block_index=None,
all_annotations=False,
use_names_as_ids=False,
):
Expand Down
2 changes: 0 additions & 2 deletions src/spikeinterface/extractors/neoextractors/ced.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ class CedRecordingExtractor(NeoBaseRecordingExtractor):
If there are several streams, specify the stream id you want to load.
stream_name : str, default: None
If there are several streams, specify the stream name you want to load.
block_index : int, default: None
If there are several blocks, specify the block index you want to load.
all_annotations : bool, default: False
Load exhaustively all annotations from neo.
"""
Expand Down
4 changes: 4 additions & 0 deletions src/spikeinterface/extractors/neoextractors/intan.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ class IntanRecordingExtractor(NeoBaseRecordingExtractor):
If True, data that violates integrity assumptions will be loaded. At the moment the only integrity
check we perform is that timestamps are continuous. Setting this to True will ignore this check and set
the attribute `discontinuous_timestamps` to True in the underlying neo object.
use_names_as_ids : bool, default: False
If False, use default IDs inherited from Neo. If True, use channel names as IDs.
"""

mode = "file"
Expand Down
2 changes: 2 additions & 0 deletions src/spikeinterface/extractors/neoextractors/maxwell.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ class MaxwellRecordingExtractor(NeoBaseRecordingExtractor):
you want to extract. (rec_name='rec0000').
install_maxwell_plugin : bool, default: False
If True, install the maxwell plugin for neo.
block_index : int, default: None
If there are several blocks (experiments), specify the block index you want to load
"""

mode = "file"
Expand Down
11 changes: 6 additions & 5 deletions src/spikeinterface/extractors/neoextractors/neuralynx.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,17 @@ class NeuralynxRecordingExtractor(NeoBaseRecordingExtractor):
If there are several streams, specify the stream name you want to load.
all_annotations : bool, default: False
Load exhaustively all annotations from neo.
exlude_filename : list[str], default: None
exclude_filename : list[str], default: None
List of filename to exclude from the loading.
For example, use `exclude_filename=["events.nev"]` to skip loading the event file.
strict_gap_mode : bool, default: False
See neo documentation.
Detect gaps using strict mode or not.
* strict_gap_mode = True then a gap is consider when timstamp difference between two
consecutive data packets is more than one sample interval.
* strict_gap_mode = False then a gap has an increased tolerance. Some new systems with different clocks need this option
otherwise, too many gaps are detected
* strict_gap_mode = True then a gap is consider when timstamp difference between
two consecutive data packets is more than one sample interval.
* strict_gap_mode = False then a gap has an increased tolerance. Some new systems
with different clocks need this option otherwise, too many gaps are detected
Note that here the default is False contrary to neo.
"""

Expand Down
2 changes: 1 addition & 1 deletion src/spikeinterface/extractors/neoextractors/plexon2.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class Plexon2RecordingExtractor(NeoBaseRecordingExtractor):
If there are several streams, specify the stream id you want to load.
stream_name : str, default: None
If there are several streams, specify the stream name you want to load.
use_names_as_ids:
use_names_as_ids : bool, default: True
If True, the names of the signals are used as channel ids. If False, the channel ids are a combination of the
source id and the channel index.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class SpikeGadgetsRecordingExtractor(NeoBaseRecordingExtractor):
NeoRawIOClass = "SpikeGadgetsRawIO"
name = "spikegadgets"

def __init__(self, file_path, stream_id=None, stream_name=None, block_index=None, all_annotations=False):
def __init__(self, file_path, stream_id=None, stream_name=None, all_annotations=False):
neo_kwargs = self.map_to_neo_kwargs(file_path)
NeoBaseRecordingExtractor.__init__(
self, stream_id=stream_id, stream_name=stream_name, all_annotations=all_annotations, **neo_kwargs
Expand Down
2 changes: 2 additions & 0 deletions src/spikeinterface/extractors/neoextractors/tdt.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ class TdtRecordingExtractor(NeoBaseRecordingExtractor):
If there are several streams, specify the stream name you want to load.
all_annotations : bool, default: False
Load exhaustively all annotations from neo.
block_index : int, default: None
If there are several blocks (experiments), specify the block index you want to load
"""

mode = "folder"
Expand Down
10 changes: 8 additions & 2 deletions src/spikeinterface/extractors/toy_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,18 @@ def toy_example(
Spike time in the recording
spike_labels : np.array or list[nparray] or None, default: None
Cluster label for each spike time (needs to specified both together).
# score_detection : int (between 0 and 1)
# Generate the sorting based on a subset of spikes compare with the trace generation
firing_rate : float, default: 3.0
The firing rate for the units (in Hz)
seed : int or None, default: None
Seed for random initialization.
upsample_factor : None or int, default: None
An upsampling factor, used only when templates are not provided.
num_columns : int, default: 1
Number of columns in probe.
average_peak_amplitude : float, default: -100
Average peak amplitude of generated templates.
contact_spacing_um : float, default: 40.0
Spacing between probe contacts in micrometers.
Returns
-------
Expand Down
19 changes: 10 additions & 9 deletions src/spikeinterface/preprocessing/filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,16 @@

_common_filter_docs = """**filter_kwargs : dict
Certain keyword arguments for `scipy.signal` filters:
filter_order : order
The order of the filter
filter_mode : "sos" | "ba", default: "sos"
Filter form of the filter coefficients:
- second-order sections ("sos")
- numerator/denominator : ("ba")
ftype : str, default: "butter"
Filter type for `scipy.signal.iirfilter` e.g. "butter", "cheby1".
"""
filter_order : order
The order of the filter. Note as filtering is applied with scipy's
`filtfilt` functions (i.e. acausal, zero-phase) the effective
order will be double the `filter_order`.
filter_mode : "sos" | "ba", default: "sos"
Filter form of the filter coefficients:
- second-order sections ("sos")
- numerator/denominator : ("ba")
ftype : str, default: "butter"
Filter type for `scipy.signal.iirfilter` e.g. "butter", "cheby1"."""


class FilterRecording(BasePreprocessor):
Expand Down

0 comments on commit be1e527

Please sign in to comment.