convert_config_versions#
- class ExperimentUpgrade_2_1_to_3_0(root: Path, app: QApplication)[source]#
Bases:
ExperimentConfigConverterHandles upgrade of a full experiment folder from 2.1 → 3.0.
- class ExperimentUpgrade_3_0_to_3_1(root: Path, app: QApplication)[source]#
Bases:
ExperimentConfigConverterHandles upgrade of a full experiment folder from 3.0 → 3.1.
For this step, the only changes are: - switch configs from .cfg → .yml - add clearmap_schema: 3 - bump clearmap_version to 3.1.0
- cfg_converter(from_v: str, to_v: str, config_type: str)[source]#
Register a file-level converter.
- Parameters:
from_v (str) – The version the converter expects as input.
to_v (str) – The version the converter produces as output.
config_type (str) – The canonical name of the config type (e.g. ‘sample’, ‘alignment’, ‘cell_map’, ‘machine’).
Examples
@register_file_converter('3.0', '3.1', 'sample') def convert_sample_3_0_to_3_1(cfg_path: Path) -> Path: ...
- convert(cfg_path, *, prev_v: str | Version = '2.1', new_v: str | Version = '3.0', backup: bool = False, overwrite: bool = False)[source]#
Convert a single config file between versions.
Detects type & scope via ALTERNATIVES_REG.
Chains multiple conversion steps if needed (2.1 → 3.0 → 3.1).
- convert_batch_3_0_to_3_1(v1_path, v2_path='', sample_config=None)#
- convert_cell_map_3_0_to_3_1(v1_path, v2_path='', sample_config=None)#
- convert_colocalization_3_0_to_3_1(v1_path, v2_path='', sample_config=None)#
- convert_group_analysis_3_0_to_3_1(v1_path, v2_path='', sample_config=None)#
- convert_machine_3_0_to_3_1(v1_path, v2_path='', sample_config=None)#
- convert_registration_3_0_to_3_1(v1_path, v2_path='', sample_config=None)#
- convert_sample_3_0_to_3_1(v1_path, v2_path='', sample_config=None)#
- convert_stitching_3_0_to_3_1(v1_path, v2_path='', sample_config=None)#
- convert_tract_map_3_0_to_3_1(v1_path, v2_path='', sample_config=None)#
- convert_vasculature_3_0_to_3_1(v1_path, v2_path='', sample_config=None)#
- convert_versions(previous_version: str, new_version: str, *, exp_dir: str | Path = '', create_app: bool = True)[source]#
- detect_config_type(cfg_path: Path) tuple[str, str][source]#
Return (canonical_name, scope) where scope is ‘experiment’ or ‘global’.
- get_conversion_steps(previous_version: Version, new_version: Version) list[tuple[Version, Version]][source]#
Return a list of (from_v, to_v) steps to go from previous_version to new_version.
Uses SUPPORTED_VERSIONS ordering; only upgrades are supported.
- make_generic_3_0_to_3_1_converter(config_type: str, migration_func: Callable[[dict, dict, dict], None] | None = None)[source]#
Factory for trivial 3.0 → 3.1 converters, for both experiment and global configs.
Uses ALTERNATIVES_REG to decide whether to register as experiment or global.
Calls migration_func if provided
Writes to .yml (if no explicit v2_path is given).
- migrate_vasculature_performance_v3_0_to_v3_1(old_cfg: dict, merged: dict, default_cfg: dict, sample_config: dict) None[source]#
- migrate_vasculature_postprocessing_v3_0_to_v3_1(old_cfg: dict, merged: dict, default_cfg: dict, sample_cfg: dict | None = None) None[source]#
Rename vessel_type_postprocessing thresholds from voxels to µm, and fix the arteries_min_radius misnomer.
Conversion: old_vox × mean(spacing). spacing is read from sample config if available, otherwise falls back to a documented default with a warning.