arq5x / poretools

a toolkit for working with Oxford nanopore data
MIT License
243 stars 89 forks source link

Poretools py3 dev #163

Open skbrimer opened 6 years ago

skbrimer commented 6 years ago

Hi Aaron and Nick,

I have updated Poretools to include support to for python2.7 and >python3.3 Please look at it and let me know if this is something of interest to you. I have also included a travisCI in the build and it shows it passing the poretools-tests.sh for all the versions of python.

Let me know what you think!

Sean

skbrimer commented 6 years ago

Hi Aaron and Nick,

I figured out how to merge :+1: so that means that the master and the poretools_py3_dev branch are the same now. Some of the things I learned in doing this are below.

  1. python3 and python2 have a different # of significant digits and deal with rounding differently. Due to this the expected outcome for the test files are different from each other. So I made a set for the py3 versions and updated the shell script to use the right ones.

  2. h5py changed using python3 and python2, in python2 you get a list of whatever you are calling in python3 you get a container-like object so the squiggle subcommand would not work because it wasn't actually pulling the information into the commands. I change the private api to work with py2 and py3 for the event table only as it was the only one I ran into an issue with.

  3. for the nucdist, python3 outputs the right answer as is, however it prints it out different each time so it was failing the test script. So I updated the script to be sorted. It works for both py2 and py3 so the answer is always in order.

The only issue I can't seem to solve is what happens if you run poretools without any commands python3 will not give you the short help command. It looks like this is a bug in python3, I found a bug report, that they are working on.

Let me know if you have any questions and happy holidays!