You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
yield {"status": "extracting metadata"}
try:
asset_metadata = nwb2asset(
path, digest=file_etag, digest_type="dandi_etag"
)
except Exception as exc:
lgr.exception("Failed to extract metadata from %s", path)
if allow_any_path:
yield {"status": "failed to extract metadata"}
asset_metadata = get_default_metadata(
path, digest=file_etag, digest_type="dandi_etag"
)
else:
yield skip_file("failed to extract metadata: %s" % str(exc))
return
metadata = asset_metadata.json_dict()
metadata["path"] = str(relpath)
so besides fall-back to get_default_metadata it adds a logic to convert to json_dict (could be omitted) but also fixes up the path to be relative to the dataset. For the purpose of metadata migration/updates etc, would be useful to centralize that logic so we do not need to (possibly incompletely) duplicate it within backups2datalad.py etc.
Could be a helper function or a class method on Asset, e.g. from_file then (IIRC has idea about dandiset) may be even ds does not need to be provided
The text was updated successfully, but these errors were encountered:
ATM upload does
so besides fall-back to
get_default_metadata
it adds a logic to convert to json_dict (could be omitted) but also fixes up the path to be relative to the dataset. For the purpose of metadata migration/updates etc, would be useful to centralize that logic so we do not need to (possibly incompletely) duplicate it within backups2datalad.py etc.Could be a helper function or a class method on Asset, e.g.
from_file
then (IIRC has idea about dandiset) may be evends
does not need to be providedThe text was updated successfully, but these errors were encountered: