Skip to content

Commit

Permalink
Fix py3 pynio backend (#1612)
Browse files Browse the repository at this point in the history
* Update pynio backend for python 3

Update pynio backend to work with python 3. Previous version accessed
the iteritems() method of of the Nio variables object, which no longer
exists in the python 3 version. Instead, access the items() method here.

* Add tests for pynio python3 support

Add tests for development version of pynio with python3 support. There
is currently no official release version of pynio with python3 support,
so we need to pull in the development version from the ncar conda
channel to use pynio in python 3 environments and to run the pynio tests
in the test suite. Also fixes a bug in the test initialization in which
the presence of the pynio library was tested by trying to import "pynio"
instead of "Nio" (the actual name of the library).

* Add notes to bug fixes documenting changes.

Add notes to big fixes section in documentation to highlight changes.

* Fix requirements for py36-pynio-dev test

Fix requirements for py36-pynio-dev test to remove unnecessary option.

* Fix py36-pynio tests

Added tests were only specified in the allowed failures and needed to be
added to the main include block as well.
  • Loading branch information
brhillman authored and Joe Hamman committed Oct 6, 2017
1 parent 30160ba commit 5bd4015
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 2 deletions.
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ matrix:
env: CONDA_ENV=py36-bottleneck-dev
- python: 3.6
env: CONDA_ENV=py36-condaforge-rc
- python: 3.6
env: CONDA_ENV=py36-pynio-dev
allow_failures:
- python: 3.6
env:
Expand All @@ -59,6 +61,8 @@ matrix:
env: CONDA_ENV=py36-bottleneck-dev
- python: 3.6
env: CONDA_ENV=py36-condaforge-rc
- python: 3.6
env: CONDA_ENV=py36-pynio-dev

before_install:
- if [[ "$TRAVIS_PYTHON_VERSION" == "2.7" ]]; then
Expand Down
25 changes: 25 additions & 0 deletions ci/requirements-py36-pynio-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: test_env
channels:
- conda-forge
- ncar
dependencies:
- python=3.6
- dask
- distributed
- h5py
- h5netcdf
- matplotlib
- netcdf4
- pynio=dev
- pytest
- numpy
- pandas
- scipy
- seaborn
- toolz
- rasterio
- bottleneck
- pip:
- coveralls
- pytest-cov
- pydap
3 changes: 3 additions & 0 deletions doc/whats-new.rst
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,9 @@ Bug fixes
The previous behavior unintentionally causing additional tests to be skipped
(:issue:`1531`). By `Joe Hamman <https://github.com/jhamman>`_.

- Fix pynio backend for upcoming release of pynio with python3 support
(:issue:`1611`). By `Ben Hillman <https://github/brhillman>`_.

.. _whats-new.0.9.6:

v0.9.6 (8 June 2017)
Expand Down
2 changes: 1 addition & 1 deletion xarray/backends/pynio_.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def open_store_variable(self, name, var):
def get_variables(self):
with self.ensure_open(autoclose=False):
return FrozenOrderedDict((k, self.open_store_variable(k, v))
for k, v in self.ds.variables.iteritems())
for k, v in self.ds.variables.items())

def get_attrs(self):
with self.ensure_open(autoclose=True):
Expand Down
2 changes: 1 addition & 1 deletion xarray/tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def _importorskip(modname, minversion=None):
has_pydap, requires_pydap = _importorskip('pydap.client')
has_netCDF4, requires_netCDF4 = _importorskip('netCDF4')
has_h5netcdf, requires_h5netcdf = _importorskip('h5netcdf')
has_pynio, requires_pynio = _importorskip('pynio')
has_pynio, requires_pynio = _importorskip('Nio')
has_dask, requires_dask = _importorskip('dask')
has_bottleneck, requires_bottleneck = _importorskip('bottleneck')
has_rasterio, requires_rasterio = _importorskip('rasterio')
Expand Down

0 comments on commit 5bd4015

Please sign in to comment.