preprocess#
- classmethod MCADComponent.preprocess(data)#
Normalize and validate component configuration formats.
This validator handles backward compatibility by automatically converting legacy component configuration formats. It merges the legacy ‘assembly’ and ‘sub_components’ keys into separate ‘mcad_sub_components’ and ‘ecad_sub_components’ dictionaries based on the child component’s
component_typefield.- Parameters:
- data
dict Raw input data before model validation.
- data
- Returns:
dictNormalized data with separated and categorized component types.
Notes
This method ensures that old configuration files using the ‘assembly’ or ‘sub_components’ keys continue to work with the new component structure. Layout-specific fields are removed from MCAD components during normalization.