ahvn.adapter.base module¶
- ahvn.adapter.base.parse_ukf_include(include=None, exclude=None, virtual_fields=None)[源代码]¶
Parse include parameter for engine initialization.
- 参数:
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.
- 返回:
List of field names to include.
Boolean indicating if the included fields are sufficient to reconstruct a full BaseUKF object.
- 返回类型:
A tuple containing
- class ahvn.adapter.base.BaseUKFAdapter(name, include=None, exclude=None)[源代码]¶
基类:
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)[源代码]¶
Initialize the adapter with specified field inclusion.
- 参数:
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)[源代码]¶
Convert a BaseUKF object to a dictionary representation entity for backend.
- abstractmethod to_ukf_data(entity)[源代码]¶
Convert a backend entity representation to a dictionary suitable for BaseUKF initialization.