instancelib.instances.combination module
- class instancelib.instances.combination.CombinationProvider(read_only, writeable, new_data, index_map)[source]
Bases:
InstanceProvider[IT,KT,DT,VT,RT],Generic[IT,KT,DT,VT,RT]- Parameters:
read_only (
Mapping[UUID,ROInstanceProvider[TypeVar(IT, bound= UpdateHookInstance[Any, Any, Any, Any]),TypeVar(KT),TypeVar(DT),TypeVar(VT),TypeVar(RT)]]) –writeable (
Mapping[UUID,InstanceProvider[TypeVar(IT, bound= UpdateHookInstance[Any, Any, Any, Any]),TypeVar(KT),TypeVar(DT),TypeVar(VT),TypeVar(RT)]]) –new_data (
Mapping[UUID,InstanceProvider[TypeVar(IT, bound= UpdateHookInstance[Any, Any, Any, Any]),TypeVar(KT),TypeVar(DT),TypeVar(VT),TypeVar(RT)]]) –index_map (
MutableMapping[TypeVar(KT),UUID]) –
-
combined:
Mapping[UUID,ROInstanceProvider[TypeVar(IT, bound= UpdateHookInstance[Any, Any, Any, Any]),TypeVar(KT),TypeVar(DT),TypeVar(VT),TypeVar(RT)]]
- create(*args, **kwargs)[source]
Create a new instance of type
InstanceType. The created instance is subsequently added to the provider.Note: The number of arguments and keyword arguments may differ in actual implementation, so there are no standard arguments.
- classmethod createprovider(read_only, writeable, new_data)[source]
- Parameters:
read_only (
Sequence[ROInstanceProvider[TypeVar(IT, bound= UpdateHookInstance[Any, Any, Any, Any]),TypeVar(KT),TypeVar(DT),TypeVar(VT),TypeVar(RT)]]) –writeable (
Sequence[InstanceProvider[TypeVar(IT, bound= UpdateHookInstance[Any, Any, Any, Any]),TypeVar(KT),TypeVar(DT),TypeVar(VT),TypeVar(RT)]]) –new_data (
InstanceProvider[TypeVar(IT, bound= UpdateHookInstance[Any, Any, Any, Any]),TypeVar(KT),TypeVar(DT),TypeVar(VT),TypeVar(RT)]) –
- Return type:
CombinationProvider[TypeVar(IT, bound= UpdateHookInstance[Any, Any, Any, Any]),TypeVar(KT),TypeVar(DT),TypeVar(VT),TypeVar(RT)]
-
index_map:
MutableMapping[TypeVar(KT),UUID]
- property key_list: Sequence[KT]
Return a list of all instance keys in this provider
- Returns:
A list of instance keys
- Return type:
List[KT]
-
new_data:
Mapping[UUID,InstanceProvider[TypeVar(IT, bound= UpdateHookInstance[Any, Any, Any, Any]),TypeVar(KT),TypeVar(DT),TypeVar(VT),TypeVar(RT)]]
-
read_only:
Mapping[UUID,ROInstanceProvider[TypeVar(IT, bound= UpdateHookInstance[Any, Any, Any, Any]),TypeVar(KT),TypeVar(DT),TypeVar(VT),TypeVar(RT)]]
- vector_chunker_selector(keys, batch_size=200)[source]
Iterate over all instances (with or without vectors) in belonging the identifier
Iterablein the keys parameter.- Parameters:
- Yields:
Sequence[Instance[KT, DT, VT, RT]]] – A sequence of instances with length batch_size. The last list may have a shorter length.
- Returns:
An iterator over sequences of key vector tuples
- Return type: