geoslegend / netcdf4-python

Automatically exported from code.google.com/p/netcdf4-python
Other
0 stars 0 forks source link

Errors with netcdf lib version 4.2.3 (svn trunk) #158

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I get many test errors (attached) when using netcdf4-python 1.0.2 (from svn 
trunk) with netcdf lib 4.2.3 (from svn trunk) on win-amd64-py2.7. The netcdf 
lib itself passes all but one test. Most netcdf4-python test errors are of the 
following kind:

ERROR: runTest (tst_atts.VariablesTestCase)
testing attributes
----------------------------------------------------------------------
Traceback (most recent call last):
  File "D:\Dev\Compile\netCDF4\netcdf4-svn\test\tst_atts.py", line 39, in setUp
    f.intatt = INTATT
  File "netCDF4.pyx", line 1791, in netCDF4.Dataset.__setattr__ (netCDF4.c:20402)
  File "netCDF4.pyx", line 1737, in netCDF4.Dataset.setncattr (netCDF4.c:19828)
  File "netCDF4.pyx", line 1016, in netCDF4._set_att (netCDF4.c:13352)
TypeError: illegal data type for attribute, must be one of ['i8', 'f4', 'u8', 
'i1', 'U1', 'S1', 'i2', 'u1', 'i4', 'u2', 'f8', 'u4'], got i

The problem is that `dtype.str[1:]` unexpectedly returns `dtype.str[1:-1]`, 
excluding the last character. `dtype.str` itself seems correct.
E.g. at 
<http://code.google.com/p/netcdf4-python/source/browse/trunk/netCDF4.pyx#1015>

These errors do not occur when using netcdf lib 4.1.3 and the exact same 
netcdf4-python, python, hdf5, numpy, cython, curl, and compiler versions.

The netcdf lib code is at <http://svn.unidata.ucar.edu/repos/netcdf/trunk>

Original issue reported on code.google.com by cjgoh...@gmail.com on 9 Jan 2013 at 2:26

Attachments:

GoogleCodeExporter commented 8 years ago
I don't see those errors with a svn build of netcdf on macos x.  I wonder if 
it's specific to the windows build.

Original comment by whitaker.jeffrey@gmail.com on 9 Jan 2013 at 2:53

GoogleCodeExporter commented 8 years ago
Good to know it works on other platforms.

It's a simple call to Python's PySequence_GetSlice C API function that fails. 
Could be due to some memory corruption.

Inserting the following print statement for debugging purposes in netCDF4.pyx 
around line 2157 shows the problem:

print datatype.str, len(datatype.str), datatype.str[:], datatype.str[1:], 
datatype.str[slice(1, None, None)]

Output: <f8 3 <f f f8

Original comment by cjgoh...@gmail.com on 9 Jan 2013 at 4:09

GoogleCodeExporter commented 8 years ago
It turns out the new netcdf.h file redefines size_t in a wrong way on win64. 
Please close this issue.

Original comment by cjgoh...@gmail.com on 11 Jan 2013 at 1:13

GoogleCodeExporter commented 8 years ago

Original comment by whitaker.jeffrey@gmail.com on 11 Jan 2013 at 1:57