preprocess#

classmethod MCADAssembly.preprocess(data)#

Normalize and validate component configuration formats.

This validator handles backward compatibility by automatically converting legacy assembly configuration formats. It merges the legacy ‘assembly’ and ‘sub_components’ keys into separate ‘mcad_sub_components’ and ‘ecad_sub_components’ dictionaries based on the component’s component_type field.

Parameters:
datadict

Raw input data before model validation.

Returns:
dict

Normalized 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.