Skip to content

ENH: Better validation of info and subject_info#12875

Merged
drammock merged 4 commits intomne-tools:mainfrom
larsoner:validate
Sep 26, 2024
Merged

ENH: Better validation of info and subject_info#12875
drammock merged 4 commits intomne-tools:mainfrom
larsoner:validate

Conversation

@larsoner
Copy link
Copy Markdown
Member

Turns out it wasn't too hard to generalize the nice validation set up originally by @mscheltienne using a ValidatedDict class. In principle yes this could be done with something like pydantic but this would require a separate new dependency (which is a high bar for us) so this PR just refactors and reuses the existing Info logic instead.

Closes #12874

Copy link
Copy Markdown
Member

@agramfort agramfort left a comment

Choose a reason for hiding this comment

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

nice !

@drammock drammock merged commit 5492174 into mne-tools:main Sep 26, 2024
@drammock drammock deleted the validate branch September 26, 2024 20:41
Copy link
Copy Markdown
Member

@sappelhoff sappelhoff left a comment

Choose a reason for hiding this comment

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

Great work! Thanks a lot!

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.

BUG: subject_info dict validation

4 participants