lucastheis / c2s

A toolbox for inferring spikes from calcium traces.
http://c2s.readthedocs.org
MIT License
22 stars 13 forks source link

No backward compatiblity provided for utils.py convert(...) method #10

Closed viktorbahr closed 8 years ago

viktorbahr commented 8 years ago

When running c2s with python3 dependencies, preprocessing .mat data results in 'Attribute not found' error because backward compatibility for dict iteritems() method is not provided properly.

Stack trace originates at cs2-preprocess line 43. The problem is in utils convert method. return dict([(convert(key), convert(value)) for key, value in input.iteritems()]). In python3 dicts don't have iteritems method any more. Since using items() is very slow in python2 I resortet to using from future.utils import iteritems to fix it.

lucastheis commented 8 years ago

Thanks @viktorbahr, I fixed it. I think using items() is fine here, as the number of items in input should never be that long that generating a list creates a lot of overhead.