Skip to content

nhp subject#1738

Merged
saskiad merged 20 commits intodevfrom
feat-1701-nhp
Mar 3, 2026
Merged

nhp subject#1738
saskiad merged 20 commits intodevfrom
feat-1701-nhp

Conversation

@saskiad
Copy link
Copy Markdown
Collaborator

@saskiad saskiad commented Feb 18, 2026

closes #1701

@saskiad
Copy link
Copy Markdown
Collaborator Author

saskiad commented Feb 18, 2026

Two suggestions:

  • move restrictions to the subject class (instead of in the mouse subject) (or remove from subject altogether and only use the one in data description)
  • add mating status to mouse subject as optional field

@saskiad saskiad requested review from dbirman and gouwens February 18, 2026 04:10
Copy link
Copy Markdown
Collaborator

@gouwens gouwens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks good - just a question about mating status being required or optional.

Comment thread src/aind_data_schema/components/subjects.py
Copy link
Copy Markdown
Member

@dbirman dbirman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to add a validator for HumanSubject.species to avoid crashing old code (unless we're sure none of these assets exist)

class HumanSubject(DataModel):
"""Description of a human subject"""

species: Species.ONE_OF = Field(..., title="Species")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like there's a sensible default we could put here. More seriously this is a breaking change, we should add a field_validator in mode="before" that pre-fills this if it's not present to avoid crashing old assets (if any have HumanSubject, I'm not sure they do though)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It gave me all sorts of errors when I tried to make it a default and I didn't have the patience to figure out why. But yes, I agree.
I think there is one very old exaspim asset with human data, that may or may not have any of the rest of its metadata...I'll look into it. But yes, let's not break everything.

@saskiad saskiad requested a review from dbirman March 3, 2026 00:27
Copy link
Copy Markdown
Member

@dbirman dbirman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

@saskiad saskiad added this pull request to the merge queue Mar 3, 2026
Merged via the queue into dev with commit f4000e3 Mar 3, 2026
5 checks passed
@saskiad saskiad deleted the feat-1701-nhp branch March 3, 2026 18:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add non-human-primate subject model

3 participants