Skip to content

Commit

Permalink
Make ZarrBIDSAsset to inherit from ZarrAsset first so iter_upload of …
Browse files Browse the repository at this point in the history
…Zarr is used not of a file

Also fixed up test
  • Loading branch information
yarikoptic committed Sep 29, 2023
1 parent c19906b commit 95a0f20
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion dandi/files/bids.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ def get_metadata(
)


class ZarrBIDSAsset(BIDSAsset, ZarrAsset):
class ZarrBIDSAsset(ZarrAsset, BIDSAsset):
"""
.. versionadded:: 0.46.0
Expand Down
6 changes: 4 additions & 2 deletions dandi/tests/test_upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,10 +295,12 @@ def test_upload_zarr(new_dandiset: SampleDandiset) -> None:
# identical to above, but different scenaior/fixture and path. TODO: avoid duplication
def test_upload_bids_zarr(bids_zarr_dandiset: SampleDandiset) -> None:
bids_zarr_dandiset.upload()
(asset,) = bids_zarr_dandiset.dandiset.get_assets()
assets = list(bids_zarr_dandiset.dandiset.get_assets())
assert len(assets) > 10 # it is a bigish dataset
(asset,) = [a for a in assets if a.path.endswith(".zarr")]
assert isinstance(asset, RemoteZarrAsset)
assert asset.asset_type is AssetType.ZARR
assert asset.path == "sample.zarr"
assert asset.path.endswith(".zarr")

Check warning on line 303 in dandi/tests/test_upload.py

View check run for this annotation

Codecov / codecov/patch

dandi/tests/test_upload.py#L297-L303

Added lines #L297 - L303 were not covered by tests
# Test that uploading again without any changes works:
bids_zarr_dandiset.upload()

Check warning on line 305 in dandi/tests/test_upload.py

View check run for this annotation

Codecov / codecov/patch

dandi/tests/test_upload.py#L305

Added line #L305 was not covered by tests

Expand Down

0 comments on commit 95a0f20

Please sign in to comment.