hoytak / treedict

TreeDict is a fast, flexible and full-featured hierarchical python container that makes simple and sophisticated bookkeeping easy.
http://www.stat.washington.edu/~hoytak/code/treedict/
Other
30 stars 9 forks source link

Support of Python 3 #5

Closed benureau closed 11 years ago

benureau commented 11 years ago

Hi,

Thanks for your wonderful package, I use it for running sets of simulations on clusters. I needed Python 3 support, so I implemented it.

The code has been tested on 2.7.3, 3.2.4 and 3.3.1 (all unit tests pass), on OS X. It is far from elegant or optimal, and it may adversely affect performance. The main changes are :

  1. print statements
  2. the str/bytes conundrum, of importance for hashes.
  3. the iteritems/items for dict.
  4. the cPickle package.

Optimization may be possible.

hoytak commented 11 years ago

Hey, this looks really good. I went through and tweaked some of the changes and benchmarked it. The biggest optimization I did was change the IS_PYTHON2 flag to a compile-time define passed in through setup.py. I also tuned some of the inner iterations so cython could optimize them better -- the ones I did seem to benchmark a bit better. Could you test it out on your installation?

Also, could you send me your info (name / maybe website) so I can acknowledge your contribution on my website?