Skip to content

Commit

Permalink
Bugfix: bonds from Lewis structure were wrong.
Browse files Browse the repository at this point in the history
  • Loading branch information
paulsaxe committed Jul 24, 2023
1 parent 85ffa3a commit c29f093
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
4 changes: 4 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
=======
History
=======
2023.7.24 -- Bugfix in Lewis structure with bond orders
* Major issue in getting the bonds from the Lewis structure where the atoms and bond
orders were mixed up.

2023.6.5 -- Bugfix working around MOPAC problem
* MOPAC is not consistent about putting end of file and end of program markers in the
AUX file. This caused carashed in SEAMM, which this fixes until MOPAC can be
Expand Down
18 changes: 9 additions & 9 deletions mopac_step/lewis_structure.py
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,15 @@ def analyze(self, indent="", lines=[], n_calculations=None):
if P["use bonds"]:
ids = configuration.atoms.ids
if same:
iatoms = [ids[i] for i in bonds["i"]]
jatoms = [ids[j] for j in bonds["j"]]
configuration.bonds.delete()
configuration.bonds.append(
i=iatoms, j=jatoms, bondorder=bonds["bondorder"]
)
text += "\nReplaced the bonds in the configuration with those from the "
text += "Lewis structure.\n"
else:
iatoms = []
jatoms = []
bondorders = []
Expand All @@ -458,15 +467,6 @@ def analyze(self, indent="", lines=[], n_calculations=None):
i=iatoms, j=jatoms, bondorder=bonds["bondorder"]
)
text += "\nReplaced the bonds in the configuration with those from the "
text += "Lewis structure.\n"
else:
iatoms = [ids[i] for i in bonds["i"]]
jatoms = [ids[j] for j in bonds["j"]]
configuration.bonds.delete()
configuration.bonds.append(
i=iatoms, j=jatoms, bondorder=bonds["bondorder"]
)
text += "\nReplaced the bonds in the configuration with those from the "
text += "simple connectivity structure.\n"

# Put any requested results into variables or tables
Expand Down

0 comments on commit c29f093

Please sign in to comment.