Skip to content

Commit d8b38a0

Browse files
committed
When fitting extra frequencies, don't forget the uncertainties.
If you manipulate an ArrayQuantity.value_si array without also changing the uncertainty array then you can end up with arrays of different sizes, which causes a problem when you pickle them and unpickle them (eg. write and load a restart file). Hopefully addresses #114
1 parent f477d79 commit d8b38a0

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

rmgpy/data/statmech.py

+3
Original file line numberDiff line numberDiff line change
@@ -431,8 +431,11 @@ def getStatmechData(self, molecule, thermoModel):
431431
modes = fitStatmechToHeatCapacity(Tlist, Cv, numVibrations - len(frequencies), numRotors, molecule)
432432
for mode in modes:
433433
if isinstance(mode, HarmonicOscillator):
434+
uncertainties = [0 for f in frequencies] # probably shouldn't be zero
434435
frequencies.extend(mode.frequencies.value_si)
436+
uncertainties.extend(mode.frequencies.uncertainty)
435437
mode.frequencies.value_si = numpy.array(frequencies, numpy.float)
438+
mode.frequencies.uncertainty = numpy.array(uncertainties, numpy.float)
436439
break
437440
else:
438441
modes.insert(0, HarmonicOscillator(frequencies=(frequencies,"cm^-1")))

0 commit comments

Comments
 (0)