Skip to content

Commit

Permalink
Fix min usage with Entry objects
Browse files Browse the repository at this point in the history
The Entry class does not have comparison methods implemented
  • Loading branch information
mliu49 committed Aug 29, 2019
1 parent 10e20cf commit 1397600
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions rmgpy/data/statmech.py
Original file line number Diff line number Diff line change
Expand Up @@ -400,8 +400,9 @@ def getStatmechData(self, molecule, thermoModel):
freqs_removed = 0
freq_count = len(frequencies)
while freq_count > num_vibrations:
min_degeneracy, min_entry = min([(entry.data.symmetry, entry)
for entry in group_count if group_count[entry] > 0])
min_entry = min((entry for entry in group_count if group_count[entry] > 0),
key=lambda x: x.data.symmetry)
min_degeneracy = min_entry.data.symmetry
if group_count[min_entry] > 1:
group_count[min_entry] -= 1
else:
Expand Down

0 comments on commit 1397600

Please sign in to comment.