Skip to content

Commit

Permalink
Using correct ZARR digest class (still not working)
Browse files Browse the repository at this point in the history
included debug print calls
  • Loading branch information
TheChymera committed Dec 1, 2022
1 parent 960eea9 commit a754bf1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
7 changes: 4 additions & 3 deletions dandi/cli/cmd_ls.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import click

from .base import devel_option, lgr, map_to_click_exceptions
from ..consts import ZARR_EXTENSIONS, metadata_all_fields
from ..dandiarchive import DandisetURL, _dandi_url_parser, parse_dandi_url
from ..misctypes import Digest
from ..utils import is_url
Expand Down Expand Up @@ -92,7 +93,6 @@ def ls(
PYOUTFormatter,
YAMLFormatter,
)
from ..consts import metadata_all_fields

# TODO: avoid
from ..support.pyout import PYOUT_SHORT_NAMES_rev
Expand Down Expand Up @@ -364,11 +364,12 @@ def fn():
digest = "0" * 32 + "-1"
else:
lgr.info("Calculating digest for %s", path)
if path.endswith((".zarr", ".ZARR")):
if path.endswith(tuple(ZARR_EXTENSIONS)):
digest = get_digest(path, digest="zarr-checksum")
rec = get_metadata(path, Digest.dandi_zarr(digest))
else:
digest = get_digest(path, digest="dandi-etag")
rec = get_metadata(path, Digest.dandi_etag(digest))
rec = get_metadata(path, Digest.dandi_etag(digest))
except Exception as exc:
_add_exc_error(path, rec, errors, exc)
if flatten:
Expand Down
1 change: 1 addition & 0 deletions dandi/files/bids.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ def get_metadata(
start_time = end_time = datetime.now().astimezone()
add_common_metadata(metadata, self.filepath, start_time, end_time, digest)
metadata["path"] = self.path
print("7777777777777777777")
return BareAsset(**metadata)

def get_validation_bids_version(self) -> str:
Expand Down
2 changes: 2 additions & 0 deletions dandi/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,9 @@ def get_metadata(
)
print("qqqqqqqqqqqqqqqqqqqqqqqqqqqqq")
print(type(df))
print("666666666666666666666666")
a = df.get_metadata(digest=digest)
print("8888888888888888888888")
meta["bids_version"] = df.get_validation_bids_version()
for key in metadata_all_fields:
try:
Expand Down

0 comments on commit a754bf1

Please sign in to comment.