Skip to content

Commit

Permalink
fix zarr filenames
Browse files Browse the repository at this point in the history
  • Loading branch information
CodyCBakerPhD committed Aug 23, 2024
1 parent 085c913 commit ec8cb2b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def bin_all_reduced_s3_logs_by_object_key(
):
object_key_as_path = pathlib.Path(object_key)
binned_s3_log_file_path = (
binned_s3_logs_folder_path / object_key_as_path.parent / f"{object_key_as_path.stem}.tsv"
binned_s3_logs_folder_path / object_key_as_path.parent / f"{object_key_as_path.name}.tsv"
)
binned_s3_log_file_path.parent.mkdir(exist_ok=True, parents=True)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ def _map_binneded_logs_to_dandiset(
all_activity_for_version = []
for asset in dandiset_version.get_assets():
asset_as_path = pathlib.Path(asset.path)
dandi_filename = asset_as_path.stem
asset_suffixes = asset_as_path.suffixes
dandi_filename = asset_as_path.name.rstrip("".join(asset_suffixes))

is_asset_zarr = ".zarr" in asset_suffixes
if is_asset_zarr and object_type == "blobs":
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ def test_map_all_reduced_s3_logs_to_dandisets(tmpdir: py.path.local):

# Ensure to extra folders were created
test_dandiset_id_folder_paths = [
dandiset_id_folder_path.stem for dandiset_id_folder_path in test_dandiset_logs_folder_path.iterdir()
dandiset_id_folder_path.name for dandiset_id_folder_path in test_dandiset_logs_folder_path.iterdir()
]
expected_dandiset_id_folder_paths = [
dandiset_id_folder_path.stem for dandiset_id_folder_path in expected_output_folder_path.iterdir()
dandiset_id_folder_path.name for dandiset_id_folder_path in expected_output_folder_path.iterdir()
]
assert set(test_dandiset_id_folder_paths) == set(expected_dandiset_id_folder_paths)

Expand Down

0 comments on commit ec8cb2b

Please sign in to comment.