Skip to content

graph

EdgeEquidistantDivider

Add points and values by uniformly dividing edges.

Attributes:

Name Type Description
edges_length ndarray[K]

Length of edges.

edge_length_max float

Maximal edge length.

edge_length_max = None instance-attribute

edges_length = None instance-attribute

__init__()

apply(values, edges)

Parameters:

Name Type Description Default
values ndarray[N, M] or [N]

Input array(s) to interpolate.

required
edges ndarray[K, 2]

Connected pairs of nodes.

required

Returns:

Type Description
ndarray

np.ndarray: Input array with interpolated values.

EdgeSubdivInterpolator

edge_divider = EdgeEquidistantDivider() instance-attribute

__init__()

apply_to_graph(graph, edge_length_max, node_attr='scalars')

Subdivides edges in a graph whose lengths are greater than a specified maximum length.

Parameters:

Name Type Description Default
graph Graph

Dgm graph object.

required
edge_length_max float

The maximum length allowed for graph edges.

required
node_attr str

Graph node attribute that will be also interpolated. Defaults to "scalars".

'scalars'

Returns:

Type Description
ndarray

ndarray[N, 3]: Array containing the node coordinates.

ndarray

ndarray[N, ]: Array containing the node attribute (scalars).

get_edge_divider()

interpolate(nodes_coords, nodes_scalars, edges, edges_length, edge_length_max)

Introduce new points and scalar value using edge subdivition.

Parameters:

Name Type Description Default
nodes_coords ndarray[N, 3]

Coords of the points.

required
nodes_scalars ndarray[N] or [N, M]

Scalar or multiple scalars.

required
edges ndarray[K, 2]

Connections.

required
edges_length ndarray[K]

Edges length.

required
edge_length_max float

Max allowed edge length.

required

Returns:

Name Type Description
tuple tuple[ndarray, ndarray]

Coords and scalars of old and new points.

set_edge_divider(divider)

EdgeUniformDivider

Add points and values by uniformly dividing edges.

Attributes:

Name Type Description
num_div int

Number of divition per edges

num_div = num_div instance-attribute

__init__(num_div)

apply(values, edges)

Parameters:

Name Type Description Default
values ndarray[N, M] or [N]

Input array(s) to interpolate.

required
edges ndarray[K, 2]

Connected pairs of nodes.

required

Returns:

Type Description
ndarray

np.ndarray: Input array with interpolated values.