kappa_sdk.DataEnumerator#
- class kappa_sdk.DataEnumerator(settings, rest_api=None)[source]#
Python wrapper for a Dataset Enumerator.
Note
Should not be instantiated directly.
Methods
DataEnumerator.extrapolation(ref_vect_x, ...)DataEnumerator.get_outputs_values(x_inputs, ...)Get the values after interpolation :param x_inputs: list of the input times :param y_inputs: list of the input values :param x_outputs: list of the output times that will be use for the interpolation and extrapolation :param vector_metadata: List with the info about the vectors
DataEnumerator.get_time_range(x_inputs, ...)Calculate the time_range of the interpolation :param x_inputs: list of the input times :param vector_metadata: metadata of the inputs
DataEnumerator.interpolation(next_index, ...)DataEnumerator.to_enumerable(params[, settings])Gets a data enumerator for multiple datasets.
Gets a data enumerator for multiple datasets from class:Vector.
- Parameters:
settings (DataEnumeratorSettings)
rest_api (RestAPI | None)
- __init__(settings, rest_api=None)[source]#
- Parameters:
settings (DataEnumeratorSettings)
rest_api (RestAPI | None)
- to_enumerable_from_vectors(params, settings=None, metadata_params=None)[source]#
Gets a data enumerator for multiple datasets from class:Vector.
Generates an enumerator that allows to iterate through the list of points of given KAPPA Automate datasets using a common time index.
- Parameters:
params (List[Vector]) – The list of class:Vector.
settings (DataEnumeratorSettings | None) – The data enumeration service.
metadata_params (List[Metadata] | None) – List of metadata for each class:Vector
- Return type:
- to_enumerable(params, settings=None)[source]#
Gets a data enumerator for multiple datasets.
Generates an enumerator that allows to iterate through the list of points of given KAPPA Automate datasets using a common time index.
- Parameters:
params (List[UUID]) – The list of KAPPA Automate vector identifiers.
settings (DataEnumeratorSettings | None) – The data enumeration service.
- Return type:
- get_time_range(x_inputs, vector_metadata)[source]#
Calculate the time_range of the interpolation :param x_inputs: list of the input times :param vector_metadata: metadata of the inputs
- Returns:
listofthe output times with in the specified time range- Parameters:
x_inputs (Dict[str, List[datetime]])
vector_metadata (Dict[str, Metadata])
- Return type:
List[datetime]
- get_outputs_values(x_inputs, y_inputs, x_outputs, vector_metadata)[source]#
Get the values after interpolation :param x_inputs: list of the input times :param y_inputs: list of the input values :param x_outputs: list of the output times that will be use for the interpolation and extrapolation :param vector_metadata: List with the info about the vectors
- Returns:
Listsofthe interpolated values- Parameters:
x_inputs (Dict[str, List[datetime]])
y_inputs (Dict[str, List[float]])
x_outputs (List[datetime])
vector_metadata (Dict[str, Metadata])
- Return type:
List[List[float]]
- interpolation(next_index, by_step, step_at_start, ref_vect_x, ref_vect_y, ref_date)[source]#
- Parameters:
next_index (int)
by_step (bool)
step_at_start (bool)
ref_vect_x (List[datetime])
ref_vect_y (List[float])
ref_date (datetime)
- Return type:
float
- static extrapolation(ref_vect_x, ref_vect_y, first_x, ref_date, extrapolation_method)[source]#
- Parameters:
ref_vect_x (List[datetime])
ref_vect_y (List[float])
first_x (datetime)
ref_date (datetime)
extrapolation_method (ExtrapolationMethodEnum)
- Return type:
float