[h5py] 149/455: More 1.8 additions

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Thu Jul 2 18:19:27 UTC 2015


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

ghisvail-guest pushed a commit to annotated tag 1.3.0
in repository h5py.

commit 9f19ea6de4462d8074823aded595507de58ef494
Author: andrewcollette <andrew.collette at gmail.com>
Date:   Wed Oct 29 04:10:31 2008 +0000

    More 1.8 additions
---
 h5py/h5o.pyx      |  13 +++++++
 h5py/h5p_dcid.pxi | 113 ++++++++++++++++++++++++++++++++----------------------
 h5py/h5p_lcid.pxi |  16 +++++++-
 h5py/h5t.pyx      |  24 +++++++++---
 4 files changed, 113 insertions(+), 53 deletions(-)

diff --git a/h5py/h5o.pyx b/h5py/h5o.pyx
index 182161a..73420f1 100644
--- a/h5py/h5o.pyx
+++ b/h5py/h5o.pyx
@@ -26,6 +26,19 @@ from utils cimport emalloc, efree
 # Initialization
 init_hdf5()
 
+# === Public constants ========================================================
+    
+TYPE_GROUP = H5O_TYPE_GROUP    
+TYPE_DATASET = H5O_TYPE_DATASET   
+TYPE_NAMED_DATATYPE = H5O_TYPE_NAMED_DATATYPE
+
+COPY_SHALLOW_HIERARCHY_FLAG = H5O_COPY_SHALLOW_HIERARCHY_FLAG
+COPY_EXPAND_SOFT_LINK_FLAG  = H5O_COPY_EXPAND_SOFT_LINK_FLAG
+COPY_EXPAND_EXT_LINK_FLAG   = H5O_COPY_EXPAND_EXT_LINK_FLAG
+COPY_EXPAND_REFERENCE_FLAG  = H5O_COPY_EXPAND_REFERENCE_FLAG
+COPY_WITHOUT_ATTR_FLAG      = H5O_COPY_WITHOUT_ATTR_FLAG
+COPY_PRESERVE_NULL_FLAG     = H5O_COPY_PRESERVE_NULL_FLAG
+
 # === Giant H5O_info_t structure ==============================================
 
 cdef class _ObjInfoBase(SmartStruct):
diff --git a/h5py/h5p_dcid.pxi b/h5py/h5p_dcid.pxi
index f42a49f..6851e36 100644
--- a/h5py/h5p_dcid.pxi
+++ b/h5py/h5p_dcid.pxi
@@ -110,6 +110,20 @@ cdef class PropDCID(PropCreateID):
         H5Pget_fill_value(self.id, tid.id, value.data)
 
     @sync
+    def fill_value_defined(self):
+        """() => INT fill_status
+
+        Determine the status of the dataset fill value.  Return values are:
+
+        - h5d.FILL_VALUE_UNDEFINED
+        - h5d.FILL_VALUE_DEFAULT
+        - h5d.FILL_VALUE_USER_DEFINED
+        """
+        cdef H5D_fill_value_t val
+        H5Pfill_value_defined(self.id, &val)
+        return <int>val
+
+    @sync
     def set_fill_time(self, int fill_time):
         """(INT fill_time)
 
@@ -137,52 +151,27 @@ cdef class PropDCID(PropCreateID):
         H5Pget_fill_time(self.id, &fill_time)
         return <int>fill_time
 
-
-    # === Filter functions ====================================================
-    
-    @sync
-    def set_deflate(self, unsigned int level=5):
-        """(UINT level=5)
-
-        Enable deflate (gzip) compression, at the given level.
-        Valid levels are 0-9, default is 5.
-        """
-        H5Pset_deflate(self.id, level)
-
     @sync
-    def set_fletcher32(self):
-        """()
+    def set_alloc_time(self, int alloc_time):
+        """(INT alloc_time)
 
-        Enable Fletcher32 error correction on this list.
+        Set the storage space allocation time.  One of h5d.ALLOC_TIME*.
         """
-        H5Pset_fletcher32(self.id)
-
-    @sync
-    def set_shuffle(self):
-        """()
-
-        Enable to use of the shuffle filter.  Use this immediately before 
-        the deflate filter to increase the compression ratio.
-        """
-        H5Pset_shuffle(self.id)
+        H5Pset_alloc_time(self.id, <H5D_alloc_time_t>alloc_time)
 
     @sync
-    def set_szip(self, unsigned int options, unsigned int pixels_per_block):
-        """(UINT options, UINT pixels_per_block)
+    def get_alloc_time(self):
+        """() => INT alloc_time
 
-        Enable SZIP compression.  See the HDF5 docs for argument meanings, 
-        and general restrictions on use of the SZIP format.
+        Get the storage space allocation time.  One of h5d.ALLOC_TIME*.
         """
-        H5Pset_szip(self.id, options, pixels_per_block)
+        cdef H5D_alloc_time_t alloc_time
+        H5Pget_alloc_time(self.id, &alloc_time)
+        return <int>alloc_time
 
-    @sync
-    def get_nfilters(self):
-        """() => INT
-
-        Determine the number of filters in the pipeline.
-        """
-        return H5Pget_nfilters(self.id)
 
+    # === Filter functions ====================================================
+    
     @sync
     def set_filter(self, int filter_code, unsigned int flags=0, object values=None):
         """(INT filter_code, UINT flags=0, TUPLE values=None)
