ahvn.adapter.base module¶
- ahvn.adapter.base.parse_ukf_include(include=None, exclude=None, virtual_fields=None)[source]¶
Parse include parameter for engine initialization.
- Parameters:
include (
Optional[List[str]]) – List of BaseUKF field names to include. If None, includes all fields.exclude (
Optional[List[str]]) – List of BaseUKF field names to exclude. If None, excludes no fields. Notice that exclude is applied after include, so if a field is in both include and exclude, it will be excluded. It is recommended to use only one of include or exclude.virtual_fields (
Optional[Iterable[str]]) – Additional virtual fields to include.
- Returns:
List of field names to include.
Boolean indicating if the included fields are sufficient to reconstruct a full BaseUKF object.
- Return type:
A tuple containing
- class ahvn.adapter.base.BaseUKFAdapter(name, include=None, exclude=None)[source]¶
Bases:
ABCBase adapter class for converting between UKF objects and backend representations.
This class should be extended to implement specific adapters for different backends.
- virtual_fields = None¶
- __init__(name, include=None, exclude=None)[source]¶
Initialize the adapter with specified field inclusion.
- Parameters:
name – Name of the adapter instance.
include (
Optional[List[str]]) – List of BaseUKF field names to include. If None, includes all fields. Default is None.exclude (
Optional[List[str]]) – List of BaseUKF field names to exclude. If None, excludes no fields. Default is None. Notice that exclude is applied after include, so if a field is in both include and exclude, it will be excluded. It is recommended to use only one of include or exclude.
- abstractmethod from_ukf(ukf)[source]¶
Convert a BaseUKF object to a dictionary representation entity for backend.
- abstractmethod to_ukf_data(entity)[source]¶
Convert a backend entity representation to a dictionary suitable for BaseUKF initialization.