Skip to content

Commit

Permalink
use blob instead of identifier
Browse files Browse the repository at this point in the history
  • Loading branch information
CodyCBakerPhD committed Aug 16, 2024
1 parent 1fb8a09 commit 788e86a
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 9 deletions.
7 changes: 4 additions & 3 deletions src/dandi_s3_log_parser/_dandiset_mapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,13 @@ def _map_reduced_logs_to_dandiset(

all_reduced_logs = []
for asset in dandiset_version.get_assets():
asset_id = asset.identifier.replace("-", "_")
asset_suffixes = pathlib.Path(asset.path).suffixes
is_asset_zarr = ".zarr" in asset_suffixes

blob_or_zarr = "blobs" if ".zarr" not in asset_suffixes else "zarr"
blob_id = asset.identifier if not is_asset_zarr else asset.zarr
blobs_or_zarr = "blobs" if not is_asset_zarr else "zarr"

reduced_log_file_path = reduced_s3_logs_folder_path / f"{blob_or_zarr}_{asset_id}.tsv"
reduced_log_file_path = reduced_s3_logs_folder_path / f"{blobs_or_zarr}_{blob_id}.tsv"

if not reduced_log_file_path.exists():
continue # No reduced logs found (possible asset was never accessed); skip to next asset
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
filename timestamp bytes_sent region
0 5e9e92e1-f044-4aa0-ab47-1cfcb8899348 2022-03-16 02:21:12 512 unknown
1 5e9e92e1-f044-4aa0-ab47-1cfcb8899348 2022-05-04 05:06:35 512 unknown
0 sub-YutaMouse20/sub-YutaMouse20_ses-YutaMouse20-140327_behavior+ecephys.nwb 2022-03-16 02:21:12 512 unknown
1 sub-YutaMouse20/sub-YutaMouse20_ses-YutaMouse20-140327_behavior+ecephys.nwb 2022-05-04 05:06:35 512 unknown
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
filename timestamp bytes_sent region
0 5e9e92e1-f044-4aa0-ab47-1cfcb8899348 2022-03-16 02:21:12 512 unknown
1 5e9e92e1-f044-4aa0-ab47-1cfcb8899348 2022-05-04 05:06:35 512 unknown
0 sub-YutaMouse20/sub-YutaMouse20_ses-YutaMouse20-140327_behavior+ecephys.nwb 2022-03-16 02:21:12 512 unknown
1 sub-YutaMouse20/sub-YutaMouse20_ses-YutaMouse20-140327_behavior+ecephys.nwb 2022-05-04 05:06:35 512 unknown
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
filename timestamp bytes_sent region
0 5e9e92e1-f044-4aa0-ab47-1cfcb8899348 2022-03-16 02:21:12 512 unknown
1 5e9e92e1-f044-4aa0-ab47-1cfcb8899348 2022-05-04 05:06:35 512 unknown
0 sub-YutaMouse20/sub-YutaMouse20_ses-YutaMouse20-140327_behavior+ecephys.nwb 2022-03-16 02:21:12 512 unknown
1 sub-YutaMouse20/sub-YutaMouse20_ses-YutaMouse20-140327_behavior+ecephys.nwb 2022-05-04 05:06:35 512 unknown

0 comments on commit 788e86a

Please sign in to comment.