Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add RemoteDandiset.has_data_standard() convenience function #958

Draft
wants to merge 16 commits into
base: master
Choose a base branch
from
14 changes: 14 additions & 0 deletions dandi/dandiapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -1071,6 +1071,20 @@ def iter_upload_raw_asset(
self, metadata=asset_metadata, jobs=jobs, replacing=replace_asset
)

def is_nwb(self) -> bool:
yarikoptic marked this conversation as resolved.
Show resolved Hide resolved
"""
Returns True if the dandiset contains NWB file assets.
bendichter marked this conversation as resolved.
Show resolved Hide resolved

This is determined by checking for "RRID:SCR_015242" in the "dataStandard" field
of the assetsSummary of the dandiset.
"""
assetsSummary = self.get_raw_metadata()["assetsSummary"]
if "dataStandard" not in assetsSummary:
return False
return any(
x["identifier"] == "RRID:SCR_015242" for x in assetsSummary["dataStandard"]
)


class BaseRemoteAsset(ABC, APIBase):
"""
Expand Down