Cage Vertices

class AngledVertex(id, position, use_neighbor_placement=True, aligner_edge=0)[source]

Bases: stk.molecular.topology_graphs.cage.vertices._CageVertex

Methods

clone()

Return a clone.

get_aligner_edge()

Return the aligner edge of the vertex.

get_cell()

Get the cell of the lattice in which the vertex is found.

get_id()

Get the id.

get_position()

Get the position.

init_at_center(id, vertices)

Initialize a _CageVertex in the middle of vertices.

map_functional_groups_to_edges(...)

Map functional groups to edges.

place_building_block(building_block, edges)

Place building_block on the Vertex.

use_neighbor_placement()

True if the position should be updated based on neighbors.

with_aligner_edge(aligner_edge)

Return a clone with a different aligner_edge.

with_position(position)

Get a clone at a certain position.

with_scale(scale)

Get a clone with a scaled position.

__init__(id, position, use_neighbor_placement=True, aligner_edge=0)

Initialize a _CageVertex.

Parameters
  • id (int) – The id of the vertex.

  • position (tuple of float) – The position of the vertex.

  • use_neighbor_placement (bool, optional) – If True, the position of the vertex will be updated based on the neighboring functional groups.

  • aligner_edge (int, optional) – The edge which is used to align the BuildingBlock placed on the vertex. The first FunctionalGroup is rotated such that it lies exactly on this Edge. Must be between 0 and the number of edges the vertex is connected to.

clone()

Return a clone.

Returns

The clone.

get_aligner_edge()

Return the aligner edge of the vertex.

Returns

The aligner edge.

Return type

int

get_cell()

Get the cell of the lattice in which the vertex is found.

Return type

ndarray

Returns

The cell of the lattice in which the vertex is found.

get_id()

Get the id.

Return type

int

Returns

The id.

get_position()

Get the position.

Return type

ndarray

Returns

The position of the Vertex.

classmethod init_at_center(id, vertices)

Initialize a _CageVertex in the middle of vertices.

Parameters
  • id (int) – The id of the initialized vertex.

  • vertices (tuple of Vertex) – The vertices at whose center this one needs to be.

Returns

The new vertex.

Return type

_CageVertex

map_functional_groups_to_edges(building_block, edges)[source]

Map functional groups to edges.

Each functional group in building_block needs to be assigned to an edge in edges.

Parameters
  • building_blockBuildingBlock The building block which is needs to have functional groups assigned to edges.

  • edges – The edges to which the vertex is attached.

Returns

A mapping from the id of a functional group in building_block to the id of the edge in edges it is assigned to.

place_building_block(building_block, edges)[source]

Place building_block on the Vertex.

Parameters
  • building_block – The building block molecule which is to be placed on the vertex.

  • edges – The edges to which the vertex is attached.

Returns

The position matrix of building_block after being placed.

use_neighbor_placement()

True if the position should be updated based on neighbors.

Returns

True if the position of the vertex should be updated based on the positions of functional groups on neighboring vertices.

Return type

bool

with_aligner_edge(aligner_edge)

Return a clone with a different aligner_edge.

Parameters

aligner_edge (int) – The aligner edge of the clone.

Returns

The clone. Has the same type as the original instance.

Return type

_CageVertex

with_position(position)

Get a clone at a certain position.

Parameters

position (ndarray) – The desired position of the clone.

Return type

Vertex

Returns

The clone.

with_scale(scale)

Get a clone with a scaled position.

Parameters

scale (Union[float, tuple[float, float, float]]) – The value by which the position of the Vertex is scaled. Can be a single number if all axes are scaled by the same amount or a tuple of three numbers if each axis is scaled by a different value.

Return type

Vertex

Returns

The clone.

class LinearVertex(id, position, use_neighbor_placement=True, aligner_edge=0)[source]

Bases: stk.molecular.topology_graphs.cage.vertices._CageVertex

Methods

clone()

Return a clone.

get_aligner_edge()

Return the aligner edge of the vertex.

get_cell()

Get the cell of the lattice in which the vertex is found.

get_id()

Get the id.

get_position()

Get the position.

init_at_center(id, vertices)

Initialize a _CageVertex in the middle of vertices.

map_functional_groups_to_edges(...)

Map functional groups to edges.

place_building_block(building_block, edges)

Place building_block on the Vertex.

use_neighbor_placement()

True if the position should be updated based on neighbors.

with_aligner_edge(aligner_edge)

Return a clone with a different aligner_edge.

with_position(position)

Get a clone at a certain position.

with_scale(scale)

Get a clone with a scaled position.

__init__(id, position, use_neighbor_placement=True, aligner_edge=0)

Initialize a _CageVertex.

Parameters
  • id (int) – The id of the vertex.

  • position (tuple of float) – The position of the vertex.

  • use_neighbor_placement (bool, optional) – If True, the position of the vertex will be updated based on the neighboring functional groups.

  • aligner_edge (int, optional) – The edge which is used to align the BuildingBlock placed on the vertex. The first FunctionalGroup is rotated such that it lies exactly on this Edge. Must be between 0 and the number of edges the vertex is connected to.

