Skip to content

Commit

Permalink
Minor.
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewtarzia committed Dec 18, 2024
1 parent 4e41e50 commit 4eff369
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/stko/_internal/molecular/intermediates/unreacted.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,17 @@ class UnreactedTopologyGraph:
cage_graphs = stko.topology_functions.UnreactedTopologyGraph(
stk.cage.TwoPlusThree((bb1, bb2))
)
# Get a NamedIntermediate with only 1 reaction, which contains an
# stk molecule and other information about the intermediate.
intermediates = cage_graphs.get_named_intermediates(n=1)
# Get a pool of NamedIntermediates with only 1 reaction, which will
# contain the reacted + the building blocks (there are 2). You can
# iterate through that pool to get the named intermediate, containing
# an stk molecule and other information about the intermediate.
pool = cage_graphs.get_named_intermediates(n=1)
.. testcode:: unreacted-topology-graph
:hide:
assert len(cage_graphs.get_available_reactions()) == 6
assert len(intermediates) == 4
assert len(pool) == 3
.. moldoc::
Expand All @@ -97,24 +99,24 @@ class UnreactedTopologyGraph:
)
# Get a NamedIntermediate with only 1 reaction, which contains an
# stk molecule and other information about the intermediate.
intermediates = cage_graphs.get_named_intermediates(n=1)
pool = cage_graphs.get_named_intermediates(n=1)
moldoc_display_molecule = molecule.Molecule(
atoms=(
molecule.Atom(
atomic_number=atom.get_atomic_number(),
position=position,
) for atom, position in zip(
intermediates[0].molecule.get_atoms(),
intermediates[0].molecule.get_position_matrix(),
pool.intermediates[0].molecule.get_atoms(),
pool.intermediates[0].molecule.get_position_matrix(),
)
),
bonds=(
molecule.Bond(
atom1_id=bond.get_atom1().get_id(),
atom2_id=bond.get_atom2().get_id(),
order=bond.get_order(),
) for bond in intermediates[0].molecule.get_bonds()
) for bond in pool.intermediates[0].molecule.get_bonds()
),
)
Expand Down

0 comments on commit 4eff369

Please sign in to comment.