CDataStringIO

String specialization of C++ template class CNumericIO.

class ikomia.dataprocess.pydataprocess.CDataStringIO

Define input or output for a task consuming or producing data as numeric values. C++ implementation uses template to handle various data types. In Python, Ikomia API exposes only the double precision (float) and string specializations. The class is designed to handle row/column data structure, it consists on a list of values, a list of associated labels and a display type (see NumericOutputType). For the specific case of plot display, a plot type property is available (see PlotType). Derived from CWorkflowTaskIO

Import

from ikomia.dataprocess import CDataStringIO

Methods

__init__(arg1)

__init__( (object)self) -> None :

add_value_list(self, values)

Append a new value list.

get_all_header_labels(self)

Get all header labels (column labels).

get_all_label_list(self)

Get all label lists associated with value lists.

get_all_value_list(self)

Get all value lists.

get_output_type(self)

Get output display type.

get_plot_type(self)

Get plot type.

get_value_list(self, index)

Get value list at position index.

set_output_type(self, type)

Set output display type.

set_plot_type(self, type)

Set plot type.

Overridden methods

clear_data(self)

See clear_data().

from_json(self, jsonStr)

Set input/output data from JSON formatted string.

is_data_available(self)

See is_data_available().

load(self, path)

Load data values (double or string) from previsouly exported file.

save(self, path)

Save data values (double or string) to file.

to_json(self)

Return input/output data in JSON formatted string (compact mode).

Inherited methods

copy_static_data(self, io)

See copy_static_data().

get_unit_element_count(self)

See get_unit_elementCount().

Attributes

auto_save

Auto-save status

data_type

I/O data type

dim_count

Number of dimensions

description

Custom description to explain input/output type and use

displayable

Displayable status (Ikomia Studio)

name

I/O name

source_file_path

Path to the source file used as workflow input (if any)

Details

__init__((object)arg1) None
__init__( (object)self) -> None :

Default constructor

__init__( (object)self, (str)name) -> None :

Construct a CNumericIO instance with the given name.

Args:

name (str): input or output custom name (to give insights to end user)

__init__( (object)arg1, (CDataStringIO)arg2) -> None :

Copy constructor

add_value_list((CDataStringIO)self, (object)values) None :

Append a new value list.

Args:

values (list): list of values (float or string)

add_value_list( (CDataStringIO)self, (object)values, (str)header_label) -> None :

Append a new value list with the corresponding header label. A header label can be seen as a column name in a table representation.

Args:

values (list): list of values (float or string)

header_label (str): header label

add_value_list( (CDataStringIO)self, (object)values, (object)labels) -> None :

Append a new value list with a label for each value.

Args:

values (list): list of values (float or string)

labels (list of str): store label for each numeric value

add_value_list( (CDataStringIO)self, (object)values, (str)header_label, (object)labels) -> None :

Append a new value list with the corresponding header label and a label for each value.

Args:

values (list): list of values (float or string)

header_label (str): header label

labels (list of str): store label for each numeric value

clear_data((CDataStringIO)self) None :

See clear_data().

clear_data( (CDataStringIO)self) -> None

copy_static_data((CDataStringIO)self, (CWorkflowTaskIO)io) None :

See copy_static_data().

copy_static_data( (CDataStringIO)self, (CWorkflowTaskIO)io) -> None

from_json((CDataStringIO)self, (str)jsonStr) None :

Set input/output data from JSON formatted string.

Args:

str: data as JSON formatted string

from_json( (CDataStringIO)self, (str)jsonStr) -> None

get_all_header_labels((CDataStringIO)self) object :

Get all header labels (column labels).

Returns:

list of str

get_all_label_list((CDataStringIO)self) object :

Get all label lists associated with value lists.

Returns:

all labels

Return type:

list of list of str

get_all_value_list((CDataStringIO)self) object :

Get all value lists.

Returns:

all values

Return type:

list of list (float or string)

get_output_type((CDataStringIO)self) NumericOutputType :

Get output display type. Can be one of the values defined in NumericOutputType.

Returns:

display type

Return type:

int

get_plot_type((CDataStringIO)self) PlotType :

Get plot type. Can be one of the values defined in PlotType. Meaningful only if output display type is set to PLOT.

Returns:

plot type

Return type:

PlotType

get_unit_element_count((CDataStringIO)self) int :

See get_unit_elementCount().

get_unit_element_count( (CDataStringIO)self) -> int

get_value_list((CDataStringIO)self, (int)index) object :

Get value list at position index.

Parameters:

index (int) – index of value list

Returns:

values

Return type:

list (float or string)

is_data_available((CDataStringIO)self) bool :

See is_data_available().

is_data_available( (CDataStringIO)self) -> bool

load((CDataStringIO)self, (str)path) None :

Load data values (double or string) from previsouly exported file. At this time, file must be in CSV format.

Args:

path (str)

load( (CDataStringIO)self, (str)path) -> None

save((CDataStringIO)self, (str)path) None :

Save data values (double or string) to file. At this time, file must be in CSV format.

Args:

path (str)

save( (CDataStringIO)self, (str)path) -> None

set_output_type((CDataStringIO)self, (NumericOutputType)type) None :

Set output display type. See NumericOutputType for possible values.

Parameters:

type (int) – display type

set_plot_type((CDataStringIO)self, (PlotType)type) None :

Set plot type. See PlotType for possible values. Only used if output display type is set to PLOT (see set_output_type()).

Parameters:

type (PlotType) – plot type

to_json((CDataStringIO)self) str :

Return input/output data in JSON formatted string (compact mode).

Returns:

string: JSON formatted string

to_json( (CDataStringIO)self) -> str

to_json( (CDataStringIO)self, (object)options) -> str :

Return input/output data in JSON formatted string. JSON format option can be set, possible values are:

  • [‘json_format’, ‘compact’] (default)

  • [‘json_format’, ‘indented’]

Args:

list of str: format-specific options encoded as pairs [option_name, option_value]

Returns:

string: JSON formatted string

to_json( (CDataStringIO)self, (object)options) -> str