Skip to content

Conversion to Python 2/3 inter-compatibility #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

darothen
Copy link

@darothen darothen commented Jan 30, 2017

These changes are the result of running the automatic 2to3 conversion scripts to the base PyGChem package. I had to tweak a few additional things, most notably the the inheritance behind FortranFile. But, this seems to work for most things! There are lot of ungainly imports that could be cleaned up and some hand-optimization (e.g. convert all the old_div function calls to //), but they're mostly cosmetic.

Needs testing and commentary / code review from someone more familiar with this package. This work is a base for the xarray backend WIP I'm about to register on the Issues board.

TODO

  • Regression testing for 2/3 compatibility
  • Clean unused and superfluous imports for all modules

@benbovy benbovy mentioned this pull request Jan 31, 2017
5 tasks
@benbovy
Copy link
Owner

benbovy commented Jan 31, 2017

Many thanks for opening this PR @darothen. Python 3 compatibility is definitely needed!

I will review this asap. Unfortunately, I'm not familiar with Python-Future, and there is no automated tests yet. But for now I think we just need to ensure that we can read GEOS-Chem bpch (and netcdf) files with the existing backends (iris and bpch) using both Python 2.7 and 3.4+.

@darothen
Copy link
Author

Reading bpch seems to work okay - only a few tweaks were needed. I haven't yet tested compatibility with iris; it's been quite some time since I used that package (I'm fully on an xarray/cartopy stack these days) but this may be an excuse to do so. I'm going to edit the top-level comment of the Pull Request with some additional TODO items based on our e-mail thread.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants