topo_metrics.rings#
Classes#
Functions#
|
Sorts a cyclic list of nodes and images, placing the central_node_id first |
|
Convert a list of node IDs and image shifts to a Ring object. |
Module Contents#
- class topo_metrics.rings.Ring[source]#
Bases:
NamedTuple- nodes: list[topo_metrics.topology.Node][source]#
The node IDs that form the ring. Neighbouring nodes are connected by an edge, and the last node is connected to the first node.
- angle: tuple[tuple[int, tuple[int]]][source]#
Neighbouring nodes about the central node, listed with node ID and image.
- geometry() topo_metrics.ring_geometry.RingGeometry[source]#
Get the ring geometry object.
- topo_metrics.rings.get_ordered_node_list(nodes_and_images: list[tuple[int, numpy.typing.NDArray[numpy.int_]]], central_node_id: int) list[tuple[int, numpy.typing.NDArray[numpy.int_]]][source]#
Sorts a cyclic list of nodes and images, placing the central_node_id first and preserving cyclic order while ensuring a deterministic ordering.
- Parameters:
nodes_and_images – A list of node IDs and image shifts.
central_node_id – The node ID of the central node.
- Return type:
A sorted list of node IDs and image shifts.
- topo_metrics.rings.node_list_to_ring(topology: topo_metrics.topology.Topology, node_list: list[tuple[int, numpy.typing.NDArray[numpy.int_]]], central_node_id: int) Ring[source]#
Convert a list of node IDs and image shifts to a Ring object.
- Parameters:
topology – The topology object containing the nodes.
node_list – A list of node IDs and image shifts.
central_node_id – The node ID of the central node.
- Return type:
A Ring object with the nodes in the correct positions.