clone()

Return a clone.

Returns

The clone.

get_aligner_edge()

Return the aligner edge of the vertex.

Returns

The aligner edge.

Return type

int

get_cell()

Get the cell of the lattice in which the vertex is found.

Return type

ndarray

Returns

The cell of the lattice in which the vertex is found.

get_id()

Get the id.

Return type

int

Returns

The id.

get_position()

Get the position.

Return type

ndarray

Returns

The position of the Vertex.

classmethod init_at_center(id, vertices)

Initialize a _CageVertex in the middle of vertices.

Parameters
  • id (int) – The id of the initialized vertex.

  • vertices (tuple of Vertex) – The vertices at whose center this one needs to be.

Returns

The new vertex.

Return type

_CageVertex

map_functional_groups_to_edges(building_block, edges)[source]

Map functional groups to edges.

Each functional group in building_block needs to be assigned to an edge in edges.

Parameters
  • building_blockBuildingBlock The building block which is needs to have functional groups assigned to edges.

  • edges – The edges to which the vertex is attached.

Returns

A mapping from the id of a functional group in building_block to the id of the edge in edges it is assigned to.

place_building_block(building_block, edges)[source]

Place building_block on the Vertex.

Parameters
  • building_block – The building block molecule which is to be placed on the vertex.

  • edges – The edges to which the vertex is attached.

Returns

The position matrix of building_block after being placed.

use_neighbor_placement()

True if the position should be updated based on neighbors.

Returns

True if the position of the vertex should be updated based on the positions of functional groups on neighboring vertices.

Return type

bool

with_aligner_edge(aligner_edge)

Return a clone with a different aligner_edge.

Parameters

aligner_edge (int) – The aligner edge of the clone.

Returns

The clone. Has the same type as the original instance.

Return type

_CageVertex

with_position(position)

Get a clone at a certain position.

Parameters

position (ndarray) – The desired position of the clone.

Return type

Vertex

Returns

The clone.

with_scale(scale)

Get a clone with a scaled position.

Parameters

scale (Union[float, tuple[float, float, float]]) – The value by which the position of the Vertex is scaled. Can be a single number if all axes are scaled by the same amount or a tuple of three numbers if each axis is scaled by a different value.

Return type

Vertex

Returns

The clone.

class NonLinearVertex(id, position, use_neighbor_placement=True, aligner_edge=0)[source]

Bases: stk.molecular.topology_graphs.cage.vertices._CageVertex

Methods

clone()

Return a clone.

get_aligner_edge()

Return the aligner edge of the vertex.

get_cell()

Get the cell of the lattice in which the vertex is found.

get_id()

Get the id.

get_position()

Get the position.

init_at_center(id, vertices)

Initialize a _CageVertex in the middle of vertices.

map_functional_groups_to_edges(...)

Map functional groups to edges.

place_building_block(building_block, edges)

Place building_block on the Vertex.

use_neighbor_placement()

True if the position should be updated based on neighbors.

with_aligner_edge(aligner_edge)

Return a clone with a different aligner_edge.

with_position(position)

Get a clone at a certain position.

with_scale(scale)

Get a clone with a scaled position.

__init__(id, position, use_neighbor_placement=True, aligner_edge=0)

Initialize a _CageVertex.

Parameters
  • id (int) – The id of the vertex.

  • position (tuple of float) – The position of the vertex.

  • use_neighbor_placement (bool, optional) – If True, the position of the vertex will be updated based on the neighboring functional groups.

  • aligner_edge (int, optional) – The edge which is used to align the BuildingBlock placed on the vertex. The first FunctionalGroup is rotated such that it lies exactly on this Edge. Must be between 0 and the number of edges the vertex is connected to.

clone()

Return a clone.

Returns

The clone.

get_aligner_edge()

Return the aligner edge of the vertex.

Returns

The aligner edge.

Return type

int

get_cell()

Get the cell of the lattice in which the vertex is found.

Return type

ndarray

Returns

The cell of the lattice in which the vertex is found.

get_id()

Get the id.

Return type

int

Returns

The id.

get_position()

Get the position.

Return type

ndarray

Returns

The position of the Vertex.

classmethod init_at_center(id, vertices)

Initialize a _CageVertex in the middle of vertices.

Parameters
  • id (int) – The id of the initialized vertex.

  • vertices (tuple of Vertex) – The vertices at whose center this one needs to be.

Returns

The new vertex.

Return type

_CageVertex

map_functional_groups_to_edges(building_block, edges)[source]

Map functional groups to edges.

Each functional group in building_block needs to be assigned to an edge in edges.

Parameters
  • building_blockBuildingBlock The building block which is needs to have functional groups assigned to edges.

  • edges – The edges to which the vertex is attached.

Returns

