Skip to content

Commit d0fb153

Browse files
authored
Merge pull request #445 from int-brain-lab/one_globus
One globus
2 parents 3735352 + 8ebcc03 commit d0fb153

File tree

8 files changed

+35
-13
lines changed

8 files changed

+35
-13
lines changed

ibllib/__init__.py

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

44
from ibllib.misc import logger_config

ibllib/atlas/atlas.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -982,4 +982,4 @@ def _download_atlas_allen(file_image, FLAT_IRON_ATLAS_REL_PATH, par):
982982
raise ValueError('Unrecognized file image')
983983

984984
cache_dir = Path(par.CACHE_DIR).joinpath(FLAT_IRON_ATLAS_REL_PATH)
985-
return http_download_file(url, cache_dir=cache_dir)
985+
return http_download_file(url, target_dir=cache_dir)

ibllib/io/spikeglx.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -779,7 +779,7 @@ def download_raw_partial(url_cbin, url_ch, first_chunk=0, last_chunk=0, one=None
779779
ch_file = url_ch
780780
else:
781781
ch_file = Path(webclient.download_file(
782-
url_ch, cache_dir=target_dir, clobber=True, return_md5=False))
782+
url_ch, target_dir=target_dir, clobber=True, return_md5=False))
783783
ch_file = remove_uuid_file(ch_file)
784784
ch_file_stream = target_dir.joinpath(ch_file.name).with_suffix('.stream.ch')
785785

@@ -836,7 +836,7 @@ def download_raw_partial(url_cbin, url_ch, first_chunk=0, last_chunk=0, one=None
836836
# Download the requested chunks
837837
cbin_local_path = webclient.download_file(
838838
url_cbin, chunks=(first_byte, n_bytes),
839-
cache_dir=target_dir, clobber=True, return_md5=False)
839+
target_dir=target_dir, clobber=True, return_md5=False)
840840
cbin_local_path = remove_uuid_file(cbin_local_path)
841841
cbin_local_path_renamed = cbin_local_path.with_suffix('.stream.cbin')
842842
cbin_local_path.replace(cbin_local_path_renamed)

ibllib/oneibl/aws.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def __init__(self, s3_bucket_name=None, one=None):
3333
def _download_datasets(self, datasets):
3434

3535
files = []
36-
for _, d in datasets.iterrows():
36+
for i, d in datasets.iterrows():
3737
rel_file_path = Path(d['session_path']).joinpath(d['rel_path'])
3838
file_path = Path(self.one.cache_dir).joinpath(rel_file_path)
3939
file_path.parent.mkdir(exist_ok=True, parents=True)
@@ -44,8 +44,13 @@ def _download_datasets(self, datasets):
4444
_logger.info(f'{file_path} already exists wont redownload')
4545
continue
4646

47+
if self.one._index_type() is int:
48+
uuid = np2str(np.r_[i[0], i[1]])
49+
elif self.one._index_type() is str:
50+
uuid = i
51+
4752
aws_path = AWS_ROOT_PATH.joinpath(
48-
add_uuid_string(rel_file_path, np2str(np.r_[d.name[0], d.name[1]]))).as_posix()
53+
add_uuid_string(rel_file_path, uuid)).as_posix()
4954
# maybe should avoid this and do a try catch instead?, see here
5055
# https://boto3.amazonaws.com/v1/documentation/api/latest/guide/collections.html#filtering
5156
# probably better to do filter on collection ? Not for today

ibllib/oneibl/data_handlers.py

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ def __init__(self, session_path, signatures, one=None):
127127

128128
# Find the lab
129129
labs = get_lab_from_endpoint_id(one=self.one)
130+
130131
if len(labs) == 2:
131132
# for flofer lab
132133
subject = self.one.path2ref(self.session_path)['subject']
@@ -167,13 +168,19 @@ def setUp(self):
167168
target_paths = []
168169
source_paths = []
169170
self.local_paths = []
170-
for _, d in df.iterrows():
171+
for i, d in df.iterrows():
171172
sess_path = Path(rel_sess_path).joinpath(d['rel_path'])
172173
full_local_path = Path(self.globus.endpoints['local']['root_path']).joinpath(sess_path)
173174
if not full_local_path.exists():
175+
176+
if self.one._index_type() is int:
177+
uuid = np2str(np.r_[i[0], i[1]])
178+
elif self.one._index_type() is str:
179+
uuid = i
180+
174181
self.local_paths.append(full_local_path)
175182
target_paths.append(sess_path)
176-
source_paths.append(add_uuid_string(sess_path, np2str(np.r_[d.name[0], d.name[1]])))
183+
source_paths.append(add_uuid_string(sess_path, uuid))
177184

178185
if len(target_paths) != 0:
179186
ts = time()
@@ -384,9 +391,15 @@ def setUp(self):
384391
df = super().getData()
385392

386393
SDSC_TMP = Path(SDSC_PATCH_PATH.joinpath(self.task.__class__.__name__))
387-
for _, d in df.iterrows():
394+
for i, d in df.iterrows():
388395
file_path = Path(d['session_path']).joinpath(d['rel_path'])
389-
file_uuid = add_uuid_string(file_path, np2str(np.r_[d.name[0], d.name[1]]))
396+
397+
if self.one._index_type() is int:
398+
uuid = np2str(np.r_[i[0], i[1]])
399+
elif self.one._index_type() is str:
400+
uuid = i
401+
402+
file_uuid = add_uuid_string(file_path, uuid)
390403
file_link = SDSC_TMP.joinpath(file_path)
391404
file_link.parent.mkdir(exist_ok=True, parents=True)
392405
file_link.symlink_to(

ibllib/tests/test_plots.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def _get_image(self, url):
3737
try:
3838
img_file = list(Path('/var/www/').rglob(rel_path))[0]
3939
except IndexError:
40-
img_file = http_download_file(url, cache_dir=Path(self.tmp_dir.name), username=TEST_DB['username'],
40+
img_file = http_download_file(url, target_dir=Path(self.tmp_dir.name), username=TEST_DB['username'],
4141
password=TEST_DB['password'], silent=True)
4242
return img_file
4343

release_notes.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1-
## To be added to next release
1+
## Release Note 2.10
2+
3+
## Release Note 2.10.0 2022-02-11
24
- Fix in EphysDLC task to not return multiple copies of outputs
35
- Loading examples for different IBL data types
46
- Fix for probe syncing when Nidq and probe pulses don't match
7+
- Account for new ONE tables in ond datahandler
8+
- Add bad channels plots into RawEphysQc task
59

610
## Release Note 2.9
711

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ scipy>=1.3.0
2222
seaborn>=0.9.0
2323
tqdm>=4.32.1
2424
iblutil
25-
ONE-api
25+
ONE-api>=1.8.1

0 commit comments

Comments
 (0)