sixty-north / segpy

A Python package for reading and writing SEG Y files.
Other
101 stars 54 forks source link

Python 2 Compatibility #16

Open stevejpurves opened 9 years ago

stevejpurves commented 9 years ago

I have seen a lot of recent changes, including bringing the rewrite branch into master. Where are things currently with python 2.7 and 3 support. Should we be expecting the code to still be working on both? or have you moved to supporting 3 only?

I note use of zip_longest over izip_longest for example, with no attempt on backwards compatibility.

rob-smallshire commented 9 years ago

We have no plans to continue supporting Python 2. The new version of Segpy makes no attempt at backwards compatibility with earlier versions of Segpy and is intended for use in new code bases. For folks with legacy code bases relying on earlier versions of Segpy (or it's predecessor SegyPy) so much work would be required to upgrade to the latest Segpy that upgrading to Python 3 seems reasonable. In any case, upgrading to Python 3 is usually straightforward.

stevejpurves commented 9 years ago

Thanks for the reply Rob. I tried to make the flip to 3 but got a lot of import errors, probably the way I am using it then. also DESCRIPTION.rst still hints that 2.7 is supported.

rob-smallshire commented 9 years ago

Thanks for the note about the DESCRIPTION.rst file – this is now fixed. We have a lot of experience moving code from Python 2 to Python 3, so if there's anything you run into trouble with, I may be able to advise. Generally though, unless you're doing lots of work with bytes and Unicode strings, the conversion is simple. For what it's worth, some parts of Segpy are quite a bit faster with Python 3, mostly because of improved handling of bytes objects.

rmlopes commented 8 years ago

Just to let you guys know that this is still not clear when you come to the repo for the first time. It is clearly stated in DESCRIPTION.RST, but the main page (README for instance) should also clearly state that only python 3.3 or higher is supported, so that it is visible immediately when one comes to the repository.

rob-smallshire commented 8 years ago

I updated the README to make support for Python 3 more explicit.