ConfigParser (config_parser.py) reads JSON and YAML configs. Inside a
config:
@namereferences another config item (nested keys are joined with::, as in@preprocessing::transforms::keys).$...is a Python expression, evaluated when the config is parsed.- A dict with
_target_is instantiated as that class or function._disabled_skips instantiation,_requires_lists references that must be resolved first,_mode_changes how the callable is invoked. These keys are defined inconfig_item.py; do not add new underscore keys without updatingConfigComponentanddocs/source/config_syntax.md.
- Reference resolution order matters.
ReferenceResolverresolves items on demand and caches them; changing resolution code can quietly alter every bundle in the model zoo, so run the bundle tests even for small changes. - Configs are user-facing files, often edited by hand. Error messages should
name the config ID that failed; a bare
KeyErrorfrom deep in the parser is a bug report waiting to happen. - Command line entry points live in
scripts.pyand run throughpython -m monai.bundle(run,download,ckpt_export, and others). Their arguments map onto config overrides; keep the CLI and the config syntax in sync. - Bundle metadata follows the specification in
docs/source/mb_specification.rstandmb_properties.rst;properties.pyholds the key definitions.