RecursiveDictionaryOfEntityHandles#

class ansys.bdm.api.recursive_dictionary.RecursiveDictionaryOfEntityHandles#

Bases: dict[str, EntityHandle | RecursiveDictionaryOfEntityHandles]

A recursive dictionary structure for storing entity handles in a nested hierarchy that maps a filesystem-like directory structure.

Overview#

__get_pydantic_core_schema__

Generate Pydantic core schema to be able to serialize/deserialize this structure with Pydantic.

Import detail#

from ansys.bdm.api.recursive_dictionary import RecursiveDictionaryOfEntityHandles

Method detail#

classmethod RecursiveDictionaryOfEntityHandles.__get_pydantic_core_schema__(source_type: Any, handler: pydantic.GetCoreSchemaHandler) → pydantic_core.CoreSchema#

Generate Pydantic core schema to be able to serialize/deserialize this structure with Pydantic.

We cannot use a simple: > return core_schema.no_info_after_validator_function(cls, handler(dict)) because it would not instantiate the nested EntityHandles, leaving them as plain dictionaries.