FilteredNodeView#

class FilteredNodeView(nodes, node_type)#

Bases: NodeView

Node view filtered by node type.

Parameters:
  • nodes (dict[Hashable, Node])

  • node_type (type[Node])

__init__(nodes, node_type)#

Create a filtered node view.

Parameters:
  • nodes (dict[Hashable, Node]) – Node mapping to filter.

  • node_type (type[Node]) – Concrete node class to include (e.g., Crossing).

Return type:

None

Methods

__init__(nodes, node_type)

Create a filtered node view.

arcs(node)

Return the arcs emanating from a node.

get(k[,d])

isdisjoint(other)

Return True if two sets have a null intersection.

items()

keys()

values()

arcs(node)#

Return the arcs emanating from a node.

Each arc is returned as a pair (adjacent_endpoint, endpoint).

Parameters:

node (Hashable) – Node identifier.

Returns:

list[tuple[Endpoint, Endpoint]] – List of arcs from the node.

Return type:

list[tuple[Endpoint, Endpoint]]

get(k[, d]) D[k] if k in D, else d.  d defaults to None.#
isdisjoint(other)#

Return True if two sets have a null intersection.

items() a set-like object providing a view on D's items#
keys() a set-like object providing a view on D's keys#
values() an object providing a view on D's values#