Class MessageMeta#

Inheritance Relationships#

Derived Type#

Class Documentation#

class MessageMeta#

Container for class holding a data table, in practice a cudf DataFrame, with the ability to return both Python and C++ representations of the table.

Subclassed by morpheus::SlicedMessageMeta

Public Functions

virtual TensorIndex count() const#

Get the row count of the underlying DataFrame.

Returns:

TensorIndex

virtual TableInfo get_info() const#

Get the info object.

Returns:

TableInfo

virtual TableInfo get_info(const std::string &col_name) const#

Get the info object for a specific column.

Parameters:

col_name – The name of the column to slice

Returns:

TableInfo The table info containing only the column specified

virtual TableInfo get_info(
const std::vector<std::string> &column_names
) const#

Get the info object for a specific set of columns.

Parameters:

column_names – The names of the columns to slice

Returns:

TableInfo The table info containing only the columns specified, in the order specified

virtual void set_data(
const std::string &col_name,
TensorObject tensor
)#

Set the data for a single column from a TensorObject.

Parameters:
  • col_name – The name of the column to set

  • tensor – The tensor to set the column to

virtual void set_data(
const std::vector<std::string> &column_names,
const std::vector<TensorObject> &tensors
)#

Set the data for multiple columns from a vector of TensorObjects.

Parameters:
  • column_names – The names of the columns to set

  • tensors – The tensors to set the columns to

virtual MutableTableInfo get_mutable_info() const#

TODO(Documentation)

std::vector<std::string> get_column_names() const#
bool has_sliceable_index() const#

Returns true if the underlying DataFrame’s index is unique and monotonic. Sliceable indices have better performance since a range of rows can be specified by a start and stop index instead of requiring boolean masks.

Returns:

bool

virtual std::optional<std::string> ensure_sliceable_index()#

Replaces the index in the underlying dataframe if the existing one is not unique and monotonic. The old index will be preserved in a column named _index_{old_index.name}. If has_sliceable_index() == true, this is a no-op.

Returns:

std::string The name of the column with the old index or nullopt if no changes were made.

virtual std::shared_ptr<MessageMeta> copy_ranges(
const std::vector<RangeType> &ranges
) const#

Creates a deep copy of DataFrame with the specified ranges.

Parameters:

ranges – the tensor index ranges to copy

Returns:

std::shared_ptr<MessageMeta> the deep copy of the specified ranges

virtual std::shared_ptr<MessageMeta> get_slice(
TensorIndex start,
TensorIndex stop
) const#

Get a slice of the underlying DataFrame by creating a deep copy.

Parameters:
  • start – the tensor index of the start of the copy

  • stop – the tensor index of the end of the copy

Returns:

std::shared_ptr<MessageMeta> the deep copy of the speicifed slice

Public Static Functions

static std::shared_ptr<MessageMeta> create_from_python(
pybind11::object &&data_table
)#

Create MessageMeta cpp object from a python object.

Parameters:

data_table

Returns:

std::shared_ptr<MessageMeta>

static std::shared_ptr<MessageMeta> create_from_cpp(
cudf::io::table_with_metadata &&data_table,
int index_col_count = 0
)#

Create MessageMeta cpp object from a cpp object, used internally by create_from_cpp

Parameters:
  • data_table

  • index_col_count

Returns:

std::shared_ptr<MessageMeta>

Protected Functions

MessageMeta(std::shared_ptr<IDataTable> data)#

Protected Attributes

std::shared_ptr<IDataTable> m_data#

Protected Static Functions

static pybind11::object cpp_to_py(
cudf::io::table_with_metadata &&table,
int index_col_count = 0
)#

Create MessageMeta python object from a cpp object.

Parameters:
  • table

  • index_col_count

Returns:

pybind11::object