Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Structureless Reaction objects with dummies #504

Merged
merged 1 commit into from
Jun 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions automol/graph/_2conv.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
explicit,
geometry_correct_linear_vinyls,
geometry_dihedrals_near_value,
has_dummy_atoms,
has_stereo,
inchi_is_bad,
is_ts_graph,
Expand Down Expand Up @@ -451,6 +452,10 @@ def ts_geometry_from_reactants(
:return: TS geometry
:rtype: automol geom data structure
"""
assert not has_dummy_atoms(
tsg
), f"Cannot convert graph->geom with dummy atoms:\n{tsg}\n{rct_geos}"

# 0. Join geometries for bimolecular reactions, yielding a single starting structure
ts_geo = ts_join_reactant_geometries(tsg, rct_geos, geo_idx_dct=geo_idx_dct)

Expand Down
6 changes: 6 additions & 0 deletions automol/reac/_4struc.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
apply_zmatrix_conversion,
mapping,
product_graphs,
without_dummy_atoms,
product_structures,
products_conversion_info,
reactant_graphs,
Expand Down Expand Up @@ -68,6 +69,11 @@ def with_structures(
if struc_typ not in ("geom", "zmat", None):
raise ValueError(f"Requesting invalid structure type {struc_typ}")

# If there are no current structures, remove dummy atoms from the graph to avoid
# problems
if orig_struc_typ is None:
rxn = without_dummy_atoms(rxn)

# If a structure type of `None` was requested, simply update with the structures
# passed in
if struc_typ is None:
Expand Down