VertexPropertyContainer#

class VertexPropertyContainer(properties=None)[source]#

Bases: object

Container for managing custom vertex properties with automatic synchronization.

Parameters:
propertiesdict of str -> np.ndarray, optional

Dictionary mapping property names to vertex data arrays.

Attributes

VertexPropertyContainer.properties

List available vertex properties.

Methods

VertexPropertyContainer.copy()

Create a deep copy of the container.

VertexPropertyContainer.get_property(name[, ...])

Get property data by name.

VertexPropertyContainer.merge(containers)

Merge multiple property containers.

VertexPropertyContainer.remove_property(name)

VertexPropertyContainer.set_property(name, data)

Insert or replace a vertex property.

copy()[source]#

Create a deep copy of the container.

get_property(name, default=None)[source]#

Get property data by name.

classmethod merge(containers)[source]#

Merge multiple property containers.

Parameters:
containerslist of VertexPropertyContainer

Containers to merge

Returns:
VertexPropertyContainer

New container with merged properties

property properties#

List available vertex properties.

set_property(name, data)[source]#

Insert or replace a vertex property.

Parameters:
namestr

Property name.

datanp.ndarray

Array of per-vertex values.

Raises:
ValueError

If data length does not match the existing vertex count.