kappa_sdk.user_tasks.DataCommandService#

class kappa_sdk.user_tasks.DataCommandService(data_api, data_dto_converter)[source]#

Python wrapper for a Data Command Service.

Note

Should not be instantiated directly.

Methods

DataCommandService.add_values(vector_id, ...)

Populates the specified dataset.

DataCommandService.convert_nan(values)

DataCommandService.remove_range(vector_id)

Clears the specified dataset.

DataCommandService.replace_data(vector_id, ...)

Replaces the content of the specified dataset.

DataCommandService.set_first_x(vector_id, ...)

Updates the reference date for the specified dataset.

Parameters:
  • data_api (DataAPI)

  • data_dto_converter (DataDtoConverter)

__init__(data_api, data_dto_converter)[source]#
Parameters:
  • data_api (DataAPI)

  • data_dto_converter (DataDtoConverter)

remove_range(vector_id)[source]#

Clears the specified dataset.

Clears the KAPPA Automate data specified by the vector id.

Parameters:

vector_id (str) – The id of the KAPPA Automate vector to clear.

Return type:

None

add_values(vector_id, x_vector, y_vector, unit=None)[source]#

Populates the specified dataset.

Populates the KAPPA Automate data specified by the vector id with values of x-vector and y-vector.

Parameters:
  • vector_id (str) – The id of the KAPPA Automate vector.

  • x_vector (List[datetime]) – The list of datetime values for the x-axis.

  • y_vector (List[int] | List[float] | List[float | None]) – The list of float values for the y-axis.

  • unit (UnitEnum | None) – Convert values to internal units from a specific unit.

  • note: (..) – If the Kappa Automate vector is point data then None values will be automatically removed.:

Return type:

None

set_first_x(vector_id, reference_date)[source]#

Updates the reference date for the specified dataset.

Updates the reference date value for KAPPA Automate data specified by the vector id.

Parameters:
  • vector_id (str) – The id of the KAPPA Automate vector.

  • reference_date (datetime | None) – The new reference date.

Return type:

None

replace_data(vector_id, x_vector, y_vector, first_x=None, unit=None)[source]#

Replaces the content of the specified dataset.

Replaces the content of KAPPA Automate data specified by the vector id with values of x-vector and y-vector.

Parameters:
  • vector_id (str) – The id of the KAPPA Automate vector.

  • x_vector (List[datetime]) – The list of datetime values for the x-axis.

  • y_vector (List[int] | List[float] | List[float | None]) – The list of float values for the y-axis.

  • first_x (datetime | None) – The first_x of the data if is_by_step

  • unit (UnitEnum | None) – Convert values to internal units from a specific unit.

  • note: (..) – If the Kappa Automate vector is point data then None values will be automatically removed.:

Return type:

None

convert_nan(values)[source]#
Parameters:

values (List[float | None] | List[float])

Return type:

List[float | None]