Skip to content

Commit

Permalink
Fix RTD examples
Browse files Browse the repository at this point in the history
  • Loading branch information
alejoe91 committed Nov 19, 2021
1 parent 0f9c30d commit 9428cfc
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion examples/getting_started/plot_getting_started.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@

we_TDC = si.WaveformExtractor.create(recording_preprocessed, sorting_TDC, 'waveforms', remove_if_exists=True)
we_TDC.set_params(ms_before=3., ms_after=4., max_spikes_per_unit=500)
we_TDC.run(n_jobs=-1, chunk_size=30000)
we_TDC.run_extract_waveforms(n_jobs=-1, chunk_size=30000)
print(we_TDC)

unit_id0 = sorting_TDC.unit_ids[0]
Expand Down
6 changes: 3 additions & 3 deletions examples/modules/sorters/plot_1_sorters_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,18 +46,18 @@
default_TDC_params['detect_threshold'] = 5

# parameters set by params dictionary
sorting_TDC = ss.run_tridesclous(recording=recording, output_folder='tmp_TDC_5',
sorting_TDC_5 = ss.run_tridesclous(recording=recording, output_folder='tmp_TDC_5',
**default_TDC_params, )
##############################################################################

# parameters set by params dictionary
sorting_TDC_8 = ss.run_tridesclous(recording=recording, output_folder='tmp_TDC_8',
detect_threshold=8.)
detect_threshold=8.)


##############################################################################

print('Units found with threshold = 4:', sorting_TDC.get_unit_ids())
print('Units found with threshold = 5:', sorting_TDC_5.get_unit_ids())
print('Units found with threshold = 8:', sorting_TDC_8.get_unit_ids())

##############################################################################
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
# Let's create a toy example with 4 channels (the :code:`dumpable=True` dumps the extractors to a file, which is
# required for parallel sorting):

recording_single, _ = si.toy_example(duration=10, num_channels=4, dumpable=True, num_segments=1)
recording_single, _ = si.toy_example(duration=10, num_channels=4, seed=0, num_segments=1)
print(recording_single)

# make dumpable
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
numpy<=1.20
numpy<1.21
neo>=0.10.0
joblib
tqdm
Expand Down
3 changes: 2 additions & 1 deletion spikeinterface/core/waveform_extractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,8 @@ def get_waveforms(self, unit_id, with_index=False, sparsity=None):
if wfs is None:
waveform_file = self.folder / 'waveforms' / f'waveforms_{unit_id}.npy'
if not waveform_file.is_file():
raise Exception('waveforms not extracted yet : please do WaveformExtractor.run_extract_waveforms() fisrt')
raise Exception('Waveforms not extracted yet: '
'please do WaveformExtractor.run_extract_waveforms() first')

wfs = np.load(waveform_file)
self._waveforms[unit_id] = wfs
Expand Down

0 comments on commit 9428cfc

Please sign in to comment.