@@ -235,6 +224,14 @@ cdef class PropDCID(PropCreateID):
         return <bint>(H5Pall_filters_avail(self.id))
 
     @sync
+    def get_nfilters(self):
+        """() => INT
+
+        Determine the number of filters in the pipeline.
+        """
+        return H5Pget_nfilters(self.id)
+
+    @sync
     def get_filter(self, int filter_idx):
         """(UINT filter_idx) => TUPLE filter_info
 
@@ -330,16 +327,40 @@ cdef class PropDCID(PropCreateID):
         H5Premove_filter(self.id, <H5Z_filter_t>filter_class)
 
     @sync
-    def fill_value_defined(self):
-        """() => INT fill_status
+    def set_deflate(self, unsigned int level=5):
+        """(UINT level=5)
 
-        Determine the status of the dataset fill value.  Return values are:
+        Enable deflate (gzip) compression, at the given level.
+        Valid levels are 0-9, default is 5.
+        """
+        H5Pset_deflate(self.id, level)
 
-        - h5d.FILL_VALUE_UNDEFINED
-        - h5d.FILL_VALUE_DEFAULT
-        - h5d.FILL_VALUE_USER_DEFINED
+    @sync
+    def set_fletcher32(self):
+        """()
+
+        Enable Fletcher32 error correction on this list.
         """
-        cdef H5D_fill_value_t val
-        H5Pfill_value_defined(self.id, &val)
-        return <int>val
+        H5Pset_fletcher32(self.id)
+
+    @sync
+    def set_shuffle(self):
+        """()
+
+        Enable to use of the shuffle filter.  Use this immediately before 
+        the deflate filter to increase the compression ratio.
+        """
+        H5Pset_shuffle(self.id)
+
+    @sync
+    def set_szip(self, unsigned int options, unsigned int pixels_per_block):
+        """(UINT options, UINT pixels_per_block)
+
+        Enable SZIP compression.  See the HDF5 docs for argument meanings, 
+        and general restrictions on use of the SZIP format.
+        """
+        H5Pset_szip(self.id, options, pixels_per_block)
+
+
+
 
diff --git a/h5py/h5p_lcid.pxi b/h5py/h5p_lcid.pxi
index c9150d9..2ead312 100644
--- a/h5py/h5p_lcid.pxi
+++ b/h5py/h5p_lcid.pxi
@@ -14,6 +14,20 @@ cdef class PropLCID(PropCreateID):
     
     """ Link creation property list """
 
-    pass
+    @sync
+    def set_create_intermediate_group(self, bint create):
+        """(BOOL create)
 
+        Set whether missing intermediate groups are automatically created.
+        """
+        H5Pset_create_intermediate_group(self.id, create)
 
+    @sync
+    def get_create_intermediate_group(self):
+        """() => BOOL 
+
+        Determine if missing intermediate groups are automatically created.
+        """
+        cdef unsigned int create
+        H5Pget_create_intermediate_group(self.id, &create)
+        return <bint>create
diff --git a/h5py/h5t.pyx b/h5py/h5t.pyx
index 5b8f097..82d9b81 100644
--- a/h5py/h5t.pyx
+++ b/h5py/h5t.pyx
@@ -62,6 +62,7 @@ include "sync.pxi"
 
 # Pyrex compile-time imports
 from h5 cimport init_hdf5, H5PYConfig, get_config, PHIL, get_phil
+from h5p cimport PropID, pdefault
 from numpy cimport dtype, ndarray
 from python_string cimport PyString_FromStringAndSize
 
@@ -368,13 +369,24 @@ cdef class TypeID(ObjectID):
     cdef object py_dtype(self):
         raise TypeError("No NumPy equivalent for %s exists" % self.__class__.__name__)
 
-    @sync
-    def commit(self, ObjectID group not None, char* name):
-        """(ObjectID group, STRING name)
+    IF H5PY_18API:
+        @sync
+        def commit(self, ObjectID group not None, char* name, PropID lcpl=None):
+            """(ObjectID group, STRING name, PropID lcpl=None)
 
-        Commit this (transient) datatype to a named datatype in a file.
-        """
-        H5Tcommit(group.id, name, self.id)
+            Commit this (transient) datatype to a named datatype in a file.
+            If present, lcpl may be a link creation property list.
+            """
+            H5Tcommit2(group.id, name, self.id, pdefault(lcpl),
+                H5P_DEFAULT, H5P_DEFAULT)
+    ELSE:
+        @sync
+        def commit(self, ObjectID group not None, char* name):
+            """(ObjectID group, STRING name)
+
+            Commit this (transient) datatype to a named datatype in a file.
+            """
+            H5Tcommit(group.id, name, self.id)
 
     @sync
     def committed(self):

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



More information about the debian-science-commits mailing list