From d4cc6dec109d4f38720f986b1da60f99561286d5 Mon Sep 17 00:00:00 2001 From: Andrew Tarzia Date: Fri, 12 Mar 2021 09:02:35 +0000 Subject: [PATCH 01/44] Update docs. --- src/stk/molecular/topology_graphs/cof/cof.py | 8 ++++++++ src/stk/molecular/writers/pdb.py | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/stk/molecular/topology_graphs/cof/cof.py b/src/stk/molecular/topology_graphs/cof/cof.py index de34cdbc4..d25e53b17 100644 --- a/src/stk/molecular/topology_graphs/cof/cof.py +++ b/src/stk/molecular/topology_graphs/cof/cof.py @@ -131,6 +131,14 @@ class Cof(TopologyGraph): alpha = periodic_info.get_alpha() beta = periodic_info.get_beta() gamma = periodic_info.get_gamma() + # Write to .pdb file. + writer = stk.PdbWriter() + writer.write( + molecule=cof, + path='cof.pdb', + periodic_info=periodic_info, + ) + *Structural Isomer Construction* diff --git a/src/stk/molecular/writers/pdb.py b/src/stk/molecular/writers/pdb.py index 5b31c78fc..3192d842d 100644 --- a/src/stk/molecular/writers/pdb.py +++ b/src/stk/molecular/writers/pdb.py @@ -31,7 +31,7 @@ class PdbWriter: writer = stk.PdbWriter() writer.write( molecule=cof, - file='cof.pdb', + path='cof.pdb', periodic_info=topology_graph.get_periodic_info() ) From 4f7e4c88ab92982c72d578a2c8ef0a1dd4afd955 Mon Sep 17 00:00:00 2001 From: Andrew Tarzia Date: Fri, 12 Mar 2021 09:03:36 +0000 Subject: [PATCH 02/44] WIP: Add periodic optimisation. Does not work currently. --- src/stk/molecular/periodic_info.py | 48 ++++++ .../topology_graphs/cof/periodic_hexagonal.py | 12 +- .../topology_graphs/cof/periodic_honeycomb.py | 11 +- .../topology_graphs/cof/periodic_kagome.py | 11 +- .../cof/periodic_linkerless_honeycomb.py | 11 +- .../topology_graphs/cof/periodic_square.py | 11 +- .../construction_state/construction_state.py | 46 ++++++ .../construction_state/graph_state.py | 41 ++++++ .../topology_graph/optimizers/__init__.py | 1 + .../topology_graph/optimizers/collapser.py | 2 +- .../optimizers/periodic_collapser.py | 139 ++++++++++++++++++ 11 files changed, 327 insertions(+), 6 deletions(-) create mode 100644 src/stk/molecular/topology_graphs/topology_graph/optimizers/periodic_collapser.py diff --git a/src/stk/molecular/periodic_info.py b/src/stk/molecular/periodic_info.py index 9e4825a21..12c6042ba 100644 --- a/src/stk/molecular/periodic_info.py +++ b/src/stk/molecular/periodic_info.py @@ -94,6 +94,54 @@ def clone(self): ) return clone + @classmethod + def _update_periodic_info(cls, vector_1, vector_2, vector_3): + """ + Return clone of :class:`.UnitCell` with new parameters. + + """ + + clone = cls.__new__(cls) + PeriodicInfo.__init__( + self=clone, + vector_1=vector_1, + vector_2=vector_2, + vector_3=vector_3, + ) + + return clone + + def with_cell_from_vectors(self, vector_1, vector_2, vector_3): + """ + Update cell. + + Parameters + ---------- + vector_1 : :class:`numpy.ndarray` + First cell lattice vector of shape (3, ) in + Angstrom. + + vector_2 : :class:`numpy.ndarray` + Second cell lattice vector of shape (3, ) in + Angstrom. + + vector_3 : :class:`numpy.ndarray` + Third cell lattice vector of shape (3, ) in + Angstrom. + + Returns + ------- + :class:`.UnitCell` + Clone with updated cell parameters. + + """ + + return self.__class__._update_periodic_info( + vector_1=vector_1, + vector_2=vector_2, + vector_3=vector_3, + ) + def get_vector_1(self): """ Get *x* vector. diff --git a/src/stk/molecular/topology_graphs/cof/periodic_hexagonal.py b/src/stk/molecular/topology_graphs/cof/periodic_hexagonal.py index 9a7d951d8..900858192 100644 --- a/src/stk/molecular/topology_graphs/cof/periodic_hexagonal.py +++ b/src/stk/molecular/topology_graphs/cof/periodic_hexagonal.py @@ -5,10 +5,11 @@ """ import numpy as np + from ...reactions import GenericReactionFactory from .cof import Cof from .vertices import _LinearCofVertex, _NonLinearCofVertex -from ..topology_graph import Edge, NullOptimizer +from ..topology_graph import Edge, NullOptimizer, ConstructionResult from ...periodic_info import PeriodicInfo @@ -147,6 +148,15 @@ def get_periodic_info(self): ), ) + def construct(self): + + state = self._get_construction_state() + state = self._place_building_blocks(state) + state = self._run_reactions(state) + state = self._optimizer.optimize(state) + self._lattice_constants = state.get_lattice_constants() + return ConstructionResult(state) + _lattice_constants = _a, _b, _c = ( np.array([1., 0., 0.]), np.array([0.5, 0.866, 0]), diff --git a/src/stk/molecular/topology_graphs/cof/periodic_honeycomb.py b/src/stk/molecular/topology_graphs/cof/periodic_honeycomb.py index f57457d97..c97445ba9 100644 --- a/src/stk/molecular/topology_graphs/cof/periodic_honeycomb.py +++ b/src/stk/molecular/topology_graphs/cof/periodic_honeycomb.py @@ -8,7 +8,7 @@ from ...reactions import GenericReactionFactory from .cof import Cof from .vertices import _LinearCofVertex, _NonLinearCofVertex -from ..topology_graph import Edge, NullOptimizer +from ..topology_graph import Edge, NullOptimizer, ConstructionResult from ...periodic_info import PeriodicInfo @@ -147,6 +147,15 @@ def get_periodic_info(self): ), ) + def construct(self): + + state = self._get_construction_state() + state = self._place_building_blocks(state) + state = self._run_reactions(state) + state = self._optimizer.optimize(state) + self._lattice_constants = state.get_lattice_constants() + return ConstructionResult(state) + _lattice_constants = _a, _b, _c = ( np.array([1., 0., 0.]), np.array([0.5, 0.866, 0]), diff --git a/src/stk/molecular/topology_graphs/cof/periodic_kagome.py b/src/stk/molecular/topology_graphs/cof/periodic_kagome.py index 219f27878..abeadc55b 100644 --- a/src/stk/molecular/topology_graphs/cof/periodic_kagome.py +++ b/src/stk/molecular/topology_graphs/cof/periodic_kagome.py @@ -8,7 +8,7 @@ from ...reactions import GenericReactionFactory from .cof import Cof from .vertices import _LinearCofVertex, _NonLinearCofVertex -from ..topology_graph import Edge, NullOptimizer +from ..topology_graph import Edge, NullOptimizer, ConstructionResult from ...periodic_info import PeriodicInfo @@ -147,6 +147,15 @@ def get_periodic_info(self): ), ) + def construct(self): + + state = self._get_construction_state() + state = self._place_building_blocks(state) + state = self._run_reactions(state) + state = self._optimizer.optimize(state) + self._lattice_constants = state.get_lattice_constants() + return ConstructionResult(state) + _lattice_constants = _a, _b, _c = ( np.array([1., 0., 0.]), np.array([0.5, 0.866, 0.]), diff --git a/src/stk/molecular/topology_graphs/cof/periodic_linkerless_honeycomb.py b/src/stk/molecular/topology_graphs/cof/periodic_linkerless_honeycomb.py index dfd4c9c22..dd9619918 100644 --- a/src/stk/molecular/topology_graphs/cof/periodic_linkerless_honeycomb.py +++ b/src/stk/molecular/topology_graphs/cof/periodic_linkerless_honeycomb.py @@ -8,7 +8,7 @@ from ...reactions import GenericReactionFactory from .cof import Cof from .vertices import _NonLinearCofVertex -from ..topology_graph import Edge, NullOptimizer +from ..topology_graph import Edge, NullOptimizer, ConstructionResult from ...periodic_info import PeriodicInfo @@ -146,6 +146,15 @@ def get_periodic_info(self): ), ) + def construct(self): + + state = self._get_construction_state() + state = self._place_building_blocks(state) + state = self._run_reactions(state) + state = self._optimizer.optimize(state) + self._lattice_constants = state.get_lattice_constants() + return ConstructionResult(state) + _lattice_constants = _a, _b, _c = ( np.array([1., 0., 0.]), np.array([0.5, 0.866, 0.]), diff --git a/src/stk/molecular/topology_graphs/cof/periodic_square.py b/src/stk/molecular/topology_graphs/cof/periodic_square.py index 43b49ca98..f20096884 100644 --- a/src/stk/molecular/topology_graphs/cof/periodic_square.py +++ b/src/stk/molecular/topology_graphs/cof/periodic_square.py @@ -8,7 +8,7 @@ from ...reactions import GenericReactionFactory from .cof import Cof from .vertices import _LinearCofVertex, _NonLinearCofVertex -from ..topology_graph import Edge, NullOptimizer +from ..topology_graph import Edge, NullOptimizer, ConstructionResult from ...periodic_info import PeriodicInfo @@ -147,6 +147,15 @@ def get_periodic_info(self): ), ) + def construct(self): + + state = self._get_construction_state() + state = self._place_building_blocks(state) + state = self._run_reactions(state) + state = self._optimizer.optimize(state) + self._lattice_constants = state.get_lattice_constants() + return ConstructionResult(state) + _lattice_constants = _a, _b, _c = ( np.array([1., 0., 0.]), np.array([0., 1., 0.]), diff --git a/src/stk/molecular/topology_graphs/topology_graph/construction_state/construction_state.py b/src/stk/molecular/topology_graphs/topology_graph/construction_state/construction_state.py index 22be6a4a9..ce088e7bf 100644 --- a/src/stk/molecular/topology_graphs/topology_graph/construction_state/construction_state.py +++ b/src/stk/molecular/topology_graphs/topology_graph/construction_state/construction_state.py @@ -127,6 +127,19 @@ def with_placement_results( results=results, ) + def get_lattice_constants(self): + """ + Get the building block to be placed on a given vertex. + + Returns + ------- + :class:`.BuildingBlock` + The building block. + + """ + + return self._graph_state.get_lattice_constants() + def get_building_block(self, vertex_id): """ Get the building block to be placed on a given vertex. @@ -285,6 +298,39 @@ def with_reaction_results(self, reactions, results): return self.clone()._with_reaction_results(reactions, results) + def _with_lattice_constants(self, lattice_constants): + """ + Modify the instance. + + """ + + self._graph_state = ( + self._graph_state.with_lattice_constants( + lattice_constants=lattice_constants, + ) + ) + return self + + def with_lattice_constants(self, lattice_constants): + """ + Return a clone holding the `position_matrix`. + + Parameters + ---------- + position_matrix : :class:`numpy.ndarray` + The position matrix of the clone. The shape of the matrix + is ``(n, 3)``. + + Returns + ------- + :class:`.ConstructionState` + The clone holding the new position matrix. Has the same + type as the original instance. + + """ + + return self.clone()._with_lattice_constants(lattice_constants) + def _with_position_matrix(self, position_matrix): """ Modify the instance. diff --git a/src/stk/molecular/topology_graphs/topology_graph/construction_state/graph_state.py b/src/stk/molecular/topology_graphs/topology_graph/construction_state/graph_state.py index e527c5594..a4c1dad85 100644 --- a/src/stk/molecular/topology_graphs/topology_graph/construction_state/graph_state.py +++ b/src/stk/molecular/topology_graphs/topology_graph/construction_state/graph_state.py @@ -152,6 +152,7 @@ def clone(self): clone._vertices = dict(self._vertices) clone._vertex_edges = dict(self._vertex_edges) clone._edges = self._edges + clone._lattice_constants = self._lattice_constants return clone def get_building_block(self, vertex_id): @@ -243,6 +244,19 @@ def get_num_edges(self): return len(self._edges) + def get_lattice_constants(self): + """ + Get the number of edges in the topology graph. + + Returns + ------- + :class:`int` + The number of edges. + + """ + + return self._lattice_constants + def get_edges(self, vertex_id): """ Get the edges connect to a vertex. @@ -289,3 +303,30 @@ def with_vertices(self, vertices): """ return self.clone()._with_vertices(vertices) + + def _with_lattice_constants(self, lattice_constants): + """ + Modify the instance. + + """ + + self._lattice_constants = lattice_constants + return self + + def with_lattice_constants(self, lattice_constants): + """ + Returns a clone holding `vertices`. + + Parameters + ---------- + vertices : :class:`iterable` of :class:`.Vertex` + The vertices the clone should hold. + + Returns + ------- + :class:`._GraphState` + The clone. Has the same type as the original instance. + + """ + + return self.clone()._with_lattice_constants(lattice_constants) diff --git a/src/stk/molecular/topology_graphs/topology_graph/optimizers/__init__.py b/src/stk/molecular/topology_graphs/topology_graph/optimizers/__init__.py index 38a6f0937..1d0ba2e1e 100644 --- a/src/stk/molecular/topology_graphs/topology_graph/optimizers/__init__.py +++ b/src/stk/molecular/topology_graphs/topology_graph/optimizers/__init__.py @@ -2,4 +2,5 @@ from .optimizer import * # noqa from .mchammer import * # noqa from .collapser import * # noqa +from .periodic_collapser import * # noqa from .utilities import * # noqa diff --git a/src/stk/molecular/topology_graphs/topology_graph/optimizers/collapser.py b/src/stk/molecular/topology_graphs/topology_graph/optimizers/collapser.py index 2418b3d61..b7e544e90 100644 --- a/src/stk/molecular/topology_graphs/topology_graph/optimizers/collapser.py +++ b/src/stk/molecular/topology_graphs/topology_graph/optimizers/collapser.py @@ -18,7 +18,7 @@ class Collapser(Optimizer): -------- *Structure Optimization* - Using :class:`.MCHammer` will lead to :class:`.ConstructedMolecule` + Using :class:`.Collapser` will lead to :class:`.ConstructedMolecule` structures without long bonds. .. code-block:: python diff --git a/src/stk/molecular/topology_graphs/topology_graph/optimizers/periodic_collapser.py b/src/stk/molecular/topology_graphs/topology_graph/optimizers/periodic_collapser.py new file mode 100644 index 000000000..48618427e --- /dev/null +++ b/src/stk/molecular/topology_graphs/topology_graph/optimizers/periodic_collapser.py @@ -0,0 +1,139 @@ +""" +PeriodicCollapser +========= + +""" + +import numpy as np +from .collapser import Collapser +from .utilities import get_mch_bonds, get_long_bond_ids, get_subunits + +import mchammer as mch + + +class PeriodicCollapser(Collapser): + """ + Performs rigid-body collapse of molecule [1]_. + + Examples + -------- + *Structure Optimization* + + Using :class:`.PeriodicCollapser` will lead to + :class:`.ConstructedMolecule` structures without long bonds and + match the unit-cell to the new structure. + + .. code-block:: python + + FILL IN WITH TESTING.py + + Optimisation with :mod:`stk` simply collects the final position + matrix and periodic info. The optimisation's trajectory can be + output using the :mod:`MCHammer` implementation if required by the + user [1]_. + + The open-source optimization code :mod:`MCHammer` specializes in + the `collapsing` of molecules with long bonds like those + constructed by :mod:`stk`. This code is entirely nonphysical and + is, therefore, completely general to any chemistry. + + References + ---------- + .. [1] https://github.com/andrewtarzia/MCHammer + + """ + + def __init__( + self, + step_size=0.1, + distance_threshold=1.5, + scale_steps=True, + ): + """ + Initialize an instance of :class:`.PeriodicCollapser`. + + Parameters + ---------- + step_size : :class:`float`, optional + The relative size of the step to take during collapse in + Angstrom. + + distance_threshold : :class:`float`, optional + Distance between distinct building blocks to use as + threshold for halting collapse in Angstrom. + + scale_steps : :class:`bool`, optional + Whether to scale the step of each distinct building block + by its relative distance from the molecules centroid. + + """ + + self._optimizer = mch.Collapser( + step_size=step_size, + distance_threshold=distance_threshold, + scale_steps=scale_steps, + ) + + def optimize(self, state): + # Define MCHammer molecule to optimize. + mch_mol = mch.Molecule( + atoms=( + mch.Atom( + id=atom.get_id(), + element_string=atom.__class__.__name__, + ) for atom in state.get_atoms() + ), + bonds=get_mch_bonds(state), + position_matrix=state.get_position_matrix(), + ) + + # Run optimization. + mch_mol, result = self._optimizer.get_result( + mol=mch_mol, + bond_pair_ids=tuple(get_long_bond_ids(state)), + subunits=get_subunits(state), + ) + + print(result) + + old_pos_mat = state.get_position_matrix() + new_pos_mat = mch_mol.get_position_matrix() + print(old_pos_mat) + print(new_pos_mat) + old_x_extent = abs( + max(old_pos_mat[:, 0])-min(old_pos_mat[:, 0]) + ) + old_y_extent = abs( + max(old_pos_mat[:, 1])-min(old_pos_mat[:, 1]) + ) + old_z_extent = abs( + max(old_pos_mat[:, 2])-min(old_pos_mat[:, 2]) + ) + print(old_x_extent, old_y_extent, old_z_extent) + new_x_extent = abs( + max(new_pos_mat[:, 0])-min(new_pos_mat[:, 0]) + ) + new_y_extent = abs( + max(new_pos_mat[:, 1])-min(new_pos_mat[:, 1]) + ) + new_z_extent = abs( + max(new_pos_mat[:, 2])-min(new_pos_mat[:, 2]) + ) + print(new_x_extent, new_y_extent, new_z_extent) + x_ratio = new_x_extent/old_x_extent + y_ratio = new_y_extent/old_y_extent + z_ratio = new_z_extent/old_z_extent + print(x_ratio, y_ratio, z_ratio) + old_lattice = state.get_lattice_constants() + print(old_lattice) + new_lattice = np.array([ + old_lattice[0]*x_ratio, + old_lattice[1]*y_ratio, + old_lattice[2]*z_ratio, + ]) + print(new_lattice) + state = state.with_lattice_constants(new_lattice) + + return state.with_position_matrix( + position_matrix=mch_mol.get_position_matrix() + ) From 6acd22143c5943a9c493b23f9b77a8204f7b82a3 Mon Sep 17 00:00:00 2001 From: Andrew Tarzia Date: Wed, 17 Mar 2021 14:09:46 +0000 Subject: [PATCH 03/44] Update lattice constants in init of Cof toplogy graph. --- src/stk/molecular/topology_graphs/cof/cof.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/stk/molecular/topology_graphs/cof/cof.py b/src/stk/molecular/topology_graphs/cof/cof.py index d25e53b17..750722e3d 100644 --- a/src/stk/molecular/topology_graphs/cof/cof.py +++ b/src/stk/molecular/topology_graphs/cof/cof.py @@ -314,6 +314,11 @@ def __init__( edges = self._get_edges(lattice) vertices = self._get_vertices(lattice) + self._lattice_constants = tuple( + self._get_lattice_constants()[i]*self._lattice_size[i] + for i in range(3) + ) + if isinstance(building_blocks, dict): for building_block in building_blocks: assert ( From 0d859708ab9b502169bf583d1e69372ec6265195 Mon Sep 17 00:00:00 2001 From: Andrew Tarzia Date: Wed, 17 Mar 2021 14:10:02 +0000 Subject: [PATCH 04/44] Update periodic topology graphs. --- .../topology_graphs/cof/periodic_honeycomb.py | 12 ++--- .../topology_graphs/cof/periodic_kagome.py | 12 ++--- .../cof/periodic_linkerless_honeycomb.py | 12 ++--- .../topology_graphs/cof/periodic_square.py | 12 ++--- .../optimizers/periodic_collapser.py | 44 +++++-------------- 5 files changed, 22 insertions(+), 70 deletions(-) diff --git a/src/stk/molecular/topology_graphs/cof/periodic_honeycomb.py b/src/stk/molecular/topology_graphs/cof/periodic_honeycomb.py index c97445ba9..09cfd540e 100644 --- a/src/stk/molecular/topology_graphs/cof/periodic_honeycomb.py +++ b/src/stk/molecular/topology_graphs/cof/periodic_honeycomb.py @@ -136,15 +136,9 @@ def get_periodic_info(self): lattice_constants = self._get_lattice_constants() return PeriodicInfo( - vector_1=( - lattice_constants[0]*self._lattice_size[0]*self._scale - ), - vector_2=( - lattice_constants[1]*self._lattice_size[1]*self._scale - ), - vector_3=( - lattice_constants[2]*self._lattice_size[2]*self._scale - ), + vector_1=lattice_constants[0], + vector_2=lattice_constants[1], + vector_3=lattice_constants[2], ) def construct(self): diff --git a/src/stk/molecular/topology_graphs/cof/periodic_kagome.py b/src/stk/molecular/topology_graphs/cof/periodic_kagome.py index abeadc55b..805181473 100644 --- a/src/stk/molecular/topology_graphs/cof/periodic_kagome.py +++ b/src/stk/molecular/topology_graphs/cof/periodic_kagome.py @@ -136,15 +136,9 @@ def get_periodic_info(self): lattice_constants = self._get_lattice_constants() return PeriodicInfo( - vector_1=( - lattice_constants[0]*self._lattice_size[0]*self._scale - ), - vector_2=( - lattice_constants[1]*self._lattice_size[1]*self._scale - ), - vector_3=( - lattice_constants[2]*self._lattice_size[2]*self._scale - ), + vector_1=lattice_constants[0], + vector_2=lattice_constants[1], + vector_3=lattice_constants[2], ) def construct(self): diff --git a/src/stk/molecular/topology_graphs/cof/periodic_linkerless_honeycomb.py b/src/stk/molecular/topology_graphs/cof/periodic_linkerless_honeycomb.py index dd9619918..aa433965a 100644 --- a/src/stk/molecular/topology_graphs/cof/periodic_linkerless_honeycomb.py +++ b/src/stk/molecular/topology_graphs/cof/periodic_linkerless_honeycomb.py @@ -135,15 +135,9 @@ def get_periodic_info(self): lattice_constants = self._get_lattice_constants() return PeriodicInfo( - vector_1=( - lattice_constants[0]*self._lattice_size[0]*self._scale - ), - vector_2=( - lattice_constants[1]*self._lattice_size[1]*self._scale - ), - vector_3=( - lattice_constants[2]*self._lattice_size[2]*self._scale - ), + vector_1=lattice_constants[0], + vector_2=lattice_constants[1], + vector_3=lattice_constants[2], ) def construct(self): diff --git a/src/stk/molecular/topology_graphs/cof/periodic_square.py b/src/stk/molecular/topology_graphs/cof/periodic_square.py index f20096884..d20c18377 100644 --- a/src/stk/molecular/topology_graphs/cof/periodic_square.py +++ b/src/stk/molecular/topology_graphs/cof/periodic_square.py @@ -136,15 +136,9 @@ def get_periodic_info(self): lattice_constants = self._get_lattice_constants() return PeriodicInfo( - vector_1=( - lattice_constants[0]*self._lattice_size[0]*self._scale - ), - vector_2=( - lattice_constants[1]*self._lattice_size[1]*self._scale - ), - vector_3=( - lattice_constants[2]*self._lattice_size[2]*self._scale - ), + vector_1=lattice_constants[0], + vector_2=lattice_constants[1], + vector_3=lattice_constants[2], ) def construct(self): diff --git a/src/stk/molecular/topology_graphs/topology_graph/optimizers/periodic_collapser.py b/src/stk/molecular/topology_graphs/topology_graph/optimizers/periodic_collapser.py index 48618427e..af4ec351e 100644 --- a/src/stk/molecular/topology_graphs/topology_graph/optimizers/periodic_collapser.py +++ b/src/stk/molecular/topology_graphs/topology_graph/optimizers/periodic_collapser.py @@ -94,46 +94,22 @@ def optimize(self, state): subunits=get_subunits(state), ) - print(result) - old_pos_mat = state.get_position_matrix() new_pos_mat = mch_mol.get_position_matrix() - print(old_pos_mat) - print(new_pos_mat) - old_x_extent = abs( - max(old_pos_mat[:, 0])-min(old_pos_mat[:, 0]) - ) - old_y_extent = abs( - max(old_pos_mat[:, 1])-min(old_pos_mat[:, 1]) - ) - old_z_extent = abs( - max(old_pos_mat[:, 2])-min(old_pos_mat[:, 2]) - ) - print(old_x_extent, old_y_extent, old_z_extent) - new_x_extent = abs( - max(new_pos_mat[:, 0])-min(new_pos_mat[:, 0]) + old_extents = ( + abs(max(old_pos_mat[:, i])-min(old_pos_mat[:, i])) + for i in range(3) ) - new_y_extent = abs( - max(new_pos_mat[:, 1])-min(new_pos_mat[:, 1]) + new_extents = ( + abs(max(new_pos_mat[:, i])-min(new_pos_mat[:, i])) + for i in range(3) ) - new_z_extent = abs( - max(new_pos_mat[:, 2])-min(new_pos_mat[:, 2]) - ) - print(new_x_extent, new_y_extent, new_z_extent) - x_ratio = new_x_extent/old_x_extent - y_ratio = new_y_extent/old_y_extent - z_ratio = new_z_extent/old_z_extent - print(x_ratio, y_ratio, z_ratio) + ratios = (new/old for new, old in zip(new_extents, old_extents)) old_lattice = state.get_lattice_constants() - print(old_lattice) - new_lattice = np.array([ - old_lattice[0]*x_ratio, - old_lattice[1]*y_ratio, - old_lattice[2]*z_ratio, - ]) - print(new_lattice) + new_lattice = tuple( + old_lattice[i]*ratio for i, ratio in enumerate(ratios) + ) state = state.with_lattice_constants(new_lattice) - return state.with_position_matrix( position_matrix=mch_mol.get_position_matrix() ) From 58957d01a80dc9e6a6234841783fe656761bf555 Mon Sep 17 00:00:00 2001 From: Andrew Tarzia Date: Wed, 17 Mar 2021 14:19:25 +0000 Subject: [PATCH 05/44] Minor. --- .../topology_graphs/topology_graph/optimizers/collapser.py | 4 ++-- .../topology_graph/optimizers/periodic_collapser.py | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/stk/molecular/topology_graphs/topology_graph/optimizers/collapser.py b/src/stk/molecular/topology_graphs/topology_graph/optimizers/collapser.py index b7e544e90..d872aea22 100644 --- a/src/stk/molecular/topology_graphs/topology_graph/optimizers/collapser.py +++ b/src/stk/molecular/topology_graphs/topology_graph/optimizers/collapser.py @@ -18,8 +18,8 @@ class Collapser(Optimizer): -------- *Structure Optimization* - Using :class:`.Collapser` will lead to :class:`.ConstructedMolecule` - structures without long bonds. + Using :class:`.Collapser` will lead to + :class:`.ConstructedMolecule` structures without long bonds. .. code-block:: python diff --git a/src/stk/molecular/topology_graphs/topology_graph/optimizers/periodic_collapser.py b/src/stk/molecular/topology_graphs/topology_graph/optimizers/periodic_collapser.py index af4ec351e..b0aaf4425 100644 --- a/src/stk/molecular/topology_graphs/topology_graph/optimizers/periodic_collapser.py +++ b/src/stk/molecular/topology_graphs/topology_graph/optimizers/periodic_collapser.py @@ -4,7 +4,6 @@ """ -import numpy as np from .collapser import Collapser from .utilities import get_mch_bonds, get_long_bond_ids, get_subunits @@ -104,7 +103,7 @@ def optimize(self, state): abs(max(new_pos_mat[:, i])-min(new_pos_mat[:, i])) for i in range(3) ) - ratios = (new/old for new, old in zip(new_extents, old_extents)) + ratios = (n/o for n, o in zip(new_extents, old_extents)) old_lattice = state.get_lattice_constants() new_lattice = tuple( old_lattice[i]*ratio for i, ratio in enumerate(ratios) From 1de617ed8a75a62421454efd4ec3ae48c2ca9053 Mon Sep 17 00:00:00 2001 From: Andrew Tarzia Date: Wed, 17 Mar 2021 15:11:02 +0000 Subject: [PATCH 06/44] Update tests. --- .../molecule/fixtures/cof/hexagonal.py | 330 +++++++++--------- .../molecule/fixtures/cof/honeycomb.py | 2 +- .../molecules/molecule/fixtures/cof/kagome.py | 30 +- .../fixtures/cof/periodic_hexagonal.py | 57 ++- .../molecule/fixtures/cof/periodic_kagome.py | 32 +- .../position_matrices/cof_hexagonal0.npy | Bin 8912 -> 8912 bytes .../position_matrices/cof_hexagonal1.npy | Bin 37712 -> 37712 bytes .../position_matrices/cof_hexagonal2.npy | Bin 8912 -> 8912 bytes .../position_matrices/cof_hexagonal3.npy | Bin 12368 -> 12368 bytes .../position_matrices/cof_honeycomb0.npy | Bin 3392 -> 3392 bytes .../position_matrices/cof_honeycomb1.npy | Bin 3392 -> 3392 bytes .../position_matrices/cof_honeycomb2.npy | Bin 3392 -> 3392 bytes .../position_matrices/cof_kagome0.npy | Bin 5072 -> 5072 bytes .../cof_periodic_hexagonal0.npy | Bin 8192 -> 8192 bytes .../cof_periodic_honeycomb0.npy | Bin 3200 -> 3200 bytes .../cof_periodic_kagome0.npy | Bin 4736 -> 4736 bytes 16 files changed, 224 insertions(+), 227 deletions(-) diff --git a/tests/molecular/molecules/molecule/fixtures/cof/hexagonal.py b/tests/molecular/molecules/molecule/fixtures/cof/hexagonal.py index a0d251e8b..40536af6e 100644 --- a/tests/molecular/molecules/molecule/fixtures/cof/hexagonal.py +++ b/tests/molecular/molecules/molecule/fixtures/cof/hexagonal.py @@ -64,35 +64,34 @@ ), ), smiles=( - 'BrC1=C([C+]2[C+](Br)[C+](I)[C+]3C4=C([C+]=N4)[C+]4[C+' - '](Br)[C+](Br)[C+]5[C+]6N7N=[C+]N7C78OS[C+]7[C+]7C9=C(' - '[C+]=N9)[C+]9[C+]([C+](Br)[C+](I)[C+]%10N%11N=[C+]N%1' - '1[C+]%11[C+](Br)[C+](Br)[C+](I)[C+](N%12N=[C+]N%12Br)' - 'C%12([C+2][NH2+][C+]%11%12)N%11[C+]=NN%11[C+]%11[C+](' - 'I)[C+](C%12=C(Br)[C+]=N%12)C%12%13[C+2][NH2+][C+]%12[' - 'C+](C%12=C(N=[C+]%12)[C+]7[C+]7[C+]%12[C+]8N8N=[C+]N8' - '[C+]8[C+](C%14=C([C+]=N%14)C6%14OS[C+]4%14)[C+]4[C+]6' - 'C%14=C(N=[C+]%14)[C+]%14[C+](C%15=C([C+]=N%15)[C+]2[C' - '+]2SOC23N2N=[C+]N42)[C+]2S[C+2]C2(Br)[C+](N2N=[C+]N2B' - 'r)[C+]2[C+]%14N3N=[C+]N3[C+]3[C+]4C%14=C(N=[C+]%14)[C' - '+]%14[C+]([C+](Br)[C+](N%15N=[C+]N%15Br)[C+]%15C%16=C' - '(N=[C+]%16)[C+]%16[C+](Br)[C+]%17[NH2+][C+2]C%17(C%17' - '=C(Br)[C+]=N%17)[C+](N%17N=[C+]N%17Br)[C+](N%17N=[C+]' - 'N%17Br)[C+]%16C%16=C([C+]=N%16)[C+]%16[C+](C%17=C(N=[' - 'C+]%17)C%14%17[C+2][NH2+][C+]%15%17)[C+]%14C%15=C([C+' - ']=N%15)C%15(OS[C+]4%15)[C+]4[C+]%15C%17=C(N=[C+]%17)[' - 'C+]%17[C+]%18C%19=C(N=[C+]%19)[C+]%19[C+]([C+](C%20=C' - '(Br)[C+]=N%20)[C+](C%20=C(Br)[C+]=N%20)[C+](C%20=C([C' - '+]=N%20)[C+]%14[C+](N%14N=[C+]N%14Br)C%14(N%20N=[C+]N' - '%20Br)[C+2]S[C+]%16%14)C%14(OS[C+]%19%14)N%14[C+]=NN4' - '%14)N4N=[C+]N4[C+]4[C+]%14C%16=C(N=[C+]%16)C%16(OS[C+' - ']%18%16)[C+]([C+]([C+]%17N%16[C+]=NN%16[C+]8C8([C+2][' - 'NH2+][C+]68)N6N=[C+]N6[C+]%153)N3[C+]=NN%123)N3N=[C+]' - 'N3[C+]3[C+]([C+](C6=C%13N=[C+]6)[C+](I)[C+](C6=C(Br)[' - 'C+]=N6)C6(OS[C+]36)C3=C(N=[C+]3)[C+]%14[C+](I)[C+](N3' - 'N=[C+]N3Br)C3(N6N=[C+]N6Br)[C+2]S[C+]43)N3[C+]=NN73)N' - '3[C+]=NN23)[C+]%11N2[C+]=NN2C%102[C+2]S[C+]92)N2N=[C+' - ']N52)N=[C+]1' + 'BrC1=C([C+]2[C+]3C4=C([C+]=N4)[C+]4[C+](Br)[C+]5[C+]6' + 'C7=C([C+]=N7)[C+]7[C+]8[C+]9[C+]%10C%11=C(N=[C+]%11)[' + 'C+]%11[C+]%12C%13=C(N=[C+]%13)[C+]%13[C+]([C+](C%14=C' + '(Br)[C+]=N%14)[C+](C%14=C(Br)[C+]=N%14)[C+]%14C%15=C(' + '[C+]=N%15)[C+]%15[C+](C%16=C([C+]=N%16)C%16(OS[C+]7%1' + '6)[C+]%10N7N=[C+]N7C%147OS[C+]%137)[C+](C7=C(N=[C+]7)' + 'C7([C+2][NH2+][C+]47)[C+]6N4N=[C+]N4Br)[C+](C4=C(N=[C' + '+]4)[C+]2[C+](N2N=[C+]N2Br)C2(N4N=[C+]N4Br)[C+2][NH2+' + '][C+]2[C+]3Br)[C+]2S[C+2]C2(N2N=[C+]N2Br)[C+]%15N2N=[' + 'C+]N2Br)N2N=[C+]N2[C+]2[C+]3C4=C(N=[C+]4)C4(OS[C+]%12' + '4)[C+]4[C+]6[C+]%11N7[C+]=NN7[C+]7[C+]%10[C+]%11C%12=' + 'C([C+]=N%12)C%12%13OS[C+]%12[C+](C%12=C(N=[C+]%12)[C+' + ']%12[C+](Br)[C+](Br)[C+]%14C%15=C(N=[C+]%15)[C+]%15[C' + '+](N%16N=[C+]N%16Br)[C+](C%16=C([C+]=N%16)[C+]([C+]%1' + '1N%11[C+]=NN%11[C+]%12C%11(C%12=C(Br)[C+]=N%12)OS[C+]' + '%14%11)[C+]%11[NH2+][C+2]C%117N7N=[C+]N97)[C+]([C+](N' + '7N=[C+]N57)C5(Br)[C+2]S[C+]%155)N5N=[C+]N85)[C+](Br)[' + 'C+](Br)[C+]5[C+]%13N7N=[C+]N7C78OS[C+]7[C+]7C9=C([C+]' + '=N9)[C+]9[C+]([C+](Br)[C+](I)[C+]%11N%12N=[C+]N%12[C+' + ']%12[C+](Br)[C+](Br)[C+](I)[C+](N%13N=[C+]N%13Br)C%13' + '([C+2][NH2+][C+]%12%13)N%12[C+]=NN%12[C+]%12[C+](I)[C' + '+](C%13=C(Br)[C+]=N%13)C%13%14[C+2][NH2+][C+]%13[C+](' + 'C%13=C(N=[C+]%13)[C+]7[C+]([C+]([C+]8N7N=[C+]N%107)N7' + 'N=[C+]N67)N6N=[C+]N6[C+]6[C+](C7=C%14N=[C+]7)[C+](I)[' + 'C+](C7=C(Br)[C+]=N7)C7(OS[C+]7[C+]6N6[C+]=NN46)C4=C(N' + '=[C+]4)[C+]3[C+](I)[C+](N3N=[C+]N3Br)C3(N4N=[C+]N4Br)' + '[C+2]S[C+]23)[C+]%12N2[C+]=NN2C%112[C+2]S[C+]92)N2N=[' + 'C+]N52)N=[C+]1' ), ), # Non-planar linear BB. @@ -121,103 +120,102 @@ 'C([H])=C([H])C8=C7[H])C7([H])C([H])(Br)C([H])(Br)C8([' 'H])C9=C([H])C%10=C(C([H])([H])C([H])([H])C([H])([H])C' '([H])([H])[H])C([H])=C(C([H])=C%10C([H])=C9[H])C9([H]' - ')C([H])(Br)C([H])(Br)C([H])(C%10=C([H])C(C([H])([H])C' - '([H])([H])C([H])([H])C([H])([H])[H])=C%11C([H])=C(Br)' - 'C([H])=C([H])C%11=C%10[H])C%10([H])C%11=C([H])C%12=C(' - 'C([H])([H])C([H])([H])C([H])([H])C([H])([H])[H])C([H]' - ')=C(C([H])=C%12C([H])=C%11[H])C%11([H])C([H])(Br)C([H' - '])(C%12=C([H])C(C([H])([H])C([H])([H])C([H])([H])C([H' - '])([H])[H])=C%13C([H])=C(Br)C([H])=C([H])C%13=C%12[H]' - ')C%12([H])C%13=C([H])C(C([H])([H])C([H])([H])C([H])([' - 'H])C([H])([H])[H])=C%14C([H])=C(C([H])=C([H])C%14=C%1' - '3[H])C%13([H])C([H])(Br)C([H])(C%14=C([H])C(C([H])([H' - '])C([H])([H])C([H])([H])C([H])([H])[H])=C%15C([H])=C(' - 'Br)C([H])=C([H])C%15=C%14[H])C%14([H])C%15=C([H])C%16' - '=C(C([H])([H])C([H])([H])C([H])([H])C([H])([H])[H])C(' - '[H])=C(C([H])=C%16C([H])=C%15[H])C%15([H])C([H])(Br)C' - '([H])(C%16=C([H])C(C([H])([H])C([H])([H])C([H])([H])C' - '([H])([H])[H])=C%17C([H])=C(Br)C([H])=C([H])C%17=C%16' - '[H])C([H])(C%16=C([H])C(C([H])([H])C([H])([H])C([H])(' - '[H])C([H])([H])[H])=C%17C([H])=C(Br)C([H])=C([H])C%17' - '=C%16[H])C([H])(C%16=C([H])C(C([H])([H])C([H])([H])C(' - '[H])([H])C([H])([H])[H])=C%17C([H])=C(Br)C([H])=C([H]' - ')C%17=C%16[H])C%15([H])C%15=C([H])C(C([H])([H])C([H])' - '([H])C([H])([H])C([H])([H])[H])=C%16C([H])=C(C([H])=C' - '([H])C%16=C%15[H])C%15([H])C%16([H])C%17=C([H])C%18=C' - '(C([H])([H])C([H])([H])C([H])([H])C([H])([H])[H])C([H' - '])=C(C([H])=C%18C([H])=C%17[H])C%14([H])C%13([H])C%13' - '=C([H])C(C([H])([H])C([H])([H])C([H])([H])C([H])([H])' - '[H])=C%14C([H])=C(C([H])=C([H])C%14=C%13[H])C%13([H])' - 'C%14([H])C%17=C([H])C%18=C(C([H])([H])C([H])([H])C([H' - '])([H])C([H])([H])[H])C([H])=C(C([H])=C%18C([H])=C%17' - '[H])C%12([H])C%11([H])C%11=C([H])C(C([H])([H])C([H])(' - '[H])C([H])([H])C([H])([H])[H])=C%12C([H])=C(C([H])=C(' - '[H])C%12=C%11[H])C%11([H])C([H])(C%12=C([H])C%17=C(C(' - '[H])([H])C([H])([H])C([H])([H])C([H])([H])[H])C([H])=' - 'C(C([H])=C%17C([H])=C%12[H])C9%10[H])C9([H])C%10=C([H' + ')C([H])(Br)C([H])(Br)C%10([H])C%11=C([H])C%12=C(C([H]' + ')([H])C([H])([H])C([H])([H])C([H])([H])[H])C([H])=C(C' + '([H])=C%12C([H])=C%11[H])C%11([H])C([H])(Br)C%12([H])' + 'C%13=C([H])C(C([H])([H])C([H])([H])C([H])([H])C([H])(' + '[H])[H])=C%14C([H])=C(C([H])=C([H])C%14=C%13[H])C%13(' + '[H])C([H])(Br)C%14([H])C%15=C([H])C%16=C(C([H])([H])C' + '([H])([H])C([H])([H])C([H])([H])[H])C([H])=C(C([H])=C' + '%16C([H])=C%15[H])C%15([H])C([H])(Br)C([H])(C%16=C([H' '])C(C([H])([H])C([H])([H])C([H])([H])C([H])([H])[H])=' - 'C%12C([H])=C(C([H])=C([H])C%12=C%10[H])C8([H])C7([H])' - 'C7=C([H])C(C([H])([H])C([H])([H])C([H])([H])C([H])([H' - '])[H])=C8C([H])=C(C([H])=C([H])C8=C7[H])C7([H])C8([H]' - ')C%10=C([H])C(C([H])([H])C([H])([H])C([H])([H])C([H])' - '([H])[H])=C%12C([H])=C(C([H])=C([H])C%12=C%10[H])C6([' - 'H])C5([H])C5=C([H])C(C([H])([H])C([H])([H])C([H])([H]' - ')C([H])([H])[H])=C6C([H])=C(C([H])=C([H])C6=C5[H])C5(' - '[H])C([H])(C6=C([H])C(C([H])([H])C([H])([H])C([H])([H' - '])C([H])([H])[H])=C%10C([H])=C(C([H])=C([H])C%10=C6[H' - '])C43[H])C([H])(Br)C([H])(C3=C([H])C(C([H])([H])C([H]' - ')([H])C([H])([H])C([H])([H])[H])=C4C([H])=C(Br)C([H])' - '=C([H])C4=C3[H])C3([H])C4=C([H])C(C([H])([H])C([H])([' - 'H])C([H])([H])C([H])([H])[H])=C6C([H])=C(C([H])=C([H]' - ')C6=C4[H])C4([H])C([H])(Br)C([H])(C6=C([H])C(C([H])([' - 'H])C([H])([H])C([H])([H])C([H])([H])[H])=C%10C([H])=C' - '(Br)C([H])=C([H])C%10=C6[H])C6([H])C%10=C([H])C%12=C(' - 'C([H])([H])C([H])([H])C([H])([H])C([H])([H])[H])C([H]' - ')=C(C([H])=C%12C([H])=C%10[H])C%10([H])C([H])(Br)C([H' - '])(C%12=C([H])C(C([H])([H])C([H])([H])C([H])([H])C([H' - '])([H])[H])=C%17C([H])=C(Br)C([H])=C([H])C%17=C%12[H]' - ')C([H])(C%12=C([H])C(C([H])([H])C([H])([H])C([H])([H]' - ')C([H])([H])[H])=C%17C([H])=C(Br)C([H])=C([H])C%17=C%' - '12[H])C%12([H])C%17=C([H])C%18=C(C([H])([H])C([H])([H' - '])C([H])([H])C([H])([H])[H])C([H])=C(C([H])=C%18C([H]' - ')=C%17[H])C%17([H])C%18([H])C%19=C([H])C(C([H])([H])C' - '([H])([H])C([H])([H])C([H])([H])[H])=C%20C([H])=C(C([' - 'H])=C([H])C%20=C%19[H])C%19([H])C%20([H])C%21=C([H])C' - '(C([H])([H])C([H])([H])C([H])([H])C([H])([H])[H])=C%2' - '2C([H])=C(C([H])=C([H])C%22=C%21[H])C([H])(C%14([H])C' - '%14=C([H])C%21=C(C([H])([H])C([H])([H])C([H])([H])C([' - 'H])([H])[H])C([H])=C(C([H])=C%21C([H])=C%14[H])C%11([' - 'H])C%11([H])C%14=C([H])C(C([H])([H])C([H])([H])C([H])' - '([H])C([H])([H])[H])=C%21C([H])=C(C([H])=C([H])C%21=C' - '%14[H])C%20([H])C%14([H])C%20=C([H])C%21=C(C([H])([H]' - ')C([H])([H])C([H])([H])C([H])([H])[H])C([H])=C(C([H])' - '=C%21C([H])=C%20[H])C([H])(C7([H])C7=C([H])C(C([H])([' - 'H])C([H])([H])C([H])([H])C([H])([H])[H])=C%20C([H])=C' - '(C([H])=C([H])C%20=C7[H])C9%11[H])C([H])(C7=C([H])C(C' - '([H])([H])C([H])([H])C([H])([H])C([H])([H])[H])=C9C([' - 'H])=C(C([H])=C([H])C9=C7[H])C4([H])C6([H])C4=C([H])C6' - '=C(C([H])([H])C([H])([H])C([H])([H])C([H])([H])[H])C(' - '[H])=C(C([H])=C6C([H])=C4[H])C%14([H])C%19([H])C4=C([' + 'C%17C([H])=C(Br)C([H])=C([H])C%17=C%16[H])C([H])(C%16' + '=C([H])C(C([H])([H])C([H])([H])C([H])([H])C([H])([H])' + '[H])=C%17C([H])=C(Br)C([H])=C([H])C%17=C%16[H])C([H])' + '(C%16=C([H])C(C([H])([H])C([H])([H])C([H])([H])C([H])' + '([H])[H])=C%17C([H])=C(Br)C([H])=C([H])C%17=C%16[H])C' + '%15([H])C%15=C([H])C(C([H])([H])C([H])([H])C([H])([H]' + ')C([H])([H])[H])=C%16C([H])=C(C([H])=C([H])C%16=C%15[' + 'H])C%15([H])C%16([H])C%17=C([H])C%18=C(C([H])([H])C([' + 'H])([H])C([H])([H])C([H])([H])[H])C([H])=C(C([H])=C%1' + '8C([H])=C%17[H])C%14([H])C([H])(C%14=C([H])C(C([H])([' + 'H])C([H])([H])C([H])([H])C([H])([H])[H])=C%17C([H])=C' + '(Br)C([H])=C([H])C%17=C%14[H])C%13([H])C%13=C([H])C(C' + '([H])([H])C([H])([H])C([H])([H])C([H])([H])[H])=C%14C' + '([H])=C(C([H])=C([H])C%14=C%13[H])C%13([H])C%14([H])C' + '%17=C([H])C%18=C(C([H])([H])C([H])([H])C([H])([H])C([' + 'H])([H])[H])C([H])=C(C([H])=C%18C([H])=C%17[H])C%12([' + 'H])C([H])(C%12=C([H])C(C([H])([H])C([H])([H])C([H])([' + 'H])C([H])([H])[H])=C%17C([H])=C(C([H])=C([H])C%17=C%1' + '2[H])C%12([H])C([H])(C%17=C([H])C%18=C(C([H])([H])C([' + 'H])([H])C([H])([H])C([H])([H])[H])C([H])=C(C([H])=C%1' + '8C([H])=C%17[H])C9([H])C%10([H])C9=C([H])C(C([H])([H]' + ')C([H])([H])C([H])([H])C([H])([H])[H])=C%10C([H])=C(B' + 'r)C([H])=C([H])C%10=C9[H])C9([H])C%10=C([H])C(C([H])(' + '[H])C([H])([H])C([H])([H])C([H])([H])[H])=C%17C([H])=' + 'C(C([H])=C([H])C%17=C%10[H])C8([H])C7([H])C7=C([H])C(' + 'C([H])([H])C([H])([H])C([H])([H])C([H])([H])[H])=C8C(' + '[H])=C(C([H])=C([H])C8=C7[H])C7([H])C8([H])C%10=C([H]' + ')C(C([H])([H])C([H])([H])C([H])([H])C([H])([H])[H])=C' + '%17C([H])=C(C([H])=C([H])C%17=C%10[H])C6([H])C5([H])C' + '5=C([H])C(C([H])([H])C([H])([H])C([H])([H])C([H])([H]' + ')[H])=C6C([H])=C(C([H])=C([H])C6=C5[H])C5([H])C([H])(' + 'C6=C([H])C(C([H])([H])C([H])([H])C([H])([H])C([H])([H' + '])[H])=C%10C([H])=C(C([H])=C([H])C%10=C6[H])C43[H])C(' + '[H])(Br)C([H])(C3=C([H])C(C([H])([H])C([H])([H])C([H]' + ')([H])C([H])([H])[H])=C4C([H])=C(Br)C([H])=C([H])C4=C' + '3[H])C3([H])C4=C([H])C(C([H])([H])C([H])([H])C([H])([' + 'H])C([H])([H])[H])=C6C([H])=C(C([H])=C([H])C6=C4[H])C' + '4([H])C([H])(Br)C([H])(C6=C([H])C(C([H])([H])C([H])([' + 'H])C([H])([H])C([H])([H])[H])=C%10C([H])=C(Br)C([H])=' + 'C([H])C%10=C6[H])C6([H])C%10=C([H])C%17=C(C([H])([H])' + 'C([H])([H])C([H])([H])C([H])([H])[H])C([H])=C(C([H])=' + 'C%17C([H])=C%10[H])C%10([H])C([H])(Br)C([H])(C%17=C([' 'H])C(C([H])([H])C([H])([H])C([H])([H])C([H])([H])[H])' - '=C6C([H])=C(C([H])=C([H])C6=C4[H])C%10%12[H])C8([H])C' - '4=C([H])C(C([H])([H])C([H])([H])C([H])([H])C([H])([H]' - ')[H])=C6C([H])=C(C([H])=C([H])C6=C4[H])C53[H])C3([H])' - 'C4=C([H])C(C([H])([H])C([H])([H])C([H])([H])C([H])([H' - '])[H])=C5C([H])=C(C([H])=C([H])C5=C4[H])C%18([H])C([H' - '])(C4=C([H])C(C([H])([H])C([H])([H])C([H])([H])C([H])' - '([H])[H])=C5C([H])=C(C([H])=C([H])C5=C4[H])C([H])(C%1' - '6([H])C4=C([H])C(C([H])([H])C([H])([H])C([H])([H])C([' - 'H])([H])[H])=C5C([H])=C(C([H])=C([H])C5=C4[H])C%133[H' - '])C([H])(C3=C([H])C(C([H])([H])C([H])([H])C([H])([H])' - 'C([H])([H])[H])=C4C([H])=C(Br)C([H])=C([H])C4=C3[H])C' - '%15([H])C3=C([H])C(C([H])([H])C([H])([H])C([H])([H])C' - '([H])([H])[H])=C4C([H])=C(Br)C([H])=C([H])C4=C3[H])C(' - '[H])(C3=C([H])C(C([H])([H])C([H])([H])C([H])([H])C([H' - '])([H])[H])=C4C([H])=C(Br)C([H])=C([H])C4=C3[H])C%17(' - '[H])C3=C([H])C(C([H])([H])C([H])([H])C([H])([H])C([H]' - ')([H])[H])=C4C([H])=C(Br)C([H])=C([H])C4=C3[H])=C([H]' + '=C%18C([H])=C(Br)C([H])=C([H])C%18=C%17[H])C([H])(C%1' + '7=C([H])C(C([H])([H])C([H])([H])C([H])([H])C([H])([H]' + ')[H])=C%18C([H])=C(Br)C([H])=C([H])C%18=C%17[H])C%17(' + '[H])C%18=C([H])C%19=C(C([H])([H])C([H])([H])C([H])([H' + '])C([H])([H])[H])C([H])=C(C([H])=C%19C([H])=C%18[H])C' + '%18([H])C%19([H])C%20=C([H])C(C([H])([H])C([H])([H])C' + '([H])([H])C([H])([H])[H])=C%21C([H])=C(C([H])=C([H])C' + '%21=C%20[H])C%20([H])C%21([H])C%22=C([H])C(C([H])([H]' + ')C([H])([H])C([H])([H])C([H])([H])[H])=C%23C([H])=C(C' + '([H])=C([H])C%23=C%22[H])C([H])(C%14([H])C%14=C([H])C' + '%22=C(C([H])([H])C([H])([H])C([H])([H])C([H])([H])[H]' + ')C([H])=C(C([H])=C%22C([H])=C%14[H])C%12([H])C%12([H]' + ')C%14=C([H])C(C([H])([H])C([H])([H])C([H])([H])C([H])' + '([H])[H])=C%22C([H])=C(C([H])=C([H])C%22=C%14[H])C%21' + '([H])C%14([H])C%21=C([H])C%22=C(C([H])([H])C([H])([H]' + ')C([H])([H])C([H])([H])[H])C([H])=C(C([H])=C%22C([H])' + '=C%21[H])C([H])(C7([H])C7=C([H])C(C([H])([H])C([H])([' + 'H])C([H])([H])C([H])([H])[H])=C%21C([H])=C(C([H])=C([' + 'H])C%21=C7[H])C9%12[H])C([H])(C7=C([H])C(C([H])([H])C' + '([H])([H])C([H])([H])C([H])([H])[H])=C9C([H])=C(C([H]' + ')=C([H])C9=C7[H])C4([H])C6([H])C4=C([H])C6=C(C([H])([' + 'H])C([H])([H])C([H])([H])C([H])([H])[H])C([H])=C(C([H' + '])=C6C([H])=C4[H])C%14([H])C%20([H])C4=C([H])C(C([H])' + '([H])C([H])([H])C([H])([H])C([H])([H])[H])=C6C([H])=C' + '(C([H])=C([H])C6=C4[H])C%10%17[H])C8([H])C4=C([H])C(C' + '([H])([H])C([H])([H])C([H])([H])C([H])([H])[H])=C6C([' + 'H])=C(C([H])=C([H])C6=C4[H])C53[H])C3([H])C4=C([H])C(' + 'C([H])([H])C([H])([H])C([H])([H])C([H])([H])[H])=C5C(' + '[H])=C(C([H])=C([H])C5=C4[H])C%19([H])C([H])(C4=C([H]' + ')C(C([H])([H])C([H])([H])C([H])([H])C([H])([H])[H])=C' + '5C([H])=C(C([H])=C([H])C5=C4[H])C([H])(C%16([H])C4=C(' + '[H])C(C([H])([H])C([H])([H])C([H])([H])C([H])([H])[H]' + ')=C5C([H])=C(C([H])=C([H])C5=C4[H])C%133[H])C([H])(C3' + '=C([H])C(C([H])([H])C([H])([H])C([H])([H])C([H])([H])' + '[H])=C4C([H])=C(Br)C([H])=C([H])C4=C3[H])C%15([H])C3=' + 'C([H])C(C([H])([H])C([H])([H])C([H])([H])C([H])([H])[' + 'H])=C4C([H])=C(Br)C([H])=C([H])C4=C3[H])C([H])(C3=C([' + 'H])C(C([H])([H])C([H])([H])C([H])([H])C([H])([H])[H])' + '=C4C([H])=C(Br)C([H])=C([H])C4=C3[H])C%18([H])C3=C([H' + '])C(C([H])([H])C([H])([H])C([H])([H])C([H])([H])[H])=' + 'C4C([H])=C(Br)C([H])=C([H])C4=C3[H])C%11([H])C3=C([H]' ')C(C([H])([H])C([H])([H])C([H])([H])C([H])([H])[H])=C' - '2C([H])=C1Br' + '4C([H])=C(Br)C([H])=C([H])C4=C3[H])=C([H])C(C([H])([H' + '])C([H])([H])C([H])([H])C([H])([H])[H])=C2C([H])=C1Br' ), ), # One placer atom linear BB. @@ -239,31 +237,31 @@ ), smiles=( '[H]C([H])(Br)C1([H])C([H])(Br)C2([H])C([H])([H])C3([H' - '])C([H])(C([H])([H])Br)C([H])(Br)C4([H])C([H])([H])C5' - '([H])C([H])(C([H])([H])Br)C([H])(Br)C6([H])C([H])([H]' - ')C7([H])C([H])(C([H])([H])Br)C([H])(Br)C([H])(Br)C8([' - 'H])C([H])([H])C9([H])C([H])(Br)C([H])(Br)C%10([H])C([' - 'H])([H])C%11([H])C([H])(Br)C([H])(Br)C%12([H])C([H])(' - '[H])C%13([H])C([H])(Br)C([H])(Br)C([H])(Br)C([H])(C([' - 'H])([H])Br)C%13([H])C([H])([H])C%13([H])C([H])(Br)C([' - 'H])(C([H])([H])Br)C%14([H])C([H])([H])C%15([H])C([H])' - '(Br)C([H])(C([H])([H])Br)C%16([H])C([H])([H])C%17([H]' - ')C([H])(Br)C([H])(C([H])([H])Br)C([H])(C([H])([H])Br)' - 'C%18([H])C([H])([H])C%19([H])C([H])(C([H])([H])Br)C([' - 'H])(C([H])([H])Br)C%20([H])C([H])([H])C%21([H])C([H])' - '(C([H])([H])Br)C([H])(C([H])([H])Br)C([H])(C([H])([H]' - ')C2([H])C([H])(C([H])([H])Br)C1([H])C([H])([H])Br)C1(' - '[H])C([H])([H])C3([H])C4([H])C([H])([H])C2([H])C3([H]' - ')C([H])([H])C5([H])C6([H])C([H])([H])C4([H])C([H])(C(' - '[H])([H])C87[H])C5([H])C([H])([H])C9([H])C%10([H])C([' + '])C([H])(Br)C4([H])C([H])([H])C5([H])C([H])(Br)C6([H]' + ')C([H])([H])C7([H])C([H])(Br)C([H])(Br)C8([H])C([H])(' + '[H])C9([H])C([H])(Br)C([H])(Br)C%10([H])C([H])([H])C%' + '11([H])C([H])(Br)C([H])(Br)C%12([H])C([H])([H])C%13([' + 'H])C([H])(Br)C([H])(Br)C([H])(Br)C([H])(C([H])([H])Br' + ')C%13([H])C([H])([H])C%13([H])C([H])(Br)C([H])(C([H])' + '([H])Br)C%14([H])C([H])([H])C%15([H])C([H])(Br)C([H])' + '(C([H])([H])Br)C%16([H])C([H])([H])C%17([H])C([H])(Br' + ')C([H])(C([H])([H])Br)C([H])(C([H])([H])Br)C%18([H])C' + '([H])([H])C%19([H])C([H])(C([H])([H])Br)C([H])(C([H])' + '([H])Br)C%20([H])C([H])([H])C%21([H])C([H])(C([H])([H' + '])Br)C([H])(C([H])([H])Br)C([H])(C([H])([H])C2([H])C(' + '[H])(C([H])([H])Br)C1([H])C([H])([H])Br)C1([H])C([H])' + '([H])C3([H])C([H])(C([H])([H])Br)C4([H])C([H])([H])C2' + '([H])C3([H])C([H])([H])C5([H])C([H])(C([H])([H])Br)C6' + '([H])C([H])([H])C4([H])C([H])(C([H])([H])C8([H])C7([H' + '])C([H])([H])Br)C5([H])C([H])([H])C9([H])C%10([H])C([' 'H])([H])C6([H])C7([H])C([H])([H])C%11([H])C%12([H])C(' '[H])([H])C%13([H])C%14([H])C([H])([H])C7([H])C7([H])C' '([H])([H])C%15([H])C%16([H])C([H])([H])C8([H])C([H])(' 'C([H])([H])C%17%18[H])C9([H])C([H])([H])C%19([H])C%20' '([H])C([H])([H])C([H])(C2([H])C([H])([H])C%211[H])C1(' - '[H])C([H])([H])C9([H])C2([H])C([H])([H])C([H])(C5([H]' - ')C([H])([H])C6([H])C7([H])C([H])([H])C82[H])C4([H])C(' - '[H])([H])C31[H]' + '[H])C([H])([H])C9([H])C2([H])C([H])([H])C([H])(C4([H]' + ')C([H])([H])C31[H])C5([H])C([H])([H])C6([H])C7([H])C(' + '[H])([H])C82[H]' ), ), # Two placer atom linear BB. @@ -288,29 +286,29 @@ '[H])(Br)C2([H])C([H])([H])C([H])([H])C3([H])C([H])(Br' ')C([H])(Br)C4([H])C([H])([H])C([H])([H])C5([H])C([H])' '(Br)C([H])(Br)C6([H])C([H])([H])C([H])([H])C7([H])C([' - 'H])(Br)C([H])(Br)C([H])(C([H])([H])C([H])([H])Br)C8([' - 'H])C([H])([H])C([H])([H])C9([H])C([H])(Br)C([H])(C([H' - '])([H])C([H])([H])Br)C%10([H])C([H])([H])C([H])([H])C' - '%11([H])C([H])(Br)C([H])(C([H])([H])C([H])([H])Br)C%1' - '2([H])C([H])([H])C([H])([H])C%13([H])C([H])(Br)C([H])' - '(C([H])([H])C([H])([H])Br)C([H])(C([H])([H])C([H])([H' - '])Br)C([H])(C([H])([H])C([H])([H])Br)C%13([H])C([H])(' - '[H])C([H])([H])C%13([H])C([H])(C([H])([H])C([H])([H])' - 'Br)C([H])(C([H])([H])C([H])([H])Br)C%14([H])C([H])([H' - '])C([H])([H])C%15([H])C([H])(C([H])([H])C([H])([H])Br' - ')C([H])(C([H])([H])C([H])([H])Br)C%16([H])C([H])([H])' - 'C([H])([H])C%17([H])C([H])(C([H])([H])C([H])([H])Br)C' - '([H])(C([H])([H])C([H])([H])Br)C([H])(Br)C%18([H])C([' - 'H])([H])C([H])([H])C%19([H])C([H])(C([H])([H])C([H])(' - '[H])Br)C([H])(Br)C%20([H])C([H])([H])C([H])([H])C%21(' - '[H])C([H])(C([H])([H])C([H])([H])Br)C([H])(Br)C([H])(' - 'C([H])([H])C([H])([H])C12[H])C1([H])C([H])([H])C([H])' - '([H])C3([H])C4([H])C([H])([H])C([H])([H])C2([H])C3([H' - '])C([H])([H])C([H])([H])C5([H])C6([H])C([H])([H])C([H' - '])([H])C4([H])C([H])(C([H])([H])C([H])([H])C78[H])C5(' - '[H])C([H])([H])C([H])([H])C9([H])C%10([H])C([H])([H])' - 'C([H])([H])C6([H])C7([H])C([H])([H])C([H])([H])C%11([' - 'H])C%12([H])C([H])([H])C([H])([H])C%13([H])C%14([H])C' + 'H])(Br)C([H])(Br)C8([H])C([H])([H])C([H])([H])C9([H])' + 'C([H])(Br)C%10([H])C([H])([H])C([H])([H])C%11([H])C([' + 'H])(Br)C%12([H])C([H])([H])C([H])([H])C%13([H])C([H])' + '(Br)C([H])(C([H])([H])C([H])([H])Br)C([H])(C([H])([H]' + ')C([H])([H])Br)C([H])(C([H])([H])C([H])([H])Br)C%13([' + 'H])C([H])([H])C([H])([H])C%13([H])C([H])(C([H])([H])C' + '([H])([H])Br)C([H])(C([H])([H])C([H])([H])Br)C%14([H]' + ')C([H])([H])C([H])([H])C%15([H])C([H])(C([H])([H])C([' + 'H])([H])Br)C([H])(C([H])([H])C([H])([H])Br)C%16([H])C' + '([H])([H])C([H])([H])C%17([H])C([H])(C([H])([H])C([H]' + ')([H])Br)C([H])(C([H])([H])C([H])([H])Br)C([H])(Br)C%' + '18([H])C([H])([H])C([H])([H])C%19([H])C([H])(C([H])([' + 'H])C([H])([H])Br)C([H])(Br)C%20([H])C([H])([H])C([H])' + '([H])C%21([H])C([H])(C([H])([H])C([H])([H])Br)C([H])(' + 'Br)C([H])(C([H])([H])C([H])([H])C12[H])C1([H])C([H])(' + '[H])C([H])([H])C3([H])C4([H])C([H])([H])C([H])([H])C2' + '([H])C3([H])C([H])([H])C([H])([H])C5([H])C6([H])C([H]' + ')([H])C([H])([H])C4([H])C([H])(C([H])([H])C([H])([H])' + 'C7([H])C8([H])C([H])([H])C([H])([H])Br)C5([H])C([H])(' + '[H])C([H])([H])C9([H])C([H])(C([H])([H])C([H])([H])Br' + ')C%10([H])C([H])([H])C([H])([H])C6([H])C7([H])C([H])(' + '[H])C([H])([H])C%11([H])C([H])(C([H])([H])C([H])([H])' + 'Br)C%12([H])C([H])([H])C([H])([H])C%13([H])C%14([H])C' '([H])([H])C([H])([H])C7([H])C7([H])C([H])([H])C([H])(' '[H])C%15([H])C%16([H])C([H])([H])C([H])([H])C8([H])C(' '[H])(C([H])([H])C([H])([H])C%18%17[H])C9([H])C([H])([' diff --git a/tests/molecular/molecules/molecule/fixtures/cof/honeycomb.py b/tests/molecular/molecules/molecule/fixtures/cof/honeycomb.py index 10e7722a7..d97c75880 100644 --- a/tests/molecular/molecules/molecule/fixtures/cof/honeycomb.py +++ b/tests/molecular/molecules/molecule/fixtures/cof/honeycomb.py @@ -62,7 +62,7 @@ '[C+2][C+]3C4=C([C+]=N4)[C+]4[C+2][C+](C5=C(N=[C+]5)[C' '+]5[C+2][C+](C6=C(Br)[C+]=N6)[C+](F)C6(N=[C+]C56[H])C' '5=C([C+]=N5)[C+]5[C+2][C+](C6=C([C+]7[C+2][C+](C8=C(B' - 'r)N=[C+]8)C8([H])[C+]=NC8(C8=C(Br)N=[C+]8)[C+]7F)[C+]' + 'r)[C+]=N8)C8([H])[C+]=NC8(C8=C(Br)[C+]=N8)[C+]7F)[C+]' '=N6)[C+](F)C6(N=[C+]C56[H])C5=C(N=[C+]5)[C+]5[C+2][C+' '](C6=C([C+]=N6)[C+]6[C+2][C+](Br)[C+](F)C7(N=[C+]C67[' 'H])C6=C(N=[C+]6)C6(N=[C+]C26[H])[C+]3F)C2([H])[C+]=NC' diff --git a/tests/molecular/molecules/molecule/fixtures/cof/kagome.py b/tests/molecular/molecules/molecule/fixtures/cof/kagome.py index 34a557895..454db12d6 100644 --- a/tests/molecular/molecules/molecule/fixtures/cof/kagome.py +++ b/tests/molecular/molecules/molecule/fixtures/cof/kagome.py @@ -27,21 +27,21 @@ ), smiles=( 'BrC1=C([C+]2[C+2][C+]3C4=C([C+]=N4)[C+]4[C+2][C+](C5=' - 'C([C+]=N5)C56[C+]=N[C+]5[C+](Br)[C+](Br)[C+2][C+]6C5=' - 'C(N=[C+]5)C35[C+]=N[C+]5[C+]2C2=C(Br)[C+]=N2)[C+]2C3=' - 'C(N=[C+]3)[C+]3[C+]5[C+2][C+]6C7=C([C+]=N7)[C+]7[C+2]' - '[C+](C8=C([C+]=N8)C89[C+]=N[C+]8[C+](Br)[C+](Br)[C+2]' - '[C+]9C8=C(N=[C+]8)C68[C+]=N[C+]38)[C+](Br)[C+]3N=[C+]' - 'C73C3=C([C+]=N3)[C+]3[C+2][C+]6C7=C(N=[C+]7)C78[C+]=N' - '[C+]7[C+](C7=C([C+]=N7)[C+]7[C+]9[C+2][C+](C%10=C(N=[' - 'C+]%10)[C+]%10[C+2][C+](C%11=C(Br)[C+]=N%11)[C+](C%11' - '=C(Br)[C+]=N%11)[C+]%11N=[C+]C%10%11C%10=C([C+]=N%10)' - '[C+]%10[C+2][C+](C%11=C(N=[C+]%11)C4%11[C+]=N[C+]2%11' - ')[C+](C2=C5N=[C+]2)[C+]2N=[C+]C%102C2=C9N=[C+]2)C2(C4' - '=C(Br)[C+]=N4)[C+]=N[C+]72)[C+](C2=C(Br)[C+]=N2)[C+2]' - '[C+]8C2=C([C+]=N2)[C+]2[C+2][C+](C4=C([C+]=N4)C64[C+]' - '=N[C+]4[C+]3Br)[C+](Br)[C+]3N=[C+]C23C2=C(Br)[C+]=N2)' - 'N=[C+]1' + 'C([C+]=N5)[C+]5[C+2][C+]6C7=C(N=[C+]7)C37[C+]=N[C+]7[' + 'C+]2C2=C([C+]=N2)[C+]2[C+]3[C+2][C+](C7=C(N=[C+]7)[C+' + ']7[C+2][C+](C8=C(Br)[C+]=N8)[C+](C8=C(Br)[C+]=N8)[C+]' + '8N=[C+]C78C7=C([C+]=N7)[C+]7[C+2][C+]8C9=C(N=[C+]9)C9' + '%10[C+]=N[C+]9[C+](C9=C(N=[C+]9)[C+]9[C+]([C+2][C+]%1' + '1C%12=C([C+]=N%12)[C+]%12[C+2][C+](C%13=C([C+]=N%13)C' + '%13%14[C+]=N[C+]%13[C+](Br)[C+](Br)[C+2][C+]%14C%13=C' + '(N=[C+]%13)C%11%13[C+]=N[C+]9%13)[C+](Br)[C+]9N=[C+]C' + '%129C9=C([C+]=N9)[C+]5[C+]5N=[C+]C65Br)C5=C([C+]=N5)[' + 'C+]8[C+]5N=[C+]C75C5=C3N=[C+]5)[C+]3[C+2][C+]%10C5=C(' + 'N=[C+]5)[C+]5[C+2][C+](C6=C(Br)[C+]=N6)[C+](C6=C(Br)[' + 'C+]=N6)[C+]6N=[C+]C56C5=C([C+]=N5)[C+]5[C+2][C+](Br)[' + 'C+](Br)[C+]6N=[C+]C56C5=C3N=[C+]5)C3(C5=C(Br)[C+]=N5)' + '[C+]=N[C+]23)[C+](Br)[C+]2N=[C+]C42C2=C(Br)[C+]=N2)N=' + '[C+]1' ), ), ), diff --git a/tests/molecular/molecules/molecule/fixtures/cof/periodic_hexagonal.py b/tests/molecular/molecules/molecule/fixtures/cof/periodic_hexagonal.py index cb0545817..2acc47621 100644 --- a/tests/molecular/molecules/molecule/fixtures/cof/periodic_hexagonal.py +++ b/tests/molecular/molecules/molecule/fixtures/cof/periodic_hexagonal.py @@ -64,35 +64,34 @@ ), ), smiles=( - '[C+]1=NC2=C1[C+]1[C+]3[C+]4C5=C(N=[C+]5)[C+]5[C+]6[C+' - ']7[C+]8[C+]9C%10=C(N=[C+]%10)[C+]%10[C+]%11C%12=C([C+' - ']=N%12)[C+]%12[C+]%13[C+]%14[C+]%15C%16=C(N=[C+]%16)[' - 'C+]%16[C+]%17C%18=C([C+]=N%18)[C+]%18[C+]([C+]%19[NH2' - '+][C+2]C%19([C+]%19[C+]%20C%21=C(N=[C+]%21)[C+]%21[C+' - ']%22C%23=C(N=[C+]%23)[C+]%23[C+]%24C%25=C([C+]=N%25)[' - 'C+]%25[C+]%26[C+]%27C%28=C([C+]=N%28)C%28%29OS[C+]%28' - '[C+]%28C%30=C(N=[C+]%30)[C+]([C+]%30[C+]%21N%21[C+]=N' - 'N%21[C+]%21[C+]%31C%32=C(N=[C+]%32)C%32%33[C+2][NH2+]' - '[C+]%32[C+]%32C%34=C(N=[C+]%34)[C+]%34[C+]([C+](C%35=' - 'C(N=[C+]%35)C5%35[C+2][NH2+][C+]9%35)[C+]5[C+]9[C+]%3' - '5SOC%35%34C%34=C(N=[C+]%34)[C+]%31[C+]%31C%34=C(N=[C+' - ']%34)C%34%35OS[C+]%34[C+]%34C%36=C(N=[C+]%36)[C+]([C+' - ']%17N%17N=[C+]N%17[C+]%31[C+]%17S[C+2]C%17%21N%17N=[C' - '+]N%17[C+]%18%20)[C+]%17SOC%17%18[C+]%16C%16=C([C+]=N' - '%16)[C+]%16[C+]%17C%20=C([C+]=N%20)C%20%21OS[C+]%20[C' - '+]%20C%31=C(N=[C+]%31)[C+]%31[C+]4N4[C+]=NN4[C+]([C+]' - '%24N4N=[C+]N4[C+]%20[C+]4[C+](C%20=C(N=[C+]%20)[C+]%3' - '4[C+]%20[C+]([C+]%35N%24N=[C+]N9%24)N9[C+]=NN9[C+]([C' - '+]%10N9N=[C+]N59)[C+](N5N=[C+]N5[C+]%27[C+](N5N=[C+]N' - '%205)C5([C+2][NH2+][C+]%255)N5N=[C+]N45)C4(OS[C+]%114' - ')N4[C+]=NN4[C+]%29[C+]([C+]4[C+]%28N5[C+]=NN5[C+]([C+' - '](C5=C([C+]=N5)[C+]([C+]%17C5=C(N=[C+]5)C%315[C+2][NH' - '2+][C+]15)[C+]1S[C+2]C1([C+]%16N1N=[C+]N%141)N1N=[C+]' - 'N41)[C+]2%32)[C+]%33N1N=[C+]N%301)N1[C+]=NN%131)[C+]%' - '21N1N=[C+]N1%18)[C+](N1N=[C+]N61)C1([C+2]S[C+]%231)N1' - '[C+]=NN%191)N1[C+]=NN31)C1(OS[C+]%221)N1N=[C+]N%261)N' - '1[C+]=NN71)N1[C+]=NN1[C+]%15C1([C+2]S[C+]%121)N1N=[C+' - ']N81' + '[C+]1=NC2=C1[C+]1[C+]3C4=C(N=[C+]4)[C+]4[C+]5[C+]6[C+' + ']7[C+]8C9=C(N=[C+]9)[C+]9[C+]%10C%11=C([C+]=N%11)[C+]' + '%11[C+]%12[C+]%13[C+]%14C%15=C(N=[C+]%15)[C+]%15[C+]%' + '16C%17=C([C+]=N%17)[C+]%17[C+]([C+]%18[NH2+][C+2]C%18' + '([C+]%18[C+]%19C%20=C(N=[C+]%20)C%20%21OS[C+]%20[C+]%' + '20C%22=C(N=[C+]%22)[C+]%22[C+]([C+]%23C%24=C([C+]=N%2' + '4)[C+]%24[C+]%25[C+]%26C%27=C([C+]=N%27)C%27%28OS[C+]' + '%27[C+]%27C%29=C(N=[C+]%29)[C+]([C+]%29[C+]%20N%20[C+' + ']=NN%20[C+]%20[C+]%30C%31=C(N=[C+]%31)[C+]%31[C+]2[C+' + ']2C%32=C(N=[C+]%32)[C+]%32[C+]%33[C+](C%34=C(N=[C+]%3' + '4)C4%34[C+2][NH2+][C+]8%34)[C+]4[C+]8[C+]%34SOC%34%32' + 'C%32=C(N=[C+]%32)[C+]%30[C+]%30C%32=C(N=[C+]%32)C%32%' + '34OS[C+]%32[C+]%32C%35=C(N=[C+]%35)[C+]([C+]%16N%16N=' + '[C+]N%16[C+]%30[C+]%16S[C+2]C%16%20N%16N=[C+]N%16[C+]' + '%17%19)[C+]%16SOC%16%17[C+]%15C%15=C([C+]=N%15)[C+]%1' + '5[C+]%16C%19=C([C+]=N%19)C%19%20OS[C+]%19[C+]%19C%30=' + 'C(N=[C+]%30)[C+]%30[C+]3N3[C+]=NN3[C+]([C+]%23N3N=[C+' + ']N3[C+]%19[C+]3[C+](C%19=C(N=[C+]%19)[C+]%32[C+]%19[C' + '+]([C+]%34N%23N=[C+]N8%23)N8[C+]=NN8[C+]([C+]9N8N=[C+' + ']N48)[C+](N4N=[C+]N4[C+]%26[C+](N4N=[C+]N%194)C4([C+2' + '][NH2+][C+]%244)N4N=[C+]N34)C3(OS[C+]%103)N3[C+]=NN3[' + 'C+]%28[C+]([C+]3[C+]%27N4[C+]=NN4[C+]([C+]%31C4=C([C+' + ']=N4)[C+]([C+]%16C4=C(N=[C+]4)C4([C+2][NH2+][C+]14)[C' + '+]%30N1N=[C+]N%331)[C+]1S[C+2]C1([C+]%15N1N=[C+]N%131' + ')N1N=[C+]N31)C1([C+2][NH2+][C+]21)N1N=[C+]N%291)N1[C+' + ']=NN%121)[C+]%20N1N=[C+]N1%17)C1([C+2]S[C+]%221)N1[C+' + ']=NN%181)[C+]%21N1N=[C+]N%251)N1N=[C+]N51)N1[C+]=NN61' + ')N1[C+]=NN1[C+]%14C1([C+2]S[C+]%111)N1N=[C+]N71' ), ), ), diff --git a/tests/molecular/molecules/molecule/fixtures/cof/periodic_kagome.py b/tests/molecular/molecules/molecule/fixtures/cof/periodic_kagome.py index 9e6944d94..1061b5c14 100644 --- a/tests/molecular/molecules/molecule/fixtures/cof/periodic_kagome.py +++ b/tests/molecular/molecules/molecule/fixtures/cof/periodic_kagome.py @@ -26,22 +26,22 @@ ), ), smiles=( - '[C+]1=NC2=C1[C+]1[C+]3[C+2][C+]4C5=C(N=[C+]5)C56[C+]=' - 'N[C+]5[C+]5C7=C([C+]=N7)[C+]7[C+]8[C+2][C+]9C%10=C(N=' - '[C+]%10)[C+]%10[C+2][C+]%11C%12=C([C+]=N%12)[C+]%12[C' - '+]%13[C+2][C+]%14C%15=C(N=[C+]%15)C%15%16[C+]=N[C+]%1' - '5[C+]%15C%17=C([C+]=N%17)[C+]%17[C+]%18[C+2][C+]%19C%' - '20=C(N=[C+]%20)[C+]%20[C+2][C+]2[C+]2C%21=C([C+]=N%21' - ')[C+]%21[C+]([C+2][C+](C%22=C(N=[C+]%22)[C+]%16[C+2][' - 'C+]%15C%15=C([C+]=N%15)[C+]%15[C+]([C+2][C+](C%16=C(N' - '=[C+]%16)C%10%16[C+]=N[C+]%16[C+]%11C%10=C([C+]=N%10)' - '[C+]%10[C+]([C+2][C+](C%11=C(N=[C+]%11)[C+]6[C+2][C+]' - '5C5=C([C+]=N5)[C+]5[C+]([C+2][C+](C6=C(N=[C+]6)C%206[' - 'C+]=N[C+]26)C2([C+]=N[C+]52)C2=C%18N=[C+]2)C2=C(N=[C+' - ']2)C92[C+]=N[C+]72)C2([C+]=N[C+]%102)C2=C%13[C+]=N2)C' - '2=C([C+]=N2)C42[C+]=N[C+]12)C1([C+]=N[C+]%151)C1=C8N=' - '[C+]1)C1=C(N=[C+]1)C%191[C+]=N[C+]%171)C1([C+]=N[C+]%' - '211)C1=C3[C+]=N1)C1=C([C+]=N1)C%141[C+]=N[C+]%121' + '[C+]1=NC2=C1[C+]1[C+2][C+]3C4=C(N=[C+]4)C45[C+]=N[C+]' + '4[C+]4C6=C([C+]=N6)[C+]6[C+]7[C+2][C+]8C9=C(N=[C+]9)[' + 'C+]9[C+2][C+]%10C%11=C([C+]=N%11)[C+]%11[C+]%12[C+2][' + 'C+]%13C%14=C(N=[C+]%14)C%14%15[C+]=N[C+]%14[C+]%14C%1' + '6=C([C+]=N%16)[C+]%16[C+]%17[C+2][C+]%18C%19=C(N=[C+]' + '%19)[C+]%19[C+2][C+]%20C%21=C([C+]=N%21)C3%21[C+]=N[C' + '+]%21[C+]1C1=C(N=[C+]1)C13[C+]=N[C+]1[C+]1C%21=C(N=[C' + '+]%21)[C+]%20[C+]%20N=[C+]C%19%20C%19=C([C+]=N%19)[C+' + ']%19[C+2][C+](C%20=C(N=[C+]%20)C8%20[C+]=N[C+]6%20)[C' + '+](C6=C(N=[C+]6)[C+]4[C+2][C+]5C4=C([C+]=N4)[C+]4[C+2' + '][C+]2[C+](C2=C(N=[C+]2)[C+]%10[C+]2N=[C+]C92C2=C([C+' + ']=N2)[C+]2[C+2][C+](C5=C(N=[C+]5)C%185[C+]=N[C+]%165)' + '[C+](C5=C(N=[C+]5)[C+]%14[C+2][C+]%15C5=C([C+]=N5)[C+' + ']3[C+2][C+]1C1=C([C+]=N1)C%131[C+]=N[C+]%111)[C+]1N=[' + 'C+]C21C1=C7N=[C+]1)[C+]1N=[C+]C41C1=C%12[C+]=N1)[C+]1' + 'N=[C+]C%191C1=C%17N=[C+]1' ), ), ), diff --git a/tests/molecular/molecules/molecule/fixtures/position_matrices/cof_hexagonal0.npy b/tests/molecular/molecules/molecule/fixtures/position_matrices/cof_hexagonal0.npy index a3d3214a357a501681c0219752b85656e385a554..25f2f01711c14d5604d39d8f5c63c2f4271d51bd 100644 GIT binary patch delta 1275 zcmZ9Kc`)2(7{}dNT?w^VtE?;QNL_1*RnmPNn_UF^bL*~Skq)9J>YBvFPa-KpMdat4 z)HEA3q?y(@656tEN@g6{N+g<2M$pKpRRoD-n_p6E#=oEEeV@SLVJmykx4xEVb~#554zA z)c^x{g!N_ITvJ`?%82KKM@P%qbr}P0Q&rw4BK74MYo3X~j0v6S`P3?{+`?!OS(UlF z2eaiFHkE1T$d967jBRWxVeIkdAz7ckM-2GNzWI#W%$8^1Jj~N*7>EYoPYq~Z^p zav?1)XGB9+_Fzc2$XlKvWoqVJ5g;o4P(b`b<87XXC;L&LK>o zec7qjqxIQ4|x5k_=@t_tI`VVC>G)F>Apoc}cC zL?>ptfT*oKG&fJm3TKUQaK2J%akSwU7lmW{#K%t7iB!|L;I&VzQ~g_f_#_uf_KEXS zbhRt*aiDCU_{PGw0jCwY(6mqdqisrOT%{+(sh%syI)qsek0>@_2$8IKtu={ARx$1D zttU&eBOvL0eQzbx8ML11x(G?vbATUDM&FN^g;-5)~_Q%NhODFX=bU8LrMatDa^7+dqNqk-RMKGjx?0Aa=I~$sCLk?IE^nJdz?kH1@STJXMG8N>E=@BAtrH_8 z^c4d7e;y}lFdadOvJsh@Bs2x&Bb%no76dvp>XkP#8DM1ICkkFL1JaX?z=U5AC@}h( zqdmibTz%UKLOTtdIJfJ=yATM}aa~}pI70IFOJ>5hCA=#2+zx0%K%}FfTAfaZ`CpSw z+SV+wah>0>W?g-~)7D*@LMJ!i+_kLeNn!y@`swBJy4E4xBLs{<ra;e@APv!S+-2tTAh zDzQQyn~!+1Af0rwAlvYfrmM~OXS#l!VL{{@U7r26L(|UrUUriY+>0u*4nOitUTC0u zMm6sbiKi!1e(;7AyYUWe^11w$LEdha-c5`nhzz}<&T`2Kll95hlgwEveWH-xHxlSK3>BEAzr-&F`Lnfe{PL3 zsEpwOA0ORV)z@NLl{Xk!oR5JtoIphgLfnk%YBsT^tO!7R{r%_kBUJ+_Tc=3s0%IVq zHJQ5Q9f^WtK+PLZ0~7=+ z3cr)uA4p4FfMWFE@3>q$SUQ(k-u4KE^go&l$n~yJUO7~4tK0?Dh(Tk?%EsqVp9ZvU z2CT16lo%aMwgL2Ar_182D164OUar{c4i_hn3QRSL`+v99xK&mzUh39gA-|k!FwIHW_m1 zA6IPNEAoY&tE3wgr+sj(aAKQRJqp-uMF-nxFSzF9^;?(u!@_j7jL_CPu+2fwbRbc5 f{E2=96x*DQj?In+*;4{zrVC%NJkT0NJGJRw?Hw&M diff --git a/tests/molecular/molecules/molecule/fixtures/position_matrices/cof_hexagonal1.npy b/tests/molecular/molecules/molecule/fixtures/position_matrices/cof_hexagonal1.npy index df9d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$>DCmitACyuoG7&eS1yRR?zbp+v~ji;j3%WKcDfo`g@O5pDZ!f!0Ebi4KU z-Plk_WvXd;JK=ywF1eJc>}CVv`@6DCj1vxcukW})Gj?*fylUO3=z*G`$~ zdt5;HVK&XyUO3>^>m}U-V_eW#XWe&0&kF~{TrQf-bl~E><@q~^8u818H_0$T6 zt^U++iF`T^c-rU6h{Nh&9;iyo&i_4EQ_j6%37p@$!??~T4#{vIEGj+^6$b}ZT;CKw^IN-FS3VoJgT%ajVIXv4+ z#{m~4YnS?XaDmY@_nP8bIu6(??&v~D<-*aV=_hR(UjG7aN{+qxO)?mwN*?{M(#H!2 z+~fK5{E%rdoawMCcOIhSfMb)HCD|UqAolyF$#yy&2iy_f5Zd33eej&1O=LAX4tQdH zPLXmk7mNh3?spm;2fSC1+QN%U-Z$>#LcZbnuEab#9QgTcPDwUC zdIxrL9U1-R>nT`y5+<-plR|d{l?xU==QJv%=r~~HzFA$oITr$NPREeF=|2G@@PB-! B6*&L^ diff --git a/tests/molecular/molecules/molecule/fixtures/position_matrices/cof_hexagonal2.npy b/tests/molecular/molecules/molecule/fixtures/position_matrices/cof_hexagonal2.npy index cdb998acf52814e6be950012753889836ce445c8..d7820fa7ec251cf95d0e46d589961f40d3a6b863 100644 GIT binary patch delta 69 zcmccMdck#r2b1{1zz_wcU@M0`bJJf2rP@01E!g;!rPF_NJkv~;$pY*W;sOqIUnva$nhqJY delta 89 zcmccMdck#r2b1{UW4+I}OtEr^eZ8&SRMf%2fV18+(<@+eJkv}TeVr#S`hIQobVyk; psd8Fipu@lV?_MJig{_o+yz3SXjW)1*n2Oqgy`qiQ`-zdEb> z(XVOK)<~hS}zfR{c1VGMcTJtvmX4^6&Hce4cx~pL;%?$2*VT z3oxXpLc{H7ynXPvBzhuD>I3FwH7|)dA+-`iB@weASyL>aGGa4iH-~x>eOSuD(Evnm4!~0#fUfX=RZ+U<9k7 zAcR+ zQJ>O|lA0PrAQg?An~*bsOlu0Sr)!Zlw;j_P3yu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Sm>(v(^z2jQ!w?f0XF@MIs`_W5q2Y51onY;mIk zT6jBK=Ncp=wn?(}PSFM&9w^mOx}`YsTpaoFI@;d~Xy6ywX_Rp!*6fZLQeMQNGr(EF zT@_Da%^%*-t>_g{JK3|$zA7QHjH-B{vm5RM#V=j=?&^*svBRG+guBvlugbwFyv0gifqkA|DQVx|tK1%5QT2|TvnF0Pm@WsnNs7u*FPft~kRo2J> zW^tVAn;Rc06&z07I;UsCX6UeyT__x6(2B0o#CZ%V4%7ZteP?Jgb|^1viUo<=S=;<9 zX;pL3j9ij@AkNr?5*w%}hIo?3ZG5%O$+wPAPcugt11@)?wHFY+3$ZFSt{rr)wU&bj8j={^G&L zucy4>PT5q>#yOwc!Qn;SHS^G&-f*XMT-Mt9T{LL&d#=d(S6}s-PR08>>_&@+xO!Q; z1G4@OkI~}c)UE?AIa&S~@!%9|J*}+T&*ADq)Obj1kl)O(+t0xnEgme+eG8o(=(YJc HcO@eLhZNl0 delta 532 zcmX>gbwFyv0gn2^7xShzUommmJk_yO@7NRj9n+P~W(oK?z{K}L#P@H9iVMl+KCToq zbLc%;^|UdL;ea%QP#Q@6hQvz>QrX51PZn6T*!4WxzvuUAACUOJ$bXH>nZ^z$^Z(u} z`}fp-?cy6@Ao0r|<(cBYsMb43z593g&Nf2_n8lkn?$ubaMcJWe8>a_vtdRrE;&1Ld zpSZItI6Syg9LoOF&>`3Bgg3|_>qlv?U)ZQR)U3HCsnTogu*zL83nczlp4(tafx3ej zmty(aH%1QSKbuQH;s$o}=C3{I>5zDmIV1V$ersC6We^w-XQ@jXAkPo0#we-zm}OkD9^sQrRB+$r}A zc3sPIb8v{eKINcygE!nM9hbGXeisdz{GKbaeuGPB{T$2-P~*Yk+_%u#fnJ-Bb5}9~0MexH8UO$Q diff --git a/tests/molecular/molecules/molecule/fixtures/position_matrices/cof_honeycomb1.npy b/tests/molecular/molecules/molecule/fixtures/position_matrices/cof_honeycomb1.npy index 28f5fb18a8f5de9d96ec7fd03b02ed82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c!Qn;SHS^G&-f*XMT-Mt9T{LL&d#=d(S6}s-PR08>>_&@+xO!Q; z1G4@OkI~}c)UE?AIa&S~@!%9|J*}+T&*ADq)Obj1kl)O(+t0xnEgme+eG8o(=(YJc HcO@eLhZNl0 delta 532 zcmX>gbwFyv0gn2^7xShzUommmJk_yO@7NRj9n+P~W(oK?z{K}L#P@H9iVMl+KCToq zbLc%;^|UdL;ea%QP#Q@6hQvz>QrX51PZn6T*!4WxzvuUAACUOJ$bXH>nZ^z$^Z(u} z`}fp-?cy6@Ao0r|<(cBYsMb43z593g&Nf2_n8lkn?$ubaMcJWe8>a_vtdRrE;&1Ld zpSZItI6Syg9LoOF&>`3Bgg3|_>qlv?U)ZQR)U3HCsnTogu*zL83nczlp4(tafx3ej zmty(aH%1QSKbuQH;s$o}=C3{I>5zDmIV1V$ersC6We^w-XQ@jXAkPo0#we-zm}OkD9^sQrRB+$r}A zc3sPIb8v{eKINcygE!nM9hbGXeisdz{GKbaeuGPB{T$2-P~*Yk+_%u#fnJ-Bb5}9~0MexH8UO$Q diff --git a/tests/molecular/molecules/molecule/fixtures/position_matrices/cof_kagome0.npy b/tests/molecular/molecules/molecule/fixtures/position_matrices/cof_kagome0.npy index 8a053cbccfb5515b1fac48c00b16d633945bd6f7..a3588035fa237ee65cb8dcbdeb8c6d296d311bf4 100644 GIT binary patch delta 305 zcmcbhenEXh1E;tc_g9XG{Sgj+oXbU*9&mG*SrGI`quyt7J!j(PADkx`>+?FNd^sj( z>JU2TMySnNM+a8lE_vGtz7Erkn^EKBAo{Z310=pEap^4fTvLaI?n`WU#W^`la=#V? z5|?#t?R-<{U$N2n;Hmr#PfeY59@Y@IHaDPaLnjQAlwm2 z@%G`#Q6Ua{GCHc+f`c4R9lBfqGF0I#_jZZ9Ar6g?&iH2?3Us&{wNL;geq}}Ed6vT= f4*k0(2QMxSbO`(~Qwk(rurfAMRWxRDyl^1^@H2gk delta 304 zcmcbhenEXh1Lx!!oC#vT<5oOZ-W}mEx&K?-;k_;n&fY#OmOD0o<2=P!-{Trhp5F4b4 z&y@+d=_RdpW1z;m-b&qB6(*6EMZqb7tngioC)@pVQZ+!6m(1&vhPWck-khWI!rX*Vs+z|^`>q)q84{^AZC-L2uD+ulgKmGeR?H+_U7`X4KbU6|T RcSOO;*hp2;n91?Ng#ebuf1v;X diff --git a/tests/molecular/molecules/molecule/fixtures/position_matrices/cof_periodic_hexagonal0.npy b/tests/molecular/molecules/molecule/fixtures/position_matrices/cof_periodic_hexagonal0.npy index e29ac1b48489207f5178af65db990a849448eef3..8feb54be6b8691273561d0ffecb882b8894bdcb6 100644 GIT binary patch delta 1028 zcmZp0XmHq|!6w;l{HK2D--q_)Gj*Q3?+A1-Kf$fHuiejK`ea8o@%p)EUYwaOb;_RM zoaPshtglP@lK1w04mQ?CIWiBw*n74+{RD}J#^mh$Ssvu@^wRu#!-bFGrgckaXB>+O za`*@l-w(6pif?4;ZH^#^+@ry7H$30E|AbxRXOKCX#oV#)m4Y06SC;&DzWkBZekt$F zACvE}rNro+mr6cd7VW?-<>mDu$-gJSwjyQ*f8WU}7 zf?eSjd}mgz6~7hdaN1Q~@rp4*-2Fxa&(b4t4i3?mj_|j*z%6)XF8us$Nu0yp@}nX9 z7P>$z*u!z8-a|Emq4c0wk_5WrdK;q)>+pG}F?QG_oYqLV>0|JN{+Z2``Ca^DjibS_R3Uv|jhn~9$bm`n zYh+%gqC+5;&dSnFfet%(mN0)UHFl6yKD03SnUaI>y|4Z$y8<2BWsBT}ZW=q(N$6hS z*lMWiVB)@JN%-DC2Y(UEXBO{`9I}3Xvq<@=?(nPM>8Ib8K!=4Q46HMX4IQ5D&QjR& LS$(s=@J1d0Rv^o= delta 1021 zcmZ9LeNfAB9LJg4qO>0Greu1)A*q%MX>UC!r&_-;W!Te{8T&Ewh9PzcAO!W~_8 z#f8$tg=)I;l&&LmI}LT@DX!g#Qb@ygZvVc%_kF!T_x{``0~x4b(cE&_Khz~ZdpJ7_ z0^Y^f5eUC;7ucAUjC}1P8bf`!?R{IGdn;#L`-}n8Yf`MNxSx}Z1q(vt9z6q`C0Wtm zOB*21TCvRd<$B9xJ>HlNF4E#|%4T@x=Rig2j(2&FqT4u3|kpV*@IWV~^I zG&ce=>b|TU^w*ZEC%^2if8HB`q`zFZw(%i8w0SYTWA>ZJtzmc#ITde{#ze0RHm26Z~n5~D-aO?Uplow4jaX5XGl1#r&j@qe9V)zhN zIXO5?Q0uw&j+vceD1Cw*o2R5$mQ?cLz)|n-(Qva@%+%quz>h{ZfyeecrYoDx67X}dh>i`coMhr~2O_?IJ5>Ci z*i6P}zQzuvGjqN>pP6fKY2@z@Qtuj@X#MMqv4f=43zpropY07>>mxzp&(=-4y+uyV zp`z^Z-6!7+9bo1!_~PXs)TM0epr@y*$0}>&0JC64S83ur1{H^Cf2+PTG#NXTmo>$L z46?Jf`B~Dc=Aaq5B>6y`u>()%vGmC@oJV5JG%c9#J+^n4!27Kvoz)v|gRqat-ZeAr z9I{`E%`KPkhFc&#UGvzbD|Qa@7Y{amJ>?CzU{g68=X`DlhZl9%%tLp2LoBf2N{M;( zRj=t(yuZV4v>=MBm$f?}>+kRwEr^_At*4b$`#D@)h#Ev`4f2~AcKbOvBL&gsKU^)0 E0D1zU4FCWD delta 396 zcmZpWY>?cLz)^qrV&2r|D<%$`r#hDE9eZNGW4f~0ECD|UnD}0Z`2Ous@ePTW6r{3^ z9iA+(XtC>gw13a<)jlBg|04f2DrXuyoXr1wuk7Db`?ZU2gn`5_f0Sp6|Dx(3_3q!{ zJKGE$VCHY$xL0Gv7G+z9o^6~Sys<_OFbk|7rM-S(qv}wz=9;8Rud%}_cfBl-L2u=` z4VDzBJBV>9malzd!`xM8S6*Ld=P*l` zb5*s4H{61!PD|X!9Sg7DfPr7PBk> diff --git a/tests/molecular/molecules/molecule/fixtures/position_matrices/cof_periodic_kagome0.npy b/tests/molecular/molecules/molecule/fixtures/position_matrices/cof_periodic_kagome0.npy index fb610af0af68c90e554cabf3fa43bb515e622072..4735c80ae416d1cda4ea3b982c1f081737c28232 100644 GIT binary patch delta 201 zcmZorZBSjn9h28N<;yWSQ-{zwH$rXJIy$iWcFEgL@O7AO9OsmH!`MNq-m7rQ8Ak^e zsQ9r5?^v|;OdJ-cPCuJbg5ateYALx8eD}pNDljLmX1iPB>=tBoJ+_#4~T*{O9Zp#$} cx4}>U{!P0FAr1!aJ1Sj{1cGgtEF+Wx00V|oR{#J2 From f7ef4b2aa0a70e87bc7689b6a8eac6a433828b5c Mon Sep 17 00:00:00 2001 From: Andrew Tarzia Date: Wed, 17 Mar 2021 15:21:45 +0000 Subject: [PATCH 07/44] Update docs. --- src/stk/molecular/topology_graphs/cof/cof.py | 15 ++++++++++++++- .../topology_graphs/cof/periodic_hexagonal.py | 2 +- .../topology_graphs/cof/periodic_honeycomb.py | 2 +- .../topology_graphs/cof/periodic_kagome.py | 2 +- .../cof/periodic_linkerless_honeycomb.py | 2 +- .../topology_graphs/cof/periodic_square.py | 2 +- .../optimizers/periodic_collapser.py | 18 +++++++++++++++++- 7 files changed, 36 insertions(+), 7 deletions(-) diff --git a/src/stk/molecular/topology_graphs/cof/cof.py b/src/stk/molecular/topology_graphs/cof/cof.py index 22fd33279..c89703cab 100644 --- a/src/stk/molecular/topology_graphs/cof/cof.py +++ b/src/stk/molecular/topology_graphs/cof/cof.py @@ -95,10 +95,12 @@ class Cof(TopologyGraph): For :class:`.Cof` topologies, it is recommend to use the :class:`.Collapser` optimizer if using the nonperiodic form. - However, no optimizer is valid for periodic systems currently. + For periodic systems, the :class:`PeriodicCollapser` is + recommended. .. code-block:: python + # Nonperiodic. cof = stk.ConstructedMolecule( topology_graph=stk.cof.Honeycomb( building_blocks=(bb1, bb2), @@ -109,6 +111,17 @@ class Cof(TopologyGraph): ), ) + # Periodic. + cof = stk.ConstructedMolecule( + topology_graph=stk.cof.PeriodicHoneycomb( + building_blocks=(bb1, bb2), + lattice_size=(3, 3, 1), + # Setting scale_steps to False tends to lead to a + # better structure. + optimizer=stk.PeriodicCollapser(scale_steps=False), + ), + ) + *Accessing the Periodic Unit Cell* The same :class:`.Cof` instance can be built as a periodic diff --git a/src/stk/molecular/topology_graphs/cof/periodic_hexagonal.py b/src/stk/molecular/topology_graphs/cof/periodic_hexagonal.py index 900858192..ee4039ed2 100644 --- a/src/stk/molecular/topology_graphs/cof/periodic_hexagonal.py +++ b/src/stk/molecular/topology_graphs/cof/periodic_hexagonal.py @@ -29,7 +29,7 @@ class PeriodicHexagonal(Cof): | 6-functional groups: 0 to 3 | 2-functional groups: 4 to 15 - Note that :class:`.Optimizer` does not optimize the + Note that only :class:`.PeriodicCollapser` optimizes the :class:`.PeriodicInfo`. See :class:`.Cof` for more details and examples. diff --git a/src/stk/molecular/topology_graphs/cof/periodic_honeycomb.py b/src/stk/molecular/topology_graphs/cof/periodic_honeycomb.py index 09cfd540e..5ea568f3d 100644 --- a/src/stk/molecular/topology_graphs/cof/periodic_honeycomb.py +++ b/src/stk/molecular/topology_graphs/cof/periodic_honeycomb.py @@ -28,7 +28,7 @@ class PeriodicHoneycomb(Cof): | 3-functional groups: 0 to 1 | 2-functional groups: 2 to 4 - Note that :class:`.Optimizer` does not optimize the + Note that only :class:`.PeriodicCollapser` optimizes the :class:`.PeriodicInfo`. See :class:`.Cof` for more details and examples. diff --git a/src/stk/molecular/topology_graphs/cof/periodic_kagome.py b/src/stk/molecular/topology_graphs/cof/periodic_kagome.py index 805181473..700e83dd8 100644 --- a/src/stk/molecular/topology_graphs/cof/periodic_kagome.py +++ b/src/stk/molecular/topology_graphs/cof/periodic_kagome.py @@ -28,7 +28,7 @@ class PeriodicKagome(Cof): | 4-functional groups: 0 to 2 | 2-functional groups: 3 to 8 - Note that :class:`.Optimizer` does not optimize the + Note that only :class:`.PeriodicCollapser` optimizes the :class:`.PeriodicInfo`. See :class:`.Cof` for more details and examples. diff --git a/src/stk/molecular/topology_graphs/cof/periodic_linkerless_honeycomb.py b/src/stk/molecular/topology_graphs/cof/periodic_linkerless_honeycomb.py index aa433965a..8348827b3 100644 --- a/src/stk/molecular/topology_graphs/cof/periodic_linkerless_honeycomb.py +++ b/src/stk/molecular/topology_graphs/cof/periodic_linkerless_honeycomb.py @@ -27,7 +27,7 @@ class PeriodicLinkerlessHoneycomb(Cof): | 3-functional groups: 0 to 1 - Note that :class:`.Optimizer` does not optimize the + Note that only :class:`.PeriodicCollapser` optimizes the :class:`.PeriodicInfo`. See :class:`.Cof` for more details and examples. diff --git a/src/stk/molecular/topology_graphs/cof/periodic_square.py b/src/stk/molecular/topology_graphs/cof/periodic_square.py index d20c18377..f06de7a7f 100644 --- a/src/stk/molecular/topology_graphs/cof/periodic_square.py +++ b/src/stk/molecular/topology_graphs/cof/periodic_square.py @@ -28,7 +28,7 @@ class PeriodicSquare(Cof): | 4-functional groups: 0 | 2-functional groups: 1 to 2 - Note that :class:`.Optimizer` does not optimize the + Note that only :class:`.PeriodicCollapser` optimizes the :class:`.PeriodicInfo`. See :class:`.Cof` for more details and examples. diff --git a/src/stk/molecular/topology_graphs/topology_graph/optimizers/periodic_collapser.py b/src/stk/molecular/topology_graphs/topology_graph/optimizers/periodic_collapser.py index b0aaf4425..fc5e26a58 100644 --- a/src/stk/molecular/topology_graphs/topology_graph/optimizers/periodic_collapser.py +++ b/src/stk/molecular/topology_graphs/topology_graph/optimizers/periodic_collapser.py @@ -24,7 +24,23 @@ class PeriodicCollapser(Collapser): .. code-block:: python - FILL IN WITH TESTING.py + import stk + + bb1 = stk.BuildingBlock('BrCCBr', [stk.BromoFactory()]) + bb2 = stk.BuildingBlock('BrCC(CBr)CBr', [stk.BromoFactory()]) + + topology_graph = stk.cof.PeriodicHoneycomb( + building_blocks=(bb1, bb2), + lattice_size=(1, 2, 3), + optimizer=stk.PeriodicCollapser(scale_steps=False), + ) + cof = stk.ConstructedMolecule(topology_graph) + periodic_info = topology_graph.get_periodic_info() + stk.PdbWriter().write( + molecule=cof, + path='temp.pdb', + periodic_info=periodic_info, + ) Optimisation with :mod:`stk` simply collects the final position matrix and periodic info. The optimisation's trajectory can be From a62cc1922b764a05fc54ede453b1055794d92273 Mon Sep 17 00:00:00 2001 From: Andrew Tarzia Date: Wed, 17 Mar 2021 15:30:57 +0000 Subject: [PATCH 08/44] Update docs. --- .../construction_state/construction_state.py | 16 ++++++++-------- .../construction_state/graph_state.py | 16 +++++++++------- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/src/stk/molecular/topology_graphs/topology_graph/construction_state/construction_state.py b/src/stk/molecular/topology_graphs/topology_graph/construction_state/construction_state.py index ce088e7bf..9f9221580 100644 --- a/src/stk/molecular/topology_graphs/topology_graph/construction_state/construction_state.py +++ b/src/stk/molecular/topology_graphs/topology_graph/construction_state/construction_state.py @@ -129,12 +129,12 @@ def with_placement_results( def get_lattice_constants(self): """ - Get the building block to be placed on a given vertex. + Get the lattice constants of the state. Returns ------- - :class:`.BuildingBlock` - The building block. + :class:`tuple` of :class:`numpy.ndarray` + The lattice constants. """ @@ -313,18 +313,18 @@ def _with_lattice_constants(self, lattice_constants): def with_lattice_constants(self, lattice_constants): """ - Return a clone holding the `position_matrix`. + Return a clone holding the `lattice_constants`. Parameters ---------- - position_matrix : :class:`numpy.ndarray` - The position matrix of the clone. The shape of the matrix - is ``(n, 3)``. + lattice_constants : :class:`tuple` of :class:`numpy.ndarray` + The lattice constants of the clone. Requires 3 arrays of + size``(3, )``. Returns ------- :class:`.ConstructionState` - The clone holding the new position matrix. Has the same + The clone holding the new lattice constants. Has the same type as the original instance. """ diff --git a/src/stk/molecular/topology_graphs/topology_graph/construction_state/graph_state.py b/src/stk/molecular/topology_graphs/topology_graph/construction_state/graph_state.py index a4c1dad85..484607d9b 100644 --- a/src/stk/molecular/topology_graphs/topology_graph/construction_state/graph_state.py +++ b/src/stk/molecular/topology_graphs/topology_graph/construction_state/graph_state.py @@ -246,12 +246,12 @@ def get_num_edges(self): def get_lattice_constants(self): """ - Get the number of edges in the topology graph. + Get the lattice constants of the state. Returns ------- - :class:`int` - The number of edges. + :class:`tuple` of :class:`numpy.ndarray` + The lattice constants. """ @@ -315,17 +315,19 @@ def _with_lattice_constants(self, lattice_constants): def with_lattice_constants(self, lattice_constants): """ - Returns a clone holding `vertices`. + Return a clone holding the `lattice_constants`. Parameters ---------- - vertices : :class:`iterable` of :class:`.Vertex` - The vertices the clone should hold. + lattice_constants : :class:`tuple` of :class:`numpy.ndarray` + The lattice constants of the clone. Requires 3 arrays of + size``(3, )``. Returns ------- :class:`._GraphState` - The clone. Has the same type as the original instance. + The clone holding the new lattice constants. Has the same + type as the original instance. """ From c077d4e9ebd44fd4f60fed89d137ce7e49e6c997 Mon Sep 17 00:00:00 2001 From: Lukas Turcani Date: Tue, 20 Apr 2021 20:50:01 +0100 Subject: [PATCH 09/44] Remove redundant methods. --- src/stk/molecular/periodic_info.py | 48 ------------------------------ 1 file changed, 48 deletions(-) diff --git a/src/stk/molecular/periodic_info.py b/src/stk/molecular/periodic_info.py index 12c6042ba..9e4825a21 100644 --- a/src/stk/molecular/periodic_info.py +++ b/src/stk/molecular/periodic_info.py @@ -94,54 +94,6 @@ def clone(self): ) return clone - @classmethod - def _update_periodic_info(cls, vector_1, vector_2, vector_3): - """ - Return clone of :class:`.UnitCell` with new parameters. - - """ - - clone = cls.__new__(cls) - PeriodicInfo.__init__( - self=clone, - vector_1=vector_1, - vector_2=vector_2, - vector_3=vector_3, - ) - - return clone - - def with_cell_from_vectors(self, vector_1, vector_2, vector_3): - """ - Update cell. - - Parameters - ---------- - vector_1 : :class:`numpy.ndarray` - First cell lattice vector of shape (3, ) in - Angstrom. - - vector_2 : :class:`numpy.ndarray` - Second cell lattice vector of shape (3, ) in - Angstrom. - - vector_3 : :class:`numpy.ndarray` - Third cell lattice vector of shape (3, ) in - Angstrom. - - Returns - ------- - :class:`.UnitCell` - Clone with updated cell parameters. - - """ - - return self.__class__._update_periodic_info( - vector_1=vector_1, - vector_2=vector_2, - vector_3=vector_3, - ) - def get_vector_1(self): """ Get *x* vector. From 51cec1d3d925923ee700cb89e6cd96bef1bdd072 Mon Sep 17 00:00:00 2001 From: Lukas Turcani Date: Tue, 20 Apr 2021 20:52:31 +0100 Subject: [PATCH 10/44] Remove lattice constant changes --- src/stk/molecular/topology_graphs/cof/cof.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/stk/molecular/topology_graphs/cof/cof.py b/src/stk/molecular/topology_graphs/cof/cof.py index c89703cab..fc83475a1 100644 --- a/src/stk/molecular/topology_graphs/cof/cof.py +++ b/src/stk/molecular/topology_graphs/cof/cof.py @@ -95,7 +95,7 @@ class Cof(TopologyGraph): For :class:`.Cof` topologies, it is recommend to use the :class:`.Collapser` optimizer if using the nonperiodic form. - For periodic systems, the :class:`PeriodicCollapser` is + For periodic systems, the :class:`.PeriodicCollapser` is recommended. .. code-block:: python @@ -328,11 +328,6 @@ def __init__( edges = self._get_edges(lattice) vertices = self._get_vertices(lattice) - self._lattice_constants = tuple( - self._get_lattice_constants()[i]*self._lattice_size[i] - for i in range(3) - ) - if isinstance(building_blocks, dict): for building_block in building_blocks: assert ( From cc72065e8946a46e3aee4849a8852f27bea05d12 Mon Sep 17 00:00:00 2001 From: Lukas Turcani Date: Tue, 20 Apr 2021 21:08:13 +0100 Subject: [PATCH 11/44] Fix up final things --- .../topology_graphs/cof/periodic_hexagonal.py | 11 +-------- .../topology_graphs/cof/periodic_honeycomb.py | 23 ++++++++----------- .../topology_graphs/cof/periodic_kagome.py | 23 ++++++++----------- .../cof/periodic_linkerless_honeycomb.py | 23 ++++++++----------- .../topology_graphs/cof/periodic_square.py | 23 ++++++++----------- .../construction_state/graph_state.py | 17 ++++++++++---- .../optimizers/periodic_collapser.py | 2 +- 7 files changed, 55 insertions(+), 67 deletions(-) diff --git a/src/stk/molecular/topology_graphs/cof/periodic_hexagonal.py b/src/stk/molecular/topology_graphs/cof/periodic_hexagonal.py index ee4039ed2..3658aeb62 100644 --- a/src/stk/molecular/topology_graphs/cof/periodic_hexagonal.py +++ b/src/stk/molecular/topology_graphs/cof/periodic_hexagonal.py @@ -9,7 +9,7 @@ from ...reactions import GenericReactionFactory from .cof import Cof from .vertices import _LinearCofVertex, _NonLinearCofVertex -from ..topology_graph import Edge, NullOptimizer, ConstructionResult +from ..topology_graph import Edge, NullOptimizer from ...periodic_info import PeriodicInfo @@ -148,15 +148,6 @@ def get_periodic_info(self): ), ) - def construct(self): - - state = self._get_construction_state() - state = self._place_building_blocks(state) - state = self._run_reactions(state) - state = self._optimizer.optimize(state) - self._lattice_constants = state.get_lattice_constants() - return ConstructionResult(state) - _lattice_constants = _a, _b, _c = ( np.array([1., 0., 0.]), np.array([0.5, 0.866, 0]), diff --git a/src/stk/molecular/topology_graphs/cof/periodic_honeycomb.py b/src/stk/molecular/topology_graphs/cof/periodic_honeycomb.py index 5ea568f3d..32dbecd88 100644 --- a/src/stk/molecular/topology_graphs/cof/periodic_honeycomb.py +++ b/src/stk/molecular/topology_graphs/cof/periodic_honeycomb.py @@ -8,7 +8,7 @@ from ...reactions import GenericReactionFactory from .cof import Cof from .vertices import _LinearCofVertex, _NonLinearCofVertex -from ..topology_graph import Edge, NullOptimizer, ConstructionResult +from ..topology_graph import Edge, NullOptimizer from ...periodic_info import PeriodicInfo @@ -136,20 +136,17 @@ def get_periodic_info(self): lattice_constants = self._get_lattice_constants() return PeriodicInfo( - vector_1=lattice_constants[0], - vector_2=lattice_constants[1], - vector_3=lattice_constants[2], + vector_1=( + lattice_constants[0]*self._lattice_size[0]*self._scale + ), + vector_2=( + lattice_constants[1]*self._lattice_size[1]*self._scale + ), + vector_3=( + lattice_constants[2]*self._lattice_size[2]*self._scale + ), ) - def construct(self): - - state = self._get_construction_state() - state = self._place_building_blocks(state) - state = self._run_reactions(state) - state = self._optimizer.optimize(state) - self._lattice_constants = state.get_lattice_constants() - return ConstructionResult(state) - _lattice_constants = _a, _b, _c = ( np.array([1., 0., 0.]), np.array([0.5, 0.866, 0]), diff --git a/src/stk/molecular/topology_graphs/cof/periodic_kagome.py b/src/stk/molecular/topology_graphs/cof/periodic_kagome.py index 700e83dd8..7c449bf77 100644 --- a/src/stk/molecular/topology_graphs/cof/periodic_kagome.py +++ b/src/stk/molecular/topology_graphs/cof/periodic_kagome.py @@ -8,7 +8,7 @@ from ...reactions import GenericReactionFactory from .cof import Cof from .vertices import _LinearCofVertex, _NonLinearCofVertex -from ..topology_graph import Edge, NullOptimizer, ConstructionResult +from ..topology_graph import Edge, NullOptimizer from ...periodic_info import PeriodicInfo @@ -136,20 +136,17 @@ def get_periodic_info(self): lattice_constants = self._get_lattice_constants() return PeriodicInfo( - vector_1=lattice_constants[0], - vector_2=lattice_constants[1], - vector_3=lattice_constants[2], + vector_1=( + lattice_constants[0]*self._lattice_size[0]*self._scale + ), + vector_2=( + lattice_constants[1]*self._lattice_size[1]*self._scale + ), + vector_3=( + lattice_constants[2]*self._lattice_size[2]*self._scale + ), ) - def construct(self): - - state = self._get_construction_state() - state = self._place_building_blocks(state) - state = self._run_reactions(state) - state = self._optimizer.optimize(state) - self._lattice_constants = state.get_lattice_constants() - return ConstructionResult(state) - _lattice_constants = _a, _b, _c = ( np.array([1., 0., 0.]), np.array([0.5, 0.866, 0.]), diff --git a/src/stk/molecular/topology_graphs/cof/periodic_linkerless_honeycomb.py b/src/stk/molecular/topology_graphs/cof/periodic_linkerless_honeycomb.py index 8348827b3..9fe3261c8 100644 --- a/src/stk/molecular/topology_graphs/cof/periodic_linkerless_honeycomb.py +++ b/src/stk/molecular/topology_graphs/cof/periodic_linkerless_honeycomb.py @@ -8,7 +8,7 @@ from ...reactions import GenericReactionFactory from .cof import Cof from .vertices import _NonLinearCofVertex -from ..topology_graph import Edge, NullOptimizer, ConstructionResult +from ..topology_graph import Edge, NullOptimizer from ...periodic_info import PeriodicInfo @@ -135,20 +135,17 @@ def get_periodic_info(self): lattice_constants = self._get_lattice_constants() return PeriodicInfo( - vector_1=lattice_constants[0], - vector_2=lattice_constants[1], - vector_3=lattice_constants[2], + vector_1=( + lattice_constants[0]*self._lattice_size[0]*self._scale + ), + vector_2=( + lattice_constants[1]*self._lattice_size[1]*self._scale + ), + vector_3=( + lattice_constants[2]*self._lattice_size[2]*self._scale + ), ) - def construct(self): - - state = self._get_construction_state() - state = self._place_building_blocks(state) - state = self._run_reactions(state) - state = self._optimizer.optimize(state) - self._lattice_constants = state.get_lattice_constants() - return ConstructionResult(state) - _lattice_constants = _a, _b, _c = ( np.array([1., 0., 0.]), np.array([0.5, 0.866, 0.]), diff --git a/src/stk/molecular/topology_graphs/cof/periodic_square.py b/src/stk/molecular/topology_graphs/cof/periodic_square.py index f06de7a7f..81c7ede5b 100644 --- a/src/stk/molecular/topology_graphs/cof/periodic_square.py +++ b/src/stk/molecular/topology_graphs/cof/periodic_square.py @@ -8,7 +8,7 @@ from ...reactions import GenericReactionFactory from .cof import Cof from .vertices import _LinearCofVertex, _NonLinearCofVertex -from ..topology_graph import Edge, NullOptimizer, ConstructionResult +from ..topology_graph import Edge, NullOptimizer from ...periodic_info import PeriodicInfo @@ -136,20 +136,17 @@ def get_periodic_info(self): lattice_constants = self._get_lattice_constants() return PeriodicInfo( - vector_1=lattice_constants[0], - vector_2=lattice_constants[1], - vector_3=lattice_constants[2], + vector_1=( + lattice_constants[0]*self._lattice_size[0]*self._scale + ), + vector_2=( + lattice_constants[1]*self._lattice_size[1]*self._scale + ), + vector_3=( + lattice_constants[2]*self._lattice_size[2]*self._scale + ), ) - def construct(self): - - state = self._get_construction_state() - state = self._place_building_blocks(state) - state = self._run_reactions(state) - state = self._optimizer.optimize(state) - self._lattice_constants = state.get_lattice_constants() - return ConstructionResult(state) - _lattice_constants = _a, _b, _c = ( np.array([1., 0., 0.]), np.array([0., 1., 0.]), diff --git a/src/stk/molecular/topology_graphs/topology_graph/construction_state/graph_state.py b/src/stk/molecular/topology_graphs/topology_graph/construction_state/graph_state.py index 484607d9b..0c38d94b4 100644 --- a/src/stk/molecular/topology_graphs/topology_graph/construction_state/graph_state.py +++ b/src/stk/molecular/topology_graphs/topology_graph/construction_state/graph_state.py @@ -54,7 +54,10 @@ def __init__( for vertex in vertices } self._edges = edges - self._lattice_constants = lattice_constants + self._lattice_constants = tuple(map( + np.array, + lattice_constants, + )) self._vertex_edges = self._get_vertex_edges() def _get_vertex_edges(self): @@ -152,7 +155,10 @@ def clone(self): clone._vertices = dict(self._vertices) clone._vertex_edges = dict(self._vertex_edges) clone._edges = self._edges - clone._lattice_constants = self._lattice_constants + clone._lattice_constants = tuple(map( + np.array, + self._lattice_constants, + )) return clone def get_building_block(self, vertex_id): @@ -255,7 +261,7 @@ def get_lattice_constants(self): """ - return self._lattice_constants + return tuple(map(np.array, self._lattice_constants)) def get_edges(self, vertex_id): """ @@ -310,7 +316,10 @@ def _with_lattice_constants(self, lattice_constants): """ - self._lattice_constants = lattice_constants + self._lattice_constants = tuple(map( + np.array, + lattice_constants, + )) return self def with_lattice_constants(self, lattice_constants): diff --git a/src/stk/molecular/topology_graphs/topology_graph/optimizers/periodic_collapser.py b/src/stk/molecular/topology_graphs/topology_graph/optimizers/periodic_collapser.py index fc5e26a58..60064456f 100644 --- a/src/stk/molecular/topology_graphs/topology_graph/optimizers/periodic_collapser.py +++ b/src/stk/molecular/topology_graphs/topology_graph/optimizers/periodic_collapser.py @@ -12,7 +12,7 @@ class PeriodicCollapser(Collapser): """ - Performs rigid-body collapse of molecule [1]_. + Performs rigid-body collapse of molecules [1]_. Examples -------- From aa4185f1f6682dbe822a323b2c8f78a6ff56941c Mon Sep 17 00:00:00 2001 From: Lukas Turcani Date: Tue, 20 Apr 2021 22:19:26 +0100 Subject: [PATCH 12/44] Revert tests --- .../molecule/fixtures/cof/hexagonal.py | 330 +++++++++--------- .../molecule/fixtures/cof/honeycomb.py | 2 +- .../molecules/molecule/fixtures/cof/kagome.py | 30 +- .../fixtures/cof/periodic_hexagonal.py | 57 +-- .../molecule/fixtures/cof/periodic_kagome.py | 32 +- .../position_matrices/cof_hexagonal0.npy | Bin 8912 -> 8912 bytes .../position_matrices/cof_hexagonal1.npy | Bin 37712 -> 37712 bytes .../position_matrices/cof_hexagonal2.npy | Bin 8912 -> 8912 bytes .../position_matrices/cof_hexagonal3.npy | Bin 12368 -> 12368 bytes .../position_matrices/cof_honeycomb0.npy | Bin 3392 -> 3392 bytes .../position_matrices/cof_honeycomb1.npy | Bin 3392 -> 3392 bytes .../position_matrices/cof_honeycomb2.npy | Bin 3392 -> 3392 bytes .../position_matrices/cof_kagome0.npy | Bin 5072 -> 5072 bytes .../cof_periodic_hexagonal0.npy | Bin 8192 -> 8192 bytes .../cof_periodic_honeycomb0.npy | Bin 3200 -> 3200 bytes .../cof_periodic_kagome0.npy | Bin 4736 -> 4736 bytes 16 files changed, 227 insertions(+), 224 deletions(-) diff --git a/tests/molecular/molecules/molecule/fixtures/cof/hexagonal.py b/tests/molecular/molecules/molecule/fixtures/cof/hexagonal.py index 40536af6e..a0d251e8b 100644 --- a/tests/molecular/molecules/molecule/fixtures/cof/hexagonal.py +++ b/tests/molecular/molecules/molecule/fixtures/cof/hexagonal.py @@ -64,34 +64,35 @@ ), ), smiles=( - 'BrC1=C([C+]2[C+]3C4=C([C+]=N4)[C+]4[C+](Br)[C+]5[C+]6' - 'C7=C([C+]=N7)[C+]7[C+]8[C+]9[C+]%10C%11=C(N=[C+]%11)[' - 'C+]%11[C+]%12C%13=C(N=[C+]%13)[C+]%13[C+]([C+](C%14=C' - '(Br)[C+]=N%14)[C+](C%14=C(Br)[C+]=N%14)[C+]%14C%15=C(' - '[C+]=N%15)[C+]%15[C+](C%16=C([C+]=N%16)C%16(OS[C+]7%1' - '6)[C+]%10N7N=[C+]N7C%147OS[C+]%137)[C+](C7=C(N=[C+]7)' - 'C7([C+2][NH2+][C+]47)[C+]6N4N=[C+]N4Br)[C+](C4=C(N=[C' - '+]4)[C+]2[C+](N2N=[C+]N2Br)C2(N4N=[C+]N4Br)[C+2][NH2+' - '][C+]2[C+]3Br)[C+]2S[C+2]C2(N2N=[C+]N2Br)[C+]%15N2N=[' - 'C+]N2Br)N2N=[C+]N2[C+]2[C+]3C4=C(N=[C+]4)C4(OS[C+]%12' - '4)[C+]4[C+]6[C+]%11N7[C+]=NN7[C+]7[C+]%10[C+]%11C%12=' - 'C([C+]=N%12)C%12%13OS[C+]%12[C+](C%12=C(N=[C+]%12)[C+' - ']%12[C+](Br)[C+](Br)[C+]%14C%15=C(N=[C+]%15)[C+]%15[C' - '+](N%16N=[C+]N%16Br)[C+](C%16=C([C+]=N%16)[C+]([C+]%1' - '1N%11[C+]=NN%11[C+]%12C%11(C%12=C(Br)[C+]=N%12)OS[C+]' - '%14%11)[C+]%11[NH2+][C+2]C%117N7N=[C+]N97)[C+]([C+](N' - '7N=[C+]N57)C5(Br)[C+2]S[C+]%155)N5N=[C+]N85)[C+](Br)[' - 'C+](Br)[C+]5[C+]%13N7N=[C+]N7C78OS[C+]7[C+]7C9=C([C+]' - '=N9)[C+]9[C+]([C+](Br)[C+](I)[C+]%11N%12N=[C+]N%12[C+' - ']%12[C+](Br)[C+](Br)[C+](I)[C+](N%13N=[C+]N%13Br)C%13' - '([C+2][NH2+][C+]%12%13)N%12[C+]=NN%12[C+]%12[C+](I)[C' - '+](C%13=C(Br)[C+]=N%13)C%13%14[C+2][NH2+][C+]%13[C+](' - 'C%13=C(N=[C+]%13)[C+]7[C+]([C+]([C+]8N7N=[C+]N%107)N7' - 'N=[C+]N67)N6N=[C+]N6[C+]6[C+](C7=C%14N=[C+]7)[C+](I)[' - 'C+](C7=C(Br)[C+]=N7)C7(OS[C+]7[C+]6N6[C+]=NN46)C4=C(N' - '=[C+]4)[C+]3[C+](I)[C+](N3N=[C+]N3Br)C3(N4N=[C+]N4Br)' - '[C+2]S[C+]23)[C+]%12N2[C+]=NN2C%112[C+2]S[C+]92)N2N=[' - 'C+]N52)N=[C+]1' + 'BrC1=C([C+]2[C+](Br)[C+](I)[C+]3C4=C([C+]=N4)[C+]4[C+' + '](Br)[C+](Br)[C+]5[C+]6N7N=[C+]N7C78OS[C+]7[C+]7C9=C(' + '[C+]=N9)[C+]9[C+]([C+](Br)[C+](I)[C+]%10N%11N=[C+]N%1' + '1[C+]%11[C+](Br)[C+](Br)[C+](I)[C+](N%12N=[C+]N%12Br)' + 'C%12([C+2][NH2+][C+]%11%12)N%11[C+]=NN%11[C+]%11[C+](' + 'I)[C+](C%12=C(Br)[C+]=N%12)C%12%13[C+2][NH2+][C+]%12[' + 'C+](C%12=C(N=[C+]%12)[C+]7[C+]7[C+]%12[C+]8N8N=[C+]N8' + '[C+]8[C+](C%14=C([C+]=N%14)C6%14OS[C+]4%14)[C+]4[C+]6' + 'C%14=C(N=[C+]%14)[C+]%14[C+](C%15=C([C+]=N%15)[C+]2[C' + '+]2SOC23N2N=[C+]N42)[C+]2S[C+2]C2(Br)[C+](N2N=[C+]N2B' + 'r)[C+]2[C+]%14N3N=[C+]N3[C+]3[C+]4C%14=C(N=[C+]%14)[C' + '+]%14[C+]([C+](Br)[C+](N%15N=[C+]N%15Br)[C+]%15C%16=C' + '(N=[C+]%16)[C+]%16[C+](Br)[C+]%17[NH2+][C+2]C%17(C%17' + '=C(Br)[C+]=N%17)[C+](N%17N=[C+]N%17Br)[C+](N%17N=[C+]' + 'N%17Br)[C+]%16C%16=C([C+]=N%16)[C+]%16[C+](C%17=C(N=[' + 'C+]%17)C%14%17[C+2][NH2+][C+]%15%17)[C+]%14C%15=C([C+' + ']=N%15)C%15(OS[C+]4%15)[C+]4[C+]%15C%17=C(N=[C+]%17)[' + 'C+]%17[C+]%18C%19=C(N=[C+]%19)[C+]%19[C+]([C+](C%20=C' + '(Br)[C+]=N%20)[C+](C%20=C(Br)[C+]=N%20)[C+](C%20=C([C' + '+]=N%20)[C+]%14[C+](N%14N=[C+]N%14Br)C%14(N%20N=[C+]N' + '%20Br)[C+2]S[C+]%16%14)C%14(OS[C+]%19%14)N%14[C+]=NN4' + '%14)N4N=[C+]N4[C+]4[C+]%14C%16=C(N=[C+]%16)C%16(OS[C+' + ']%18%16)[C+]([C+]([C+]%17N%16[C+]=NN%16[C+]8C8([C+2][' + 'NH2+][C+]68)N6N=[C+]N6[C+]%153)N3[C+]=NN%123)N3N=[C+]' + 'N3[C+]3[C+]([C+](C6=C%13N=[C+]6)[C+](I)[C+](C6=C(Br)[' + 'C+]=N6)C6(OS[C+]36)C3=C(N=[C+]3)[C+]%14[C+](I)[C+](N3' + 'N=[C+]N3Br)C3(N6N=[C+]N6Br)[C+2]S[C+]43)N3[C+]=NN73)N' + '3[C+]=NN23)[C+]%11N2[C+]=NN2C%102[C+2]S[C+]92)N2N=[C+' + ']N52)N=[C+]1' ), ), # Non-planar linear BB. @@ -120,102 +121,103 @@ 'C([H])=C([H])C8=C7[H])C7([H])C([H])(Br)C([H])(Br)C8([' 'H])C9=C([H])C%10=C(C([H])([H])C([H])([H])C([H])([H])C' '([H])([H])[H])C([H])=C(C([H])=C%10C([H])=C9[H])C9([H]' - ')C([H])(Br)C([H])(Br)C%10([H])C%11=C([H])C%12=C(C([H]' - ')([H])C([H])([H])C([H])([H])C([H])([H])[H])C([H])=C(C' - '([H])=C%12C([H])=C%11[H])C%11([H])C([H])(Br)C%12([H])' - 'C%13=C([H])C(C([H])([H])C([H])([H])C([H])([H])C([H])(' - '[H])[H])=C%14C([H])=C(C([H])=C([H])C%14=C%13[H])C%13(' - '[H])C([H])(Br)C%14([H])C%15=C([H])C%16=C(C([H])([H])C' - '([H])([H])C([H])([H])C([H])([H])[H])C([H])=C(C([H])=C' - '%16C([H])=C%15[H])C%15([H])C([H])(Br)C([H])(C%16=C([H' - '])C(C([H])([H])C([H])([H])C([H])([H])C([H])([H])[H])=' - 'C%17C([H])=C(Br)C([H])=C([H])C%17=C%16[H])C([H])(C%16' + ')C([H])(Br)C([H])(Br)C([H])(C%10=C([H])C(C([H])([H])C' + '([H])([H])C([H])([H])C([H])([H])[H])=C%11C([H])=C(Br)' + 'C([H])=C([H])C%11=C%10[H])C%10([H])C%11=C([H])C%12=C(' + 'C([H])([H])C([H])([H])C([H])([H])C([H])([H])[H])C([H]' + ')=C(C([H])=C%12C([H])=C%11[H])C%11([H])C([H])(Br)C([H' + '])(C%12=C([H])C(C([H])([H])C([H])([H])C([H])([H])C([H' + '])([H])[H])=C%13C([H])=C(Br)C([H])=C([H])C%13=C%12[H]' + ')C%12([H])C%13=C([H])C(C([H])([H])C([H])([H])C([H])([' + 'H])C([H])([H])[H])=C%14C([H])=C(C([H])=C([H])C%14=C%1' + '3[H])C%13([H])C([H])(Br)C([H])(C%14=C([H])C(C([H])([H' + '])C([H])([H])C([H])([H])C([H])([H])[H])=C%15C([H])=C(' + 'Br)C([H])=C([H])C%15=C%14[H])C%14([H])C%15=C([H])C%16' + '=C(C([H])([H])C([H])([H])C([H])([H])C([H])([H])[H])C(' + '[H])=C(C([H])=C%16C([H])=C%15[H])C%15([H])C([H])(Br)C' + '([H])(C%16=C([H])C(C([H])([H])C([H])([H])C([H])([H])C' + '([H])([H])[H])=C%17C([H])=C(Br)C([H])=C([H])C%17=C%16' + '[H])C([H])(C%16=C([H])C(C([H])([H])C([H])([H])C([H])(' + '[H])C([H])([H])[H])=C%17C([H])=C(Br)C([H])=C([H])C%17' + '=C%16[H])C([H])(C%16=C([H])C(C([H])([H])C([H])([H])C(' + '[H])([H])C([H])([H])[H])=C%17C([H])=C(Br)C([H])=C([H]' + ')C%17=C%16[H])C%15([H])C%15=C([H])C(C([H])([H])C([H])' + '([H])C([H])([H])C([H])([H])[H])=C%16C([H])=C(C([H])=C' + '([H])C%16=C%15[H])C%15([H])C%16([H])C%17=C([H])C%18=C' + '(C([H])([H])C([H])([H])C([H])([H])C([H])([H])[H])C([H' + '])=C(C([H])=C%18C([H])=C%17[H])C%14([H])C%13([H])C%13' '=C([H])C(C([H])([H])C([H])([H])C([H])([H])C([H])([H])' - '[H])=C%17C([H])=C(Br)C([H])=C([H])C%17=C%16[H])C([H])' - '(C%16=C([H])C(C([H])([H])C([H])([H])C([H])([H])C([H])' - '([H])[H])=C%17C([H])=C(Br)C([H])=C([H])C%17=C%16[H])C' - '%15([H])C%15=C([H])C(C([H])([H])C([H])([H])C([H])([H]' - ')C([H])([H])[H])=C%16C([H])=C(C([H])=C([H])C%16=C%15[' - 'H])C%15([H])C%16([H])C%17=C([H])C%18=C(C([H])([H])C([' - 'H])([H])C([H])([H])C([H])([H])[H])C([H])=C(C([H])=C%1' - '8C([H])=C%17[H])C%14([H])C([H])(C%14=C([H])C(C([H])([' - 'H])C([H])([H])C([H])([H])C([H])([H])[H])=C%17C([H])=C' - '(Br)C([H])=C([H])C%17=C%14[H])C%13([H])C%13=C([H])C(C' - '([H])([H])C([H])([H])C([H])([H])C([H])([H])[H])=C%14C' - '([H])=C(C([H])=C([H])C%14=C%13[H])C%13([H])C%14([H])C' - '%17=C([H])C%18=C(C([H])([H])C([H])([H])C([H])([H])C([' - 'H])([H])[H])C([H])=C(C([H])=C%18C([H])=C%17[H])C%12([' - 'H])C([H])(C%12=C([H])C(C([H])([H])C([H])([H])C([H])([' - 'H])C([H])([H])[H])=C%17C([H])=C(C([H])=C([H])C%17=C%1' - '2[H])C%12([H])C([H])(C%17=C([H])C%18=C(C([H])([H])C([' - 'H])([H])C([H])([H])C([H])([H])[H])C([H])=C(C([H])=C%1' - '8C([H])=C%17[H])C9([H])C%10([H])C9=C([H])C(C([H])([H]' - ')C([H])([H])C([H])([H])C([H])([H])[H])=C%10C([H])=C(B' - 'r)C([H])=C([H])C%10=C9[H])C9([H])C%10=C([H])C(C([H])(' - '[H])C([H])([H])C([H])([H])C([H])([H])[H])=C%17C([H])=' - 'C(C([H])=C([H])C%17=C%10[H])C8([H])C7([H])C7=C([H])C(' - 'C([H])([H])C([H])([H])C([H])([H])C([H])([H])[H])=C8C(' - '[H])=C(C([H])=C([H])C8=C7[H])C7([H])C8([H])C%10=C([H]' - ')C(C([H])([H])C([H])([H])C([H])([H])C([H])([H])[H])=C' - '%17C([H])=C(C([H])=C([H])C%17=C%10[H])C6([H])C5([H])C' - '5=C([H])C(C([H])([H])C([H])([H])C([H])([H])C([H])([H]' - ')[H])=C6C([H])=C(C([H])=C([H])C6=C5[H])C5([H])C([H])(' - 'C6=C([H])C(C([H])([H])C([H])([H])C([H])([H])C([H])([H' - '])[H])=C%10C([H])=C(C([H])=C([H])C%10=C6[H])C43[H])C(' - '[H])(Br)C([H])(C3=C([H])C(C([H])([H])C([H])([H])C([H]' - ')([H])C([H])([H])[H])=C4C([H])=C(Br)C([H])=C([H])C4=C' - '3[H])C3([H])C4=C([H])C(C([H])([H])C([H])([H])C([H])([' - 'H])C([H])([H])[H])=C6C([H])=C(C([H])=C([H])C6=C4[H])C' - '4([H])C([H])(Br)C([H])(C6=C([H])C(C([H])([H])C([H])([' - 'H])C([H])([H])C([H])([H])[H])=C%10C([H])=C(Br)C([H])=' - 'C([H])C%10=C6[H])C6([H])C%10=C([H])C%17=C(C([H])([H])' - 'C([H])([H])C([H])([H])C([H])([H])[H])C([H])=C(C([H])=' - 'C%17C([H])=C%10[H])C%10([H])C([H])(Br)C([H])(C%17=C([' - 'H])C(C([H])([H])C([H])([H])C([H])([H])C([H])([H])[H])' - '=C%18C([H])=C(Br)C([H])=C([H])C%18=C%17[H])C([H])(C%1' - '7=C([H])C(C([H])([H])C([H])([H])C([H])([H])C([H])([H]' - ')[H])=C%18C([H])=C(Br)C([H])=C([H])C%18=C%17[H])C%17(' - '[H])C%18=C([H])C%19=C(C([H])([H])C([H])([H])C([H])([H' - '])C([H])([H])[H])C([H])=C(C([H])=C%19C([H])=C%18[H])C' - '%18([H])C%19([H])C%20=C([H])C(C([H])([H])C([H])([H])C' - '([H])([H])C([H])([H])[H])=C%21C([H])=C(C([H])=C([H])C' - '%21=C%20[H])C%20([H])C%21([H])C%22=C([H])C(C([H])([H]' - ')C([H])([H])C([H])([H])C([H])([H])[H])=C%23C([H])=C(C' - '([H])=C([H])C%23=C%22[H])C([H])(C%14([H])C%14=C([H])C' - '%22=C(C([H])([H])C([H])([H])C([H])([H])C([H])([H])[H]' - ')C([H])=C(C([H])=C%22C([H])=C%14[H])C%12([H])C%12([H]' - ')C%14=C([H])C(C([H])([H])C([H])([H])C([H])([H])C([H])' - '([H])[H])=C%22C([H])=C(C([H])=C([H])C%22=C%14[H])C%21' - '([H])C%14([H])C%21=C([H])C%22=C(C([H])([H])C([H])([H]' - ')C([H])([H])C([H])([H])[H])C([H])=C(C([H])=C%22C([H])' - '=C%21[H])C([H])(C7([H])C7=C([H])C(C([H])([H])C([H])([' - 'H])C([H])([H])C([H])([H])[H])=C%21C([H])=C(C([H])=C([' - 'H])C%21=C7[H])C9%12[H])C([H])(C7=C([H])C(C([H])([H])C' - '([H])([H])C([H])([H])C([H])([H])[H])=C9C([H])=C(C([H]' - ')=C([H])C9=C7[H])C4([H])C6([H])C4=C([H])C6=C(C([H])([' - 'H])C([H])([H])C([H])([H])C([H])([H])[H])C([H])=C(C([H' - '])=C6C([H])=C4[H])C%14([H])C%20([H])C4=C([H])C(C([H])' - '([H])C([H])([H])C([H])([H])C([H])([H])[H])=C6C([H])=C' - '(C([H])=C([H])C6=C4[H])C%10%17[H])C8([H])C4=C([H])C(C' - '([H])([H])C([H])([H])C([H])([H])C([H])([H])[H])=C6C([' - 'H])=C(C([H])=C([H])C6=C4[H])C53[H])C3([H])C4=C([H])C(' - 'C([H])([H])C([H])([H])C([H])([H])C([H])([H])[H])=C5C(' - '[H])=C(C([H])=C([H])C5=C4[H])C%19([H])C([H])(C4=C([H]' - ')C(C([H])([H])C([H])([H])C([H])([H])C([H])([H])[H])=C' - '5C([H])=C(C([H])=C([H])C5=C4[H])C([H])(C%16([H])C4=C(' - '[H])C(C([H])([H])C([H])([H])C([H])([H])C([H])([H])[H]' - ')=C5C([H])=C(C([H])=C([H])C5=C4[H])C%133[H])C([H])(C3' - '=C([H])C(C([H])([H])C([H])([H])C([H])([H])C([H])([H])' - '[H])=C4C([H])=C(Br)C([H])=C([H])C4=C3[H])C%15([H])C3=' - 'C([H])C(C([H])([H])C([H])([H])C([H])([H])C([H])([H])[' - 'H])=C4C([H])=C(Br)C([H])=C([H])C4=C3[H])C([H])(C3=C([' - 'H])C(C([H])([H])C([H])([H])C([H])([H])C([H])([H])[H])' - '=C4C([H])=C(Br)C([H])=C([H])C4=C3[H])C%18([H])C3=C([H' + '[H])=C%14C([H])=C(C([H])=C([H])C%14=C%13[H])C%13([H])' + 'C%14([H])C%17=C([H])C%18=C(C([H])([H])C([H])([H])C([H' + '])([H])C([H])([H])[H])C([H])=C(C([H])=C%18C([H])=C%17' + '[H])C%12([H])C%11([H])C%11=C([H])C(C([H])([H])C([H])(' + '[H])C([H])([H])C([H])([H])[H])=C%12C([H])=C(C([H])=C(' + '[H])C%12=C%11[H])C%11([H])C([H])(C%12=C([H])C%17=C(C(' + '[H])([H])C([H])([H])C([H])([H])C([H])([H])[H])C([H])=' + 'C(C([H])=C%17C([H])=C%12[H])C9%10[H])C9([H])C%10=C([H' '])C(C([H])([H])C([H])([H])C([H])([H])C([H])([H])[H])=' - 'C4C([H])=C(Br)C([H])=C([H])C4=C3[H])C%11([H])C3=C([H]' + 'C%12C([H])=C(C([H])=C([H])C%12=C%10[H])C8([H])C7([H])' + 'C7=C([H])C(C([H])([H])C([H])([H])C([H])([H])C([H])([H' + '])[H])=C8C([H])=C(C([H])=C([H])C8=C7[H])C7([H])C8([H]' + ')C%10=C([H])C(C([H])([H])C([H])([H])C([H])([H])C([H])' + '([H])[H])=C%12C([H])=C(C([H])=C([H])C%12=C%10[H])C6([' + 'H])C5([H])C5=C([H])C(C([H])([H])C([H])([H])C([H])([H]' + ')C([H])([H])[H])=C6C([H])=C(C([H])=C([H])C6=C5[H])C5(' + '[H])C([H])(C6=C([H])C(C([H])([H])C([H])([H])C([H])([H' + '])C([H])([H])[H])=C%10C([H])=C(C([H])=C([H])C%10=C6[H' + '])C43[H])C([H])(Br)C([H])(C3=C([H])C(C([H])([H])C([H]' + ')([H])C([H])([H])C([H])([H])[H])=C4C([H])=C(Br)C([H])' + '=C([H])C4=C3[H])C3([H])C4=C([H])C(C([H])([H])C([H])([' + 'H])C([H])([H])C([H])([H])[H])=C6C([H])=C(C([H])=C([H]' + ')C6=C4[H])C4([H])C([H])(Br)C([H])(C6=C([H])C(C([H])([' + 'H])C([H])([H])C([H])([H])C([H])([H])[H])=C%10C([H])=C' + '(Br)C([H])=C([H])C%10=C6[H])C6([H])C%10=C([H])C%12=C(' + 'C([H])([H])C([H])([H])C([H])([H])C([H])([H])[H])C([H]' + ')=C(C([H])=C%12C([H])=C%10[H])C%10([H])C([H])(Br)C([H' + '])(C%12=C([H])C(C([H])([H])C([H])([H])C([H])([H])C([H' + '])([H])[H])=C%17C([H])=C(Br)C([H])=C([H])C%17=C%12[H]' + ')C([H])(C%12=C([H])C(C([H])([H])C([H])([H])C([H])([H]' + ')C([H])([H])[H])=C%17C([H])=C(Br)C([H])=C([H])C%17=C%' + '12[H])C%12([H])C%17=C([H])C%18=C(C([H])([H])C([H])([H' + '])C([H])([H])C([H])([H])[H])C([H])=C(C([H])=C%18C([H]' + ')=C%17[H])C%17([H])C%18([H])C%19=C([H])C(C([H])([H])C' + '([H])([H])C([H])([H])C([H])([H])[H])=C%20C([H])=C(C([' + 'H])=C([H])C%20=C%19[H])C%19([H])C%20([H])C%21=C([H])C' + '(C([H])([H])C([H])([H])C([H])([H])C([H])([H])[H])=C%2' + '2C([H])=C(C([H])=C([H])C%22=C%21[H])C([H])(C%14([H])C' + '%14=C([H])C%21=C(C([H])([H])C([H])([H])C([H])([H])C([' + 'H])([H])[H])C([H])=C(C([H])=C%21C([H])=C%14[H])C%11([' + 'H])C%11([H])C%14=C([H])C(C([H])([H])C([H])([H])C([H])' + '([H])C([H])([H])[H])=C%21C([H])=C(C([H])=C([H])C%21=C' + '%14[H])C%20([H])C%14([H])C%20=C([H])C%21=C(C([H])([H]' + ')C([H])([H])C([H])([H])C([H])([H])[H])C([H])=C(C([H])' + '=C%21C([H])=C%20[H])C([H])(C7([H])C7=C([H])C(C([H])([' + 'H])C([H])([H])C([H])([H])C([H])([H])[H])=C%20C([H])=C' + '(C([H])=C([H])C%20=C7[H])C9%11[H])C([H])(C7=C([H])C(C' + '([H])([H])C([H])([H])C([H])([H])C([H])([H])[H])=C9C([' + 'H])=C(C([H])=C([H])C9=C7[H])C4([H])C6([H])C4=C([H])C6' + '=C(C([H])([H])C([H])([H])C([H])([H])C([H])([H])[H])C(' + '[H])=C(C([H])=C6C([H])=C4[H])C%14([H])C%19([H])C4=C([' + 'H])C(C([H])([H])C([H])([H])C([H])([H])C([H])([H])[H])' + '=C6C([H])=C(C([H])=C([H])C6=C4[H])C%10%12[H])C8([H])C' + '4=C([H])C(C([H])([H])C([H])([H])C([H])([H])C([H])([H]' + ')[H])=C6C([H])=C(C([H])=C([H])C6=C4[H])C53[H])C3([H])' + 'C4=C([H])C(C([H])([H])C([H])([H])C([H])([H])C([H])([H' + '])[H])=C5C([H])=C(C([H])=C([H])C5=C4[H])C%18([H])C([H' + '])(C4=C([H])C(C([H])([H])C([H])([H])C([H])([H])C([H])' + '([H])[H])=C5C([H])=C(C([H])=C([H])C5=C4[H])C([H])(C%1' + '6([H])C4=C([H])C(C([H])([H])C([H])([H])C([H])([H])C([' + 'H])([H])[H])=C5C([H])=C(C([H])=C([H])C5=C4[H])C%133[H' + '])C([H])(C3=C([H])C(C([H])([H])C([H])([H])C([H])([H])' + 'C([H])([H])[H])=C4C([H])=C(Br)C([H])=C([H])C4=C3[H])C' + '%15([H])C3=C([H])C(C([H])([H])C([H])([H])C([H])([H])C' + '([H])([H])[H])=C4C([H])=C(Br)C([H])=C([H])C4=C3[H])C(' + '[H])(C3=C([H])C(C([H])([H])C([H])([H])C([H])([H])C([H' + '])([H])[H])=C4C([H])=C(Br)C([H])=C([H])C4=C3[H])C%17(' + '[H])C3=C([H])C(C([H])([H])C([H])([H])C([H])([H])C([H]' + ')([H])[H])=C4C([H])=C(Br)C([H])=C([H])C4=C3[H])=C([H]' ')C(C([H])([H])C([H])([H])C([H])([H])C([H])([H])[H])=C' - '4C([H])=C(Br)C([H])=C([H])C4=C3[H])=C([H])C(C([H])([H' - '])C([H])([H])C([H])([H])C([H])([H])[H])=C2C([H])=C1Br' + '2C([H])=C1Br' ), ), # One placer atom linear BB. @@ -237,31 +239,31 @@ ), smiles=( '[H]C([H])(Br)C1([H])C([H])(Br)C2([H])C([H])([H])C3([H' - '])C([H])(Br)C4([H])C([H])([H])C5([H])C([H])(Br)C6([H]' - ')C([H])([H])C7([H])C([H])(Br)C([H])(Br)C8([H])C([H])(' - '[H])C9([H])C([H])(Br)C([H])(Br)C%10([H])C([H])([H])C%' - '11([H])C([H])(Br)C([H])(Br)C%12([H])C([H])([H])C%13([' - 'H])C([H])(Br)C([H])(Br)C([H])(Br)C([H])(C([H])([H])Br' - ')C%13([H])C([H])([H])C%13([H])C([H])(Br)C([H])(C([H])' - '([H])Br)C%14([H])C([H])([H])C%15([H])C([H])(Br)C([H])' - '(C([H])([H])Br)C%16([H])C([H])([H])C%17([H])C([H])(Br' - ')C([H])(C([H])([H])Br)C([H])(C([H])([H])Br)C%18([H])C' - '([H])([H])C%19([H])C([H])(C([H])([H])Br)C([H])(C([H])' - '([H])Br)C%20([H])C([H])([H])C%21([H])C([H])(C([H])([H' - '])Br)C([H])(C([H])([H])Br)C([H])(C([H])([H])C2([H])C(' - '[H])(C([H])([H])Br)C1([H])C([H])([H])Br)C1([H])C([H])' - '([H])C3([H])C([H])(C([H])([H])Br)C4([H])C([H])([H])C2' - '([H])C3([H])C([H])([H])C5([H])C([H])(C([H])([H])Br)C6' - '([H])C([H])([H])C4([H])C([H])(C([H])([H])C8([H])C7([H' - '])C([H])([H])Br)C5([H])C([H])([H])C9([H])C%10([H])C([' + '])C([H])(C([H])([H])Br)C([H])(Br)C4([H])C([H])([H])C5' + '([H])C([H])(C([H])([H])Br)C([H])(Br)C6([H])C([H])([H]' + ')C7([H])C([H])(C([H])([H])Br)C([H])(Br)C([H])(Br)C8([' + 'H])C([H])([H])C9([H])C([H])(Br)C([H])(Br)C%10([H])C([' + 'H])([H])C%11([H])C([H])(Br)C([H])(Br)C%12([H])C([H])(' + '[H])C%13([H])C([H])(Br)C([H])(Br)C([H])(Br)C([H])(C([' + 'H])([H])Br)C%13([H])C([H])([H])C%13([H])C([H])(Br)C([' + 'H])(C([H])([H])Br)C%14([H])C([H])([H])C%15([H])C([H])' + '(Br)C([H])(C([H])([H])Br)C%16([H])C([H])([H])C%17([H]' + ')C([H])(Br)C([H])(C([H])([H])Br)C([H])(C([H])([H])Br)' + 'C%18([H])C([H])([H])C%19([H])C([H])(C([H])([H])Br)C([' + 'H])(C([H])([H])Br)C%20([H])C([H])([H])C%21([H])C([H])' + '(C([H])([H])Br)C([H])(C([H])([H])Br)C([H])(C([H])([H]' + ')C2([H])C([H])(C([H])([H])Br)C1([H])C([H])([H])Br)C1(' + '[H])C([H])([H])C3([H])C4([H])C([H])([H])C2([H])C3([H]' + ')C([H])([H])C5([H])C6([H])C([H])([H])C4([H])C([H])(C(' + '[H])([H])C87[H])C5([H])C([H])([H])C9([H])C%10([H])C([' 'H])([H])C6([H])C7([H])C([H])([H])C%11([H])C%12([H])C(' '[H])([H])C%13([H])C%14([H])C([H])([H])C7([H])C7([H])C' '([H])([H])C%15([H])C%16([H])C([H])([H])C8([H])C([H])(' 'C([H])([H])C%17%18[H])C9([H])C([H])([H])C%19([H])C%20' '([H])C([H])([H])C([H])(C2([H])C([H])([H])C%211[H])C1(' - '[H])C([H])([H])C9([H])C2([H])C([H])([H])C([H])(C4([H]' - ')C([H])([H])C31[H])C5([H])C([H])([H])C6([H])C7([H])C(' - '[H])([H])C82[H]' + '[H])C([H])([H])C9([H])C2([H])C([H])([H])C([H])(C5([H]' + ')C([H])([H])C6([H])C7([H])C([H])([H])C82[H])C4([H])C(' + '[H])([H])C31[H]' ), ), # Two placer atom linear BB. @@ -286,29 +288,29 @@ '[H])(Br)C2([H])C([H])([H])C([H])([H])C3([H])C([H])(Br' ')C([H])(Br)C4([H])C([H])([H])C([H])([H])C5([H])C([H])' '(Br)C([H])(Br)C6([H])C([H])([H])C([H])([H])C7([H])C([' - 'H])(Br)C([H])(Br)C8([H])C([H])([H])C([H])([H])C9([H])' - 'C([H])(Br)C%10([H])C([H])([H])C([H])([H])C%11([H])C([' - 'H])(Br)C%12([H])C([H])([H])C([H])([H])C%13([H])C([H])' - '(Br)C([H])(C([H])([H])C([H])([H])Br)C([H])(C([H])([H]' - ')C([H])([H])Br)C([H])(C([H])([H])C([H])([H])Br)C%13([' - 'H])C([H])([H])C([H])([H])C%13([H])C([H])(C([H])([H])C' - '([H])([H])Br)C([H])(C([H])([H])C([H])([H])Br)C%14([H]' - ')C([H])([H])C([H])([H])C%15([H])C([H])(C([H])([H])C([' - 'H])([H])Br)C([H])(C([H])([H])C([H])([H])Br)C%16([H])C' - '([H])([H])C([H])([H])C%17([H])C([H])(C([H])([H])C([H]' - ')([H])Br)C([H])(C([H])([H])C([H])([H])Br)C([H])(Br)C%' - '18([H])C([H])([H])C([H])([H])C%19([H])C([H])(C([H])([' - 'H])C([H])([H])Br)C([H])(Br)C%20([H])C([H])([H])C([H])' - '([H])C%21([H])C([H])(C([H])([H])C([H])([H])Br)C([H])(' - 'Br)C([H])(C([H])([H])C([H])([H])C12[H])C1([H])C([H])(' - '[H])C([H])([H])C3([H])C4([H])C([H])([H])C([H])([H])C2' - '([H])C3([H])C([H])([H])C([H])([H])C5([H])C6([H])C([H]' - ')([H])C([H])([H])C4([H])C([H])(C([H])([H])C([H])([H])' - 'C7([H])C8([H])C([H])([H])C([H])([H])Br)C5([H])C([H])(' - '[H])C([H])([H])C9([H])C([H])(C([H])([H])C([H])([H])Br' - ')C%10([H])C([H])([H])C([H])([H])C6([H])C7([H])C([H])(' - '[H])C([H])([H])C%11([H])C([H])(C([H])([H])C([H])([H])' - 'Br)C%12([H])C([H])([H])C([H])([H])C%13([H])C%14([H])C' + 'H])(Br)C([H])(Br)C([H])(C([H])([H])C([H])([H])Br)C8([' + 'H])C([H])([H])C([H])([H])C9([H])C([H])(Br)C([H])(C([H' + '])([H])C([H])([H])Br)C%10([H])C([H])([H])C([H])([H])C' + '%11([H])C([H])(Br)C([H])(C([H])([H])C([H])([H])Br)C%1' + '2([H])C([H])([H])C([H])([H])C%13([H])C([H])(Br)C([H])' + '(C([H])([H])C([H])([H])Br)C([H])(C([H])([H])C([H])([H' + '])Br)C([H])(C([H])([H])C([H])([H])Br)C%13([H])C([H])(' + '[H])C([H])([H])C%13([H])C([H])(C([H])([H])C([H])([H])' + 'Br)C([H])(C([H])([H])C([H])([H])Br)C%14([H])C([H])([H' + '])C([H])([H])C%15([H])C([H])(C([H])([H])C([H])([H])Br' + ')C([H])(C([H])([H])C([H])([H])Br)C%16([H])C([H])([H])' + 'C([H])([H])C%17([H])C([H])(C([H])([H])C([H])([H])Br)C' + '([H])(C([H])([H])C([H])([H])Br)C([H])(Br)C%18([H])C([' + 'H])([H])C([H])([H])C%19([H])C([H])(C([H])([H])C([H])(' + '[H])Br)C([H])(Br)C%20([H])C([H])([H])C([H])([H])C%21(' + '[H])C([H])(C([H])([H])C([H])([H])Br)C([H])(Br)C([H])(' + 'C([H])([H])C([H])([H])C12[H])C1([H])C([H])([H])C([H])' + '([H])C3([H])C4([H])C([H])([H])C([H])([H])C2([H])C3([H' + '])C([H])([H])C([H])([H])C5([H])C6([H])C([H])([H])C([H' + '])([H])C4([H])C([H])(C([H])([H])C([H])([H])C78[H])C5(' + '[H])C([H])([H])C([H])([H])C9([H])C%10([H])C([H])([H])' + 'C([H])([H])C6([H])C7([H])C([H])([H])C([H])([H])C%11([' + 'H])C%12([H])C([H])([H])C([H])([H])C%13([H])C%14([H])C' '([H])([H])C([H])([H])C7([H])C7([H])C([H])([H])C([H])(' '[H])C%15([H])C%16([H])C([H])([H])C([H])([H])C8([H])C(' '[H])(C([H])([H])C([H])([H])C%18%17[H])C9([H])C([H])([' diff --git a/tests/molecular/molecules/molecule/fixtures/cof/honeycomb.py b/tests/molecular/molecules/molecule/fixtures/cof/honeycomb.py index d97c75880..10e7722a7 100644 --- a/tests/molecular/molecules/molecule/fixtures/cof/honeycomb.py +++ b/tests/molecular/molecules/molecule/fixtures/cof/honeycomb.py @@ -62,7 +62,7 @@ '[C+2][C+]3C4=C([C+]=N4)[C+]4[C+2][C+](C5=C(N=[C+]5)[C' '+]5[C+2][C+](C6=C(Br)[C+]=N6)[C+](F)C6(N=[C+]C56[H])C' '5=C([C+]=N5)[C+]5[C+2][C+](C6=C([C+]7[C+2][C+](C8=C(B' - 'r)[C+]=N8)C8([H])[C+]=NC8(C8=C(Br)[C+]=N8)[C+]7F)[C+]' + 'r)N=[C+]8)C8([H])[C+]=NC8(C8=C(Br)N=[C+]8)[C+]7F)[C+]' '=N6)[C+](F)C6(N=[C+]C56[H])C5=C(N=[C+]5)[C+]5[C+2][C+' '](C6=C([C+]=N6)[C+]6[C+2][C+](Br)[C+](F)C7(N=[C+]C67[' 'H])C6=C(N=[C+]6)C6(N=[C+]C26[H])[C+]3F)C2([H])[C+]=NC' diff --git a/tests/molecular/molecules/molecule/fixtures/cof/kagome.py b/tests/molecular/molecules/molecule/fixtures/cof/kagome.py index 454db12d6..34a557895 100644 --- a/tests/molecular/molecules/molecule/fixtures/cof/kagome.py +++ b/tests/molecular/molecules/molecule/fixtures/cof/kagome.py @@ -27,21 +27,21 @@ ), smiles=( 'BrC1=C([C+]2[C+2][C+]3C4=C([C+]=N4)[C+]4[C+2][C+](C5=' - 'C([C+]=N5)[C+]5[C+2][C+]6C7=C(N=[C+]7)C37[C+]=N[C+]7[' - 'C+]2C2=C([C+]=N2)[C+]2[C+]3[C+2][C+](C7=C(N=[C+]7)[C+' - ']7[C+2][C+](C8=C(Br)[C+]=N8)[C+](C8=C(Br)[C+]=N8)[C+]' - '8N=[C+]C78C7=C([C+]=N7)[C+]7[C+2][C+]8C9=C(N=[C+]9)C9' - '%10[C+]=N[C+]9[C+](C9=C(N=[C+]9)[C+]9[C+]([C+2][C+]%1' - '1C%12=C([C+]=N%12)[C+]%12[C+2][C+](C%13=C([C+]=N%13)C' - '%13%14[C+]=N[C+]%13[C+](Br)[C+](Br)[C+2][C+]%14C%13=C' - '(N=[C+]%13)C%11%13[C+]=N[C+]9%13)[C+](Br)[C+]9N=[C+]C' - '%129C9=C([C+]=N9)[C+]5[C+]5N=[C+]C65Br)C5=C([C+]=N5)[' - 'C+]8[C+]5N=[C+]C75C5=C3N=[C+]5)[C+]3[C+2][C+]%10C5=C(' - 'N=[C+]5)[C+]5[C+2][C+](C6=C(Br)[C+]=N6)[C+](C6=C(Br)[' - 'C+]=N6)[C+]6N=[C+]C56C5=C([C+]=N5)[C+]5[C+2][C+](Br)[' - 'C+](Br)[C+]6N=[C+]C56C5=C3N=[C+]5)C3(C5=C(Br)[C+]=N5)' - '[C+]=N[C+]23)[C+](Br)[C+]2N=[C+]C42C2=C(Br)[C+]=N2)N=' - '[C+]1' + 'C([C+]=N5)C56[C+]=N[C+]5[C+](Br)[C+](Br)[C+2][C+]6C5=' + 'C(N=[C+]5)C35[C+]=N[C+]5[C+]2C2=C(Br)[C+]=N2)[C+]2C3=' + 'C(N=[C+]3)[C+]3[C+]5[C+2][C+]6C7=C([C+]=N7)[C+]7[C+2]' + '[C+](C8=C([C+]=N8)C89[C+]=N[C+]8[C+](Br)[C+](Br)[C+2]' + '[C+]9C8=C(N=[C+]8)C68[C+]=N[C+]38)[C+](Br)[C+]3N=[C+]' + 'C73C3=C([C+]=N3)[C+]3[C+2][C+]6C7=C(N=[C+]7)C78[C+]=N' + '[C+]7[C+](C7=C([C+]=N7)[C+]7[C+]9[C+2][C+](C%10=C(N=[' + 'C+]%10)[C+]%10[C+2][C+](C%11=C(Br)[C+]=N%11)[C+](C%11' + '=C(Br)[C+]=N%11)[C+]%11N=[C+]C%10%11C%10=C([C+]=N%10)' + '[C+]%10[C+2][C+](C%11=C(N=[C+]%11)C4%11[C+]=N[C+]2%11' + ')[C+](C2=C5N=[C+]2)[C+]2N=[C+]C%102C2=C9N=[C+]2)C2(C4' + '=C(Br)[C+]=N4)[C+]=N[C+]72)[C+](C2=C(Br)[C+]=N2)[C+2]' + '[C+]8C2=C([C+]=N2)[C+]2[C+2][C+](C4=C([C+]=N4)C64[C+]' + '=N[C+]4[C+]3Br)[C+](Br)[C+]3N=[C+]C23C2=C(Br)[C+]=N2)' + 'N=[C+]1' ), ), ), diff --git a/tests/molecular/molecules/molecule/fixtures/cof/periodic_hexagonal.py b/tests/molecular/molecules/molecule/fixtures/cof/periodic_hexagonal.py index 2acc47621..cb0545817 100644 --- a/tests/molecular/molecules/molecule/fixtures/cof/periodic_hexagonal.py +++ b/tests/molecular/molecules/molecule/fixtures/cof/periodic_hexagonal.py @@ -64,34 +64,35 @@ ), ), smiles=( - '[C+]1=NC2=C1[C+]1[C+]3C4=C(N=[C+]4)[C+]4[C+]5[C+]6[C+' - ']7[C+]8C9=C(N=[C+]9)[C+]9[C+]%10C%11=C([C+]=N%11)[C+]' - '%11[C+]%12[C+]%13[C+]%14C%15=C(N=[C+]%15)[C+]%15[C+]%' - '16C%17=C([C+]=N%17)[C+]%17[C+]([C+]%18[NH2+][C+2]C%18' - '([C+]%18[C+]%19C%20=C(N=[C+]%20)C%20%21OS[C+]%20[C+]%' - '20C%22=C(N=[C+]%22)[C+]%22[C+]([C+]%23C%24=C([C+]=N%2' - '4)[C+]%24[C+]%25[C+]%26C%27=C([C+]=N%27)C%27%28OS[C+]' - '%27[C+]%27C%29=C(N=[C+]%29)[C+]([C+]%29[C+]%20N%20[C+' - ']=NN%20[C+]%20[C+]%30C%31=C(N=[C+]%31)[C+]%31[C+]2[C+' - ']2C%32=C(N=[C+]%32)[C+]%32[C+]%33[C+](C%34=C(N=[C+]%3' - '4)C4%34[C+2][NH2+][C+]8%34)[C+]4[C+]8[C+]%34SOC%34%32' - 'C%32=C(N=[C+]%32)[C+]%30[C+]%30C%32=C(N=[C+]%32)C%32%' - '34OS[C+]%32[C+]%32C%35=C(N=[C+]%35)[C+]([C+]%16N%16N=' - '[C+]N%16[C+]%30[C+]%16S[C+2]C%16%20N%16N=[C+]N%16[C+]' - '%17%19)[C+]%16SOC%16%17[C+]%15C%15=C([C+]=N%15)[C+]%1' - '5[C+]%16C%19=C([C+]=N%19)C%19%20OS[C+]%19[C+]%19C%30=' - 'C(N=[C+]%30)[C+]%30[C+]3N3[C+]=NN3[C+]([C+]%23N3N=[C+' - ']N3[C+]%19[C+]3[C+](C%19=C(N=[C+]%19)[C+]%32[C+]%19[C' - '+]([C+]%34N%23N=[C+]N8%23)N8[C+]=NN8[C+]([C+]9N8N=[C+' - ']N48)[C+](N4N=[C+]N4[C+]%26[C+](N4N=[C+]N%194)C4([C+2' - '][NH2+][C+]%244)N4N=[C+]N34)C3(OS[C+]%103)N3[C+]=NN3[' - 'C+]%28[C+]([C+]3[C+]%27N4[C+]=NN4[C+]([C+]%31C4=C([C+' - ']=N4)[C+]([C+]%16C4=C(N=[C+]4)C4([C+2][NH2+][C+]14)[C' - '+]%30N1N=[C+]N%331)[C+]1S[C+2]C1([C+]%15N1N=[C+]N%131' - ')N1N=[C+]N31)C1([C+2][NH2+][C+]21)N1N=[C+]N%291)N1[C+' - ']=NN%121)[C+]%20N1N=[C+]N1%17)C1([C+2]S[C+]%221)N1[C+' - ']=NN%181)[C+]%21N1N=[C+]N%251)N1N=[C+]N51)N1[C+]=NN61' - ')N1[C+]=NN1[C+]%14C1([C+2]S[C+]%111)N1N=[C+]N71' + '[C+]1=NC2=C1[C+]1[C+]3[C+]4C5=C(N=[C+]5)[C+]5[C+]6[C+' + ']7[C+]8[C+]9C%10=C(N=[C+]%10)[C+]%10[C+]%11C%12=C([C+' + ']=N%12)[C+]%12[C+]%13[C+]%14[C+]%15C%16=C(N=[C+]%16)[' + 'C+]%16[C+]%17C%18=C([C+]=N%18)[C+]%18[C+]([C+]%19[NH2' + '+][C+2]C%19([C+]%19[C+]%20C%21=C(N=[C+]%21)[C+]%21[C+' + ']%22C%23=C(N=[C+]%23)[C+]%23[C+]%24C%25=C([C+]=N%25)[' + 'C+]%25[C+]%26[C+]%27C%28=C([C+]=N%28)C%28%29OS[C+]%28' + '[C+]%28C%30=C(N=[C+]%30)[C+]([C+]%30[C+]%21N%21[C+]=N' + 'N%21[C+]%21[C+]%31C%32=C(N=[C+]%32)C%32%33[C+2][NH2+]' + '[C+]%32[C+]%32C%34=C(N=[C+]%34)[C+]%34[C+]([C+](C%35=' + 'C(N=[C+]%35)C5%35[C+2][NH2+][C+]9%35)[C+]5[C+]9[C+]%3' + '5SOC%35%34C%34=C(N=[C+]%34)[C+]%31[C+]%31C%34=C(N=[C+' + ']%34)C%34%35OS[C+]%34[C+]%34C%36=C(N=[C+]%36)[C+]([C+' + ']%17N%17N=[C+]N%17[C+]%31[C+]%17S[C+2]C%17%21N%17N=[C' + '+]N%17[C+]%18%20)[C+]%17SOC%17%18[C+]%16C%16=C([C+]=N' + '%16)[C+]%16[C+]%17C%20=C([C+]=N%20)C%20%21OS[C+]%20[C' + '+]%20C%31=C(N=[C+]%31)[C+]%31[C+]4N4[C+]=NN4[C+]([C+]' + '%24N4N=[C+]N4[C+]%20[C+]4[C+](C%20=C(N=[C+]%20)[C+]%3' + '4[C+]%20[C+]([C+]%35N%24N=[C+]N9%24)N9[C+]=NN9[C+]([C' + '+]%10N9N=[C+]N59)[C+](N5N=[C+]N5[C+]%27[C+](N5N=[C+]N' + '%205)C5([C+2][NH2+][C+]%255)N5N=[C+]N45)C4(OS[C+]%114' + ')N4[C+]=NN4[C+]%29[C+]([C+]4[C+]%28N5[C+]=NN5[C+]([C+' + '](C5=C([C+]=N5)[C+]([C+]%17C5=C(N=[C+]5)C%315[C+2][NH' + '2+][C+]15)[C+]1S[C+2]C1([C+]%16N1N=[C+]N%141)N1N=[C+]' + 'N41)[C+]2%32)[C+]%33N1N=[C+]N%301)N1[C+]=NN%131)[C+]%' + '21N1N=[C+]N1%18)[C+](N1N=[C+]N61)C1([C+2]S[C+]%231)N1' + '[C+]=NN%191)N1[C+]=NN31)C1(OS[C+]%221)N1N=[C+]N%261)N' + '1[C+]=NN71)N1[C+]=NN1[C+]%15C1([C+2]S[C+]%121)N1N=[C+' + ']N81' ), ), ), diff --git a/tests/molecular/molecules/molecule/fixtures/cof/periodic_kagome.py b/tests/molecular/molecules/molecule/fixtures/cof/periodic_kagome.py index 1061b5c14..9e6944d94 100644 --- a/tests/molecular/molecules/molecule/fixtures/cof/periodic_kagome.py +++ b/tests/molecular/molecules/molecule/fixtures/cof/periodic_kagome.py @@ -26,22 +26,22 @@ ), ), smiles=( - '[C+]1=NC2=C1[C+]1[C+2][C+]3C4=C(N=[C+]4)C45[C+]=N[C+]' - '4[C+]4C6=C([C+]=N6)[C+]6[C+]7[C+2][C+]8C9=C(N=[C+]9)[' - 'C+]9[C+2][C+]%10C%11=C([C+]=N%11)[C+]%11[C+]%12[C+2][' - 'C+]%13C%14=C(N=[C+]%14)C%14%15[C+]=N[C+]%14[C+]%14C%1' - '6=C([C+]=N%16)[C+]%16[C+]%17[C+2][C+]%18C%19=C(N=[C+]' - '%19)[C+]%19[C+2][C+]%20C%21=C([C+]=N%21)C3%21[C+]=N[C' - '+]%21[C+]1C1=C(N=[C+]1)C13[C+]=N[C+]1[C+]1C%21=C(N=[C' - '+]%21)[C+]%20[C+]%20N=[C+]C%19%20C%19=C([C+]=N%19)[C+' - ']%19[C+2][C+](C%20=C(N=[C+]%20)C8%20[C+]=N[C+]6%20)[C' - '+](C6=C(N=[C+]6)[C+]4[C+2][C+]5C4=C([C+]=N4)[C+]4[C+2' - '][C+]2[C+](C2=C(N=[C+]2)[C+]%10[C+]2N=[C+]C92C2=C([C+' - ']=N2)[C+]2[C+2][C+](C5=C(N=[C+]5)C%185[C+]=N[C+]%165)' - '[C+](C5=C(N=[C+]5)[C+]%14[C+2][C+]%15C5=C([C+]=N5)[C+' - ']3[C+2][C+]1C1=C([C+]=N1)C%131[C+]=N[C+]%111)[C+]1N=[' - 'C+]C21C1=C7N=[C+]1)[C+]1N=[C+]C41C1=C%12[C+]=N1)[C+]1' - 'N=[C+]C%191C1=C%17N=[C+]1' + '[C+]1=NC2=C1[C+]1[C+]3[C+2][C+]4C5=C(N=[C+]5)C56[C+]=' + 'N[C+]5[C+]5C7=C([C+]=N7)[C+]7[C+]8[C+2][C+]9C%10=C(N=' + '[C+]%10)[C+]%10[C+2][C+]%11C%12=C([C+]=N%12)[C+]%12[C' + '+]%13[C+2][C+]%14C%15=C(N=[C+]%15)C%15%16[C+]=N[C+]%1' + '5[C+]%15C%17=C([C+]=N%17)[C+]%17[C+]%18[C+2][C+]%19C%' + '20=C(N=[C+]%20)[C+]%20[C+2][C+]2[C+]2C%21=C([C+]=N%21' + ')[C+]%21[C+]([C+2][C+](C%22=C(N=[C+]%22)[C+]%16[C+2][' + 'C+]%15C%15=C([C+]=N%15)[C+]%15[C+]([C+2][C+](C%16=C(N' + '=[C+]%16)C%10%16[C+]=N[C+]%16[C+]%11C%10=C([C+]=N%10)' + '[C+]%10[C+]([C+2][C+](C%11=C(N=[C+]%11)[C+]6[C+2][C+]' + '5C5=C([C+]=N5)[C+]5[C+]([C+2][C+](C6=C(N=[C+]6)C%206[' + 'C+]=N[C+]26)C2([C+]=N[C+]52)C2=C%18N=[C+]2)C2=C(N=[C+' + ']2)C92[C+]=N[C+]72)C2([C+]=N[C+]%102)C2=C%13[C+]=N2)C' + '2=C([C+]=N2)C42[C+]=N[C+]12)C1([C+]=N[C+]%151)C1=C8N=' + '[C+]1)C1=C(N=[C+]1)C%191[C+]=N[C+]%171)C1([C+]=N[C+]%' + '211)C1=C3[C+]=N1)C1=C([C+]=N1)C%141[C+]=N[C+]%121' ), ), ), diff --git a/tests/molecular/molecules/molecule/fixtures/position_matrices/cof_hexagonal0.npy b/tests/molecular/molecules/molecule/fixtures/position_matrices/cof_hexagonal0.npy index 25f2f01711c14d5604d39d8f5c63c2f4271d51bd..a3d3214a357a501681c0219752b85656e385a554 100644 GIT binary patch delta 1277 zcmZ9Mdo-J89LFVVf~7P?y``iSIp!MTlB)8nOHm}=C{4X}ZCv6c+pH(7-Kn&qW#}Az zt!Q_1FxuHr;;ra;e@APv!S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z-y8?*O=vZv1T#T7Qel+%%M1rR8b2d*Mv@7mCOX;eBIY>YJT0+@)6)##PCDlhVPlR1 z9^COm{9Gdgbju~=hrYATaKIr>GJ%Wl7$By#aq@+g84h@tNS|}idj@E@FrL^xHN^od zDeJ%eT)+TQRfGRbwkZxc@OUu6^eF?{n^)%|f0*Kc8Fld#%{T_s4_6n{xXu3s{HN^2 z?!+nv#5M2~?Ju#w0Y3|LHW(LWg4VOrAjfJ89B}U~Wvaj)CJf!0I_+;@0pq^`3(vc8 z6>eaH$jiU>uS+z;0Y`}miC)LHre&5spR8|&10HH_cV)L0Gl0#tHK#?<3lzsjN1IEx!TROu5XiN@2k4*Jzu-)22A!gec1} z@&g7eZ<9-MA)DcVC2zU5+{eCuXI+t&k)@0&4)|lfczNb?2Aoj;WN|&+1P5%^(SP6P zIs>ds=U$}{P5%d&7PosDyRgPJPWl!L{La@UojPNW13oP~CpnhMf(I6&((Uc`IN)U> z4$N28EC^?6DX8;0;DDRO^inU5vB2scBO|%b9tRvXIAzWd^Mto&l`=&{9B{x2%jaw5 zG(Fjnb;kRY@31`%IE7DOj}XNZw$$tk-;`#L119FtV@Cr$VP&PfCt<%m4mesj!b4rc z6UJ|Cuk`k_#{rv-q>X1xvEWC&b1Egl9tRxpIod&|fdv-_q@!k-Ytuml7e(|<92Ey_Qqd4>{*49iL@JxIUnva$nhqJY diff --git a/tests/molecular/molecules/molecule/fixtures/position_matrices/cof_hexagonal3.npy b/tests/molecular/molecules/molecule/fixtures/position_matrices/cof_hexagonal3.npy index 4e92e266a489d628fd149a7b9d073ffc43e823d2..6e6124e90813bf009143f4185c6abf578b4621e5 100644 GIT binary patch delta 1404 zcmZA0e^8Tk90zcQh_U1b6pSIF88NV81Ge!axaR|dF_6KtTW~x$_wZ}g4oQBPuqa2F zzeovq1Ov*z<4P2Q1PLLWdi{`sLk^va7?ijf>KG6|6;`M2@qGUMe((Fa*ZX_#&*jw1 zsjXsb=JKzH4edulVB5Wp{d{KtuAL@E6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*ADq)Obj1kl)O(+t0xnEgme+eG8o(=(YJc HcO@eLhZNl0 diff --git a/tests/molecular/molecules/molecule/fixtures/position_matrices/cof_honeycomb1.npy b/tests/molecular/molecules/molecule/fixtures/position_matrices/cof_honeycomb1.npy index 452140cd48ae9e8d0bfb1eae143adfad96605acf..28f5fb18a8f5de9d96ec7fd03b02ed82dc9ec966 100644 GIT binary patch delta 532 zcmX>gbwFyv0gn2%{?L%6mBtP!CzbL`6d4X|RN2}zOTf?J@Ws5T%~wnu?oM?q)jRfN z|BmU(X2{}`A>#Jiq2fs<++1&M%^Y?uuxPRCd1SwB_1ph5f#!6(++Xq7-pt{1{@;6L z|DNu5p1GbAWX?Ud{%HXlmFgX8mR5f$urP7BrsQo8lGwCyuf~ck$__o-I6Zh{jT~SW zU->A{6#qrlLF(PV!*{kBI>0R6wYkh*E=R>7>y6>3qiqHbpFFhPK<0cYy!0!{Ldn6S z`}q_bbwh_EPyGTw;s$o}=C3{I>5zDmIV1V$ersC6We^w-XQ@jcll0f~29*4p}AG-&dBuE_c&R%!`H?ff0) zL&Fv3ZJ79RXgt8Y?U|t3e&D{p!|an)PaESH4oEWyrGdgbwFyv0gig}=-9x@NhS_o1%5QT2|V7vW4f~0ECD|UKaYl+y<(;g8zJKM+o9ru zFD%cP)|xoHlzQLzm4(?sQs8MbNWDtGi>6|r&Pw=UE&vVDr z;fd=DmffQb(E(9=`ZW0f^>fLZ)(-K5)FWzAE))(jT6((Xu}fF% z9ON$^Z2Wr4+o8OyDHbHYsho{-KDUFzi@Iy(p*y`Dcsh@zgTy;7Yi<258Z`MmS7iOG zuX;_V;{6?VL&F;u9C7usb_Znr9UepD2NoQsb{%lZ$?|sy$^^&5f%@7V$sjYGVy&l@ zRr@(yU6=!k2YX8+e}9m8T7&#%hTVP+&Qjobus3Y2j|7QZock6!JJ4(Maqdb+0Q#HU AI{*Lx diff --git a/tests/molecular/molecules/molecule/fixtures/position_matrices/cof_honeycomb2.npy b/tests/molecular/molecules/molecule/fixtures/position_matrices/cof_honeycomb2.npy index 14eaf478a684f6f08fb37d56ae365460630a887a..0a6638286ba4db7db379ae3a69d17048a7d0f1a2 100644 GIT binary patch delta 532 zcmX>gbwFyv0gn2^7xShzUommmJk_yO@7NRj9n+P~W(oK?z{K}L#P@H9iVMl+KCToq zbLc%;^|UdL;ea%QP#Q@6hQvz>QrX51PZn6T*!4WxzvuUAACUOJ$bXH>nZ^z$^Z(u} z`}fp-?cy6@Ao0r|<(cBYsMb43z593g&Nf2_n8lkn?$ubaMcJWe8>a_vtdRrE;&1Ld zpSZItI6Syg9LoOF&>`3Bgg3|_>qlv?U)ZQR)U3HCsnTogu*zL83nczlp4(tafx3ej zmty(aH%1QSKbuQH;s$o}=C3{I>5zDmIV1V$ersC6We^w-XQ@jXAkPo0#we-zm}OkD9^sQrRB+$r}A zc3sPIb8v{eKINcygE!nM9hbGXeisdz{GKbaeuGPB{T$2-P~*Yk+_%u#fnJ-Bb5}9~0MexH8UO$Q delta 532 zcmX>gbwFyv0gifqkA|DQVx|tK1%5QT2|TvnF0Pm@WsnNs7u*FPft~kRo2J> zW^tVAn;Rc06&z07I;UsCX6UeyT__x6(2B0o#CZ%V4%7ZteP?Jgb|^1viUo<=S=;<9 zX;pL3j9ij@AkNr?5*w%}hIo?3ZG5%O$+wPAPcugt11@)?wHFY+3$ZFSt{rr)wU&bj8j={^G&L zucy4>PT5q>#yOwc!Qn;SHS^G&-f*XMT-Mt9T{LL&d#=d(S6}s-PR08>>_&@+xO!Q; z1G4@OkI~}c)UE?AIa&S~@!%9|J*}+T&*ADq)Obj1kl)O(+t0xnEgme+eG8o(=(YJc HcO@eLhZNl0 diff --git a/tests/molecular/molecules/molecule/fixtures/position_matrices/cof_kagome0.npy b/tests/molecular/molecules/molecule/fixtures/position_matrices/cof_kagome0.npy index a3588035fa237ee65cb8dcbdeb8c6d296d311bf4..8a053cbccfb5515b1fac48c00b16d633945bd6f7 100644 GIT binary patch delta 304 zcmcbhenEXh1Lx!!oC#vT<5oOZ-W}mEx&K?-;k_;n&fY#OmOD0o<2=P!-{Trhp5F4b4 z&y@+d=_RdpW1z;m-b&qB6(*6EMZqb7tngioC)@pVQZ+!6m(1&vhPWck-khWI!rX*Vs+z|^`>q)q84{^AZC-L2uD+ulgKmGeR?H+_U7`X4KbU6|T RcSOO;*hp2;n91?Ng#ebuf1v;X delta 305 zcmcbhenEXh1E;tc_g9XG{Sgj+oXbU*9&mG*SrGI`quyt7J!j(PADkx`>+?FNd^sj( z>JU2TMySnNM+a8lE_vGtz7Erkn^EKBAo{Z310=pEap^4fTvLaI?n`WU#W^`la=#V? z5|?#t?R-<{U$N2n;Hmr#PfeY59@Y@IHaDPaLnjQAlwm2 z@%G`#Q6Ua{GCHc+f`c4R9lBfqGF0I#_jZZ9Ar6g?&iH2?3Us&{wNL;geq}}Ed6vT= f4*k0(2QMxSbO`(~Qwk(rurfAMRWxRDyl^1^@H2gk diff --git a/tests/molecular/molecules/molecule/fixtures/position_matrices/cof_periodic_hexagonal0.npy b/tests/molecular/molecules/molecule/fixtures/position_matrices/cof_periodic_hexagonal0.npy index 8feb54be6b8691273561d0ffecb882b8894bdcb6..e29ac1b48489207f5178af65db990a849448eef3 100644 GIT binary patch delta 1021 zcmZ9LeNfAB9LJg4qO>0Greu1)A*q%MX>UC!r&_-;W!Te{8T&Ewh9PzcAO!W~_8 z#f8$tg=)I;l&&LmI}LT@DX!g#Qb@ygZvVc%_kF!T_x{``0~x4b(cE&_Khz~ZdpJ7_ z0^Y^f5eUC;7ucAUjC}1P8bf`!?R{IGdn;#L`-}n8Yf`MNxSx}Z1q(vt9z6q`C0Wtm zOB*21TCvRd<$B9xJ>HlNF4E#|%4T@x=Rig2j(2&FqT4u3|kpV*@IWV~^I zG&ce=>b|TU^w*ZEC%^2if8HB`q`zFZw(%i8w0SYTWA>ZJtzmc#ITde{#ze0RHm26Z~n5~D-aO?Uplow4jaX5XGl1#r&j@qe9V)zhN zIXO5?Q0uw&j+vceD1Cw*o2R5$mQ+O za`*@l-w(6pif?4;ZH^#^+@ry7H$30E|AbxRXOKCX#oV#)m4Y06SC;&DzWkBZekt$F zACvE}rNro+mr6cd7VW?-<>mDu$-gJSwjyQ*f8WU}7 zf?eSjd}mgz6~7hdaN1Q~@rp4*-2Fxa&(b4t4i3?mj_|j*z%6)XF8us$Nu0yp@}nX9 z7P>$z*u!z8-a|Emq4c0wk_5WrdK;q)>+pG}F?QG_oYqLV>0|JN{+Z2``Ca^DjibS_R3Uv|jhn~9$bm`n zYh+%gqC+5;&dSnFfet%(mN0)UHFl6yKD03SnUaI>y|4Z$y8<2BWsBT}ZW=q(N$6hS z*lMWiVB)@JN%-DC2Y(UEXBO{`9I}3Xvq<@=?(nPM>8Ib8K!=4Q46HMX4IQ5D&QjR& LS$(s=@J1d0Rv^o= diff --git a/tests/molecular/molecules/molecule/fixtures/position_matrices/cof_periodic_honeycomb0.npy b/tests/molecular/molecules/molecule/fixtures/position_matrices/cof_periodic_honeycomb0.npy index 2f327ded113af2ff72eb536630fc8ed828cf02e2..9a76c857fed3aa3ed75d5f33f38e33acd9aeb4eb 100644 GIT binary patch delta 396 zcmZpWY>?cLz)^qrV&2r|D<%$`r#hDE9eZNGW4f~0ECD|UnD}0Z`2Ous@ePTW6r{3^ z9iA+(XtC>gw13a<)jlBg|04f2DrXuyoXr1wuk7Db`?ZU2gn`5_f0Sp6|Dx(3_3q!{ zJKGE$VCHY$xL0Gv7G+z9o^6~Sys<_OFbk|7rM-S(qv}wz=9;8Rud%}_cfBl-L2u=` z4VDzBJBV>9malzd!`xM8S6*Ld=P*l` zb5*s4H{61!PD|X!9Sg7DfPr7PBk> delta 396 zcmZpWY>?cLz)|n-(Qva@%+%quz>h{ZfyeecrYoDx67X}dh>i`coMhr~2O_?IJ5>Ci z*i6P}zQzuvGjqN>pP6fKY2@z@Qtuj@X#MMqv4f=43zpropY07>>mxzp&(=-4y+uyV zp`z^Z-6!7+9bo1!_~PXs)TM0epr@y*$0}>&0JC64S83ur1{H^Cf2+PTG#NXTmo>$L z46?Jf`B~Dc=Aaq5B>6y`u>()%vGmC@oJV5JG%c9#J+^n4!27Kvoz)v|gRqat-ZeAr z9I{`E%`KPkhFc&#UGvzbD|Qa@7Y{amJ>?CzU{g68=X`DlhZl9%%tLp2LoBf2N{M;( zRj=t(yuZV4v>=MBm$f?}>+kRwEr^_At*4b$`#D@)h#Ev`4f2~AcKbOvBL&gsKU^)0 E0D1zU4FCWD diff --git a/tests/molecular/molecules/molecule/fixtures/position_matrices/cof_periodic_kagome0.npy b/tests/molecular/molecules/molecule/fixtures/position_matrices/cof_periodic_kagome0.npy index 4735c80ae416d1cda4ea3b982c1f081737c28232..fb610af0af68c90e554cabf3fa43bb515e622072 100644 GIT binary patch delta 201 zcmZorZBSjn9n<3==ezctiNl9E6VLuEadcqy?UJ{h;OkITbLC}~hKWO8-Nc{ISezVK zpyK}~`SB%WnL0f4pWoFT?&NT+_#4~T*{O9Zp#$} cx4}>U{!P0FAr1!aJ1Sj{1cGgtEF+Wx00V|oR{#J2 delta 201 zcmZorZBSjn9h28N<;yWSQ-{zwH$rXJIy$iWcFEgL@O7AO9OsmH!`MNq-m7rQ8Ak^e zsQ9r5?^v|;OdJ-cPCuJbg5ateYALx8eD}pNDljLmX1iPB>=tBoJ Date: Tue, 20 Apr 2021 22:53:32 +0100 Subject: [PATCH 13/44] wip --- .../construction_result/__init__.py | 2 + .../construction_result.py | 0 .../construction_result/periodic.py | 48 +++++++++++++++++++ 3 files changed, 50 insertions(+) create mode 100644 src/stk/molecular/topology_graphs/topology_graph/construction_result/__init__.py rename src/stk/molecular/topology_graphs/topology_graph/{ => construction_result}/construction_result.py (100%) create mode 100644 src/stk/molecular/topology_graphs/topology_graph/construction_result/periodic.py diff --git a/src/stk/molecular/topology_graphs/topology_graph/construction_result/__init__.py b/src/stk/molecular/topology_graphs/topology_graph/construction_result/__init__.py new file mode 100644 index 000000000..cc7cfdb1b --- /dev/null +++ b/src/stk/molecular/topology_graphs/topology_graph/construction_result/__init__.py @@ -0,0 +1,2 @@ +from .construction_result import ConstructionResult +from .periodic import PeriodicConstructionResult diff --git a/src/stk/molecular/topology_graphs/topology_graph/construction_result.py b/src/stk/molecular/topology_graphs/topology_graph/construction_result/construction_result.py similarity index 100% rename from src/stk/molecular/topology_graphs/topology_graph/construction_result.py rename to src/stk/molecular/topology_graphs/topology_graph/construction_result/construction_result.py diff --git a/src/stk/molecular/topology_graphs/topology_graph/construction_result/periodic.py b/src/stk/molecular/topology_graphs/topology_graph/construction_result/periodic.py new file mode 100644 index 000000000..fb6b5b2cd --- /dev/null +++ b/src/stk/molecular/topology_graphs/topology_graph/construction_result/periodic.py @@ -0,0 +1,48 @@ +""" +Periodic Construction Result +============================ + +""" + +from .construction_result import ConstructionResult +from ...periodic_info import PeriodicInfo + + +class PeriodicConstructionResult(ConstructionResult): + """ + The result of :meth:`.TopologyGraph.construct` with periodic info. + + """ + + __slots__ = [ + '_periodic_info', + ] + + def __init__(self, construction_state): + """ + Initialize a :class:`.ConstructionResult`. + + Parameters + ---------- + construction_state : :class:`.ConstructionState` + The state from which the result is initialized. + + """ + + super().__init__(construction_state) + self._periodic_info = PeriodicInfo( + *construction_state.get_lattice_constants() + ) + + def get_periodic_info(self): + """ + Get the periodic cell information of the constructed molecule. + + Returns + ------- + :class:`.PeriodicInfo` + The periodic cell information of the constructed molecule. + + """ + + return self._periodic_info From 4aa677e080c92fddd59dbc2e1aeb025b3dd796bc Mon Sep 17 00:00:00 2001 From: Lukas Turcani Date: Tue, 20 Apr 2021 23:01:27 +0100 Subject: [PATCH 14/44] add some docs --- .../topology_graph/topology_graph.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/stk/molecular/topology_graphs/topology_graph/topology_graph/topology_graph.py b/src/stk/molecular/topology_graphs/topology_graph/topology_graph/topology_graph.py index 14ab12f9b..ef95e69c6 100644 --- a/src/stk/molecular/topology_graphs/topology_graph/topology_graph/topology_graph.py +++ b/src/stk/molecular/topology_graphs/topology_graph/topology_graph/topology_graph.py @@ -404,6 +404,24 @@ def construct(self): state = self._place_building_blocks(state) state = self._run_reactions(state) state = self._optimizer.optimize(state) + return self._get_construction_result(state) + + def _get_construction_result(self, state): + """ + Get the result of the construction. + + Parameters + ---------- + state : :class:`.ConstructionState` + The state of the molecule being constructed. + + Returns + ------- + :class:`.ConstructionResult` + The data describing the :class:`.ConstructedMolecule`. + + """ + return ConstructionResult(state) def _get_construction_state(self): From fb7f2457720c935d6bce65c857a3ffe7d58a12b9 Mon Sep 17 00:00:00 2001 From: Lukas Turcani Date: Tue, 20 Apr 2021 23:07:55 +0100 Subject: [PATCH 15/44] wip --- .../topology_graphs/cof/periodic_hexagonal.py | 32 +++++++++++++++++++ .../topology_graphs/cof/periodic_honeycomb.py | 32 +++++++++++++++++++ 2 files changed, 64 insertions(+) diff --git a/src/stk/molecular/topology_graphs/cof/periodic_hexagonal.py b/src/stk/molecular/topology_graphs/cof/periodic_hexagonal.py index 3658aeb62..2d4b54055 100644 --- a/src/stk/molecular/topology_graphs/cof/periodic_hexagonal.py +++ b/src/stk/molecular/topology_graphs/cof/periodic_hexagonal.py @@ -10,6 +10,7 @@ from .cof import Cof from .vertices import _LinearCofVertex, _NonLinearCofVertex from ..topology_graph import Edge, NullOptimizer +from ..construction_result import PeriodicConstructionResult from ...periodic_info import PeriodicInfo @@ -148,6 +149,37 @@ def get_periodic_info(self): ), ) + def construct(self): + """ + Construct a :class:`.ConstructedMolecule`. + + Returns + ------- + :class:`.PeriodicConstructionResult` + The data describing the :class:`.ConstructedMolecule`. + + """ + + return super().construct() + + def _get_construction_result(self, state): + """ + Get the result of the construction. + + Parameters + ---------- + state : :class:`.ConstructionState` + The state of the molecule being constructed. + + Returns + ------- + :class:`.PeriodicConstructionResult` + The data describing the :class:`.ConstructedMolecule`. + + """ + + return PeriodicConstructionResult(state) + _lattice_constants = _a, _b, _c = ( np.array([1., 0., 0.]), np.array([0.5, 0.866, 0]), diff --git a/src/stk/molecular/topology_graphs/cof/periodic_honeycomb.py b/src/stk/molecular/topology_graphs/cof/periodic_honeycomb.py index 32dbecd88..df8400abc 100644 --- a/src/stk/molecular/topology_graphs/cof/periodic_honeycomb.py +++ b/src/stk/molecular/topology_graphs/cof/periodic_honeycomb.py @@ -9,6 +9,7 @@ from .cof import Cof from .vertices import _LinearCofVertex, _NonLinearCofVertex from ..topology_graph import Edge, NullOptimizer +from ..construction_result import PeriodicConstructionResult from ...periodic_info import PeriodicInfo @@ -147,6 +148,37 @@ def get_periodic_info(self): ), ) + def construct(self): + """ + Construct a :class:`.ConstructedMolecule`. + + Returns + ------- + :class:`.PeriodicConstructionResult` + The data describing the :class:`.ConstructedMolecule`. + + """ + + return super().construct() + + def _get_construction_result(self, state): + """ + Get the result of the construction. + + Parameters + ---------- + state : :class:`.ConstructionState` + The state of the molecule being constructed. + + Returns + ------- + :class:`.PeriodicConstructionResult` + The data describing the :class:`.ConstructedMolecule`. + + """ + + return PeriodicConstructionResult(state) + _lattice_constants = _a, _b, _c = ( np.array([1., 0., 0.]), np.array([0.5, 0.866, 0]), From 91b751d8d12a09025515e48b29cd23ca970a953b Mon Sep 17 00:00:00 2001 From: Lukas Turcani Date: Wed, 21 Apr 2021 20:58:16 +0100 Subject: [PATCH 16/44] wip --- .../topology_graphs/cof/periodic_hexagonal.py | 32 +++++++++--------- .../topology_graphs/cof/periodic_honeycomb.py | 33 +++++++++---------- .../topology_graphs/cof/periodic_kagome.py | 33 ++++++++++++++++++- .../topology_graph/__init__.py | 1 + .../construction_result/__init__.py | 6 ++++ .../construction_result/periodic.py | 2 +- 6 files changed, 71 insertions(+), 36 deletions(-) diff --git a/src/stk/molecular/topology_graphs/cof/periodic_hexagonal.py b/src/stk/molecular/topology_graphs/cof/periodic_hexagonal.py index 2d4b54055..912187fc9 100644 --- a/src/stk/molecular/topology_graphs/cof/periodic_hexagonal.py +++ b/src/stk/molecular/topology_graphs/cof/periodic_hexagonal.py @@ -5,12 +5,16 @@ """ import numpy as np +import warnings from ...reactions import GenericReactionFactory from .cof import Cof from .vertices import _LinearCofVertex, _NonLinearCofVertex -from ..topology_graph import Edge, NullOptimizer -from ..construction_result import PeriodicConstructionResult +from ..topology_graph import ( + Edge, + NullOptimizer, + PeriodicConstructionResult, +) from ...periodic_info import PeriodicInfo @@ -135,6 +139,15 @@ def get_periodic_info(self): """ + warnings.warn( + 'You called get_periodic_info() on a topology graph ' + 'instance. This method will be removed in any version ' + 'of stk released on, or after, 21/10/21. Please call ' + 'the construct() method instead. This will return a ' + 'PeriodicConstructionResult which provides the new ' + 'get_periodic_info() method.' + ) + lattice_constants = self._get_lattice_constants() return PeriodicInfo( @@ -163,21 +176,6 @@ def construct(self): return super().construct() def _get_construction_result(self, state): - """ - Get the result of the construction. - - Parameters - ---------- - state : :class:`.ConstructionState` - The state of the molecule being constructed. - - Returns - ------- - :class:`.PeriodicConstructionResult` - The data describing the :class:`.ConstructedMolecule`. - - """ - return PeriodicConstructionResult(state) _lattice_constants = _a, _b, _c = ( diff --git a/src/stk/molecular/topology_graphs/cof/periodic_honeycomb.py b/src/stk/molecular/topology_graphs/cof/periodic_honeycomb.py index df8400abc..72ee0a40b 100644 --- a/src/stk/molecular/topology_graphs/cof/periodic_honeycomb.py +++ b/src/stk/molecular/topology_graphs/cof/periodic_honeycomb.py @@ -5,11 +5,16 @@ """ import numpy as np +import warnings + from ...reactions import GenericReactionFactory from .cof import Cof from .vertices import _LinearCofVertex, _NonLinearCofVertex -from ..topology_graph import Edge, NullOptimizer -from ..construction_result import PeriodicConstructionResult +from ..topology_graph import ( + Edge, + NullOptimizer, + PeriodicConstructionResult, +) from ...periodic_info import PeriodicInfo @@ -134,6 +139,15 @@ def get_periodic_info(self): """ + warnings.warn( + 'You called get_periodic_info() on a topology graph ' + 'instance. This method will be removed in any version ' + 'of stk released on, or after, 21/10/21. Please call ' + 'the construct() method instead. This will return a ' + 'PeriodicConstructionResult which provides the new ' + 'get_periodic_info() method.' + ) + lattice_constants = self._get_lattice_constants() return PeriodicInfo( @@ -162,21 +176,6 @@ def construct(self): return super().construct() def _get_construction_result(self, state): - """ - Get the result of the construction. - - Parameters - ---------- - state : :class:`.ConstructionState` - The state of the molecule being constructed. - - Returns - ------- - :class:`.PeriodicConstructionResult` - The data describing the :class:`.ConstructedMolecule`. - - """ - return PeriodicConstructionResult(state) _lattice_constants = _a, _b, _c = ( diff --git a/src/stk/molecular/topology_graphs/cof/periodic_kagome.py b/src/stk/molecular/topology_graphs/cof/periodic_kagome.py index 7c449bf77..8077bbaee 100644 --- a/src/stk/molecular/topology_graphs/cof/periodic_kagome.py +++ b/src/stk/molecular/topology_graphs/cof/periodic_kagome.py @@ -5,10 +5,16 @@ """ import numpy as np +import warnings + from ...reactions import GenericReactionFactory from .cof import Cof from .vertices import _LinearCofVertex, _NonLinearCofVertex -from ..topology_graph import Edge, NullOptimizer +from ..topology_graph import ( + Edge, + NullOptimizer, + PeriodicConstructionResult, +) from ...periodic_info import PeriodicInfo @@ -133,6 +139,15 @@ def get_periodic_info(self): """ + warnings.warn( + 'You called get_periodic_info() on a topology graph ' + 'instance. This method will be removed in any version ' + 'of stk released on, or after, 21/10/21. Please call ' + 'the construct() method instead. This will return a ' + 'PeriodicConstructionResult which provides the new ' + 'get_periodic_info() method.' + ) + lattice_constants = self._get_lattice_constants() return PeriodicInfo( @@ -147,6 +162,22 @@ def get_periodic_info(self): ), ) + def construct(self): + """ + Construct a :class:`.ConstructedMolecule`. + + Returns + ------- + :class:`.PeriodicConstructionResult` + The data describing the :class:`.ConstructedMolecule`. + + """ + + return super().construct() + + def _get_construction_result(self, state): + return PeriodicConstructionResult(state) + _lattice_constants = _a, _b, _c = ( np.array([1., 0., 0.]), np.array([0.5, 0.866, 0.]), diff --git a/src/stk/molecular/topology_graphs/topology_graph/__init__.py b/src/stk/molecular/topology_graphs/topology_graph/__init__.py index 09fc7c9f0..0c7880999 100644 --- a/src/stk/molecular/topology_graphs/topology_graph/__init__.py +++ b/src/stk/molecular/topology_graphs/topology_graph/__init__.py @@ -2,3 +2,4 @@ from .vertex import * # noqa from .topology_graph import * # noqa from .optimizers import * # noqa +from .construction_result import * # noqa diff --git a/src/stk/molecular/topology_graphs/topology_graph/construction_result/__init__.py b/src/stk/molecular/topology_graphs/topology_graph/construction_result/__init__.py index cc7cfdb1b..9a5f221ae 100644 --- a/src/stk/molecular/topology_graphs/topology_graph/construction_result/__init__.py +++ b/src/stk/molecular/topology_graphs/topology_graph/construction_result/__init__.py @@ -1,2 +1,8 @@ from .construction_result import ConstructionResult from .periodic import PeriodicConstructionResult + + +__all__ = [ + 'ConstructionResult', + 'PeriodicConstructionResult', +] diff --git a/src/stk/molecular/topology_graphs/topology_graph/construction_result/periodic.py b/src/stk/molecular/topology_graphs/topology_graph/construction_result/periodic.py index fb6b5b2cd..4cda3c9a3 100644 --- a/src/stk/molecular/topology_graphs/topology_graph/construction_result/periodic.py +++ b/src/stk/molecular/topology_graphs/topology_graph/construction_result/periodic.py @@ -5,7 +5,7 @@ """ from .construction_result import ConstructionResult -from ...periodic_info import PeriodicInfo +from ....periodic_info import PeriodicInfo class PeriodicConstructionResult(ConstructionResult): From c20ea67af5e342907108872384a70f5d04dcdb8d Mon Sep 17 00:00:00 2001 From: Lukas Turcani Date: Wed, 21 Apr 2021 21:02:52 +0100 Subject: [PATCH 17/44] wip --- .../cof/periodic_linkerless_honeycomb.py | 33 ++++++++++++++++++- .../topology_graphs/cof/periodic_square.py | 32 +++++++++++++++++- 2 files changed, 63 insertions(+), 2 deletions(-) diff --git a/src/stk/molecular/topology_graphs/cof/periodic_linkerless_honeycomb.py b/src/stk/molecular/topology_graphs/cof/periodic_linkerless_honeycomb.py index 9fe3261c8..b28cc0557 100644 --- a/src/stk/molecular/topology_graphs/cof/periodic_linkerless_honeycomb.py +++ b/src/stk/molecular/topology_graphs/cof/periodic_linkerless_honeycomb.py @@ -5,10 +5,16 @@ """ import numpy as np +import warnings + from ...reactions import GenericReactionFactory from .cof import Cof from .vertices import _NonLinearCofVertex -from ..topology_graph import Edge, NullOptimizer +from ..topology_graph import ( + Edge, + NullOptimizer, + PeriodicConstructionResult, +) from ...periodic_info import PeriodicInfo @@ -132,6 +138,15 @@ def get_periodic_info(self): """ + warnings.warn( + 'You called get_periodic_info() on a topology graph ' + 'instance. This method will be removed in any version ' + 'of stk released on, or after, 21/10/21. Please call ' + 'the construct() method instead. This will return a ' + 'PeriodicConstructionResult which provides the new ' + 'get_periodic_info() method.' + ) + lattice_constants = self._get_lattice_constants() return PeriodicInfo( @@ -146,6 +161,22 @@ def get_periodic_info(self): ), ) + def construct(self): + """ + Construct a :class:`.ConstructedMolecule`. + + Returns + ------- + :class:`.PeriodicConstructionResult` + The data describing the :class:`.ConstructedMolecule`. + + """ + + return super().construct() + + def _get_construction_result(self, state): + return PeriodicConstructionResult(state) + _lattice_constants = _a, _b, _c = ( np.array([1., 0., 0.]), np.array([0.5, 0.866, 0.]), diff --git a/src/stk/molecular/topology_graphs/cof/periodic_square.py b/src/stk/molecular/topology_graphs/cof/periodic_square.py index 81c7ede5b..fb401e3b5 100644 --- a/src/stk/molecular/topology_graphs/cof/periodic_square.py +++ b/src/stk/molecular/topology_graphs/cof/periodic_square.py @@ -5,10 +5,15 @@ """ import numpy as np +import warnings from ...reactions import GenericReactionFactory from .cof import Cof from .vertices import _LinearCofVertex, _NonLinearCofVertex -from ..topology_graph import Edge, NullOptimizer +from ..topology_graph import ( + Edge, + NullOptimizer, + PeriodicConstructionResult, +) from ...periodic_info import PeriodicInfo @@ -133,6 +138,15 @@ def get_periodic_info(self): """ + warnings.warn( + 'You called get_periodic_info() on a topology graph ' + 'instance. This method will be removed in any version ' + 'of stk released on, or after, 21/10/21. Please call ' + 'the construct() method instead. This will return a ' + 'PeriodicConstructionResult which provides the new ' + 'get_periodic_info() method.' + ) + lattice_constants = self._get_lattice_constants() return PeriodicInfo( @@ -147,6 +161,22 @@ def get_periodic_info(self): ), ) + def construct(self): + """ + Construct a :class:`.ConstructedMolecule`. + + Returns + ------- + :class:`.PeriodicConstructionResult` + The data describing the :class:`.ConstructedMolecule`. + + """ + + return super().construct() + + def _get_construction_result(self, state): + return PeriodicConstructionResult(state) + _lattice_constants = _a, _b, _c = ( np.array([1., 0., 0.]), np.array([0., 1., 0.]), From 3599a8c9ade4ec807069cf675aba590c4aec3980 Mon Sep 17 00:00:00 2001 From: Lukas Turcani Date: Wed, 21 Apr 2021 21:48:41 +0100 Subject: [PATCH 18/44] Add collapsed tests --- .../optimizers/periodic_collapser.py | 2 +- .../fixtures/cof/periodic_hexagonal.py | 90 ++++++++++++++++++ .../fixtures/cof/periodic_honeycomb.py | 36 ++++++- .../molecule/fixtures/cof/periodic_kagome.py | 39 ++++++++ .../cof/periodic_linkerless_honeycomb.py | 25 +++++ .../molecule/fixtures/cof/periodic_square.py | 24 +++++ .../cof_periodic_hexagonal1.npy | Bin 0 -> 8192 bytes .../cof_periodic_honeycomb1.npy | Bin 0 -> 3200 bytes .../cof_periodic_kagome1.npy | Bin 0 -> 4736 bytes .../cof_periodic_linkerless_honeycomb1.npy | Bin 0 -> 2048 bytes .../cof_periodic_square1.npy | Bin 0 -> 1376 bytes 11 files changed, 214 insertions(+), 2 deletions(-) create mode 100644 tests/molecular/molecules/molecule/fixtures/position_matrices/cof_periodic_hexagonal1.npy create mode 100644 tests/molecular/molecules/molecule/fixtures/position_matrices/cof_periodic_honeycomb1.npy create mode 100644 tests/molecular/molecules/molecule/fixtures/position_matrices/cof_periodic_kagome1.npy create mode 100644 tests/molecular/molecules/molecule/fixtures/position_matrices/cof_periodic_linkerless_honeycomb1.npy create mode 100644 tests/molecular/molecules/molecule/fixtures/position_matrices/cof_periodic_square1.npy diff --git a/src/stk/molecular/topology_graphs/topology_graph/optimizers/periodic_collapser.py b/src/stk/molecular/topology_graphs/topology_graph/optimizers/periodic_collapser.py index 60064456f..693d2b801 100644 --- a/src/stk/molecular/topology_graphs/topology_graph/optimizers/periodic_collapser.py +++ b/src/stk/molecular/topology_graphs/topology_graph/optimizers/periodic_collapser.py @@ -62,7 +62,7 @@ def __init__( self, step_size=0.1, distance_threshold=1.5, - scale_steps=True, + scale_steps=False, ): """ Initialize an instance of :class:`.PeriodicCollapser`. diff --git a/tests/molecular/molecules/molecule/fixtures/cof/periodic_hexagonal.py b/tests/molecular/molecules/molecule/fixtures/cof/periodic_hexagonal.py index cb0545817..b8c78fdfd 100644 --- a/tests/molecular/molecules/molecule/fixtures/cof/periodic_hexagonal.py +++ b/tests/molecular/molecules/molecule/fixtures/cof/periodic_hexagonal.py @@ -95,6 +95,96 @@ ']N81' ), ), + CaseData( + molecule=stk.ConstructedMolecule( + topology_graph=stk.cof.PeriodicHexagonal( + building_blocks={ + stk.BuildingBlock( + smiles='BrC1=C(Br)[C+]=N1', + functional_groups=[stk.BromoFactory()], + ): ( + 4, 5, 6, 7, 8, 9, 20, 21, 23, 24, 30, 36, + 38, 40, 41, 42, 43, 46, 47, 52, 53, 60, 61, + ), + stk.BuildingBlock( + smiles='BrN1N(Br)[C+]=N1', + functional_groups=[stk.BromoFactory()], + ): ( + 10, 11, 12, 13, 14, 15, 22, 25, 26, 27, 28, + 29, 37, 39, 44, 45, 54, 55, 56, 57, 58, 59, + 31, 62, 63, + ), + stk.BuildingBlock( + smiles=( + 'Br[C+]1[C+]2[N+][C+2]C2(Br)[C+](I)[C+' + '](I)[C+](Br)[C+]1Br' + ), + functional_groups=[ + stk.BromoFactory(), + stk.IodoFactory(), + stk.FluoroFactory(), + ], + ): (0, 1, 18, 50, 51), + stk.BuildingBlock( + smiles=( + 'Br[C+]1[C+]2[S][C+2]C2(Br)[C+](I)[C+]' + '(I)[C+](Br)[C+]1Br' + ), + functional_groups=[ + stk.BromoFactory(), + stk.IodoFactory(), + stk.FluoroFactory(), + ], + ): (2, 16, 34, 49), + stk.BuildingBlock( + smiles=( + 'Br[C+]1[C+]2[S][O]C2(Br)[C+](I)[C+](I' + ')[C+](Br)[C+]1Br' + ), + functional_groups=[ + stk.BromoFactory(), + stk.IodoFactory(), + stk.FluoroFactory(), + ], + ): (3, 17, 19, 32, 33, 35, 48), + }, + lattice_size=(2, 2, 1), + vertex_alignments={0: 5}, + optimizer=stk.PeriodicCollapser(), + ), + ), + smiles=( + '[C+]1=NC2=C1[C+]1[C+]3[C+]4C5=C(N=[C+]5)[C+]5[C+]6[C+' + ']7[C+]8[C+]9C%10=C(N=[C+]%10)[C+]%10[C+]%11C%12=C([C+' + ']=N%12)[C+]%12[C+]%13[C+]%14[C+]%15C%16=C(N=[C+]%16)[' + 'C+]%16[C+]%17C%18=C([C+]=N%18)[C+]%18[C+]([C+]%19[NH2' + '+][C+2]C%19([C+]%19[C+]%20C%21=C(N=[C+]%21)[C+]%21[C+' + ']%22C%23=C(N=[C+]%23)[C+]%23[C+]%24C%25=C([C+]=N%25)[' + 'C+]%25[C+]%26[C+]%27C%28=C([C+]=N%28)C%28%29OS[C+]%28' + '[C+]%28C%30=C(N=[C+]%30)[C+]([C+]%30[C+]%21N%21[C+]=N' + 'N%21[C+]%21[C+]%31C%32=C(N=[C+]%32)C%32%33[C+2][NH2+]' + '[C+]%32[C+]%32C%34=C(N=[C+]%34)[C+]%34[C+]([C+](C%35=' + 'C(N=[C+]%35)C5%35[C+2][NH2+][C+]9%35)[C+]5[C+]9[C+]%3' + '5SOC%35%34C%34=C(N=[C+]%34)[C+]%31[C+]%31C%34=C(N=[C+' + ']%34)C%34%35OS[C+]%34[C+]%34C%36=C(N=[C+]%36)[C+]([C+' + ']%17N%17N=[C+]N%17[C+]%31[C+]%17S[C+2]C%17%21N%17N=[C' + '+]N%17[C+]%18%20)[C+]%17SOC%17%18[C+]%16C%16=C([C+]=N' + '%16)[C+]%16[C+]%17C%20=C([C+]=N%20)C%20%21OS[C+]%20[C' + '+]%20C%31=C(N=[C+]%31)[C+]%31[C+]4N4[C+]=NN4[C+]([C+]' + '%24N4N=[C+]N4[C+]%20[C+]4[C+](C%20=C(N=[C+]%20)[C+]%3' + '4[C+]%20[C+]([C+]%35N%24N=[C+]N9%24)N9[C+]=NN9[C+]([C' + '+]%10N9N=[C+]N59)[C+](N5N=[C+]N5[C+]%27[C+](N5N=[C+]N' + '%205)C5([C+2][NH2+][C+]%255)N5N=[C+]N45)C4(OS[C+]%114' + ')N4[C+]=NN4[C+]%29[C+]([C+]4[C+]%28N5[C+]=NN5[C+]([C+' + '](C5=C([C+]=N5)[C+]([C+]%17C5=C(N=[C+]5)C%315[C+2][NH' + '2+][C+]15)[C+]1S[C+2]C1([C+]%16N1N=[C+]N%141)N1N=[C+]' + 'N41)[C+]2%32)[C+]%33N1N=[C+]N%301)N1[C+]=NN%131)[C+]%' + '21N1N=[C+]N1%18)[C+](N1N=[C+]N61)C1([C+2]S[C+]%231)N1' + '[C+]=NN%191)N1[C+]=NN31)C1(OS[C+]%221)N1N=[C+]N%261)N' + '1[C+]=NN71)N1[C+]=NN1[C+]%15C1([C+2]S[C+]%121)N1N=[C+' + ']N81' + ), + ), ), ) def cof_periodic_hexagonal(request): diff --git a/tests/molecular/molecules/molecule/fixtures/cof/periodic_honeycomb.py b/tests/molecular/molecules/molecule/fixtures/cof/periodic_honeycomb.py index dc124dc4f..b4051855f 100644 --- a/tests/molecular/molecules/molecule/fixtures/cof/periodic_honeycomb.py +++ b/tests/molecular/molecules/molecule/fixtures/cof/periodic_honeycomb.py @@ -22,7 +22,41 @@ functional_groups=[stk.BromoFactory()], ), ), - lattice_size=(2, 2, 1)), + lattice_size=(2, 2, 1), + ), + ), + smiles=( + '[H]C12[C+]=NC13C1=C(N=[C+]1)C14N=[C+]C1([H])[C+]1[C+2' + '][C+](C5=C([C+]=N5)[C+]5[C+2][C+]6C7=C(N=[C+]7)[C+]7[' + 'C+2][C+]8C9=C([C+]=N9)[C+]9[C+2][C+](C%10=C1N=[C+]%10' + ')C1([H])[C+]=NC1(C1=C(N=[C+]1)C1%10N=[C+]C1([H])[C+]1' + '[C+2][C+](C%11=C([C+]=N%11)[C+]%11[C+2][C+](C%12=C(N=' + '[C+]%12)[C+]%12[C+2][C+](C%13=C([C+]=N%13)[C+]([C+2][' + 'C+]2C2=C1N=[C+]2)[C+]3F)[C+](F)C1(N=[C+]C%121[H])C1=C' + '([C+]=N1)C1(N=[C+]C61[H])[C+]5F)C1([H])[C+]=NC1(C1=C(' + 'N=[C+]1)C1(N=[C+]C71[H])[C+]8F)[C+]%11F)[C+]%10F)[C+]' + '9F)[C+]4F' + ), + ), + CaseData( + molecule=stk.ConstructedMolecule( + topology_graph=stk.cof.PeriodicHoneycomb( + building_blocks=( + stk.BuildingBlock( + smiles='BrC1=C(Br)[C+]=N1', + functional_groups=[stk.BromoFactory()], + ), + stk.BuildingBlock( + smiles=( + 'Br[C+]1C2[C+]=NC2(Br)[C+](F)[C+](Br)' + '[C+2]1' + ), + functional_groups=[stk.BromoFactory()], + ), + ), + lattice_size=(2, 2, 1), + optimizer=stk.PeriodicCollapser(), + ), ), smiles=( '[H]C12[C+]=NC13C1=C(N=[C+]1)C14N=[C+]C1([H])[C+]1[C+2' diff --git a/tests/molecular/molecules/molecule/fixtures/cof/periodic_kagome.py b/tests/molecular/molecules/molecule/fixtures/cof/periodic_kagome.py index 9e6944d94..debfb76a3 100644 --- a/tests/molecular/molecules/molecule/fixtures/cof/periodic_kagome.py +++ b/tests/molecular/molecules/molecule/fixtures/cof/periodic_kagome.py @@ -44,6 +44,45 @@ '211)C1=C3[C+]=N1)C1=C([C+]=N1)C%141[C+]=N[C+]%121' ), ), + CaseData( + molecule=stk.ConstructedMolecule( + topology_graph=stk.cof.PeriodicKagome( + building_blocks=( + stk.BuildingBlock( + smiles='BrC1=C(Br)[C+]=N1', + functional_groups=[stk.BromoFactory()], + ), + stk.BuildingBlock( + smiles=( + 'Br[C+]1C2(Br)[C+]=N[C+]2[C+](Br)[C+](' + 'Br)[C+2]1' + ), + functional_groups=[stk.BromoFactory()], + ), + ), + lattice_size=(2, 2, 1), + optimizer=stk.PeriodicCollapser(), + ), + ), + smiles=( + '[C+]1=NC2=C1[C+]1[C+]3[C+2][C+]4C5=C(N=[C+]5)C56[C+]=' + 'N[C+]5[C+]5C7=C([C+]=N7)[C+]7[C+]8[C+2][C+]9C%10=C(N=' + '[C+]%10)[C+]%10[C+2][C+]%11C%12=C([C+]=N%12)[C+]%12[C' + '+]%13[C+2][C+]%14C%15=C(N=[C+]%15)C%15%16[C+]=N[C+]%1' + '5[C+]%15C%17=C([C+]=N%17)[C+]%17[C+]%18[C+2][C+]%19C%' + '20=C(N=[C+]%20)[C+]%20[C+2][C+]2[C+]2C%21=C([C+]=N%21' + ')[C+]%21[C+]([C+2][C+](C%22=C(N=[C+]%22)[C+]%16[C+2][' + 'C+]%15C%15=C([C+]=N%15)[C+]%15[C+]([C+2][C+](C%16=C(N' + '=[C+]%16)C%10%16[C+]=N[C+]%16[C+]%11C%10=C([C+]=N%10)' + '[C+]%10[C+]([C+2][C+](C%11=C(N=[C+]%11)[C+]6[C+2][C+]' + '5C5=C([C+]=N5)[C+]5[C+]([C+2][C+](C6=C(N=[C+]6)C%206[' + 'C+]=N[C+]26)C2([C+]=N[C+]52)C2=C%18N=[C+]2)C2=C(N=[C+' + ']2)C92[C+]=N[C+]72)C2([C+]=N[C+]%102)C2=C%13[C+]=N2)C' + '2=C([C+]=N2)C42[C+]=N[C+]12)C1([C+]=N[C+]%151)C1=C8N=' + '[C+]1)C1=C(N=[C+]1)C%191[C+]=N[C+]%171)C1([C+]=N[C+]%' + '211)C1=C3[C+]=N1)C1=C([C+]=N1)C%141[C+]=N[C+]%121' + ), + ), ), ) def cof_periodic_kagome(request): diff --git a/tests/molecular/molecules/molecule/fixtures/cof/periodic_linkerless_honeycomb.py b/tests/molecular/molecules/molecule/fixtures/cof/periodic_linkerless_honeycomb.py index 1f30e71ce..113f2636a 100644 --- a/tests/molecular/molecules/molecule/fixtures/cof/periodic_linkerless_honeycomb.py +++ b/tests/molecular/molecules/molecule/fixtures/cof/periodic_linkerless_honeycomb.py @@ -30,6 +30,31 @@ '1[H])[C+]4F)C1([H])[C+]=NC13[C+]8F)[C+]7F' ), ), + CaseData( + molecule=stk.ConstructedMolecule( + topology_graph=stk.cof.PeriodicLinkerlessHoneycomb( + building_blocks=( + stk.BuildingBlock( + smiles=( + 'Br[C+]1C2[C+]=NC2(Br)[C+](F)[C+](Br)' + '[C+2]1' + ), + functional_groups=[stk.BromoFactory()], + ), + ), + lattice_size=(2, 2, 1), + optimizer=stk.PeriodicCollapser(), + ), + ), + smiles=( + '[H]C12[C+]=NC13[C+](F)[C+]1[C+2][C+]2[C+]2[C+2][C+]4[' + 'C+]5[C+2][C+]6[C+]7[C+2][C+]1[C+](F)C1(N=[C+]C71[H])C' + '17N=[C+]C1([H])[C+]1[C+2][C+]([C+]8[C+2][C+]([C+]9[C+' + '2][C+]([C+]%10[C+2][C+]1C1([H])[C+]=NC1([C+]%10F)C1(N' + '=[C+]C61[H])[C+]5F)[C+](F)C1(N=[C+]C91[H])C1(N=[C+]C2' + '1[H])[C+]4F)C1([H])[C+]=NC13[C+]8F)[C+]7F' + ), + ), ), ) def cof_periodic_linkerless_honeycomb(request): diff --git a/tests/molecular/molecules/molecule/fixtures/cof/periodic_square.py b/tests/molecular/molecules/molecule/fixtures/cof/periodic_square.py index e3af4dd3b..b9f78a422 100644 --- a/tests/molecular/molecules/molecule/fixtures/cof/periodic_square.py +++ b/tests/molecular/molecules/molecule/fixtures/cof/periodic_square.py @@ -29,6 +29,30 @@ ')C75F' ), ), + CaseData( + molecule=stk.ConstructedMolecule( + topology_graph=stk.cof.PeriodicSquare( + building_blocks=( + stk.BuildingBlock( + smiles='BrC1=C(Br)[C+]=N1', + functional_groups=[stk.BromoFactory()], + ), + stk.BuildingBlock( + smiles='BrC1=C(Br)C(F)(Br)[C+]1Br', + functional_groups=[stk.BromoFactory()], + ), + ), + lattice_size=(2, 2, 1), + optimizer=stk.PeriodicCollapser(), + ), + ), + smiles=( + 'FC12C3=C(N=[C+]3)C3=C4C5=C([C+]=N5)[C+]5C6=C7C8=C([C+' + ']=N8)[C+]3C4(F)C3=C(N=[C+]3)C3=C1C1=C([C+]=N1)[C+]1C(' + '=C(C4=C([C+]=N4)[C+]32)C1(F)C1=C6N=[C+]1)C1=C([C+]=N1' + ')C75F' + ), + ), ), ) def cof_periodic_square(request): diff --git a/tests/molecular/molecules/molecule/fixtures/position_matrices/cof_periodic_hexagonal1.npy b/tests/molecular/molecules/molecule/fixtures/position_matrices/cof_periodic_hexagonal1.npy new file mode 100644 index 0000000000000000000000000000000000000000..26f83d60f9b6932732507ce54a528311dd79140f GIT binary patch literal 8192 zcmbVRd032l*p4?yQq|CS16He?MWLYqD@p(NRqaL zbL>eRM}#Cvi}bynYv$+r-nqViKL2%Jb3LAWdG7a}N~ZH1nJ&}Bc8f)5cz6c82Wb$N zYnXePXy`82@Cpdp73Ajc8W7~+Ifawlwg-D+c(9LKpeOdTrlFyc?s7vd-Q`is|DXS4 z$LE)w^j=GaPxi6qZ&+5~yU%R;=rtBdj&hn}4p1Q_4yfHGfbee;!-o==IKWzduSwP= zD+p0logA6^e9VX=qn!$r=?(ey$(Ar4p(Zgk$9=xy(yhJ@ppcR}p#Q@RoW2G9_j!et z^~aOtX(G7A&4-M1YP8U&*OCM!cj_N0=RtWc+(Y18%SsLh6t`(;gT7viU z3F)ahYUANq$JjLJrBsgS*IPmQxPsgi{_+8-ZUs%%P+D)`zLmfgGV4;1h2Vf z92@CPhri?6;x~9&qy2;5Tqt4PafGe0ZpN-2)@c8)NxI)=e51o>oc`kh57bmi3=#c5 zLpL+%rO)mi0X+xLkVJ6m z3B$aAizIksr+GPZpE(?n)Sf-1!%^RxAz5^L_(c85I)1<$HXo)cPT|7+&n0!2_55p( za`IEKzimMGi;fU7!ru$_znh{^TBk@x`4R5_S6}4T&Uky2pNpiHhFB#gR9}8CbI^o@ z^p|iv9h&7MiYuF4&sgQbg!AE9jEDP)NdMu^Aw2~}CYbGBBlct;5$V6}Z14O&A`4Cy zS3ms4r-F+hpN$vl?oZDY#h+w6A2^!Ag4h7xh13EH{3*!i72SF9VYVz#@|$d-=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G5p;9 zQwL#{BanyTr$(4#`Kc_Cn0f1fzyl0FtwmgB&~h$|;b$Pk&ws3l3uzdB9*!wje^BQ_ cH-?{g2kR#`oac)0Q~c9um!)+Gq+$5^FDc<@4*&oF literal 0 HcmV?d00001 diff --git a/tests/molecular/molecules/molecule/fixtures/position_matrices/cof_periodic_kagome1.npy b/tests/molecular/molecules/molecule/fixtures/position_matrices/cof_periodic_kagome1.npy new file mode 100644 index 0000000000000000000000000000000000000000..b598815fa1044265746b609bafa42398bac69baa GIT binary patch literal 4736 zcmbW)dpMM79|v$+C8v^V(_3lipq%NT5I@75=b3rtP+2O6jYY^QrPy^YDQBCKLN=q) zmQt-0$r4HwrLA;M2~n{T^*-}n++El6{P+6L_qwm~b^Ff8GZ})l82*!@LYTrX{mq^s zKL_hu(e!P+R_Pnj^u4wQhX%U`xNZ&J>?zNg?tUSjL>}Vp9_UGYzr=jCg%NGpQX^U< z?f?8z4a?P;9lVzVcTT(tYo1I8-Ey_rM~`5zOf$>d&zJ)>xgEJWKK8KWM9&0We+&*= zl_vPxa6p_`-q70&aG-L1^!*wPH0lppJ~_jNu44-e*0%x_GfK{DstbVoVq0crG#eVW zJeghXZx7`)AyVyH41BGu^i$`sp&(3g=0r6*Ol36DVu+vXw(Z^7=eyXT+1-2=J5GnZ zNfW+o^}}G((*NwaWx|2fl2nT>BA;tese3E~149d+Ngru^n80E-F;Cc|{{EF8E_{yU zgO(I4`pluD{u8s>vi}X>LyULO&Lz+3sDH+!-p=@8KD@(}k5zWiQUCSb(~_E(VxW@1 zH(bl0qyCmz*yq+1;+}RHm}$xEQGa{q!~QX*7}QL3$*5PiNBtd+`yV(E!3PJ&94%ua zAMbBHz)}a0=*Y2_$Ghx*1vi!Mr5iR|qyCkre5_rDIFOVT)OGBj4eH-)x6aBW1_N=+FQ(Jpuu=cy(wm7( z7GdC6Ab1c-qFutS=59b3v z-Tlr4jE(NU_E8XKT_3Ajp`rk;{o%p@~bF-O#|5)LWvGca;>ZKgi|8&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5mEekrtevL z+)@N5N&cwhm0tJi#3}wvofg00qoxR&Nd5$D^P0Z13a9vUv$sqXa{#CM)8b&%sv(At zB!AAj1!b^ailCU}Poztp89iG>@#l)pQGr{P2u4W$By7Jj;;SP>&W!J;-FJH8>Ky`< zkMHMX@_n{$w1DEzd#}wp`~^aaKcjK=UmC9y??;k9p9&T>lm-eZ{>-^=cKXg_oZ?S| z^RulD<~Z<4{^T1bU08ljO!24a@J8XaM`DUUxdkSrwM!(hh2)R^Q`1bDf`sBvRbZ=R zV1)#VN&aYWFV>inD1jo9KPH}a#)sl0kW2DMeMsSY+%gFmko>U>60|zL5L5iIeopgm zQI}Bs$ze`d=u{!5_%l=~@^H%#Q~Y^Z@WiH6MGB!Le>%)H3Ku<hLfi!i75VLCoF0kCf+Y(e`2$h%K~gfph@zlP^oEt9Pxf6`%{t; zHKm4l?ww2Wr%3PgHp}xOs37^nk=?v{Mu~V1B>6L77#Srq7DE%spIak~>$LuqLOsc! lyZ%G2N86>~L-MB~q@lWS;aYe{@<)8Ou`ppo3PU7+{tJePA}0U< literal 0 HcmV?d00001 diff --git a/tests/molecular/molecules/molecule/fixtures/position_matrices/cof_periodic_linkerless_honeycomb1.npy b/tests/molecular/molecules/molecule/fixtures/position_matrices/cof_periodic_linkerless_honeycomb1.npy new file mode 100644 index 0000000000000000000000000000000000000000..a259c6de7a1b7c2717eb28a704713d2157fff944 GIT binary patch literal 2048 zcmbW%YfMvT7{GB*Vak|NVNfn=r{F29K@_Wafj%t-rR}*sa{t&5*L*CocJ#!tTU z1N;O$e{TVA7w`W*b_YJ|AtX=b&=obucTWO9W6`1&B@P7SRq?qq2jy_2Wku@*ErPUp zjlXRh!NJoMwSBLr0zT@ZkLMl=0{gQi%ldW`kTVkUpwJ+P`F9A~I2s7;#&mN=Apz7K zk-0)9hy4+PgQev`X#QC7#&Nny2Ad-7<5|L+79WJoUZ~px&zNF_>^zCtsfW#76-J zuTuNLSt58Dn7pz#0|)iMZXx%k0&Zmqqt9%x%!!NhSBGC$Ky+GdjlZK9_1;=M&7mt_ z0Ts{OC7N_G>eVDS7ja!bA`!Rl~RIwFY8xZ{Stsf=vb7*rdopLCw~<_TXj+a zey>k7_&Eoo-jBmIV^=;`K*6qac9-u+Q16LK!BKUE0=^qmwe7iK+4E7?glcyX4&8?4 z#NK&Q)O*2o$-Yr80qt8jHm4s*P_Oa)jxc@`0e5AudlKs{b2^s!W~&+qP)WC8&$miZ zZ{Wz=MFUv`oNRj3;`N6V^*-uzxY%J$LP=mu>|2)*)XTARsk;$LLc&h%dj0QG)SD!F zU&eh(Le>tS&eRQ3)Ejr|Ww&uD1s)^L*^l*7)ayUZi#L0a1h@T3O$#b5d%n7@40}tF z(ALIT*n$V6UiZ9({G2obx;Ve?f0Zvqz3NMCX{u`^%db{4ANZ{#%kPX9jG(P3uwnR3 zJho=Wxl9t=8GctJ3!SbmCRu(T3h{;7N#7s*e)ylWc}e!|t^~L-{5tEfpRx)Fmfy(g zv9x>v2^|c-&VM`I%9&0<8N+Xlq}kU)Nx^M~->PgU*(#bse$%J!tM1-6?pZ<#PB8q| zcG(OJr&BDy!RDEdlPf5QW%wPko!C_PoPuj@zjx+%EN@cVVHy^r2VvHY&Zyf#IRQY^n}Klh`34HV07 zn+LZr=`aN$48PbkPj|7HV)@M&U0U#R^1CqoUg2>zhl(gT#_-$Myd#9no7|t_m-u3C z=aF#=?oRm~p1PlVYa0VRWi-q0!zY{w@p>AzF#I}(z4qECprMlC*Cd)gJg%XknBjMq z()O9|N1ElAuNhbA`)Jt7@Ov-AJotP;IJhzV=8>Ox7WLD>W%%88t}-D1_~iZ!zt*4H O*U;WH+@JFMq4!^9Ut+fa literal 0 HcmV?d00001 diff --git a/tests/molecular/molecules/molecule/fixtures/position_matrices/cof_periodic_square1.npy b/tests/molecular/molecules/molecule/fixtures/position_matrices/cof_periodic_square1.npy new file mode 100644 index 0000000000000000000000000000000000000000..54ebf6a813e7ecb7c04edf61b960978e4c3e322c GIT binary patch literal 1376 zcmbR27wQ`j$;eQ~P_3SlTAW;@Zl$1ZlV+i=qoAIaUsO_*m=~X4l#&V(cT3DEP6dh= zXCxM+0{I%IMmh?{nmP)#3giN=%8V?Q)?gQhjQY#XEBc%r`dWO?OxR-N;I>ROweGRA z1J~+@>rZjGI3!(EkN}DQuvsazBGlR82(zhj##CpADJ(}0gTy}+C)nFOb#mA+-#P2d zTxW+*S(&xgM~xkL5{exYE;>78pHJR#jMv$rY=W#JNIlG6{%P<0UvG4S+v^UscjLi7 z)x0|H81`mM1-xIi!wqild#JtP+v3dl54vI4EA*_ch11XtZm(Q@>xJWG?il`kv&X>j zAe%def9C}sx%aBV4a2|Fx~jSBIovS(yQ!>?ckvfD4FAIHMfWev-VJE}h1rYlUzoiS zX#R!Si|${`sLaP*A6y)+1ez^geaG41?&QA143CT)o~8+h@0sQb7rzY^7j*WYex=vd z;e^DC7vI#K9d`C+-Ug{ZpLOWq%GWLqVIp-if2%n=c*iY$4-)^nvF!QMWM_xN0ZMw) zF1a|!EV%FsB>o*LUKo33;qeMr2Pvqy>*FH}qa<7$=2~(*x}WdrAaNq452QZwwcf{2 zNf(Fc#A=?cXI&hO7Qa{s61RZ5zcM2*|J{E#4EMvt(cPb`&%D*r+YRpivrzZ{)tZ@V z=jDds{;YJ{UpKzG!`%<_msrX3T&_7DaQC}G-R~5jyiRGd2i*M;Q1>%cOuO;@gFD>) zw+mXg6^FTh2h{y}XyIQ3 eb^jl<@Q1k*J^W$f=;04@KYIB8V}!ULJ^TT9bW~{o literal 0 HcmV?d00001 From 6ad50ae38dc4dcc6c8f457a311bc4133465bc3d7 Mon Sep 17 00:00:00 2001 From: Lukas Turcani Date: Wed, 21 Apr 2021 21:55:00 +0100 Subject: [PATCH 19/44] Remove redundant comments --- .../topology_graph/optimizers/periodic_collapser.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/stk/molecular/topology_graphs/topology_graph/optimizers/periodic_collapser.py b/src/stk/molecular/topology_graphs/topology_graph/optimizers/periodic_collapser.py index 693d2b801..8424767cb 100644 --- a/src/stk/molecular/topology_graphs/topology_graph/optimizers/periodic_collapser.py +++ b/src/stk/molecular/topology_graphs/topology_graph/optimizers/periodic_collapser.py @@ -90,7 +90,6 @@ def __init__( ) def optimize(self, state): - # Define MCHammer molecule to optimize. mch_mol = mch.Molecule( atoms=( mch.Atom( @@ -102,7 +101,6 @@ def optimize(self, state): position_matrix=state.get_position_matrix(), ) - # Run optimization. mch_mol, result = self._optimizer.get_result( mol=mch_mol, bond_pair_ids=tuple(get_long_bond_ids(state)), From eb7cc1b465788264832b6d9d01895745d761fc93 Mon Sep 17 00:00:00 2001 From: Lukas Turcani Date: Wed, 21 Apr 2021 22:31:08 +0100 Subject: [PATCH 20/44] fix test --- tests/molecular/topology_graphs/conftest.py | 8 -------- .../topology_graphs/test_get_periodic_info.py | 20 +++++++------------ 2 files changed, 7 insertions(+), 21 deletions(-) diff --git a/tests/molecular/topology_graphs/conftest.py b/tests/molecular/topology_graphs/conftest.py index e15308f35..688c08376 100644 --- a/tests/molecular/topology_graphs/conftest.py +++ b/tests/molecular/topology_graphs/conftest.py @@ -21,14 +21,6 @@ np.array([0., 0., 210.33234855]) ), ), - CaseData( - topology_graph=stk.cof.Honeycomb( - building_blocks=(bb1, bb2), - lattice_size=(3, 3, 1), - periodic=False, - ), - cell=None, - ), ), ) def periodic_case(request): diff --git a/tests/molecular/topology_graphs/test_get_periodic_info.py b/tests/molecular/topology_graphs/test_get_periodic_info.py index 249c9190d..8fd0ba521 100644 --- a/tests/molecular/topology_graphs/test_get_periodic_info.py +++ b/tests/molecular/topology_graphs/test_get_periodic_info.py @@ -41,16 +41,10 @@ def _test_get_periodic_info(topology_graph, cell): """ - try: - if not topology_graph._periodic: - assert cell is None - except AttributeError: - # Topology must be a PeriodicClass to access periodic info. - assert hasattr(topology_graph, '_internal') - test_cell = ( - topology_graph.get_periodic_info().get_cell_matrix() - ) - assert np.all(np.array([ - np.allclose(i, j, atol=1e-4) - for i, j in zip(test_cell, cell) - ])) + actual_cell = ( + topology_graph.get_periodic_info().get_cell_matrix() + ) + assert np.all(np.array([ + np.allclose(i, j, atol=1e-4) + for i, j in zip(actual_cell, cell) + ])) From a714fa9f752a6989485b67bfeea1e6a46df22521 Mon Sep 17 00:00:00 2001 From: Lukas Turcani Date: Wed, 21 Apr 2021 23:17:42 +0100 Subject: [PATCH 21/44] wip --- .../molecules/constructed_molecule.py | 22 +++++++++++++++++++ .../topology_graphs/test_get_periodic_info.py | 17 +++++++++++++- 2 files changed, 38 insertions(+), 1 deletion(-) diff --git a/src/stk/molecular/molecules/constructed_molecule.py b/src/stk/molecular/molecules/constructed_molecule.py index e4c7e802f..aed4a8ef8 100644 --- a/src/stk/molecular/molecules/constructed_molecule.py +++ b/src/stk/molecular/molecules/constructed_molecule.py @@ -132,6 +132,28 @@ def init( molecule._num_building_blocks = dict(num_building_blocks) return molecule + @classmethod + def init_from_construction_result( + cls, + topology_graph, + construction_result, + ): + obj = cls.__new__(cls) + Molecule.__init__( + self=obj, + atoms=construction_result.get_atoms(), + bonds=construction_result.get_bonds(), + position_matrix=construction_result.get_position_matrix(), + ) + obj._atom_infos = construction_result.get_atom_infos() + obj._bond_infos = construction_result.get_bond_infos() + obj._num_building_blocks = { + building_block: + topology_graph.get_num_building_block(building_block) + for building_block in topology_graph.get_building_blocks() + } + return obj + def clone(self): clone = super().clone() clone._atom_infos = self._atom_infos diff --git a/tests/molecular/topology_graphs/test_get_periodic_info.py b/tests/molecular/topology_graphs/test_get_periodic_info.py index 8fd0ba521..0892360fe 100644 --- a/tests/molecular/topology_graphs/test_get_periodic_info.py +++ b/tests/molecular/topology_graphs/test_get_periodic_info.py @@ -3,7 +3,7 @@ def test_get_periodic_info(periodic_case): """ - Test collection of periodic cell from `.TopologyGraph`. + Test the collection of the periodic cell from a `.TopologyGraph`. Parameters ---------- @@ -48,3 +48,18 @@ def _test_get_periodic_info(topology_graph, cell): np.allclose(i, j, atol=1e-4) for i, j in zip(actual_cell, cell) ])) + + +def test_get_periodic_info_2(periodic_case): + """ + + """ + + construction_result = periodic_case.construct() + actual_cell = ( + construction_result.get_periodic_info().get_cell_matrix() + ) + assert np.all(np.array([ + np.allclose(i, j, atol=1e-4) + for i, j in zip(actual_cell, periodic_case.cell) + ])) From f096f7336bc9c916ac1bb66782f4494bb0dc5e26 Mon Sep 17 00:00:00 2001 From: Lukas Turcani Date: Sun, 25 Apr 2021 23:27:14 +0100 Subject: [PATCH 22/44] Account for lattice size in PeriodicInfo --- src/stk/molecular/topology_graphs/cof/cof.py | 20 ++++++++++++++++++- .../topology_graphs/test_get_periodic_info.py | 13 +++++++++++- 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/src/stk/molecular/topology_graphs/cof/cof.py b/src/stk/molecular/topology_graphs/cof/cof.py index fc83475a1..ce4e64028 100644 --- a/src/stk/molecular/topology_graphs/cof/cof.py +++ b/src/stk/molecular/topology_graphs/cof/cof.py @@ -32,7 +32,12 @@ from functools import partial from operator import getitem -from ..topology_graph import TopologyGraph, NullOptimizer, EdgeGroup +from ..topology_graph import ( + TopologyGraph, + NullOptimizer, + EdgeGroup, + ConstructionState, +) from .vertices import _UnaligningVertex from .edge import _CofEdge from ...reactions import GenericReactionFactory @@ -684,6 +689,19 @@ def _get_building_block_vertices( def _get_lattice_constants(self): return self._lattice_constants + def _get_construction_state(self): + return ConstructionState( + building_block_vertices=self._building_block_vertices, + edges=self._edges, + lattice_constants=tuple( + np.array(constant, dtype=np.float64)*self._scale*dim + for constant, dim in zip( + self._get_lattice_constants(), + self._lattice_size, + ) + ), + ) + def _get_scale(self, building_block_vertices): return 5*max( bb.get_maximum_diameter() diff --git a/tests/molecular/topology_graphs/test_get_periodic_info.py b/tests/molecular/topology_graphs/test_get_periodic_info.py index 0892360fe..530554dd2 100644 --- a/tests/molecular/topology_graphs/test_get_periodic_info.py +++ b/tests/molecular/topology_graphs/test_get_periodic_info.py @@ -52,10 +52,21 @@ def _test_get_periodic_info(topology_graph, cell): def test_get_periodic_info_2(periodic_case): """ + Test getting of :class:`.PeriodicInfo`. + + Parameters + ---------- + periodic_case : :class:`.CaseData` + The test case. Includes the topology graph and the expected + cell. + + Returns + ------- + None : :class:`NoneType` """ - construction_result = periodic_case.construct() + construction_result = periodic_case.topology_graph.construct() actual_cell = ( construction_result.get_periodic_info().get_cell_matrix() ) From eb89c2436a39857e3d20fa3fe467e70e36d101f2 Mon Sep 17 00:00:00 2001 From: Lukas Turcani Date: Sun, 25 Apr 2021 23:37:36 +0100 Subject: [PATCH 23/44] Undo changes --- src/stk/molecular/topology_graphs/cof/cof.py | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/src/stk/molecular/topology_graphs/cof/cof.py b/src/stk/molecular/topology_graphs/cof/cof.py index ce4e64028..fc83475a1 100644 --- a/src/stk/molecular/topology_graphs/cof/cof.py +++ b/src/stk/molecular/topology_graphs/cof/cof.py @@ -32,12 +32,7 @@ from functools import partial from operator import getitem -from ..topology_graph import ( - TopologyGraph, - NullOptimizer, - EdgeGroup, - ConstructionState, -) +from ..topology_graph import TopologyGraph, NullOptimizer, EdgeGroup from .vertices import _UnaligningVertex from .edge import _CofEdge from ...reactions import GenericReactionFactory @@ -689,19 +684,6 @@ def _get_building_block_vertices( def _get_lattice_constants(self): return self._lattice_constants - def _get_construction_state(self): - return ConstructionState( - building_block_vertices=self._building_block_vertices, - edges=self._edges, - lattice_constants=tuple( - np.array(constant, dtype=np.float64)*self._scale*dim - for constant, dim in zip( - self._get_lattice_constants(), - self._lattice_size, - ) - ), - ) - def _get_scale(self, building_block_vertices): return 5*max( bb.get_maximum_diameter() From 9a8a1a484b391455e447fe17dc32252f0a6126e6 Mon Sep 17 00:00:00 2001 From: Lukas Turcani Date: Sun, 25 Apr 2021 23:42:25 +0100 Subject: [PATCH 24/44] remove stuff --- src/stk/molecular/topology_graphs/cof/cof.py | 23 ++++++++++++++++++- .../topology_graphs/cof/periodic_hexagonal.py | 22 +----------------- .../topology_graphs/cof/periodic_honeycomb.py | 22 +----------------- .../topology_graphs/cof/periodic_kagome.py | 22 +----------------- .../cof/periodic_linkerless_honeycomb.py | 22 +----------------- .../topology_graphs/cof/periodic_square.py | 16 ------------- 6 files changed, 26 insertions(+), 101 deletions(-) diff --git a/src/stk/molecular/topology_graphs/cof/cof.py b/src/stk/molecular/topology_graphs/cof/cof.py index fc83475a1..57b10f7f2 100644 --- a/src/stk/molecular/topology_graphs/cof/cof.py +++ b/src/stk/molecular/topology_graphs/cof/cof.py @@ -32,7 +32,12 @@ from functools import partial from operator import getitem -from ..topology_graph import TopologyGraph, NullOptimizer, EdgeGroup +from ..topology_graph import ( + TopologyGraph, + NullOptimizer, + EdgeGroup, + PeriodicConstructionResult, +) from .vertices import _UnaligningVertex from .edge import _CofEdge from ...reactions import GenericReactionFactory @@ -684,6 +689,22 @@ def _get_building_block_vertices( def _get_lattice_constants(self): return self._lattice_constants + def construct(self): + """ + Construct a :class:`.ConstructedMolecule`. + + Returns + ------- + :class:`.PeriodicConstructionResult` + The data describing the :class:`.ConstructedMolecule`. + + """ + + return super().construct() + + def _get_construction_result(self, state): + return PeriodicConstructionResult(state) + def _get_scale(self, building_block_vertices): return 5*max( bb.get_maximum_diameter() diff --git a/src/stk/molecular/topology_graphs/cof/periodic_hexagonal.py b/src/stk/molecular/topology_graphs/cof/periodic_hexagonal.py index 912187fc9..41c7fefc1 100644 --- a/src/stk/molecular/topology_graphs/cof/periodic_hexagonal.py +++ b/src/stk/molecular/topology_graphs/cof/periodic_hexagonal.py @@ -10,11 +10,7 @@ from ...reactions import GenericReactionFactory from .cof import Cof from .vertices import _LinearCofVertex, _NonLinearCofVertex -from ..topology_graph import ( - Edge, - NullOptimizer, - PeriodicConstructionResult, -) +from ..topology_graph import Edge, NullOptimizer from ...periodic_info import PeriodicInfo @@ -162,22 +158,6 @@ def get_periodic_info(self): ), ) - def construct(self): - """ - Construct a :class:`.ConstructedMolecule`. - - Returns - ------- - :class:`.PeriodicConstructionResult` - The data describing the :class:`.ConstructedMolecule`. - - """ - - return super().construct() - - def _get_construction_result(self, state): - return PeriodicConstructionResult(state) - _lattice_constants = _a, _b, _c = ( np.array([1., 0., 0.]), np.array([0.5, 0.866, 0]), diff --git a/src/stk/molecular/topology_graphs/cof/periodic_honeycomb.py b/src/stk/molecular/topology_graphs/cof/periodic_honeycomb.py index 72ee0a40b..9486465a2 100644 --- a/src/stk/molecular/topology_graphs/cof/periodic_honeycomb.py +++ b/src/stk/molecular/topology_graphs/cof/periodic_honeycomb.py @@ -10,11 +10,7 @@ from ...reactions import GenericReactionFactory from .cof import Cof from .vertices import _LinearCofVertex, _NonLinearCofVertex -from ..topology_graph import ( - Edge, - NullOptimizer, - PeriodicConstructionResult, -) +from ..topology_graph import Edge, NullOptimizer from ...periodic_info import PeriodicInfo @@ -162,22 +158,6 @@ def get_periodic_info(self): ), ) - def construct(self): - """ - Construct a :class:`.ConstructedMolecule`. - - Returns - ------- - :class:`.PeriodicConstructionResult` - The data describing the :class:`.ConstructedMolecule`. - - """ - - return super().construct() - - def _get_construction_result(self, state): - return PeriodicConstructionResult(state) - _lattice_constants = _a, _b, _c = ( np.array([1., 0., 0.]), np.array([0.5, 0.866, 0]), diff --git a/src/stk/molecular/topology_graphs/cof/periodic_kagome.py b/src/stk/molecular/topology_graphs/cof/periodic_kagome.py index 8077bbaee..aa22fb3d7 100644 --- a/src/stk/molecular/topology_graphs/cof/periodic_kagome.py +++ b/src/stk/molecular/topology_graphs/cof/periodic_kagome.py @@ -10,11 +10,7 @@ from ...reactions import GenericReactionFactory from .cof import Cof from .vertices import _LinearCofVertex, _NonLinearCofVertex -from ..topology_graph import ( - Edge, - NullOptimizer, - PeriodicConstructionResult, -) +from ..topology_graph import Edge, NullOptimizer from ...periodic_info import PeriodicInfo @@ -162,22 +158,6 @@ def get_periodic_info(self): ), ) - def construct(self): - """ - Construct a :class:`.ConstructedMolecule`. - - Returns - ------- - :class:`.PeriodicConstructionResult` - The data describing the :class:`.ConstructedMolecule`. - - """ - - return super().construct() - - def _get_construction_result(self, state): - return PeriodicConstructionResult(state) - _lattice_constants = _a, _b, _c = ( np.array([1., 0., 0.]), np.array([0.5, 0.866, 0.]), diff --git a/src/stk/molecular/topology_graphs/cof/periodic_linkerless_honeycomb.py b/src/stk/molecular/topology_graphs/cof/periodic_linkerless_honeycomb.py index b28cc0557..bc7ee85c0 100644 --- a/src/stk/molecular/topology_graphs/cof/periodic_linkerless_honeycomb.py +++ b/src/stk/molecular/topology_graphs/cof/periodic_linkerless_honeycomb.py @@ -10,11 +10,7 @@ from ...reactions import GenericReactionFactory from .cof import Cof from .vertices import _NonLinearCofVertex -from ..topology_graph import ( - Edge, - NullOptimizer, - PeriodicConstructionResult, -) +from ..topology_graph import Edge, NullOptimizer from ...periodic_info import PeriodicInfo @@ -161,22 +157,6 @@ def get_periodic_info(self): ), ) - def construct(self): - """ - Construct a :class:`.ConstructedMolecule`. - - Returns - ------- - :class:`.PeriodicConstructionResult` - The data describing the :class:`.ConstructedMolecule`. - - """ - - return super().construct() - - def _get_construction_result(self, state): - return PeriodicConstructionResult(state) - _lattice_constants = _a, _b, _c = ( np.array([1., 0., 0.]), np.array([0.5, 0.866, 0.]), diff --git a/src/stk/molecular/topology_graphs/cof/periodic_square.py b/src/stk/molecular/topology_graphs/cof/periodic_square.py index fb401e3b5..07d51fa6c 100644 --- a/src/stk/molecular/topology_graphs/cof/periodic_square.py +++ b/src/stk/molecular/topology_graphs/cof/periodic_square.py @@ -161,22 +161,6 @@ def get_periodic_info(self): ), ) - def construct(self): - """ - Construct a :class:`.ConstructedMolecule`. - - Returns - ------- - :class:`.PeriodicConstructionResult` - The data describing the :class:`.ConstructedMolecule`. - - """ - - return super().construct() - - def _get_construction_result(self, state): - return PeriodicConstructionResult(state) - _lattice_constants = _a, _b, _c = ( np.array([1., 0., 0.]), np.array([0., 1., 0.]), From 4c1884074b2cdd1629292f86dceb8cd7e1ff9dad Mon Sep 17 00:00:00 2001 From: Lukas Turcani Date: Sun, 25 Apr 2021 23:45:38 +0100 Subject: [PATCH 25/44] wip --- .../construction_result/periodic.py | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/stk/molecular/topology_graphs/topology_graph/construction_result/periodic.py b/src/stk/molecular/topology_graphs/topology_graph/construction_result/periodic.py index 4cda3c9a3..cf102fe87 100644 --- a/src/stk/molecular/topology_graphs/topology_graph/construction_result/periodic.py +++ b/src/stk/molecular/topology_graphs/topology_graph/construction_result/periodic.py @@ -18,7 +18,11 @@ class PeriodicConstructionResult(ConstructionResult): '_periodic_info', ] - def __init__(self, construction_state): + def __init__( + self, + construction_state, + lattice_size, + ): """ Initialize a :class:`.ConstructionResult`. @@ -27,11 +31,20 @@ def __init__(self, construction_state): construction_state : :class:`.ConstructionState` The state from which the result is initialized. + lattice_size : :class:`tuple` of :class:`int` + The size of the lattice in the x, y and z directions. + """ super().__init__(construction_state) self._periodic_info = PeriodicInfo( - *construction_state.get_lattice_constants() + *( + lattice_constant*dim + for lattice_constant, dim in zip( + construction_state.get_lattice_constants(), + lattice_size, + ) + ) ) def get_periodic_info(self): From c8475f6cf70fbdad3e57361f616e9b5f49adc089 Mon Sep 17 00:00:00 2001 From: Lukas Turcani Date: Sun, 25 Apr 2021 23:47:10 +0100 Subject: [PATCH 26/44] tests passing --- src/stk/molecular/topology_graphs/cof/cof.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/stk/molecular/topology_graphs/cof/cof.py b/src/stk/molecular/topology_graphs/cof/cof.py index 57b10f7f2..ddfb2d5ff 100644 --- a/src/stk/molecular/topology_graphs/cof/cof.py +++ b/src/stk/molecular/topology_graphs/cof/cof.py @@ -703,7 +703,7 @@ def construct(self): return super().construct() def _get_construction_result(self, state): - return PeriodicConstructionResult(state) + return PeriodicConstructionResult(state, self._lattice_size) def _get_scale(self, building_block_vertices): return 5*max( From b131e81f82b2492dad3de98f09d83766ee9a866d Mon Sep 17 00:00:00 2001 From: Lukas Turcani Date: Mon, 26 Apr 2021 10:11:08 +0100 Subject: [PATCH 27/44] wip --- .../molecules/constructed_molecule.py | 38 +++++++------- .../construction_result.py | 47 ++++++++++++++++++ .../construction_state/construction_state.py | 39 +++++++++++++++ .../construction_state/graph_state.py | 49 +++++++++++++++++++ 4 files changed, 154 insertions(+), 19 deletions(-) diff --git a/src/stk/molecular/molecules/constructed_molecule.py b/src/stk/molecular/molecules/constructed_molecule.py index aed4a8ef8..2cf484c6a 100644 --- a/src/stk/molecular/molecules/constructed_molecule.py +++ b/src/stk/molecular/molecules/constructed_molecule.py @@ -70,19 +70,10 @@ def __init__(self, topology_graph): """ - construction_result = topology_graph.construct() - super().__init__( - atoms=construction_result.get_atoms(), - bonds=construction_result.get_bonds(), - position_matrix=construction_result.get_position_matrix(), + self._init_from_construction_result( + obj=self, + construction_result=topology_graph.construct(), ) - self._atom_infos = construction_result.get_atom_infos() - self._bond_infos = construction_result.get_bond_infos() - self._num_building_blocks = { - building_block: - topology_graph.get_num_building_block(building_block) - for building_block in topology_graph.get_building_blocks() - } @classmethod def init( @@ -135,12 +126,19 @@ def init( @classmethod def init_from_construction_result( cls, - topology_graph, construction_result, ): - obj = cls.__new__(cls) - Molecule.__init__( - self=obj, + return cls._init_from_construction_result( + obj=cls.__new__(cls), + construction_result=construction_result, + ) + + @staticmethod + def _init_from_construction_result( + obj, + construction_result, + ): + super(ConstructedMolecule, obj).__init__( atoms=construction_result.get_atoms(), bonds=construction_result.get_bonds(), position_matrix=construction_result.get_position_matrix(), @@ -148,9 +146,11 @@ def init_from_construction_result( obj._atom_infos = construction_result.get_atom_infos() obj._bond_infos = construction_result.get_bond_infos() obj._num_building_blocks = { - building_block: - topology_graph.get_num_building_block(building_block) - for building_block in topology_graph.get_building_blocks() + building_block: construction_result.get_num_building_block( + building_block=building_block, + ) + for building_block + in construction_result.get_building_blocks() } return obj diff --git a/src/stk/molecular/topology_graphs/topology_graph/construction_result/construction_result.py b/src/stk/molecular/topology_graphs/topology_graph/construction_result/construction_result.py index 3a40ae1f4..4f0325f47 100644 --- a/src/stk/molecular/topology_graphs/topology_graph/construction_result/construction_result.py +++ b/src/stk/molecular/topology_graphs/topology_graph/construction_result/construction_result.py @@ -17,6 +17,7 @@ class ConstructionResult: '_atom_infos', '_bond_infos', '_position_matrix', + '_num_building_blocks', ] def __init__(self, construction_state): @@ -38,6 +39,13 @@ def __init__(self, construction_state): self._bonds = tuple(construction_state.get_bonds()) self._atom_infos = tuple(construction_state.get_atom_infos()) self._bond_infos = tuple(construction_state.get_bond_infos()) + self._num_building_blocks = { + building_block: construction_state.get_num_building_block( + building_block=building_block, + ) + for building_block + in construction_state.get_building_blocks() + } def get_position_matrix(self): """ @@ -103,3 +111,42 @@ def get_bond_infos(self): """ return self._bond_infos + + def get_num_building_block(self, building_block): + """ + Get the number of times `building_block` is present. + + Parameters + ---------- + building_block : :class:`.BuildingBlock` + The building block whose frequency in the topology graph + is desired. + + Returns + ------- + :class:`int` + The number of times `building_block` is present in the + topology graph. + + """ + + return self._num_building_blocks[building_block] + + def get_building_blocks(self): + """ + Yield the building blocks. + + Building blocks are yielded in an order based on their + position in the topology graph. For two equivalent + topology graphs, but with different building blocks, + equivalently positioned building blocks will be yielded at the + same time. + + Yields + ------ + :class:`.BuildingBlock` + A building block of the topology graph. + + """ + + yield from self._num_building_blocks diff --git a/src/stk/molecular/topology_graphs/topology_graph/construction_state/construction_state.py b/src/stk/molecular/topology_graphs/topology_graph/construction_state/construction_state.py index 9f9221580..365c571dc 100644 --- a/src/stk/molecular/topology_graphs/topology_graph/construction_state/construction_state.py +++ b/src/stk/molecular/topology_graphs/topology_graph/construction_state/construction_state.py @@ -455,3 +455,42 @@ def get_bond_infos(self): """ yield from self._molecule_state.get_bond_infos() + + def get_num_building_block(self, building_block): + """ + Get the number of times `building_block` is present. + + Parameters + ---------- + building_block : :class:`.BuildingBlock` + The building block whose frequency in the topology graph + is desired. + + Returns + ------- + :class:`int` + The number of times `building_block` is present in the + topology graph. + + """ + + return self._graph_state.get_num_building_block(building_block) + + def get_building_blocks(self): + """ + Yield the building blocks. + + Building blocks are yielded in an order based on their + position in the topology graph. For two equivalent + topology graphs, but with different building blocks, + equivalently positioned building blocks will be yielded at the + same time. + + Yields + ------ + :class:`.BuildingBlock` + A building block of the topology graph. + + """ + + yield from self._graph_state.get_building_blocks() diff --git a/src/stk/molecular/topology_graphs/topology_graph/construction_state/graph_state.py b/src/stk/molecular/topology_graphs/topology_graph/construction_state/graph_state.py index 0c38d94b4..bf5721410 100644 --- a/src/stk/molecular/topology_graphs/topology_graph/construction_state/graph_state.py +++ b/src/stk/molecular/topology_graphs/topology_graph/construction_state/graph_state.py @@ -48,6 +48,11 @@ def __init__( in building_block_vertices.items() for vertex in vertices } + self._num_building_blocks = { + building_block: len(vertices) + for building_block, vertices + in building_block_vertices.items() + } self._vertices = { vertex.get_id(): vertex for vertices in building_block_vertices.values() @@ -341,3 +346,47 @@ def with_lattice_constants(self, lattice_constants): """ return self.clone()._with_lattice_constants(lattice_constants) + + def get_num_building_block(self, building_block): + """ + Get the number of times `building_block` is present. + + Parameters + ---------- + building_block : :class:`.BuildingBlock` + The building block whose frequency in the topology graph + is desired. + + Returns + ------- + :class:`int` + The number of times `building_block` is present in the + topology graph. + + """ + + return self._num_building_blocks[building_block] + + def get_building_blocks(self): + """ + Yield the building blocks. + + Building blocks are yielded in an order based on their + position in the topology graph. For two equivalent + topology graphs, but with different building blocks, + equivalently positioned building blocks will be yielded at the + same time. + + Yields + ------ + :class:`.BuildingBlock` + A building block of the topology graph. + + """ + + yielded = set() + for vertex_id in range(max(self._vertex_building_blocks)+1): + building_block = self._vertex_building_blocks[vertex_id] + if building_block not in yielded: + yielded.add(building_block) + yield building_block From a3a5044e72368b8e492ec55cc2992dec56290e65 Mon Sep 17 00:00:00 2001 From: Lukas Turcani Date: Mon, 26 Apr 2021 10:25:34 +0100 Subject: [PATCH 28/44] tests passing --- .../topology_graph/construction_state/graph_state.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/stk/molecular/topology_graphs/topology_graph/construction_state/graph_state.py b/src/stk/molecular/topology_graphs/topology_graph/construction_state/graph_state.py index bf5721410..307d30e4a 100644 --- a/src/stk/molecular/topology_graphs/topology_graph/construction_state/graph_state.py +++ b/src/stk/molecular/topology_graphs/topology_graph/construction_state/graph_state.py @@ -14,6 +14,7 @@ class _GraphState: '_edges', '_lattice_constants', '_vertex_edges', + '_num_building_blocks', ] def __init__( @@ -164,6 +165,7 @@ def clone(self): np.array, self._lattice_constants, )) + clone._num_building_blocks = dict(self._num_building_blocks) return clone def get_building_block(self, vertex_id): From 23d2fb4730770aa7533fcc8214ce5da8c5a3ebb8 Mon Sep 17 00:00:00 2001 From: Lukas Turcani Date: Mon, 26 Apr 2021 10:27:47 +0100 Subject: [PATCH 29/44] Add docs --- .../molecular/molecules/constructed_molecule.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/stk/molecular/molecules/constructed_molecule.py b/src/stk/molecular/molecules/constructed_molecule.py index 2cf484c6a..7e34d61e8 100644 --- a/src/stk/molecular/molecules/constructed_molecule.py +++ b/src/stk/molecular/molecules/constructed_molecule.py @@ -128,6 +128,22 @@ def init_from_construction_result( cls, construction_result, ): + """ + Initialize a :class:`.ConstructedMolecule`. + + Parameters + ---------- + construction_result : :class:`.ConstructionResult` + The result of a construction, from which the + :class:`.ConstructedMolecule` should be initialized. + + Returns + ------- + :class:`.ConstructedMolecule` + The constructed molecule. + + """ + return cls._init_from_construction_result( obj=cls.__new__(cls), construction_result=construction_result, From 55c0d5bfc8c25e3813740ce4a0d7a18bc1eb49e8 Mon Sep 17 00:00:00 2001 From: Lukas Turcani Date: Mon, 26 Apr 2021 10:29:53 +0100 Subject: [PATCH 30/44] update docs --- .../molecules/constructed_molecule.py | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/stk/molecular/molecules/constructed_molecule.py b/src/stk/molecular/molecules/constructed_molecule.py index 7e34d61e8..2d14cccbd 100644 --- a/src/stk/molecular/molecules/constructed_molecule.py +++ b/src/stk/molecular/molecules/constructed_molecule.py @@ -154,6 +154,27 @@ def _init_from_construction_result( obj, construction_result, ): + """ + Initialize a :class:`.ConstructedMolecule`. + + This modifies `obj`. + + Parameters + ---------- + obj : :class:`.ConstructedMolecule` + The constructed molecule to initialize. + + construction_result : :class:`.ConstructionResult` + The result of a construction, from which the + :class:`.ConstructedMolecule` should be initialized. + + Returns + ------- + :class:`.ConstructedMolecule` + The `obj` instance. + + """ + super(ConstructedMolecule, obj).__init__( atoms=construction_result.get_atoms(), bonds=construction_result.get_bonds(), From eb09847eabef8745e226f1b8ea296272607f22e0 Mon Sep 17 00:00:00 2001 From: Lukas Turcani Date: Mon, 26 Apr 2021 10:39:25 +0100 Subject: [PATCH 31/44] update docs --- src/stk/molecular/topology_graphs/cof/cof.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/stk/molecular/topology_graphs/cof/cof.py b/src/stk/molecular/topology_graphs/cof/cof.py index ddfb2d5ff..a6efb27d9 100644 --- a/src/stk/molecular/topology_graphs/cof/cof.py +++ b/src/stk/molecular/topology_graphs/cof/cof.py @@ -134,14 +134,22 @@ class Cof(TopologyGraph): can be accessed at any time from the :class:`.TopologyGraph` instance. + When building periodic :class:`.Cof` instances, the periodic + information, such as the unit cell, can be accessed if you use the + :class:`.PeriodicConstructionResult` returned by calling + :class:`.Cof.construct` + .. code-block:: python topology_graph = stk.cof.PeriodicHoneycomb( building_blocks=(bb1, bb2), lattice_size=(3, 3, 1), ) - cof = stk.ConstructedMolecule(topology_graph) - periodic_info = topology.get_periodic_info() + construction_result = topology_graph.construct() + cof = stk.ConstructedMolecule.init_from_construction_result( + construction_result=construction_result, + ) + periodic_info = construction_result.get_periodic_info() cell_matrix = periodic_info.get_cell_matrix() # Can access all unit-cell parameters. a = periodic_info.get_a() @@ -158,7 +166,6 @@ class Cof(TopologyGraph): periodic_info=periodic_info, ) - *Structural Isomer Construction* Different structural isomers of COFs can be made by using the From 24380646bfdc3db64ef370fd95a83536bd00158f Mon Sep 17 00:00:00 2001 From: Lukas Turcani Date: Mon, 26 Apr 2021 10:39:54 +0100 Subject: [PATCH 32/44] clean up docs --- src/stk/molecular/topology_graphs/cof/cof.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/stk/molecular/topology_graphs/cof/cof.py b/src/stk/molecular/topology_graphs/cof/cof.py index a6efb27d9..5211cbd22 100644 --- a/src/stk/molecular/topology_graphs/cof/cof.py +++ b/src/stk/molecular/topology_graphs/cof/cof.py @@ -129,11 +129,6 @@ class Cof(TopologyGraph): *Accessing the Periodic Unit Cell* - The same :class:`.Cof` instance can be built as a periodic - structure, which has a unit cell (assuming as P1 space group) that - can be accessed at any time from the :class:`.TopologyGraph` - instance. - When building periodic :class:`.Cof` instances, the periodic information, such as the unit cell, can be accessed if you use the :class:`.PeriodicConstructionResult` returned by calling From ce160dc46837e7517a5429dcacead94ae2e7a0ac Mon Sep 17 00:00:00 2001 From: Lukas Turcani Date: Mon, 26 Apr 2021 10:41:46 +0100 Subject: [PATCH 33/44] typo --- src/stk/molecular/topology_graphs/cof/cof.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/stk/molecular/topology_graphs/cof/cof.py b/src/stk/molecular/topology_graphs/cof/cof.py index 5211cbd22..db6e47af6 100644 --- a/src/stk/molecular/topology_graphs/cof/cof.py +++ b/src/stk/molecular/topology_graphs/cof/cof.py @@ -127,7 +127,7 @@ class Cof(TopologyGraph): ), ) - *Accessing the Periodic Unit Cell* + *Accessing the Periodic Information* When building periodic :class:`.Cof` instances, the periodic information, such as the unit cell, can be accessed if you use the From 5d19579d7cdd650843c8fb1e13b9e4b9e8fe6da5 Mon Sep 17 00:00:00 2001 From: Lukas Turcani Date: Mon, 26 Apr 2021 10:46:10 +0100 Subject: [PATCH 34/44] docs --- .../construction_result/construction_result.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/stk/molecular/topology_graphs/topology_graph/construction_result/construction_result.py b/src/stk/molecular/topology_graphs/topology_graph/construction_result/construction_result.py index 4f0325f47..095bf0bfb 100644 --- a/src/stk/molecular/topology_graphs/topology_graph/construction_result/construction_result.py +++ b/src/stk/molecular/topology_graphs/topology_graph/construction_result/construction_result.py @@ -126,7 +126,7 @@ def get_num_building_block(self, building_block): ------- :class:`int` The number of times `building_block` is present in the - topology graph. + constructed molecule. """ @@ -137,10 +137,10 @@ def get_building_blocks(self): Yield the building blocks. Building blocks are yielded in an order based on their - position in the topology graph. For two equivalent - topology graphs, but with different building blocks, - equivalently positioned building blocks will be yielded at the - same time. + position in the constructed molecule. For two topologically + equivalent constructed molecules, but with different building + blocks, equivalently positioned building blocks will be + yielded at the same time. Yields ------ From e3a8d87e3739eca1413fa92191388a1d5669d463 Mon Sep 17 00:00:00 2001 From: Lukas Turcani Date: Mon, 26 Apr 2021 10:47:52 +0100 Subject: [PATCH 35/44] docs --- .../construction_result/construction_result.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/stk/molecular/topology_graphs/topology_graph/construction_result/construction_result.py b/src/stk/molecular/topology_graphs/topology_graph/construction_result/construction_result.py index 095bf0bfb..40a9e8c96 100644 --- a/src/stk/molecular/topology_graphs/topology_graph/construction_result/construction_result.py +++ b/src/stk/molecular/topology_graphs/topology_graph/construction_result/construction_result.py @@ -119,14 +119,14 @@ def get_num_building_block(self, building_block): Parameters ---------- building_block : :class:`.BuildingBlock` - The building block whose frequency in the topology graph - is desired. + The building block whose frequency in the constructed + molecule is desired. Returns ------- :class:`int` - The number of times `building_block` is present in the - constructed molecule. + The number of times `building_block` was used in the + construction of the constructed molecule. """ From d8e02ffca38c610c094a7461385ce476cda651f6 Mon Sep 17 00:00:00 2001 From: Lukas Turcani Date: Mon, 26 Apr 2021 11:01:00 +0100 Subject: [PATCH 36/44] typo --- .../topology_graph/optimizers/periodic_collapser.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/stk/molecular/topology_graphs/topology_graph/optimizers/periodic_collapser.py b/src/stk/molecular/topology_graphs/topology_graph/optimizers/periodic_collapser.py index 8424767cb..36100d5fd 100644 --- a/src/stk/molecular/topology_graphs/topology_graph/optimizers/periodic_collapser.py +++ b/src/stk/molecular/topology_graphs/topology_graph/optimizers/periodic_collapser.py @@ -1,6 +1,6 @@ """ -PeriodicCollapser -========= +Periodic Collapser +================== """ From afa6da7ed794321e098e5270a358978a1a6db1ee Mon Sep 17 00:00:00 2001 From: Lukas Turcani Date: Mon, 26 Apr 2021 11:05:50 +0100 Subject: [PATCH 37/44] fix child class --- .../topology_graphs/topology_graph/optimizers/optimizer.py | 5 +++++ .../topology_graph/optimizers/periodic_collapser.py | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/stk/molecular/topology_graphs/topology_graph/optimizers/optimizer.py b/src/stk/molecular/topology_graphs/topology_graph/optimizers/optimizer.py index fcbe8062b..7fa481a3a 100644 --- a/src/stk/molecular/topology_graphs/topology_graph/optimizers/optimizer.py +++ b/src/stk/molecular/topology_graphs/topology_graph/optimizers/optimizer.py @@ -7,6 +7,11 @@ Collapser <\ stk.molecular.topology_graphs.topology_graph.optimizers.collapser\ +> + + Periodic Collapser <\ +stk.molecular.topology_graphs.topology_graph.optimizers.\ +periodic_collapser\ > MCHammer <\ diff --git a/src/stk/molecular/topology_graphs/topology_graph/optimizers/periodic_collapser.py b/src/stk/molecular/topology_graphs/topology_graph/optimizers/periodic_collapser.py index 36100d5fd..d292bb9d1 100644 --- a/src/stk/molecular/topology_graphs/topology_graph/optimizers/periodic_collapser.py +++ b/src/stk/molecular/topology_graphs/topology_graph/optimizers/periodic_collapser.py @@ -4,13 +4,13 @@ """ -from .collapser import Collapser +from .optimizer import Optimizer from .utilities import get_mch_bonds, get_long_bond_ids, get_subunits import mchammer as mch -class PeriodicCollapser(Collapser): +class PeriodicCollapser(Optimizer): """ Performs rigid-body collapse of molecules [1]_. From 97858b249444e27eefa7bf0b051f9af654fc5ba6 Mon Sep 17 00:00:00 2001 From: Lukas Turcani Date: Mon, 26 Apr 2021 11:50:08 +0100 Subject: [PATCH 38/44] wip --- src/stk/molecular/topology_graphs/cof/cof.py | 2 +- .../constructed_molecule/fixtures/cof.py | 86 +++++++++++++++++++ 2 files changed, 87 insertions(+), 1 deletion(-) diff --git a/src/stk/molecular/topology_graphs/cof/cof.py b/src/stk/molecular/topology_graphs/cof/cof.py index db6e47af6..4b1fa717d 100644 --- a/src/stk/molecular/topology_graphs/cof/cof.py +++ b/src/stk/molecular/topology_graphs/cof/cof.py @@ -132,7 +132,7 @@ class Cof(TopologyGraph): When building periodic :class:`.Cof` instances, the periodic information, such as the unit cell, can be accessed if you use the :class:`.PeriodicConstructionResult` returned by calling - :class:`.Cof.construct` + :meth:`.Cof.construct` .. code-block:: python diff --git a/tests/molecular/molecules/constructed_molecule/fixtures/cof.py b/tests/molecular/molecules/constructed_molecule/fixtures/cof.py index 5c4511894..5732e2c3e 100644 --- a/tests/molecular/molecules/constructed_molecule/fixtures/cof.py +++ b/tests/molecular/molecules/constructed_molecule/fixtures/cof.py @@ -92,6 +92,72 @@ def __init__( } self.building_blocks = building_blocks + @classmethod + def init_from_construction_result( + cls, + topology_graph, + building_blocks, + lattice_size, + vertex_alignments, + num_new_atoms, + num_new_bonds, + num_building_blocks, + ): + """ + Initialize a :class:`.CofData` instance. + + This method creates the constructed molecule using + :meth:`.ConstructedMolecule.init_from_construction_result`. + + Parameters + ---------- + topology_graph : :class:`type` + A COF class. + + building_blocks : :class:`tuple` of :class:`.BuildingBlock` + The building blocks of the COF. + + lattice_size : :class:`tuple` of :class:`int` + The size of the lattice. + + vertex_alignments : :class:`dict` + Passed to the `vertex_alignments` parameter of the COF + initializer. + + num_new_atoms : :class:`int` + The number of new atoms added by the construction process. + + num_new_bonds : :class:`int` + The number of new bonds added by the construction process. + + num_building_blocks : :class:`dict` + For each building block in `building_blocks`, maps its + index to the number of times its used in the construction + of the COF. + + """ + + obj = cls.__new__(cls) + topology_graph_instance = topology_graph( + building_blocks=building_blocks, + lattice_size=lattice_size, + vertex_alignments=vertex_alignments, + ) + construction_result = topology_graph_instance.construct() + obj.constructed_molecule = ( + stk.ConstructedMolecule.init_from_construction_result( + construction_result=construction_result, + ) + ) + obj.num_new_atoms = num_new_atoms + obj.num_new_bonds = num_new_bonds + obj.num_building_blocks = { + building_blocks[index]: num + for index, num in num_building_blocks.items() + } + obj.building_blocks = building_blocks + return obj + @pytest.fixture( params=( @@ -115,6 +181,26 @@ def __init__( num_new_bonds=20, num_building_blocks={0: 8, 1: 12}, ), + CofData.init_from_construction_result( + topology_graph=stk.cof.Honeycomb, + building_blocks=( + stk.BuildingBlock( + smiles=( + 'Br[C+]1[C+2][C+](Br)[C+](F)[C+](Br)[C+2]1' + ), + functional_groups=[stk.BromoFactory()], + ), + stk.BuildingBlock( + smiles='Br[C+]=NC#CBr', + functional_groups=[stk.BromoFactory()], + ), + ), + lattice_size=(2, 2, 1), + vertex_alignments=None, + num_new_atoms=0, + num_new_bonds=20, + num_building_blocks={0: 8, 1: 12}, + ), CofData( topology_graph=stk.cof.Honeycomb, building_blocks=( From f512cf38c8dc04c4d0bbcabbcf359b351ef0a67f Mon Sep 17 00:00:00 2001 From: Lukas Turcani Date: Mon, 26 Apr 2021 12:18:54 +0100 Subject: [PATCH 39/44] add clone test --- .../topology_graphs/construction_state/utilities.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/molecular/topology_graphs/construction_state/utilities.py b/tests/molecular/topology_graphs/construction_state/utilities.py index 196e9e6ed..59beba841 100644 --- a/tests/molecular/topology_graphs/construction_state/utilities.py +++ b/tests/molecular/topology_graphs/construction_state/utilities.py @@ -72,3 +72,12 @@ def is_clone(construction_state, clone): assert (counts1.keys() | counts2.keys()) == counts1.keys() for building_block, count1 in counts1.items(): assert count1 == counts2[building_block] + + assert all( + np.all(np.equal(actual_constant, expected_constant)) + for actual_constant, expected_constant + in zip( + construction_state.get_lattice_constants(), + clone.get_lattice_constants(), + ) + ) From c49de15e7beedabe4a900b394baff3cc652b8486 Mon Sep 17 00:00:00 2001 From: Lukas Turcani Date: Mon, 26 Apr 2021 12:22:01 +0100 Subject: [PATCH 40/44] wip --- tests/molecular/topology_graphs/construction_state/utilities.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/molecular/topology_graphs/construction_state/utilities.py b/tests/molecular/topology_graphs/construction_state/utilities.py index 59beba841..d2c62a3c5 100644 --- a/tests/molecular/topology_graphs/construction_state/utilities.py +++ b/tests/molecular/topology_graphs/construction_state/utilities.py @@ -76,7 +76,7 @@ def is_clone(construction_state, clone): assert all( np.all(np.equal(actual_constant, expected_constant)) for actual_constant, expected_constant - in zip( + in it.zip_longest( construction_state.get_lattice_constants(), clone.get_lattice_constants(), ) From 1a4e9cec74690182b9c3c764463ae9fd3471364b Mon Sep 17 00:00:00 2001 From: Lukas Turcani Date: Mon, 26 Apr 2021 12:23:52 +0100 Subject: [PATCH 41/44] use zip longest --- tests/molecular/topology_graphs/test_get_periodic_info.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/molecular/topology_graphs/test_get_periodic_info.py b/tests/molecular/topology_graphs/test_get_periodic_info.py index 530554dd2..ef4215142 100644 --- a/tests/molecular/topology_graphs/test_get_periodic_info.py +++ b/tests/molecular/topology_graphs/test_get_periodic_info.py @@ -1,4 +1,5 @@ import numpy as np +import itertools def test_get_periodic_info(periodic_case): @@ -46,7 +47,7 @@ def _test_get_periodic_info(topology_graph, cell): ) assert np.all(np.array([ np.allclose(i, j, atol=1e-4) - for i, j in zip(actual_cell, cell) + for i, j in itertools.zip_longest(actual_cell, cell) ])) @@ -72,5 +73,8 @@ def test_get_periodic_info_2(periodic_case): ) assert np.all(np.array([ np.allclose(i, j, atol=1e-4) - for i, j in zip(actual_cell, periodic_case.cell) + for i, j in itertools.zip_longest( + actual_cell, + periodic_case.cell, + ) ])) From 21bc12f1124e72c8006588ef3b9cb326fca6a2cb Mon Sep 17 00:00:00 2001 From: Lukas Turcani Date: Mon, 26 Apr 2021 12:38:52 +0100 Subject: [PATCH 42/44] add test case --- tests/molecular/topology_graphs/conftest.py | 46 ++++++++++++++++++- .../topology_graphs/test_get_periodic_info.py | 14 +++--- 2 files changed, 53 insertions(+), 7 deletions(-) diff --git a/tests/molecular/topology_graphs/conftest.py b/tests/molecular/topology_graphs/conftest.py index 688c08376..4ded15d53 100644 --- a/tests/molecular/topology_graphs/conftest.py +++ b/tests/molecular/topology_graphs/conftest.py @@ -21,8 +21,52 @@ np.array([0., 0., 210.33234855]) ), ), + CaseData( + topology_graph=stk.cof.PeriodicHoneycomb( + building_blocks=(bb1, bb2), + lattice_size=(3, 1, 2), + optimizer=stk.PeriodicCollapser(), + ), + cell=( + np.array([109.29499828, 0., 0.]), + np.array([18.21583305, 31.54982284, 0.]), + np.array([0., 0., 210.33234855]) + ), + ), + ), +) +def unscaled_periodic_case(request): + + return request.param + + +@pytest.fixture( + params=( + CaseData( + topology_graph=stk.cof.PeriodicHoneycomb( + building_blocks=(bb1, bb2), + lattice_size=(3, 1, 2), + ), + cell=( + np.array([109.29499828, 0., 0.]), + np.array([18.21583305, 31.54982284, 0.]), + np.array([0., 0., 210.33234855]) + ), + ), + CaseData( + topology_graph=stk.cof.PeriodicHoneycomb( + building_blocks=(bb1, bb2), + lattice_size=(3, 1, 2), + optimizer=stk.PeriodicCollapser(), + ), + cell=( + np.array([40.32953729, 0., 0.]), + np.array([7.88334589, 13.65395508, 0.]), + np.array([0., 0., 76.68756542]) + ), + ), ), ) -def periodic_case(request): +def scaled_periodic_case(request): return request.param diff --git a/tests/molecular/topology_graphs/test_get_periodic_info.py b/tests/molecular/topology_graphs/test_get_periodic_info.py index ef4215142..61c2dfb59 100644 --- a/tests/molecular/topology_graphs/test_get_periodic_info.py +++ b/tests/molecular/topology_graphs/test_get_periodic_info.py @@ -2,7 +2,7 @@ import itertools -def test_get_periodic_info(periodic_case): +def test_get_periodic_info(unscaled_periodic_case): """ Test the collection of the periodic cell from a `.TopologyGraph`. @@ -18,8 +18,8 @@ def test_get_periodic_info(periodic_case): """ _test_get_periodic_info( - topology_graph=periodic_case.topology_graph, - cell=periodic_case.cell, + topology_graph=unscaled_periodic_case.topology_graph, + cell=unscaled_periodic_case.cell, ) @@ -51,7 +51,7 @@ def _test_get_periodic_info(topology_graph, cell): ])) -def test_get_periodic_info_2(periodic_case): +def test_get_periodic_info_2(scaled_periodic_case): """ Test getting of :class:`.PeriodicInfo`. @@ -67,7 +67,9 @@ def test_get_periodic_info_2(periodic_case): """ - construction_result = periodic_case.topology_graph.construct() + construction_result = ( + scaled_periodic_case.topology_graph.construct() + ) actual_cell = ( construction_result.get_periodic_info().get_cell_matrix() ) @@ -75,6 +77,6 @@ def test_get_periodic_info_2(periodic_case): np.allclose(i, j, atol=1e-4) for i, j in itertools.zip_longest( actual_cell, - periodic_case.cell, + scaled_periodic_case.cell, ) ])) From d5f645b6871355ea84117b6eae77a6ad4ff74a8e Mon Sep 17 00:00:00 2001 From: Lukas Turcani Date: Mon, 26 Apr 2021 12:54:01 +0100 Subject: [PATCH 43/44] docs --- src/stk/molecular/topology_graphs/cof/cof.py | 4 +--- .../topology_graph/optimizers/periodic_collapser.py | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/stk/molecular/topology_graphs/cof/cof.py b/src/stk/molecular/topology_graphs/cof/cof.py index 4b1fa717d..2a86cb806 100644 --- a/src/stk/molecular/topology_graphs/cof/cof.py +++ b/src/stk/molecular/topology_graphs/cof/cof.py @@ -121,9 +121,7 @@ class Cof(TopologyGraph): topology_graph=stk.cof.PeriodicHoneycomb( building_blocks=(bb1, bb2), lattice_size=(3, 3, 1), - # Setting scale_steps to False tends to lead to a - # better structure. - optimizer=stk.PeriodicCollapser(scale_steps=False), + optimizer=stk.PeriodicCollapser(), ), ) diff --git a/src/stk/molecular/topology_graphs/topology_graph/optimizers/periodic_collapser.py b/src/stk/molecular/topology_graphs/topology_graph/optimizers/periodic_collapser.py index d292bb9d1..986bf0db4 100644 --- a/src/stk/molecular/topology_graphs/topology_graph/optimizers/periodic_collapser.py +++ b/src/stk/molecular/topology_graphs/topology_graph/optimizers/periodic_collapser.py @@ -32,7 +32,7 @@ class PeriodicCollapser(Optimizer): topology_graph = stk.cof.PeriodicHoneycomb( building_blocks=(bb1, bb2), lattice_size=(1, 2, 3), - optimizer=stk.PeriodicCollapser(scale_steps=False), + optimizer=stk.PeriodicCollapser(), ) cof = stk.ConstructedMolecule(topology_graph) periodic_info = topology_graph.get_periodic_info() From 168a360d5e0e8bcaba22368194950be666cb47a2 Mon Sep 17 00:00:00 2001 From: Lukas Turcani Date: Mon, 26 Apr 2021 12:59:04 +0100 Subject: [PATCH 44/44] docs --- .../topology_graphs/cof/periodic_hexagonal.py | 4 ++-- .../topology_graphs/cof/periodic_honeycomb.py | 4 ++-- .../molecular/topology_graphs/cof/periodic_kagome.py | 4 ++-- .../cof/periodic_linkerless_honeycomb.py | 4 ++-- .../molecular/topology_graphs/cof/periodic_square.py | 10 +++------- .../topology_graph/optimizers/periodic_collapser.py | 2 ++ 6 files changed, 13 insertions(+), 15 deletions(-) diff --git a/src/stk/molecular/topology_graphs/cof/periodic_hexagonal.py b/src/stk/molecular/topology_graphs/cof/periodic_hexagonal.py index 41c7fefc1..6b7f92dad 100644 --- a/src/stk/molecular/topology_graphs/cof/periodic_hexagonal.py +++ b/src/stk/molecular/topology_graphs/cof/periodic_hexagonal.py @@ -30,8 +30,8 @@ class PeriodicHexagonal(Cof): | 6-functional groups: 0 to 3 | 2-functional groups: 4 to 15 - Note that only :class:`.PeriodicCollapser` optimizes the - :class:`.PeriodicInfo`. + Note that optimizers may not optimize the :class:`.PeriodicInfo`. + The documentation of the optimizer will state if it does. See :class:`.Cof` for more details and examples. diff --git a/src/stk/molecular/topology_graphs/cof/periodic_honeycomb.py b/src/stk/molecular/topology_graphs/cof/periodic_honeycomb.py index 9486465a2..d93e44e9e 100644 --- a/src/stk/molecular/topology_graphs/cof/periodic_honeycomb.py +++ b/src/stk/molecular/topology_graphs/cof/periodic_honeycomb.py @@ -30,8 +30,8 @@ class PeriodicHoneycomb(Cof): | 3-functional groups: 0 to 1 | 2-functional groups: 2 to 4 - Note that only :class:`.PeriodicCollapser` optimizes the - :class:`.PeriodicInfo`. + Note that optimizers may not optimize the :class:`.PeriodicInfo`. + The documentation of the optimizer will state if it does. See :class:`.Cof` for more details and examples. diff --git a/src/stk/molecular/topology_graphs/cof/periodic_kagome.py b/src/stk/molecular/topology_graphs/cof/periodic_kagome.py index aa22fb3d7..abab824dc 100644 --- a/src/stk/molecular/topology_graphs/cof/periodic_kagome.py +++ b/src/stk/molecular/topology_graphs/cof/periodic_kagome.py @@ -30,8 +30,8 @@ class PeriodicKagome(Cof): | 4-functional groups: 0 to 2 | 2-functional groups: 3 to 8 - Note that only :class:`.PeriodicCollapser` optimizes the - :class:`.PeriodicInfo`. + Note that optimizers may not optimize the :class:`.PeriodicInfo`. + The documentation of the optimizer will state if it does. See :class:`.Cof` for more details and examples. diff --git a/src/stk/molecular/topology_graphs/cof/periodic_linkerless_honeycomb.py b/src/stk/molecular/topology_graphs/cof/periodic_linkerless_honeycomb.py index bc7ee85c0..d8a2c9873 100644 --- a/src/stk/molecular/topology_graphs/cof/periodic_linkerless_honeycomb.py +++ b/src/stk/molecular/topology_graphs/cof/periodic_linkerless_honeycomb.py @@ -29,8 +29,8 @@ class PeriodicLinkerlessHoneycomb(Cof): | 3-functional groups: 0 to 1 - Note that only :class:`.PeriodicCollapser` optimizes the - :class:`.PeriodicInfo`. + Note that optimizers may not optimize the :class:`.PeriodicInfo`. + The documentation of the optimizer will state if it does. See :class:`.Cof` for more details and examples. diff --git a/src/stk/molecular/topology_graphs/cof/periodic_square.py b/src/stk/molecular/topology_graphs/cof/periodic_square.py index 07d51fa6c..a40039fa7 100644 --- a/src/stk/molecular/topology_graphs/cof/periodic_square.py +++ b/src/stk/molecular/topology_graphs/cof/periodic_square.py @@ -9,11 +9,7 @@ from ...reactions import GenericReactionFactory from .cof import Cof from .vertices import _LinearCofVertex, _NonLinearCofVertex -from ..topology_graph import ( - Edge, - NullOptimizer, - PeriodicConstructionResult, -) +from ..topology_graph import Edge, NullOptimizer from ...periodic_info import PeriodicInfo @@ -33,8 +29,8 @@ class PeriodicSquare(Cof): | 4-functional groups: 0 | 2-functional groups: 1 to 2 - Note that only :class:`.PeriodicCollapser` optimizes the - :class:`.PeriodicInfo`. + Note that optimizers may not optimize the :class:`.PeriodicInfo`. + The documentation of the optimizer will state if it does. See :class:`.Cof` for more details and examples. diff --git a/src/stk/molecular/topology_graphs/topology_graph/optimizers/periodic_collapser.py b/src/stk/molecular/topology_graphs/topology_graph/optimizers/periodic_collapser.py index 986bf0db4..d09379ab8 100644 --- a/src/stk/molecular/topology_graphs/topology_graph/optimizers/periodic_collapser.py +++ b/src/stk/molecular/topology_graphs/topology_graph/optimizers/periodic_collapser.py @@ -14,6 +14,8 @@ class PeriodicCollapser(Optimizer): """ Performs rigid-body collapse of molecules [1]_. + This :class:`.Optimizer` will also update the `.PeriodicInfo`. + Examples -------- *Structure Optimization*