Skip to content

Commit

Permalink
Update openforcefield/utils/toolkits.py
Browse files Browse the repository at this point in the history
Co-Authored-By: Matt Thompson <[email protected]>
  • Loading branch information
j-wags and mattwthompson authored Apr 7, 2020
1 parent 184394c commit 9f6b550
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions openforcefield/utils/toolkits.py
Original file line number Diff line number Diff line change
Expand Up @@ -500,9 +500,7 @@ def to_file(self, molecule, file_path, file_format):
# Remove all but the first conformer when writing to SDF as we only support single conformer format
if (file_format.lower() == "sdf") and oemol.NumConfs() > 1:
conf1 = [conf for conf in oemol.GetConfs()][0]
flat_coords = list()
for idx, coord in conf1.GetCoords().items():
flat_coords.extend(coord)
flat_coords = [*conf1.GetCoords().values()]
oemol.DeleteConfs()
oecoords = oechem.OEFloatArray(flat_coords)
oemol.NewConf(oecoords)
Expand Down

0 comments on commit 9f6b550

Please sign in to comment.