Closed mberth closed 12 years ago
This "feature" in reusing the spectrum object was implemented on purpose since not initiating a new spectra every time will yield much faster parsing speeds! One can however obtain a spectrum object for later usage by calling deRef, please see http://pymzml.github.com/spec.html#spec.Spectrum.deRef
Thus to keep the speed I would like to keep the "re-use" model as it is.
Cheers
The problem was that the same
self.spectrum
object was reused over and over when new spectra are read. The fix is to have__getitem__
and__next__
return fresh Spectrum objects.Added unit tests for this, run them with
nosetests test/