From 3d03b77c73f18b18ecd61bcae9b047e0dca94508 Mon Sep 17 00:00:00 2001 From: Alessio Buccino Date: Thu, 13 Aug 2020 19:32:32 +0200 Subject: [PATCH 1/7] Updated packages --- requirements.txt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/requirements.txt b/requirements.txt index 22ea635eb0..730552bfea 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ -spikeextractors>=0.8.4 -spiketoolkit>=0.6.3 -spikesorters>=0.3.2 -spikecomparison>=0.2.6 -spikewidgets>=0.4.3 +spikeextractors>=0.9.0 +spiketoolkit>=0.7.0 +spikesorters>=0.4.0 +spikecomparison>=0.3.0 +spikewidgets>=0.5.0 From 2afce8bc3a3dec48f4303686a4cfbabccd578baf Mon Sep 17 00:00:00 2001 From: Alessio Buccino Date: Thu, 13 Aug 2020 19:34:59 +0200 Subject: [PATCH 2/7] Changed readme --- README.md | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 1cae936c61..0a721ec908 100644 --- a/README.md +++ b/README.md @@ -36,16 +36,14 @@ python setup.py develop **Important**: installing with `python setup.py develop` DOES NOT install the latest version of the different modules. In order to get the latest updates, clone the above-mentioned repositories and install them from source. -## Examples - -For using SpikeInterface, please checkout these [examples](https://github.com/SpikeInterface/spikeinterface/tree/master/examples). - -Also, you can checkout this [tutorial](https://github.com/SpikeInterface/spiketutorials/tree/master/Spike_sorting_workshop_2019) for getting started with SpikeInterface. - ## Documentation All documentation for SpikeInterface can be found here: https://spikeinterface.readthedocs.io/en/latest/. +You can also check out this 1-hour video tutorial for the NWB User Days 2019: +https://www.youtube.com/watch?v=nWJGwFB7oII + + ## Citation If you find SpikeInterface useful in your research, please cite: From f2e613ba89bb578912b0de88ebd68bc512b448f4 Mon Sep 17 00:00:00 2001 From: Alessio Buccino Date: Tue, 25 Aug 2020 14:41:09 +0200 Subject: [PATCH 3/7] mpl 3.2.2 --- .travis.yml | 1 + requirements_rtd.txt | 1 + 2 files changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index bc575b93d3..02b20afdd1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,6 +5,7 @@ os: python: - '3.6' install: +- pip install matplotlib==3.2.2 - pip install -r requirements.txt - pip install -r requirements_rtd.txt - pip install sphinx pillow sphinx-gallery diff --git a/requirements_rtd.txt b/requirements_rtd.txt index c63a18d039..cf10797785 100644 --- a/requirements_rtd.txt +++ b/requirements_rtd.txt @@ -18,4 +18,5 @@ klustakwik2==0.2.7 # tridesclous pyqt5 +hdbscan tridesclous==1.6.0 From e99ade6d4ddd0163bd2d01c05dec9ebba884721e Mon Sep 17 00:00:00 2001 From: Alessio Buccino Date: Tue, 25 Aug 2020 15:27:13 +0200 Subject: [PATCH 4/7] Fix tests --- doc/sorting_extractor.rst | 2 +- doc/spike_sorter.rst | 23 +++++++++---------- .../sorters/plot_3_sorting_by_group.py | 5 ++-- requirements.txt | 2 +- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/doc/sorting_extractor.rst b/doc/sorting_extractor.rst index 4ffe2511e8..e56594e20e 100644 --- a/doc/sorting_extractor.rst +++ b/doc/sorting_extractor.rst @@ -26,7 +26,7 @@ The contributed extractors are in the **spikeextractors/extractors** folder. You SortingExtractor.__init__(self) ## All file specific initialization code can go here. - # If your format stores the sampling frequency, you can overweite the self._sampling_frequency. This way, + # If your format stores the sampling frequency, you can overwrite the self._sampling_frequency. This way, # the base method self.get_sampling_frequency() will return the correct sampling frequency self._sampling_frequency = my_sampling_frequency diff --git a/doc/spike_sorter.rst b/doc/spike_sorter.rst index 1ce7597dcf..1f7c05a202 100644 --- a/doc/spike_sorter.rst +++ b/doc/spike_sorter.rst @@ -49,17 +49,10 @@ Then, you can start creating a new class: 'param2': 2, } - # (optional) rewrite the params as a list for the Spikely GUI to use - _extra_gui_params = [ - {'name': 'param1', 'type': 'str', 'value': None, 'default': None, - 'title': "My first param"}, - {'name': 'param2', 'type': 'int', 'value': 2, 'default': 2, - 'title': "My second param"}, - ] - - sorter_gui_params = copy.deepcopy(BaseSorter.sorter_gui_params) - for param in _extra_gui_params: - sorter_gui_params.append(param) + _params_description = { + 'param1': 'Description for param1', + 'param1': 'Description for param1', + } installation_mesg = """ >>> pip install myspikesorter @@ -79,12 +72,18 @@ Now you can start filling out the required methods: def get_sorter_version(): return myspikesorter.__version__ + @classmethod + def is_installed(cls): + + # Fill code to check sorter installation. It returns a boolean + return HAVE_MSS + def _setup_recording(self, recording, output_folder): # Fill code to set up the recording: convert to required file, parse config files, etc. # The files should be placed in the 'output_folder' - def _run(self, recording, output_folder): + def _run(self, recording, output_folder): # Fill code to run your spike sorter based on the files created in the _setup_recording() # You can run CLI commands (e.g. klusta, spykingcircus, tridescous), pure Python code (e.g. Mountainsort4, diff --git a/examples/modules/sorters/plot_3_sorting_by_group.py b/examples/modules/sorters/plot_3_sorting_by_group.py index 3a7a2a6fc1..0501e0c4e8 100644 --- a/examples/modules/sorters/plot_3_sorting_by_group.py +++ b/examples/modules/sorters/plot_3_sorting_by_group.py @@ -22,9 +22,10 @@ # (using the :code:`set_channel_property` method), or by using a probe file. In this example we will create a 16 channel # recording and split it in four channel groups (tetrodes). # -# Let's create a toy example with 16 channels: +# Let's create a toy example with 16 channels (the :code:`dumpable=True` dumps the extractors to a file, which is +# required for parallel sorting): -recording_tetrodes, sorting_true = se.example_datasets.toy_example(duration=10, num_channels=16) +recording_tetrodes, sorting_true = se.example_datasets.toy_example(duration=10, num_channels=16, dumpable=True) ############################################################################## # Initially there is no group information ('location' is loaded automatically when creating toy data): diff --git a/requirements.txt b/requirements.txt index 730552bfea..e787ed72b8 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ spikeextractors>=0.9.0 spiketoolkit>=0.7.0 -spikesorters>=0.4.0 +spikesorters>=0.4.1 spikecomparison>=0.3.0 spikewidgets>=0.5.0 From ad1af9175c08671768bed308b3eea4a1e200ea16 Mon Sep 17 00:00:00 2001 From: Alessio Buccino Date: Tue, 25 Aug 2020 15:51:50 +0200 Subject: [PATCH 5/7] sorters -> ss, remove installed_sorter_list --- doc/supported.rst | 14 +++++++------- examples/getting_started/plot_getting_started.py | 6 +++--- .../comparison/generate_erroneous_sorting.py | 1 - .../comparison/plot_1_compare_two_sorters.py | 6 +++--- .../comparison/plot_2_compare_multiple_sorters.py | 10 +++++----- .../plot_3_compare_sorter_with_ground_truth.py | 6 +++--- .../plot_5_comparison_sorter_weaknesses.py | 2 +- examples/modules/sorters/plot_1_sorters_example.py | 6 +++--- 8 files changed, 25 insertions(+), 26 deletions(-) diff --git a/doc/supported.rst b/doc/supported.rst index 22ace52f09..d16ae8b3d6 100644 --- a/doc/supported.rst +++ b/doc/supported.rst @@ -170,22 +170,22 @@ First, import the spikesorters package, .. code:: python - import spikesorters as sorters + import spikesorters as ss Then you can check the installed Sorter list, .. code:: python - sorters.installed_sorter_list + ss.installed_sorters() which outputs, .. parsed-literal:: - [spikesorters.klusta.klusta.KlustaSorter, - spikesorters.tridesclous.tridesclous.TridesclousSorter, - spikesorters.mountainsort4.mountainsort4.Mountainsort4Sorter, - spikesorters.spyking_circus.spyking_circus.SpykingcircusSorter, - spikesorters.herdingspikes.herdingspikes.HerdingspikesSorter] + ['herdingspikes', + 'klusta', + 'mountainsort4', + 'spykingcircus', + 'tridesclous'] When trying to use an sorter that has not been installed in your environment, an installation message will appear indicating how to install the given sorter, diff --git a/examples/getting_started/plot_getting_started.py b/examples/getting_started/plot_getting_started.py index 73c8657b92..b17ffdf26e 100644 --- a/examples/getting_started/plot_getting_started.py +++ b/examples/getting_started/plot_getting_started.py @@ -118,11 +118,11 @@ # Let's first check which sorters are implemented and which are installed print('Available sorters', ss.available_sorters()) -print('Installed sorters', ss.installed_sorter_list) +print('Installed sorters', ss.installed_sorters()) ############################################################################## -# The :code:`ss.installed_sorter_list` will list the sorters installed in the machine. Each spike sorter -# is implemented as a class. We can see we have Klusta and Mountainsort4 installed. +# The :code:`ss.installed_sorters()` will list the sorters installed in the machine. +# We can see we have Klusta and Mountainsort4 installed. # Spike sorters come with a set of parameters that users can change. The available parameters are dictionaries and # can be accessed with: diff --git a/examples/modules/comparison/generate_erroneous_sorting.py b/examples/modules/comparison/generate_erroneous_sorting.py index d2e1290000..c0758c1aab 100644 --- a/examples/modules/comparison/generate_erroneous_sorting.py +++ b/examples/modules/comparison/generate_erroneous_sorting.py @@ -8,7 +8,6 @@ import matplotlib.pyplot as plt import spikeinterface.extractors as se -import spikeinterface.sorters as sorters import spikeinterface.comparison as sc import spikeinterface.widgets as sw diff --git a/examples/modules/comparison/plot_1_compare_two_sorters.py b/examples/modules/comparison/plot_1_compare_two_sorters.py index f887378aaa..c98bc1b015 100644 --- a/examples/modules/comparison/plot_1_compare_two_sorters.py +++ b/examples/modules/comparison/plot_1_compare_two_sorters.py @@ -14,7 +14,7 @@ import matplotlib.pyplot as plt import spikeinterface.extractors as se -import spikeinterface.sorters as sorters +import spikeinterface.sorters as ss import spikeinterface.comparison as sc import spikeinterface.widgets as sw @@ -27,8 +27,8 @@ ############################################################################# # Then run two spike sorters and compare their ouput. -sorting_KL = sorters.run_klusta(recording) -sorting_MS4 = sorters.run_mountainsort4(recording) +sorting_KL = ss.run_klusta(recording) +sorting_MS4 = ss.run_mountainsort4(recording) ############################################################################# diff --git a/examples/modules/comparison/plot_2_compare_multiple_sorters.py b/examples/modules/comparison/plot_2_compare_multiple_sorters.py index c422730bb3..e50f9853e1 100644 --- a/examples/modules/comparison/plot_2_compare_multiple_sorters.py +++ b/examples/modules/comparison/plot_2_compare_multiple_sorters.py @@ -16,7 +16,7 @@ import matplotlib.pyplot as plt import spikeinterface.extractors as se -import spikeinterface.sorters as sorters +import spikeinterface.sorters as ss import spikeinterface.comparison as sc import spikeinterface.widgets as sw @@ -26,11 +26,11 @@ recording, sorting = se.example_datasets.toy_example(num_channels=4, duration=20, seed=0) ############################################################################# -# Then run 3 spike sorters and compare their ouput. +# Then run 3 spike sorters and compare their output. -sorting_KL = sorters.run_klusta(recording) -sorting_MS4 = sorters.run_mountainsort4(recording) -sorting_TDC = sorters.run_tridesclous(recording) +sorting_KL = ss.run_klusta(recording) +sorting_MS4 = ss.run_mountainsort4(recording) +sorting_TDC = ss.run_tridesclous(recording) ############################################################################# # Compare multiple spike sorter outputs diff --git a/examples/modules/comparison/plot_3_compare_sorter_with_ground_truth.py b/examples/modules/comparison/plot_3_compare_sorter_with_ground_truth.py index 929af46a5f..ddbc0269dc 100644 --- a/examples/modules/comparison/plot_3_compare_sorter_with_ground_truth.py +++ b/examples/modules/comparison/plot_3_compare_sorter_with_ground_truth.py @@ -22,7 +22,7 @@ import seaborn as sns import spikeinterface.extractors as se -import spikeinterface.sorters as sorters +import spikeinterface.sorters as ss import spikeinterface.comparison as sc import spikeinterface.widgets as sw @@ -30,7 +30,7 @@ recording, sorting_true = se.example_datasets.toy_example(num_channels=4, duration=10, seed=0) -sorting_MS4 = sorters.run_mountainsort4(recording) +sorting_MS4 = ss.run_mountainsort4(recording) ############################################################################## @@ -108,7 +108,7 @@ ############################################################################## # Lets do the same for klusta -sorting_KL = sorters.run_klusta(recording) +sorting_KL = ss.run_klusta(recording) cmp_gt_KL = sc.compare_sorter_to_ground_truth(sorting_true, sorting_KL, exhaustive_gt=True) ############################################################################## diff --git a/examples/modules/comparison/plot_5_comparison_sorter_weaknesses.py b/examples/modules/comparison/plot_5_comparison_sorter_weaknesses.py index 84de168189..8b03137f5d 100644 --- a/examples/modules/comparison/plot_5_comparison_sorter_weaknesses.py +++ b/examples/modules/comparison/plot_5_comparison_sorter_weaknesses.py @@ -41,7 +41,7 @@ import seaborn as sns import spikeinterface.extractors as se -import spikeinterface.sorters as sorters +import spikeinterface.sorters as ss import spikeinterface.comparison as sc import spikeinterface.widgets as sw diff --git a/examples/modules/sorters/plot_1_sorters_example.py b/examples/modules/sorters/plot_1_sorters_example.py index 37a4084ebe..6cdbdd28cd 100644 --- a/examples/modules/sorters/plot_1_sorters_example.py +++ b/examples/modules/sorters/plot_1_sorters_example.py @@ -21,10 +21,10 @@ print(ss.available_sorters()) ############################################################################## -# This will list the sorters installed in the machine. Each spike sorter -# is implemented in a class. To access the class names you can run: +# This will list the sorters available through SpikeInterface. To see which sorters are installed on the machine +# you can run: -print(ss.installed_sorter_list) +print(ss.installed_sorters()) ############################################################################## # Change sorter parameters From c6469aeec1e2717eb74f21e3f1afc7c182836fc5 Mon Sep 17 00:00:00 2001 From: Alessio Buccino Date: Wed, 26 Aug 2020 15:40:06 +0200 Subject: [PATCH 6/7] Upgrade se to 0.9.1 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index e787ed72b8..3092493305 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -spikeextractors>=0.9.0 +spikeextractors>=0.9.1 spiketoolkit>=0.7.0 spikesorters>=0.4.1 spikecomparison>=0.3.0 From 13c97f56de1a25c1287655dc827dd5e0360af7d9 Mon Sep 17 00:00:00 2001 From: Alessio Buccino Date: Wed, 26 Aug 2020 22:48:00 +0200 Subject: [PATCH 7/7] spikesorters 0.4.2 and reference to paper, video, notebooks --- doc/index.rst | 8 ++++++-- requirements.txt | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/doc/index.rst b/doc/index.rst index 78a8b6481a..2b15f3d3da 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -33,9 +33,13 @@ With SpikeInterface, users can: whatisnew authors +For more informatio, please have a look at: + +- The bioRxiv `preprint `_ + +- 1-hour `video tutorial `_, recorded for the NWB User Days (May 2020) -Please have a look at the `preprint paper `_ for more info. - +- A collection of analysis notebook `spikeinterface report `_ .. Indices and tables .. ================== diff --git a/requirements.txt b/requirements.txt index 3092493305..39baa6991a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ spikeextractors>=0.9.1 spiketoolkit>=0.7.0 -spikesorters>=0.4.1 +spikesorters>=0.4.2 spikecomparison>=0.3.0 spikewidgets>=0.5.0