From 43ce76bc702b0e97a0b81164f2bcb09283713598 Mon Sep 17 00:00:00 2001 From: Miles Wells Date: Wed, 30 Oct 2024 12:48:57 +0200 Subject: [PATCH] Resolves https://github.com/int-brain-lab/iblenv/issues/384 --- CHANGELOG.md | 1 + one/api.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d9746329..9aa9d944 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ - prompt user to strip quotation marks if used during ONE setup - indicate when downloading from S3 - added 'keep_eid_index' kwarg to One.list_datasets which will return the data frame with the eid index level reinstated +- HOTFIX: include Subject/lab part in destination path when downloading from S3 ## [2.10.0] This version improves behaviour of loading revisions and loading datasets from list_datasets output. diff --git a/one/api.py b/one/api.py index 15df0228..cfa9d3ea 100644 --- a/one/api.py +++ b/one/api.py @@ -2373,8 +2373,9 @@ def _download_aws(self, dsets, update_exists=True, keep_uuid=None, **_) -> List[ assert record['relative_path'].endswith(dset['rel_path']), \ f'Relative path for dataset {uuid} does not match Alyx record' source_path = PurePosixPath(record['data_repository_path'], record['relative_path']) + local_path = self.cache_dir.joinpath(alfiles.get_alf_path(source_path)) + # Add UUIDs to filenames, if required source_path = alfiles.add_uuid_string(source_path, uuid) - local_path = self.cache_dir.joinpath(record['relative_path']) if keep_uuid is True or (keep_uuid is None and self.uuid_filenames is True): local_path = alfiles.add_uuid_string(local_path, uuid) local_path.parent.mkdir(exist_ok=True, parents=True)