psathyrella / partis

B- and T-cell receptor sequence annotation, simulation, clonal family and germline inference, and affinity prediction
GNU General Public License v3.0
54 stars 34 forks source link

Add Python 3 support #230

Closed laserson closed 6 years ago

laserson commented 7 years ago

Even if SCons doesn't support Python 3, the ultimate partis binary could still be Python 3 compatible.

psathyrella commented 7 years ago

If you mean migrating the partis code to python 3, that definitely seems like the way to go long-term, but I don't imagine it happening any time soon. For instance, here:

""" Note the question that isn’t on the list: “I have a large Python 2 application which is working well for me. Should I migrate it to Python 3?”.

While OpenStack and some key Linux distributions have answered “Yes”, it makes sense for the answer to that question to remain “No” for the time being while companies like Canonical, Red Hat, Facebook, Google, Dropbox, and others work to migrate their own systems, and publish the related migration tools (such as the pylint --py3k option, or the working going into the mypy and typeshed projects to allow Python 3 type analysis to be applied to Python 2 programs prior to attempting to migrate them). """

unless of course you're running into a problem I haven't thought of? Is there a particular reason?

laserson commented 7 years ago

Mostly just convenience from my perspective. I also don't have a sense for how big of a job it would be (e.g., just rewrite all the print statements versus having to replace some fundamental libraries)

psathyrella commented 7 years ago

It's been a while since I read the python 3 migration docs (reading again just now), but if it's just the prints I wouldn't really care, that'd be a nice day or two of emacs regex search and replace. It's the subtle changes in iterators, for instance, that worried me more (like, there's lots of places where I'm being careful to use [or not use] a copy of a list/dict/set). The testing framework is pretty extensive, but still... 100% coverage is always a dream even with simply-defined inputs. And BCR repertoires are so variable in so many ways, that I'm constantly coming across repertoires that have a one-in-a-million sequence (or confluence of sequences) that manages to break something in an unforeseeable way.

The bottom line being I'm pretty sure I will need to spend a lot of time carefully going through a lot of lines of code to re-think through the logic to make sure it doesn't break.

psathyrella commented 6 months ago

Well, it turned out I did need to spend a lot of time going through individual lines of code to keep python 3 from breaking things, but it's (mostly) done now https://quay.io/repository/matsengrp/partis/build/85bbb9c6-1c11-4668-8c8c-e26a48f72da7