Skip to content

Commit e4a4f88

Browse files
committed
Merge branch 'release/2.10.2'
2 parents 2e1f91c + a83051e commit e4a4f88

File tree

5 files changed

+24
-8
lines changed

5 files changed

+24
-8
lines changed

brainbox/io/one.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -941,7 +941,7 @@ def _get_spike_sorting_collection(self, spike_sorter='pykilosort', revision=None
941941
_logger.debug(f"selecting: {collection} to load amongst candidates: {self.collections}")
942942
return collection
943943

944-
def _download_spike_sorting_object(self, obj, spike_sorter='pykilosort', dataset_types=None):
944+
def download_spike_sorting_object(self, obj, spike_sorter='pykilosort', dataset_types=None):
945945
"""
946946
Downloads an ALF object
947947
:param obj: object name, str between 'spikes', 'clusters' or 'channels'
@@ -954,7 +954,8 @@ def _download_spike_sorting_object(self, obj, spike_sorter='pykilosort', dataset
954954
self.collection = self._get_spike_sorting_collection(spike_sorter=spike_sorter)
955955
_logger.debug(f"loading spike sorting from {self.collection}")
956956
spike_attributes, cluster_attributes = self._get_attributes(dataset_types)
957-
attributes = {'spikes': spike_attributes, 'clusters': cluster_attributes, 'channels': None}
957+
attributes = {'spikes': spike_attributes, 'clusters': cluster_attributes, 'channels': None,
958+
'templates': None, 'spikes_subset': None}
958959
self.files[obj] = self.one.load_object(self.eid, obj=obj, attribute=attributes[obj],
959960
collection=self.collection, download_only=True)
960961

@@ -966,7 +967,7 @@ def download_spike_sorting(self, **kwargs):
966967
:return:
967968
"""
968969
for obj in ['spikes', 'clusters', 'channels']:
969-
self._download_spike_sorting_object(obj=obj, **kwargs)
970+
self.download_spike_sorting_object(obj=obj, **kwargs)
970971
self.spike_sorting_path = self.files['spikes'][0].parent
971972

972973
def load_spike_sorting(self, **kwargs):

brainbox/io/spikeglx.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import logging
33
from pathlib import Path
44
import time
5+
import json
56

67
import numpy as np
78

@@ -126,14 +127,22 @@ def stream(pid, t0, nsecs=1, one=None, cache_folder=None, remove_cached=False, t
126127
if cache_folder is None:
127128
samples_folder = Path(one.alyx._par.CACHE_DIR).joinpath('cache', typ)
128129

130+
def _get_file(one_rec):
131+
fpath = Path(one.alyx._par.CACHE_DIR).joinpath(
132+
str(one_rec['session_path'].values[0]),
133+
str(one_rec['rel_path'].values[0]))
134+
if fpath.exists():
135+
return fpath
136+
else:
137+
return one._download_datasets(one_rec)[0]
138+
129139
eid, pname = one.pid2eid(pid)
130140
cbin_rec = one.list_datasets(eid, collection=f"*{pname}", filename=f'*{typ}.*bin', details=True)
131141
ch_rec = one.list_datasets(eid, collection=f"*{pname}", filename=f'*{typ}.ch', details=True)
132142
meta_rec = one.list_datasets(eid, collection=f"*{pname}", filename=f'*{typ}.meta', details=True)
133-
ch_file = one._download_datasets(ch_rec)[0]
134-
one._download_datasets(meta_rec)[0]
143+
ch_file = _get_file(ch_rec)
144+
_get_file(meta_rec)
135145

136-
import json
137146
with open(ch_file) as fid:
138147
chinfo = json.load(fid)
139148
tbounds = np.array(chinfo['chunk_bounds']) / chinfo['sample_rate']

ibllib/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
__version__ = "2.10.1"
1+
__version__ = "2.10.2"
22
import warnings
33

44
from ibllib.misc import logger_config

ibllib/pipes/local_server.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
import ibllib.oneibl.registration as registration
1717

1818
_logger = logging.getLogger('ibllib')
19-
LARGE_TASKS = ['EphysVideoCompress', 'TrainingVideoCompress', 'SpikeSorting'] # 'EphysDLC', 'TrainingDLC',
19+
LARGE_TASKS = ['EphysVideoCompress', 'TrainingVideoCompress', 'SpikeSorting', 'EphysDLC'] # 'TrainingDLC',
2020

2121

2222
def _get_pipeline_class(session_path, one):
@@ -164,6 +164,9 @@ def job_runner(subjects_path, mode='all', lab=None, dry=False, one=None, count=5
164164
tasks = one.alyx.rest('tasks', 'list', status='Waiting',
165165
django=f'session__lab__name__in,{lab},name__in,{LARGE_TASKS}', no_cache=True)
166166

167+
# Order tasks by priority
168+
tasks = sorted(tasks, key=lambda d: d['priority'], reverse=True)
169+
167170
tasks_runner(subjects_path, tasks, one=one, count=count, time_out=3600, dry=dry)
168171

169172

release_notes.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
## Release Note 2.10
22

3+
## Release Note 2.10.2 2022-02-28
4+
- Small fixes to local server task queues
5+
36
## Release Note 2.10.1 2022-02-22
47
- Authenticate alyx user in Task class
58
- Some fixes to make dlc_qc_plot in EphysPostDLC more reliable

0 commit comments

Comments
 (0)