snayfach / MicrobeCensus

MicrobeCensus estimates the average genome size of microbial communities from metagenomic data
http://genomebiology.com/2015/16/1/51
GNU General Public License v3.0
41 stars 16 forks source link

Fix #20 for Python 2/3 compatibility #21

Closed nigiord closed 6 years ago

nigiord commented 6 years ago

Related to #20 Allow to install and use MicrobeCensus in Python3. Unittests run ok for Python 2.7.15 and Python 3.5.5.

$ python tests/test_microbe_census.py 
...
----------------------------------------------------------------------
Ran 3 tests in 36.410s

OK

Details

There were only two problems with Python 3:

Also in Python 3, tests/test_microbe_census.py was complaining about unclosed files (lot of warnings). I fixed the code so all opened files are properly closed when no longer used.

Finally, tests/test_microbe_census.py and microbe_census/microbe_census.py presented a mix of tab and 4-space indentations. I converted everything to 4-space indentation.

Best, Nils

snayfach commented 6 years ago

Looks good - I'll merge. Thanks!