[pytables] 07/14: New patch for HDF5 1.10 compatibility

Antonio Valentino a_valentino-guest at moszumanska.debian.org
Tue Nov 1 07:57:30 UTC 2016


This is an automated email from the git hooks/post-receive script.

a_valentino-guest pushed a commit to branch master
in repository pytables.

commit 04898abd7626733c7b5c316026837d65aff11962
Author: Antonio Valentino <antonio.valentino at tiscali.it>
Date:   Mon Oct 31 08:30:29 2016 +0000

    New patch for HDF5 1.10 compatibility
---
 debian/changelog                                   |   1 +
 .../0005-fix-compatibility-with-HDF5-1.10.patch    | 329 +++++++++++++++++++++
 debian/patches/series                              |   1 +
 3 files changed, 331 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index bd36a00..a4963f3 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -7,6 +7,7 @@ pytables (3.3.0-1) UNRELEASED; urgency=medium
     - refresh all patches
     - drop 0005-fix-index-inheritance-order.patch and
       0006-fix-typo-in-hdf5extension.pyx.patch: applied upstream
+    - new 0005-fix-compatibility-with-HDF5-1.10.patch
   * debian/copyright
     - add copyright for zsrd source
 
diff --git a/debian/patches/0005-fix-compatibility-with-HDF5-1.10.patch b/debian/patches/0005-fix-compatibility-with-HDF5-1.10.patch
new file mode 100644
index 0000000..ab3193b
--- /dev/null
+++ b/debian/patches/0005-fix-compatibility-with-HDF5-1.10.patch
@@ -0,0 +1,329 @@
+From: Antonio Valentino <antonio.valentino at tiscali.it>
+Date: Mon, 31 Oct 2016 08:27:44 +0000
+Subject: fix compatibility with HDF5 1.10
+
+---
+ README.rst                             |   3 +-
+ doc/source/usersguide/installation.rst |   2 +-
+ setup.py                               |   6 +-
+ src/H5ARRAY.c                          |   4 +-
+ src/H5ARRAY.h                          |   2 +-
+ src/H5TB-opt.c                         |   2 +-
+ src/H5TB-opt.h                         |   2 +-
+ src/H5VLARRAY.c                        |   2 +-
+ src/H5VLARRAY.h                        |   2 +-
+ tables/definitions.pxd                 | 105 ++++++++++++++++-----------------
+ tables/hdf5extension.pyx               |   8 +++
+ tables/utilsextension.pyx              |   1 +
+ 12 files changed, 70 insertions(+), 69 deletions(-)
+
+diff --git a/README.rst b/README.rst
+index 3e73474..68323d8 100644
+--- a/README.rst
++++ b/README.rst
+@@ -105,8 +105,7 @@ optional.
+ Installation
+ ------------
+ 
+-1. Make sure you have HDF5 version 1.8.4 or above. HDF5 1.10.x is not
+-supported.
++1. Make sure you have HDF5 version 1.8.4 or above.
+ 
+    On OSX you can install HDF5 using `Homebrew <http://brew.sh>`_::
+ 
+diff --git a/doc/source/usersguide/installation.rst b/doc/source/usersguide/installation.rst
+index 692e3bc..6de34e2 100644
+--- a/doc/source/usersguide/installation.rst
++++ b/doc/source/usersguide/installation.rst
+@@ -49,7 +49,7 @@ Prerequisites
+ First, make sure that you have
+ 
+ * Python_ >= 2.7 including Python 3.x
+-* HDF5_ >= 1.8.4 (>=1.8.15 is strongly recommended, HDF5 v1.10 not supported)
++* HDF5_ >= 1.8.4 (>=1.8.15 is strongly recommended)
+ * NumPy_ >= 1.8.1
+ * Numexpr_ >= 2.5.2
+ * Cython_ >= 0.21
+diff --git a/setup.py b/setup.py
+index a2c79c0..2168a77 100755
+--- a/setup.py
++++ b/setup.py
+@@ -515,6 +515,7 @@ CFLAGS.append("-Isrc")
+ # Force the 1.8.x HDF5 API even if the library as been compiled to use the
+ # 1.6.x API by default
+ CFLAGS.extend([
++    "-DH5_USE_18_API",
+     "-DH5Acreate_vers=2",
+     "-DH5Aiterate_vers=2",
+     "-DH5Dcreate_vers=2",
+@@ -572,11 +573,6 @@ for (package, location) in [(hdf5_package, HDF5_DIR),
+                 "Unsupported HDF5 version! HDF5 v%s+ required. "
+                 "Found version v%s" % (min_hdf5_version, hdf5_version))
+ 
+-        if hdf5_version >= "1.10":
+-            exit_with_error(
+-                "HDF5 1.10 release not supported. HDF5 v1.8 release required. "
+-                "Found version v%s" % (hdf5_version))
+-
+         if os.name == 'nt' and hdf5_version < "1.8.10":
+             # Change in DLL naming happened in 1.8.10
+             hdf5_old_dll_name = 'hdf5dll' if not debug else 'hdf5ddll'
+diff --git a/src/H5ARRAY.c b/src/H5ARRAY.c
+index 4b29c05..3ca25c5 100644
+--- a/src/H5ARRAY.c
++++ b/src/H5ARRAY.c
+@@ -31,7 +31,7 @@
+  *-------------------------------------------------------------------------
+  */
+ 
+-herr_t H5ARRAYmake( hid_t loc_id,
++hid_t H5ARRAYmake(  hid_t loc_id,
+                     const char *dset_name,
+                     const char *obversion,
+                     const int rank,
+@@ -138,7 +138,7 @@ herr_t H5ARRAYmake( hid_t loc_id,
+        blosc_compcode = blosc_compname_to_compcode(blosc_compname);
+        cd_values[6] = blosc_compcode;
+        if ( H5Pset_filter( plist_id, FILTER_BLOSC, H5Z_FLAG_OPTIONAL, 7, cd_values) < 0 )
+-	 return -1;
++         return -1;
+      }
+      /* The LZO compressor does accept parameters */
+      else if (strcmp(complib, "lzo") == 0) {
+diff --git a/src/H5ARRAY.h b/src/H5ARRAY.h
+index 2c1fd40..d49e4fb 100644
+--- a/src/H5ARRAY.h
++++ b/src/H5ARRAY.h
+@@ -13,7 +13,7 @@
+ extern "C" {
+ #endif
+ 
+-herr_t H5ARRAYmake( hid_t loc_id,
++hid_t H5ARRAYmake(  hid_t loc_id,
+                     const char *dset_name,
+                     const char *obversion,
+                     const int rank,
+diff --git a/src/H5TB-opt.c b/src/H5TB-opt.c
+index 31e7948..c1c1b34 100644
+--- a/src/H5TB-opt.c
++++ b/src/H5TB-opt.c
+@@ -72,7 +72,7 @@
+  */
+ 
+ 
+-herr_t H5TBOmake_table( const char *table_title,
++hid_t H5TBOmake_table(  const char *table_title,
+                         hid_t loc_id,
+                         const char *dset_name,
+                         char *version,
+diff --git a/src/H5TB-opt.h b/src/H5TB-opt.h
+index 8bb2847..4c2243d 100644
+--- a/src/H5TB-opt.h
++++ b/src/H5TB-opt.h
+@@ -4,7 +4,7 @@
+ extern "C" {
+ #endif
+ 
+-herr_t H5TBOmake_table( const char *table_title,
++hid_t H5TBOmake_table(  const char *table_title,
+                         hid_t loc_id,
+                         const char *dset_name,
+                         char *version,
+diff --git a/src/H5VLARRAY.c b/src/H5VLARRAY.c
+index 86ff545..431b436 100644
+--- a/src/H5VLARRAY.c
++++ b/src/H5VLARRAY.c
+@@ -29,7 +29,7 @@
+  *-------------------------------------------------------------------------
+  */
+ 
+-herr_t H5VLARRAYmake( hid_t loc_id,
++hid_t H5VLARRAYmake(  hid_t loc_id,
+                       const char *dset_name,
+                       const char *obversion,
+                       const int rank,
+diff --git a/src/H5VLARRAY.h b/src/H5VLARRAY.h
+index c0913b5..a900857 100644
+--- a/src/H5VLARRAY.h
++++ b/src/H5VLARRAY.h
+@@ -7,7 +7,7 @@
+ extern "C" {
+ #endif
+ 
+-herr_t H5VLARRAYmake( hid_t loc_id,
++hid_t H5VLARRAYmake(  hid_t loc_id,
+                       const char *dset_name,
+                       const char *obversion,
+                       const int rank,
+diff --git a/tables/definitions.pxd b/tables/definitions.pxd
+index 61d75cb..0dce74c 100644
+--- a/tables/definitions.pxd
++++ b/tables/definitions.pxd
+@@ -40,16 +40,16 @@ cdef extern from "numpy/arrayobject.h":
+ # Structs and types from HDF5
+ cdef extern from "hdf5.h" nogil:
+ 
+-  ctypedef int hid_t  # In H5Ipublic.h
++  ctypedef long long hid_t  # In H5Ipublic.h
+   ctypedef int hbool_t
+   ctypedef int herr_t
+   ctypedef int htri_t
+   # hsize_t should be unsigned, but Windows platform does not support
+   # such an unsigned long long type.
+-  ctypedef long long hsize_t
++  ctypedef unsigned long long hsize_t
+   ctypedef signed long long hssize_t
+   ctypedef long long int64_t
+-  ctypedef long long haddr_t
++  ctypedef unsigned long long haddr_t
+   ctypedef haddr_t hobj_ref_t
+ 
+   ctypedef struct hvl_t:
+@@ -172,61 +172,58 @@ cdef extern from "hdf5.h" nogil:
+     H5T_NCLASSES                # this must be last
+ 
+   # Native types
+-  cdef enum:
+-    H5T_C_S1
+-    H5T_NATIVE_B8
+-    H5T_NATIVE_CHAR
+-    H5T_NATIVE_SCHAR
+-    H5T_NATIVE_UCHAR
+-    H5T_NATIVE_SHORT
+-    H5T_NATIVE_USHORT
+-    H5T_NATIVE_INT
+-    H5T_NATIVE_UINT
+-    H5T_NATIVE_LONG
+-    H5T_NATIVE_ULONG
+-    H5T_NATIVE_LLONG
+-    H5T_NATIVE_ULLONG
+-    H5T_NATIVE_FLOAT
+-    H5T_NATIVE_DOUBLE
+-    H5T_NATIVE_LDOUBLE
++  hid_t H5T_C_S1
++  hid_t H5T_NATIVE_B8
++  hid_t H5T_NATIVE_CHAR
++  hid_t H5T_NATIVE_SCHAR
++  hid_t H5T_NATIVE_UCHAR
++  hid_t H5T_NATIVE_SHORT
++  hid_t H5T_NATIVE_USHORT
++  hid_t H5T_NATIVE_INT
++  hid_t H5T_NATIVE_UINT
++  hid_t H5T_NATIVE_LONG
++  hid_t H5T_NATIVE_ULONG
++  hid_t H5T_NATIVE_LLONG
++  hid_t H5T_NATIVE_ULLONG
++  hid_t H5T_NATIVE_FLOAT
++  hid_t H5T_NATIVE_DOUBLE
++  hid_t H5T_NATIVE_LDOUBLE
+ 
+   # "Standard" types
+-  cdef enum:
+-    H5T_STD_I8LE
+-    H5T_STD_I16LE
+-    H5T_STD_I32LE
+-    H5T_STD_I64LE
+-    H5T_STD_U8LE
+-    H5T_STD_U16LE
+-    H5T_STD_U32LE
+-    H5T_STD_U64LE
+-    H5T_STD_B8LE
+-    H5T_STD_B16LE
+-    H5T_STD_B32LE
+-    H5T_STD_B64LE
+-    H5T_IEEE_F32LE
+-    H5T_IEEE_F64LE
+-    H5T_STD_I8BE
+-    H5T_STD_I16BE
+-    H5T_STD_I32BE
+-    H5T_STD_I64BE
+-    H5T_STD_U8BE
+-    H5T_STD_U16BE
+-    H5T_STD_U32BE
+-    H5T_STD_U64BE
+-    H5T_STD_B8BE
+-    H5T_STD_B16BE
+-    H5T_STD_B32BE
+-    H5T_STD_B64BE
+-    H5T_IEEE_F32BE
+-    H5T_IEEE_F64BE
++  hid_t H5T_STD_I8LE
++  hid_t H5T_STD_I16LE
++  hid_t H5T_STD_I32LE
++  hid_t H5T_STD_I64LE
++  hid_t H5T_STD_U8LE
++  hid_t H5T_STD_U16LE
++  hid_t H5T_STD_U32LE
++  hid_t H5T_STD_U64LE
++  hid_t H5T_STD_B8LE
++  hid_t H5T_STD_B16LE
++  hid_t H5T_STD_B32LE
++  hid_t H5T_STD_B64LE
++  hid_t H5T_IEEE_F32LE
++  hid_t H5T_IEEE_F64LE
++  hid_t H5T_STD_I8BE
++  hid_t H5T_STD_I16BE
++  hid_t H5T_STD_I32BE
++  hid_t H5T_STD_I64BE
++  hid_t H5T_STD_U8BE
++  hid_t H5T_STD_U16BE
++  hid_t H5T_STD_U32BE
++  hid_t H5T_STD_U64BE
++  hid_t H5T_STD_B8BE
++  hid_t H5T_STD_B16BE
++  hid_t H5T_STD_B32BE
++  hid_t H5T_STD_B64BE
++  hid_t H5T_IEEE_F32BE
++  hid_t H5T_IEEE_F64BE
+ 
+   # Types which are particular to UNIX (for Time types)
+-  cdef enum:
+-    H5T_UNIX_D32LE
+-    H5T_UNIX_D64LE
+-    H5T_UNIX_D32BE
+-    H5T_UNIX_D64BE
++  hid_t H5T_UNIX_D32LE
++  hid_t H5T_UNIX_D64LE
++  hid_t H5T_UNIX_D32BE
++  hid_t H5T_UNIX_D64BE
+ 
+   # The order to retrieve atomic native datatype
+   cdef enum H5T_direction_t:
+diff --git a/tables/hdf5extension.pyx b/tables/hdf5extension.pyx
+index b496db4..b9bd9e8 100644
+--- a/tables/hdf5extension.pyx
++++ b/tables/hdf5extension.pyx
+@@ -1217,6 +1217,10 @@ cdef class Array(Leaf):
+       atom_ = atom
+       shape = shape[:-len(atom_.shape)]
+     self.disk_type_id = atom_to_hdf5_type(atom_, self.byteorder)
++    if self.disk_type_id < 0:
++      raise HDF5ExtError(
++        "Problems creating the %s: invalid disk type ID for atom %s" % (
++            self.__class__.__name__, atom_))
+ 
+     # Allocate space for the dimension axis info and fill it
+     dims = numpy.array(shape, dtype=numpy.intp)
+@@ -1885,6 +1889,10 @@ cdef class VLArray(Leaf):
+     # Get the HDF5 type of the *scalar* atom
+     scatom = atom.copy(shape=())
+     self.base_type_id = atom_to_hdf5_type(scatom, self.byteorder)
++    if self.base_type_id < 0:
++      raise HDF5ExtError(
++        "Problems creating the %s: invalid base type ID for atom %s" % (
++            self.__class__.__name__, scatom))
+ 
+     # Allocate space for the dimension axis info
+     rank = len(atom.shape)
+diff --git a/tables/utilsextension.pyx b/tables/utilsextension.pyx
+index 7d801e0..65889bd 100644
+--- a/tables/utilsextension.pyx
++++ b/tables/utilsextension.pyx
+@@ -1156,6 +1156,7 @@ def enum_to_hdf5(object enum_atom, str byteorder):
+ 
+ def atom_to_hdf5_type(atom, str byteorder):
+   cdef hid_t   tid = -1
++  cdef hid_t   tid2 = -1
+   cdef hsize_t *dims = NULL
+   cdef bytes   encoded_byteorder
+   cdef char    *cbyteorder = NULL
diff --git a/debian/patches/series b/debian/patches/series
index 5900800..692ccbc 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -2,3 +2,4 @@
 0002-Use-system-compression-libs.patch
 0003-Never-use-the-msse2-flag-explicitly.patch
 0004-Do-not-fetch-icons-for-external-web-sites.patch
+0005-fix-compatibility-with-HDF5-1.10.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/pytables.git



More information about the debian-science-commits mailing list