Repository navigation
Modality: add MRS, iEEG, CT and physiological, with is_a parents - #61
Merged
Merged
Conversation
Modality gains the four values ns-pond's acquisition_modality vocabulary uses beyond the schema's: MRS (instantiates MRI), and iEEG, CT and physiological (instantiate OtherModality). Each refining value names the coarser one with `is_a`: fMRI, sMRI, dMRI and MRS refine MRI, and iEEG, CT and physiological refine other. The generator writes those parents onto the enum's JSON Schema definition as `x-parents`, and `study_schema.jsonschema.value_parents` / `value_children` read them, so neurostore and ns-pond can take the vocabulary and its hierarchy from here instead of copying them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ity values `pondie.schema.generate` (pondie main) projects the storage Modality, with its `is_a` parents, into neuroimaging-study-extraction/acquisition.yaml; the extraction models and JSON Schema are regenerated from it. The tutorial's modality table lists the new values and their parents. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Makes study_schema's
Modalitythe single source of the modality vocabulary that ns-pond normalizes to and neurostore filters base studies on (neurostuff/neurostore#1962). Both repos currently hold their own 14-value copy.Changes
Four new values in the storage
Modality. The extraction projection is regenerated throughpondie.schema.generate.instantiatesis_aMRSMRI(MR scanner parameters apply)MRIiEEG(ECoG, sEEG, depth electrodes, LFP, units)OtherModalityotherCTOtherModalityotherphysiological(EMG, ECG, EDA, eye tracking and pupil, pulse, respiration, movement)OtherModalityotheriEEGinstantiatesOtherModalityrather thanEEG, because theEEGclass is scalp EEG (10-20 placement).Parents as
is_aon permissible values:fMRI,sMRI,dMRIandMRSrefineMRI;iEEG,CTandphysiologicalrefineother.Generator.
tools/generate_models.pywrites each enum's value parents onto its JSON Schema definition asx-parents, alongsidex-referenceandx-unique-keys.Python API.
study_schema.jsonschema.value_parents(name, enum)andvalue_children(name, enum)readx-parentsback in declared order. For example,value_children("storage-study", "Modality")is{"MRI": ("fMRI", "sMRI", "dMRI", "MRS"), "other": ("iEEG", "CT", "physiological")}. The package still depends only on pydantic.The
Modality,MRIandOtherModalitydescriptions, and the tutorial's modality table, list the new values.Values are spelled the way
Modalityalready spells them, so consumers store them as-is:MRS,iEEG,CT,physiological.Checks
tools/generate_models.py --checkis clean. The tests pass with linkml 1.12.1: 265 passed, 17 skipped (pyarrow, pyarty and setuptools were not installed locally).tests/test_annotate_value_parents.py, the generator annotation;tests/test_value_parents.py: the API on both contracts, parents and children being values of the enum, the extraction and storage vocabularies being identical, and an enum without parents.pondie.schema.generate --check,checks.field_provenance,checks.linkml,checks.extraction_to_storage_mapandchecks.storage_parameter_priorities.Downstream
Modalitygains four values, so the extraction models may need retraining before they emit them. Nothing has been retrained; that needs James's go-ahead and a budget.modalitydatabase enum and parent mapping fromModalityandvalue_children;normalization/modality.pythen reads its values and parents from here, in a follow-up PR.🤖 Generated with Claude Code