From df14d84ade4696e17ff1c5503bfcdc12dd9a7e4a Mon Sep 17 00:00:00 2001 From: Hannah Martinez Date: Mon, 31 Mar 2025 16:22:36 +0000 Subject: [PATCH] Small bugfixes --- requirements.txt | 5 +++-- vsvi2precomputed/__init__.py | 6 +++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/requirements.txt b/requirements.txt index e58661f..d428bb4 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,5 @@ -cloud-volume +cloud-volume==11.1.5 joblib tqdm -pillow \ No newline at end of file +pillow +boto3==1.35.99 diff --git a/vsvi2precomputed/__init__.py b/vsvi2precomputed/__init__.py index 0bc2db6..dc03f70 100644 --- a/vsvi2precomputed/__init__.py +++ b/vsvi2precomputed/__init__.py @@ -85,8 +85,8 @@ def convert_precomputed_tiles(vsvi_root_path, vsvi_data, output_path): ''' input_bucket, base_prefix = vsvi_root_path.replace("s3://", "").split("/", 1) - source_prefix = vsvi_data.get("SourceFileNameTemplate").split("/")[1] - prefix = "/".join([base_prefix, source_prefix]) + source_prefix = vsvi_data.get("SourceFileNameTemplate").split("/")[:-2] + prefix = os.path.join(base_prefix, "/".join(source_prefix)) # Prepend "file://" if path is local and does not already have it if output_path[:5] != "s3://" and output_path[:7] != "file://": @@ -99,7 +99,7 @@ def convert_precomputed_tiles(vsvi_root_path, vsvi_data, output_path): Parallel(n_jobs=-1)(delayed(_convert_tile)(vol, key, vsvi_data, input_bucket) for key in tqdm(_list_objects_cloud(input_bucket, prefix))) # TODO: add log that counts number of objects copied else: - search_dir = os.path.join(vsvi_root_path, source_prefix) + search_dir = os.path.join(vsvi_root_path, "/".join(source_prefix)) Parallel(n_jobs=-1)(delayed(_convert_tile)(vol, key, vsvi_data) for key in tqdm(_list_objects_local(search_dir))) # TODO: add log that counts number of objects copied