profiles.base.profile_from_dict#

profiles.base.profile_from_dict(data: dict[str, Any], registry: dict[str, type[BaseProfile]] | None = None) BaseProfile[source]#

Reconstruct a profile instance from a dictionary with optional registry support.

Parameters:
  • data (dict) – Dictionary with class and parameters fields, as produced by to_dict().

  • registry (dict, optional) – Mapping of class names to profile classes. Defaults to the global __default_profile_registry__.

Returns:

The reconstructed profile instance.

Return type:

BaseProfile

Raises:

ValueError – If the class name is missing or the class cannot be resolved.