-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
pynio backend broken in python 3 #1611
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
Comments
@brhillman - that would be great. I don't think anyone has worked on this yet and we'd be happy to have you contribute here. We have some contributor guidelines in the works (see #1485). Generally, we'll want to add the pynio package to one or more of the python3 test suites (here would be a good place to start). Put your changes on a branch (e.g. |
@jhamman okay I'll take a look and put this together. Would you prefer a single PR to both fix the issue and add a pynio test, or separate PRs for those two changes? I've got a bit of reading to do to get up to speed on adding a test I think. |
Do you know if the py3k support made into |
@ocefpaf no, I don't think so. I think the only version of pynio that has py3 support is the dev snapshot on the ncar conda-forge channel. This is the version I used to get pynio to work in my python 3 environment so that I could use xarray to read ERA-Interim grib files. I installed the dev snapshot via |
Yep, just saw that in conda-forge/pynio-feedstock#30 So we need to wait... Hopefully they will release it soon. Thanks! |
@brhillman - A PR to fix the iteritems issue can happen now. You could also add a test to the Lines 42 to 61 in c748062
that pulls the ncar dev build down. That would allow us to work out some of the kinks while they get their final python3 release ready. More broadly, if we don't have a viable way to install the package, perhaps your effort would be better spent helping PyNio get Python3 into a full release. |
Okay @jhamman excuse my ignorance on the test suite, I've never worked with pytest or Travis CI before, but if I understand correctly, this would involve adding a section like:
to FYI I also had to make a change to |
Yep, it sounds like you have it about right. Why don't you open a PR and we can iterate further there. |
@jhamman okay I figured it out, added the tests, confirmed that the Nio tests get run, and they all pass (other than a dask test, but I think that's expected right now?). But, I'm getting some strange results from edit: oops, commented before I got your response. Opening PR now and we can iterate there... |
pynio recently released a development python 3 port (see NCAR/pynio#10). The pynio backend in xarray needs a slight fix to use this though; the get_variables() method in the NioDataStore class tries to access the iteritems() method of the variables object, which no longer exists in python3. The simple fix is to replace iteritems() with items() in this method. I've made this fix on a local version of the code, and it seems to work as expected. I would be happy to put together a PR if nobody has done such, and if someone could point me to any documentation or recommendations on the preferred conventions for structuring PRs for the project (I have not contributed before). Thanks!
The text was updated successfully, but these errors were encountered: