kappa_sdk.Plot#

class kappa_sdk.Plot(field_id, well_id, plot_id, plot_name, field_api, data_types_catalog, dto_converter)[source]#

Plot object.

Presents a KAPPA Automate Plot object.

Attributes

Plot.id

Gets the id of the Plot object.

Plot.name

Gets the name of the Plot object.

Methods

Plot.add_cross_plot_data(x_data, y_data[, ...])

Adds cross plot data to the visualization, enabling plotting of X versus Y data points with customizable display options and metadata.

Plot.add_embedded_data(data[, channel_name, ...])

Add data to the Plot object.

Plot.add_existing_data(data[, channel_name, ...])

Add data to the Plot object.

Plot.add_sub_plot(name[, square_log_cycles, ...])

Add a new subplot or pane to the Plot object

Plot.delete()

Delete the current plot

Plot.get_plot_dto()

Get the plot dto from Kappa Automate

Plot.rename(name)

Rename the Plot object.

Plot.update_plot()

Update the plot in Kappa Automate

Parameters:
  • field_id (str)

  • well_id (str)

  • plot_id (str)

  • plot_name (str)

  • field_api (FieldAPI)

  • data_types_catalog (FieldDataTypesCatalog)

  • dto_converter (PlotDtoConverter)

__init__(field_id, well_id, plot_id, plot_name, field_api, data_types_catalog, dto_converter)[source]#
Parameters:
  • field_id (str)

  • well_id (str)

  • plot_id (str)

  • plot_name (str)

  • field_api (FieldAPI)

  • data_types_catalog (FieldDataTypesCatalog)

  • dto_converter (PlotDtoConverter)

Return type:

None

rename(name)[source]#

Rename the Plot object.

Parameters:

name (str) – Name of the plot.

Return type:

None

add_existing_data(data, channel_name=None, pane_name=None, show_symbols=None, show_lines=True, is_y_log=False, hide_in_legend=False, is_raw=False)[source]#

Add data to the Plot object.

Parameters:
  • data (Data) – Data to plot.

  • channel_name (str | None) – Name of the data.

  • pane_name (str | None) – Name of the pane.

  • show_symbols (bool | None) – Show the point on the plot.

  • show_lines (bool) – Show the lines on the plot.

  • is_y_log (bool) – Show Y axis as log

  • use_elapsed – use elapsed times instead of datetime values

  • hide_in_legend (bool) – Whether this channel should be hidden or not on the legend

  • is_raw (bool) – Whether to display raw data, as opposed to preview (default: false)

Returns:

PlotChannel – A new Channel added to the Plot object

Return type:

PlotChannel

add_embedded_data(data, channel_name=None, pane_name=None, show_symbols=None, show_lines=True, data_type=None, is_by_step=False, x_measure=None, y_measure=None, is_y_log=False, first_x=None, use_elapsed=False, hide_in_legend=False)[source]#

Add data to the Plot object.

Parameters:
  • data (Vector | Tuple[List[float], List[float]]) – Data to plot.

  • channel_name (str | None) – Name of the data.

  • pane_name (str | None) – Name of the pane.

  • show_symbols (bool | None) – Show the point on the plot.

  • show_lines (bool) – Show the lines on the plot.

  • data_type (PlotDataTypesEnum | str | None) – Type of the data.

  • is_by_step (bool) – True if it is step data.

  • x_measure (MeasureEnum | None) – Unit of the x_axis of the Channel (only for scatter plot).

  • y_measure (MeasureEnum | None) – Unit of the y_axis of the Channel.

  • is_y_log (bool) – Show Y axis as log

  • first_x (datetime | None) – specify the first x of step data

  • use_elapsed (bool) – use elapsed times instead of datetime values

  • hide_in_legend (bool) – Whether this channel should be hidden or not on the legend

Returns:

PlotChannel – A new Channel added to the Plot object

Return type:

PlotChannel

add_cross_plot_data(x_data, y_data, channel_name=None, pane_name=None, show_symbols=None, show_lines=True, data_type=None, is_y_log=False, hide_in_legend=False)[source]#

Adds cross plot data to the visualization, enabling plotting of X versus Y data points with customizable display options and metadata. This function is used to define how data is represented in a cross plot channel and associated visualization components.

Parameters:
  • x_data (Data) – The dataset representing the X-axis values for the cross plot.

  • y_data (Data) – The dataset representing the Y-axis values for the cross plot.

  • channel_name (Optional[str], optional) – An optional name associated with the created plot channel. Defaults to None.

  • pane_name (Optional[str], optional) – An optional pane name where the cross plot is defined. Defaults to None.

  • show_symbols (Optional[bool], optional) – Indicates if symbols should be displayed on the plot. Defaults to None.

  • show_lines (bool, optional) – Determines whether lines should be displayed connecting the data points. Defaults to True.

  • data_type (Optional[Union[PlotDataTypesEnum, str]], optional) – Indicates the data type of the plot, allowing for specific type categorization. Defaults to None.

  • is_y_log (bool, optional) – Specifies whether the Y-axis of the plot should use a logarithmic scale. Defaults to False.

  • hide_in_legend (bool, optional) – Determines if the plot should be hidden from the legend in the visualization. Defaults to False.

Returns:

PlotChannel – The constructed and configured plot channel that represents the cross plot data and associated properties.

Return type:

PlotChannel

update_plot()[source]#

Update the plot in Kappa Automate

Return type:

None

get_plot_dto()[source]#

Get the plot dto from Kappa Automate

Returns:

PlotInstanceDto – The Plot instance dto from Kappa Automate

Return type:

PlotInstanceDto

delete()[source]#

Delete the current plot

Return type:

None

property id: str#

Gets the id of the Plot object.

property name: str#

Gets the name of the Plot object.

add_sub_plot(name, square_log_cycles=False, stacked_bars=False)[source]#

Add a new subplot or pane to the Plot object

Parameters:
  • name (str) – The name of the subplot

  • square_log_cycles (bool) – Whether or not to use squared logarithmic cycles

  • stacked_bars (bool) – Whether or not to use stacked bars

Return type:

None