OrderedDict may be in reversed order on Py3.5

Create issue
Issue #35 resolved
Joshua Klein created an issue

While updating some tests to work with the new release, I noticed that tests assuming that the offset index of a file were ordered started failing on Python 3.5 while still passing on 2.7 and 3.6.

from pyteomics import mzml

reader = mzml.MzML("three_test_scans.mzML", use_index=True)
index = reader.index['spectrum']
print(index)

Produces:

OffsetIndex([('controllerType=0 controllerNumber=1 scan=10014', 3799), 
('controllerType=0 controllerNumber=1 scan=10016', 188056),
('controllerType=0 controllerNumber=1 scan=10015', 158797)])

with lines manually wrapped for convenience.

The order may be permuted randomly. When tested with a larger file, there are no issues.

Comments (7)

  1. Lev Levitsky repo owner

    I knew I only had to roll the release out for new bugs to surface :) Any idea of a reason?

    I can't reproduce it easily, though. The index prints fine after several attempts on my system:

    Python 3.5.6 (default, Jan 7 2019, 00:49:38) [GCC 8.2.1 20181127] on linux

  2. Joshua Klein reporter

    The problem appears to be due to an error in loading the index from file. I'll open a pull request with the fix.

  3. Joshua Klein reporter

    The PR has been submitted and merged. Do you know when you'd be able to make a patched release?

  4. Joshua Klein reporter

    That would be great. That way I can continue testing against a released version of Pyteomics instead of relying on installing development during each test on continuous integration services.

  5. Log in to comment