Skip to content

Commit 60bd1e6

Browse files
authored
Merge pull request #3188 from chrishalcrow/eradicate-sphinx-warnings
Eradicate sphinx warnings
2 parents bf4115d + 4823068 commit 60bd1e6

24 files changed

+92
-130
lines changed

doc/api.rst

Lines changed: 37 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -338,59 +338,58 @@ spikeinterface.curation
338338
spikeinterface.generation
339339
-------------------------
340340

341+
.. currentmodule:: spikeinterface.generation
342+
341343
Core
342344
~~~~
343-
.. automodule:: spikeinterface.generation
344-
345-
.. autofunction:: generate_recording
346-
.. autofunction:: generate_sorting
347-
.. autofunction:: generate_snippets
348-
.. autofunction:: generate_templates
349-
.. autofunction:: generate_recording_by_size
350-
.. autofunction:: generate_ground_truth_recording
351-
.. autofunction:: add_synchrony_to_sorting
352-
.. autofunction:: synthesize_random_firings
353-
.. autofunction:: inject_some_duplicate_units
354-
.. autofunction:: inject_some_split_units
355-
.. autofunction:: synthetize_spike_train_bad_isi
356-
.. autofunction:: inject_templates
357-
.. autofunction:: noise_generator_recording
358-
.. autoclass:: InjectTemplatesRecording
359-
.. autoclass:: NoiseGeneratorRecording
345+
346+
347+
.. autofunction:: generate_recording
348+
.. autofunction:: generate_sorting
349+
.. autofunction:: generate_snippets
350+
.. autofunction:: generate_templates
351+
.. autofunction:: generate_recording_by_size
352+
.. autofunction:: generate_ground_truth_recording
353+
.. autofunction:: add_synchrony_to_sorting
354+
.. autofunction:: synthesize_random_firings
355+
.. autofunction:: inject_some_duplicate_units
356+
.. autofunction:: inject_some_split_units
357+
.. autofunction:: synthetize_spike_train_bad_isi
358+
.. autofunction:: inject_templates
359+
.. autofunction:: noise_generator_recording
360+
.. autoclass:: InjectTemplatesRecording
361+
.. autoclass:: NoiseGeneratorRecording
360362

361363
Drift
362364
~~~~~
363-
.. automodule:: spikeinterface.generation
364365

365-
.. autofunction:: generate_drifting_recording
366-
.. autofunction:: generate_displacement_vector
367-
.. autofunction:: make_one_displacement_vector
368-
.. autofunction:: make_linear_displacement
369-
.. autofunction:: move_dense_templates
370-
.. autofunction:: interpolate_templates
371-
.. autoclass:: DriftingTemplates
372-
.. autoclass:: InjectDriftingTemplatesRecording
366+
.. autofunction:: generate_drifting_recording
367+
.. autofunction:: generate_displacement_vector
368+
.. autofunction:: make_one_displacement_vector
369+
.. autofunction:: make_linear_displacement
370+
.. autofunction:: move_dense_templates
371+
.. autofunction:: interpolate_templates
372+
.. autoclass:: DriftingTemplates
373+
.. autoclass:: InjectDriftingTemplatesRecording
373374

374375
Hybrid
375376
~~~~~~
376-
.. automodule:: spikeinterface.generation
377377

378-
.. autofunction:: generate_hybrid_recording
379-
.. autofunction:: estimate_templates_from_recording
380-
.. autofunction:: select_templates
381-
.. autofunction:: scale_template_to_range
382-
.. autofunction:: relocate_templates
383-
.. autofunction:: fetch_template_object_from_database
384-
.. autofunction:: fetch_templates_database_info
385-
.. autofunction:: list_available_datasets_in_template_database
386-
.. autofunction:: query_templates_from_database
378+
.. autofunction:: generate_hybrid_recording
379+
.. autofunction:: estimate_templates_from_recording
380+
.. autofunction:: select_templates
381+
.. autofunction:: scale_template_to_range
382+
.. autofunction:: relocate_templates
383+
.. autofunction:: fetch_template_object_from_database
384+
.. autofunction:: fetch_templates_database_info
385+
.. autofunction:: list_available_datasets_in_template_database
386+
.. autofunction:: query_templates_from_database
387387

388388

