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_default_settings()

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.linear_interpolation(...)

DataEnumerator.to_enumerable(params[, settings])

Gets a data enumerator for multiple datasets.

DataEnumerator.to_enumerable_from_vectors(params)

Gets a data enumerator for multiple datasets from class:Vector.

Parameters:
__init__(settings, rest_api=None)[source]#
Parameters:
get_default_settings()[source]#
Return type:

DataEnumeratorSettings

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:

DataEnumeration

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:

DataEnumeration

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:

list of the 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:

Lists of the 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

static linear_interpolation(reference_x, previous_x, next_x, previous_y, next_y)[source]#
Parameters:
  • reference_x (datetime)

  • previous_x (datetime)

  • next_x (datetime)

  • previous_y (float)

  • next_y (float)

Return type:

float