autoemx.utils.legacy.legacy_standards module
Legacy compatibility helpers for standards-library JSON payloads.
- autoemx.utils.legacy.legacy_standards.is_legacy_standards_payload(payload: Any) bool[source]
Return True when payload matches the legacy top-level format.
Legacy standards files store measurement modes directly at the root, e.g.
{"point": {...}, "map": {...}}.
- autoemx.utils.legacy.legacy_standards.migrate_legacy_standards_payload(payload: Dict[str, Any], measurement_type: str, beam_energy_keV: int) Dict[str, Any][source]
Wrap legacy payload in the schema-based top-level envelope.
- autoemx.utils.legacy.legacy_standards.normalize_standards_file_payload(payload: Any, measurement_type: str, beam_energy_keV: int) Dict[str, Any][source]
Normalize both legacy and schema-based standards payloads.
Returns a schema-based payload that can be validated by the Pydantic models.
- autoemx.utils.legacy.legacy_standards.load_legacy_standards_dict_as_model(standards_dict: Dict[str, Any], measurement_type: str, beam_energy_keV: int) EDSStandardsFile[source]
Convert an old standards dictionary into the schema-based Pydantic model.
- autoemx.utils.legacy.legacy_standards.standards_payload_to_model(payload: Any, measurement_type: str, beam_energy_keV: int) EDSStandardsFile[source]
Convert standards payloads (legacy or schema-envelope) into the schema model.