389389
Noise
390390
~~~~~
391-
.. automodule:: spikeinterface.generation
392391

393-
.. autofunction:: generate_noise
392+
.. autofunction:: generate_noise
394393

395394

396395
spikeinterface.sortingcomponents

doc/conf.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@
7474
"IPython.sphinxext.ipython_console_highlighting"
7575
]
7676

77+
autosectionlabel_prefix_document = True
78+
7779
numpydoc_show_class_members = False
7880

7981

@@ -128,7 +130,7 @@
128130
'../examples/tutorials/widgets',
129131
]),
130132
'within_subsection_order': FileNameSortKey,
131-
'ignore_pattern': '/generate_',
133+
'ignore_pattern': '/generate_*',
132134
'nested_sections': False,
133135
'copyfile_regex': r'.*\.rst|.*\.png|.*\.svg'
134136
}

doc/get_started/install_sorters.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ sorters to retrieve installation instructions for other operating systems.
2727
We use **pip** to install packages, but **conda** should also work in many cases.
2828

2929
Some novel spike sorting algorithms are implemented directly in SpikeInterface using the
30-
:py:mod:`spikeinterface.sortingcomponents` module. Checkout the :ref:`SpikeInterface-based spike sorters` section of this page
30+
:py:mod:`spikeinterface.sortingcomponents` module. Checkout the :ref:`get_started/install_sorters:SpikeInterface-based spike sorters` section of this page
3131
for more information!
3232

3333
If you experience installation problems please directly contact the authors of these tools or write on the

doc/get_started/installation.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,4 +102,4 @@ Sub-modules have more dependencies, so you should also install:
102102

103103

104104
All external spike sorters can be either run inside containers (Docker or Singularity - see :ref:`containerizedsorters`)
105-
or must be installed independently (see :ref:`Installing Spike Sorters`).
105+
or must be installed independently (see :ref:`get_started/install_sorters:Installing Spike Sorters`).

doc/how_to/load_your_data_into_sorting.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ to take your existing data and load it as a SpikeInterface :code:`Sorting` objec
1818

1919

2020
Reading a standard spike sorting format into a :code:`Sorting`
21-
-------------------------------------------------------------
21+
--------------------------------------------------------------
2222

2323
For most spike sorting output formats the :code:`Sorting` is automatically generated. For example one could do
2424

@@ -36,7 +36,7 @@ current formats see :ref:`compatible_formats`.
3636

3737

3838
Loading your own data into a :code:`Sorting`
39-
-------------------------------------------
39+
--------------------------------------------
4040

4141

4242
This :code:`Sorting` contains important information about your spike trains including:
@@ -115,7 +115,7 @@ using :code:`Neo.SpikeTrain`'s.
115115
116116
117117
Loading multisegment data into a :code:`Sorting`
118-
-----------------------------------------------
118+
------------------------------------------------
119119

120120
One of the great advantages of SpikeInterface :code:`Sorting` objects is that they can also handle
121121
multisegment recordings and sortings (e.g. you have a baseline, stimulus, post-stimulus). The

doc/index.rst

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,13 @@ SpikeInterface is a Python module to analyze extracellular electrophysiology dat
1212
With a few lines of code, SpikeInterface enables you to load and pre-process the recording, run several
1313
state-of-the-art spike sorters, post-process and curate the output, compute quality metrics, and visualize the results.
1414

15-
1615
.. warning::
1716

18-
**New features under construction!** 🚧🚧🚧: after the 0.100.0 release (and related bug fixes), the next release will contain
1917
a major API improvement: the :code:`SortingAnalyzer`. To read more about this, checkout the
2018
`enhancement proposal <https://github.com/SpikeInterface/spikeinterface/issues/2282>`_.
21-
Please refer to the stable documentation `here <https://spikeinterface.readthedocs.io/en/0.100.4>`_.
22-
Learn how to update your code `here <tutorials/waveform_extractor_to_sorting_analyzer.html>`_ and read more about the
23-
:code:`SortingAnalyzer` `here <modules/postprocessing.html>`_.
19+
Please refer to the `stable documentation <https://spikeinterface.readthedocs.io/en/0.100.4>`_.
20+
Learn how to :ref:`update your code here <tutorials/waveform_extractor_to_sorting_analyzer:From WaveformExtractor to SortingAnalyzer>` and read more about the
21+
:ref:`SortingAnalyzer here <modules/postprocessing:Postprocessing module>`.
2422

