Skip to content

Comments

nhp subject#1738

Open
saskiad wants to merge 4 commits intodevfrom
feat-1701-nhp
Open

nhp subject#1738
saskiad wants to merge 4 commits intodevfrom
feat-1701-nhp

Conversation

@saskiad
Copy link
Collaborator

@saskiad saskiad commented Feb 18, 2026

closes #1701

@saskiad
Copy link
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
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.

sex: Sex = Field(..., title="Sex")
date_of_birth: Optional[Annotated[date_type, TimeValidation.BEFORE]] = Field(default=None, title="Date of birth")
year_of_birth: int = Field(..., title="Year of birth")
mating_status: MatingStatus = Field(..., title="Mating status")
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm not sure, but maybe mating status should also be optional for NHP subject?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

we do have an "unknown" option, which I think is a bit better than having it optional because then people are explicit about not knowing vs having to guess did they just not bother to provide it or is it unknown?
But we can make it optional too...

Copy link
Collaborator

Choose a reason for hiding this comment

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

Got it - having "unknown" works for me, then

Copy link
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
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
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.

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