Problem
dump_defaults() in osipy/cli/config.py returns hard-coded YAML template strings from the _DEFAULT_TEMPLATES dictionary (lines 398–532). These templates are manually maintained and have already drifted from the actual Pydantic config classes — for example, delay fitting options (fit_delay, delay_bounds) exist in the fitting API but are absent from the templates.
As we add more parameters across modalities, keeping hand-written templates in sync with the Pydantic models is unsustainable.
Proposal
Replace the hard-coded _DEFAULT_TEMPLATES strings with auto-generated YAML derived from the Pydantic model schemas. For example:
- Use
model_json_schema() or model_fields to iterate over each config class
- Emit field names, defaults, types, and descriptions as commented YAML
- Ensure the output stays human-readable (grouped by section, with comments from
Field(description=...))
This guarantees that every field defined in the Pydantic config classes automatically appears in the config dump, eliminating drift.
Affected code
osipy/cli/config.py — _DEFAULT_TEMPLATES dict and dump_defaults() function
- All Pydantic config classes:
DCEFittingConfig, DCEPipelineYAML, DSCPipelineYAML, ASLPipelineYAML, IVIMPipelineYAML, etc.
🤖 Generated with Claude Code
Problem
dump_defaults()inosipy/cli/config.pyreturns hard-coded YAML template strings from the_DEFAULT_TEMPLATESdictionary (lines 398–532). These templates are manually maintained and have already drifted from the actual Pydantic config classes — for example, delay fitting options (fit_delay,delay_bounds) exist in the fitting API but are absent from the templates.As we add more parameters across modalities, keeping hand-written templates in sync with the Pydantic models is unsustainable.
Proposal
Replace the hard-coded
_DEFAULT_TEMPLATESstrings with auto-generated YAML derived from the Pydantic model schemas. For example:model_json_schema()ormodel_fieldsto iterate over each config classField(description=...))This guarantees that every field defined in the Pydantic config classes automatically appears in the config dump, eliminating drift.
Affected code
osipy/cli/config.py—_DEFAULT_TEMPLATESdict anddump_defaults()functionDCEFittingConfig,DCEPipelineYAML,DSCPipelineYAML,ASLPipelineYAML,IVIMPipelineYAML, etc.🤖 Generated with Claude Code