2523

2624

doc/modules/core.rst

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ All classes support:
2121
* data on-demand (lazy loading)
2222
* multiple segments, where each segment is a contiguous piece of data (recording, sorting, events).
2323

24-
.. _core-recording:
24+
2525
Recording
2626
---------
2727

@@ -162,7 +162,6 @@ Internally, any sorting object can construct 2 internal caches:
162162
2. a unique numpy.array with structured dtype aka "spikes vector". This is useful for processing by small chunks of
163163
time, like for extracting amplitudes from a recording.
164164

165-
.. _core-sorting-analyzer:
166165
SortingAnalyzer
167166
---------------
168167

@@ -178,7 +177,7 @@ to perform further analysis, such as calculating :code:`waveforms` and :code:`te
178177

179178
Importantly, the :py:class:`~spikeinterface.core.SortingAnalyzer` handles the *sparsity* and the physical *scaling*.
180179
Sparsity defines the channels on which waveforms and templates are calculated using, for example, a
181-
physical distance from the channel with the largest peak amplitude (see the :ref:`Sparsity` section). Scaling, set by
180+
physical distance from the channel with the largest peak amplitude (see the :ref:`modules/core:Sparsity` section). Scaling, set by
182181
the :code:`return_scaled` argument, determines whether the data is converted from integer values to :math:`\mu V` or not.
183182
By default, :code:`return_scaled` is true and all processed data voltage values are in :math:`\mu V` (e.g., waveforms, templates, spike amplitudes, etc.).
184183

@@ -207,7 +206,7 @@ Now we will create a :code:`SortingAnalyzer` called :code:`sorting_analyzer`.
207206
The :py:class:`~spikeinterface.core.SortingAnalyzer` by default is defined *in memory*, but it can be saved at any time
208207
(or upon instantiation) to one of the following backends:
209208

210-
* | :code:`zarr`: the sorting analyzer is saved to a `Zarr <https://zarr.dev/>`_ folder, and each extension is a Zarr group. This is the recommended backend, since Zarr files can be written to/read from the cloud and compression is applied.
209+
* | :code:`zarr`: the sorting analyzer is saved to a `Zarr <https://zarr.dev/>`__ folder, and each extension is a Zarr group. This is the recommended backend, since Zarr files can be written to/read from the cloud and compression is applied.
211210
* | :code:`binary_folder`: the sorting analyzer is saved to a folder, and each extension creates a sub-folder. The extension data are saved to either :code:`npy` (for arrays), :code:`csv` (for dataframes), or :code:`pickle` (for everything else).
212211

