netcdf-c branch ghpull-375 breaks netcdf4-python tests
I'm in the process of merging a pull request submitted by Wei-Keng Liao (full history here: https://github.com/Unidata/netcdf-c/pull/319 working branch is ghpull-375). Regression tests on the branch result in the following error in the netcdf4-python tests:
Writing /usr/local/lib/python2.7/dist-packages/netCDF4-1.2.7.egg-info
......................E....................................................................
======================================================================
ERROR: runTest (tst_multifile2.VariablesTestCase)
testing multi-file dataset access
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/tester/netcdf4-python/test/tst_multifile2.py", line 60, in runTest
assert_array_equal(varin[4:-4:4,3:5,2:8],data2[4:-4:4,3:5,2:8])
File "netCDF4/_netCDF4.pyx", line 5834, in netCDF4._netCDF4._Variable.__getitem__ (netCDF4/_netCDF4.c:72711)
File "netCDF4/_netCDF4.pyx", line 3753, in netCDF4._netCDF4.Variable.__getitem__ (netCDF4/_netCDF4.c:38851)
File "netCDF4/_netCDF4.pyx", line 4470, in netCDF4._netCDF4.Variable._get (netCDF4/_netCDF4.c:48586)
IndexError
----------------------------------------------------------------------
Ran 91 tests in 80.829s
FAILED (errors=1)
not running tst_unicode3.py ...
netcdf4-python version: 1.2.7
HDF5 lib version: 1.8.18
netcdf lib version: 4.4.2-development
numpy version 1.11.0
It has been a long time coming, but we are preparing to merge this into master. Since there are netcdf4-python failures, I thought I should post this information here so there is some warning (and chance for feedback; if this is a big problem let us know!) instead of rudely allowing the tests to fail with no warning :).
If you have docker available, you can duplicate this easily as follows:
$ docker run -it -e CBRANCH=ghpull-375 unidata/nctests:serial
To run ONLY the python tests:
$ docker run -it -e CBRANCH=ghpull-375 -e RUNC=OFF -e RUNF=OFF -e RUNCXX=OFF -e RUNNCO=OFF unidata/nctests:serial
So that test fails because it is requesting data from a slice that is outside the actual bound of the data. Previously, this would return an empty array; with these changes to netcdf-c, now it seems that this code is triggering:
ierr = nc_get_vars(self._grpid, self._varid,
startp, countp, stridep, data.data)
if ierr == NC_EINVALCOORDS:
raise IndexError
So we need to adapt somehow...
pull request merged that should fix the tests