A mapping from the id of a functional group in building_block to the id of the edge in edges it is assigned to.

place_building_block(building_block, edges)[source]

Place building_block on the Vertex.

Parameters
  • building_block – The building block molecule which is to be placed on the vertex.

  • edges – The edges to which the vertex is attached.

Returns

The position matrix of building_block after being placed.

use_neighbor_placement()

True if the position should be updated based on neighbors.

Returns

True if the position of the vertex should be updated based on the positions of functional groups on neighboring vertices.

Return type

bool

with_aligner_edge(aligner_edge)

Return a clone with a different aligner_edge.

Parameters

aligner_edge (int) – The aligner edge of the clone.

Returns

The clone. Has the same type as the original instance.

Return type

_CageVertex

with_position(position)

Get a clone at a certain position.

Parameters

position (ndarray) – The desired position of the clone.

Return type

Vertex

Returns

The clone.

with_scale(scale)

Get a clone with a scaled position.

Parameters

scale (Union[float, tuple[float, float, float]]) – The value by which the position of the Vertex is scaled. Can be a single number if all axes are scaled by the same amount or a tuple of three numbers if each axis is scaled by a different value.

Return type

Vertex

Returns

The clone.

class UnaligningVertex(id, position, use_neighbor_placement=True, aligner_edge=0)[source]

Bases: stk.molecular.topology_graphs.cage.vertices._CageVertex

Just places a building block, does not align.

Methods

clone()

Return a clone.

get_aligner_edge()

Return the aligner edge of the vertex.

get_cell()

Get the cell of the lattice in which the vertex is found.

get_id()

Get the id.

get_position()

Get the position.

init_at_center(id, vertices)

Initialize a _CageVertex in the middle of vertices.

map_functional_groups_to_edges(...)

Map functional groups to edges.

place_building_block(building_block, edges)

Place building_block on the Vertex.

use_neighbor_placement()

True if the position should be updated based on neighbors.

with_aligner_edge(aligner_edge)

Return a clone with a different aligner_edge.

with_position(position)

Get a clone at a certain position.

with_scale(scale)

Get a clone with a scaled position.

__init__(id, position, use_neighbor_placement=True, aligner_edge=0)

Initialize a _CageVertex.

Parameters
  • id (int) – The id of the vertex.

  • position (tuple of float) – The position of the vertex.

  • use_neighbor_placement (bool, optional) – If True, the position of the vertex will be updated based on the neighboring functional groups.

  • aligner_edge (int, optional) – The edge which is used to align the BuildingBlock placed on the vertex. The first FunctionalGroup is rotated such that it lies exactly on this Edge. Must be between 0 and the number of edges the vertex is connected to.

clone()

Return a clone.

Returns

The clone.

get_aligner_edge()

Return the aligner edge of the vertex.

Returns

The aligner edge.

Return type

int

get_cell()

Get the cell of the lattice in which the vertex is found.

Return type

ndarray

Returns

The cell of the lattice in which the vertex is found.

get_id()

Get the id.

Return type

int

Returns

The id.

get_position()

Get the position.

Return type

ndarray

Returns

The position of the Vertex.

classmethod init_at_center(id, vertices)[source]

Initialize a _CageVertex in the middle of vertices.

Parameters
  • id (int) – The id of the initialized vertex.

  • vertices (tuple of Vertex) – The vertices at whose center this one needs to be.

Returns

The new vertex.

Return type

_CageVertex

map_functional_groups_to_edges(building_block, edges)[source]

Map functional groups to edges.

Each functional group in building_block needs to be assigned to an edge in edges.

Parameters
  • building_blockBuildingBlock The building block which is needs to have functional groups assigned to edges.

  • edges – The edges to which the vertex is attached.

Returns

A mapping from the id of a functional group in building_block to the id of the edge in edges it is assigned to.

place_building_block(building_block, edges)[source]

Place building_block on the Vertex.

Parameters
  • building_block – The building block molecule which is to be placed on the vertex.

  • edges – The edges to which the vertex is attached.

Returns

The position matrix of building_block after being placed.

use_neighbor_placement()

True if the position should be updated based on neighbors.

Returns

True if the position of the vertex should be updated based on the positions of functional groups on neighboring vertices.

Return type

bool

with_aligner_edge(aligner_edge)

Return a clone with a different aligner_edge.

Parameters

aligner_edge (int) – The aligner edge of the clone.

Returns

The clone. Has the same type as the original instance.

Return type

_CageVertex

with_position(position)

Get a clone at a certain position.

Parameters

position (ndarray) – The desired position of the clone.

Return type

Vertex

Returns

The clone.

with_scale(scale)

Get a clone with a scaled position.

Parameters

scale (Union[float, tuple[float, float, float]]) – The value by which the position of the Vertex is scaled. Can be a single number if all axes are scaled by the same amount or a tuple of three numbers if each axis is scaled by a different value.

Return type

Vertex

Returns

The clone.