213212
If the sorting analyzer is in memory, the :code:`SortingAnalyzer.save_as` function can be used to save it
@@ -568,7 +567,7 @@ re-instantiate the object from scratch (this is true for all objects except in-m
568567

569568
The :code:`save()` function allows to easily store SI objects to a folder on disk.
570569
:py:class:`~spikeinterface.core.BaseRecording` objects are stored in binary (.raw) or
571-
`Zarr <https://zarr.readthedocs.io/en/stable/tutorial.html>`_ (.zarr) format and
570+
`Zarr <https://zarr.readthedocs.io/en/stable/tutorial.html>`__ (.zarr) format and
572571
:py:class:`~spikeinterface.core.BaseSorting` and :py:class:`~spikeinterface.core.BaseSnippets` object in numpy (.npz)
573572
format. With the actual data, the :code:`save()` function also stores the provenance dictionary and all the properties
574573
and annotations associated to the object.
@@ -922,7 +921,7 @@ The :py:class:`~spikeinterface.core.WaveformExtractor` allows us to:
922921
* extract waveforms
923922
* sub-sample spikes for waveform extraction
924923
* compute templates (i.e. average extracellular waveforms) with different modes
925-
* save waveforms in a folder (in numpy / `Zarr <https://zarr.readthedocs.io/en/stable/tutorial.html>`_) for easy retrieval
924+
* save waveforms in a folder (in numpy / `Zarr <https://zarr.readthedocs.io/en/stable/tutorial.html>`__) for easy retrieval
926925
* save sparse waveforms or *sparsify* dense waveforms
927926
* select units and associated waveforms
928927

doc/modules/curation.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,12 @@ This format has two part:
6565
* "merged_unit_groups"
6666
* "removed_units"
6767

68-
Here is the description of the format with a simple example:
68+
Here is the description of the format with a simple example (the first part of the
69+
format is the definition; the second part of the format is manual action):
6970

7071
.. code-block:: json
7172
7273
{
73-
# the first part of the format is the definitation
7474
"format_version": "1",
7575
"unit_ids": [
7676
"u1",
@@ -91,7 +91,7 @@ Here is the description of the format with a simple example:
9191
"MUA",
9292
"artifact"
9393
],
94-
"exclusive": true
94+
"exclusive": "true"
9595
},
9696
"putative_type": {
9797
"label_options": [
@@ -100,10 +100,10 @@ Here is the description of the format with a simple example:
100100
"pyramidal",
101101
"mitral"
102102
],
103-
"exclusive": false
103+
"exclusive": "false"
104104
}
105105
},
106-
# the second part of the format is manual action
106+
107107
"manual_labels": [
108108
{
109109
"unit_id": "u1",

doc/modules/exporters.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ results.
1515
**Note** : :py:func:`~spikeinterface.exporters.export_to_phy` speed and the size of the folder will highly depend
1616
on the sparsity of the :code:`SortingAnalyzer` itself or the external specified sparsity.
1717
The Phy viewer enables one to explore PCA projections, spike amplitudes, waveforms and quality of spike sorting results.
18-
So if these pieces of information have already been computed as extensions (see :ref:`analyzer_extensions`),
18+
So if these pieces of information have already been computed as extensions (see :ref:`modules/postprocessing:Extensions as AnalyzerExtensions`),
1919
then exporting to Phy should be fast (and the user has better control of the parameters for the extensions).
2020
If not pre-computed, then the required extensions (e.g., :code:`spike_amplitudes`, :code:`principal_components`)
2121
can be computed directly at export time.

doc/modules/postprocessing.rst

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ To check what extensions spikeinterface can calculate, you can use the :code:`ge
5959
6060
>>> ['random_spikes', 'waveforms', 'templates', 'noise_levels', 'amplitude_scalings', 'correlograms', 'isi_histograms', 'principal_components', 'spike_amplitudes', 'spike_locations', 'template_metrics', 'template_similarity', 'unit_locations', 'quality_metrics']
6161
62-
There is detailed documentation about each extension :ref:`below<Available postprocessing extensions>`.
62+
There is detailed documentation about each extension :ref:`below<modules/postprocessing:Available postprocessing extensions>`.
6363
Each extension comes from a different module. To use the :code:`postprocessing` extensions, you'll need to have the `postprocessing`
6464
module loaded.
6565

@@ -68,11 +68,9 @@ both `random_spikes` and `waveforms`. We say that `principal_components` is a ch
6868
two. Other extensions, like `isi_histograms`, don't depend on anything. It has no children and no parents. The parent/child
6969
relationships of all the extensions currently defined in spikeinterface can be found in this diagram:
7070

71-
|
7271
.. figure:: ../images/parent_child.svg
7372
:alt: Parent child relationships for the extensions in spikeinterface
7473
:align: center
75-
|
7674

7775
If you try to calculate a child before calculating a parent, an error will be thrown. Further, when a parent is recalculated we delete
7876
its children. Why? Consider calculating :code:`principal_components`. This depends on random selection of spikes chosen
@@ -312,7 +310,7 @@ By default, the following metrics are computed:
312310
The units of :code:`recovery_slope` and :code:`repolarization_slope` depend on the
313311
input. Voltages are based on the units of the template. By default this is :math:`\mu V`
314312
but can be the raw output from the recording device (this depends on the
315-
:code:`return_scaled` parameter, read more here: :ref:`core-sorting-analyzer`).
313+
:code:`return_scaled` parameter, read more here: :ref:`modules/core:SortingAnalyzer`).
316314
Distances are in :math:`\mu m` and times are in seconds. So, for example, if the
317315
templates are in units of :math:`\mu V` then: :code:`repolarization_slope` is in
318316
:math:`mV / s`; :code:`peak_to_trough_ratio` is in :math:`\mu m` and the

0 commit comments

Comments
 (0)