-
Notifications
You must be signed in to change notification settings - Fork 15
feat: add numberOfSessions to AssetsSummary #409
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
base: master
Are you sure you want to change the base?
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1201,6 +1201,9 @@ class AssetsSummary(DandiBaseModel): | |
| None, json_schema_extra={"readOnly": True} | ||
| ) # more of NWB | ||
| numberOfCells: Optional[int] = Field(None, json_schema_extra={"readOnly": True}) | ||
| numberOfSessions: Optional[int] = Field( | ||
| None, json_schema_extra={"readOnly": True} | ||
| ) # BIDS ses-* tokens, counted as unique (subject, session) pairs | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Possibly add to the comment that this count assumes the dataset is valid BIDS dataset. (For example, a session without subject will not be counted)
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Possibly moving some of the info in the comment into the
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would like to keep this information as comments rather than description. If we were to add a new data structure, then we could add a new way to compute numberOfSessions, which could still be a valid field. If we don't make notes about how the data is derived, we can support new data structure without making any changes to the schema. That's why I think the field should contain information about what the data is about, and comments should be used to give hints about how it was derived. |
||
|
|
||
| dataStandard: Optional[List[StandardsType]] = Field( | ||
| None, json_schema_extra={"readOnly": True} | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
too aisloppy -- easier to HI compose the logic but first potentially even generalize 2 prior blocks into a 'for' loop, then if no session was found in filename, go through path's parts and split on ses- and be done if any matches.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in cdb37ee — collapsed the
sub-/sample-/ses-filename parsing into a single loop over anentitieslist, and simplified the session fallback to scanningasset_path.parts[:-1]for ases-Xdirectory and stopping at the first match. Dropped the directory-only subject fallback since BIDS files always carrysub-in the filename.