Compare commits

...

22 Commits
f32 ... rawhide

Author SHA1 Message Date
Fedora Release Engineering efa2912222 Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2022-07-21 13:27:40 +00:00
Dan Horák 4578df64e4 fix build after migration to IEEE 128-bit long double on ppc64le 2022-06-14 17:03:35 +00:00
Python Maint 5d4a8321fe Rebuilt for Python 3.11 2022-06-13 22:19:54 +02:00
Terje Rosten c6356c6d16 Update to 3.7.0 2022-05-24 19:35:50 +02:00
Terje Rosten 817b2394d9 Update to 3.6.0 2022-01-23 11:31:30 +01:00
Fedora Release Engineering a21455a337 - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2022-01-20 12:10:41 +00:00
Orion Poplawski bcc64af2fd Rebuild for hdf5 1.12.1 2021-11-20 21:55:02 -07:00
Terje Rosten 30d5c34fb6 Revert an upstream commit that caused crash in PySCF (rhbz#2009628) 2021-10-03 15:47:36 +02:00
Terje Rosten 91f933df47 Update to 3.4.0 2021-09-18 10:50:52 +02:00
Orion Poplawski 1c78439df1 Rebuild for hdf5 1.10.7 2021-08-09 20:02:33 -06:00
Fedora Release Engineering 85d09944b6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2021-07-22 07:28:15 +00:00
Python Maint f23f6a371e Rebuilt for Python 3.10 2021-06-04 20:06:50 +02:00
Tomas Hrnciar be75a199cd BuildRequire setuptools explicitly
See https://fedoraproject.org/wiki/Changes/Reduce_dependencies_on_python3-setuptools
2021-04-19 13:18:31 +02:00
Orion Poplawski edb3f8d9c7 Update to 3.2.1 2021-03-08 21:04:58 -07:00
Fedora Release Engineering 07bb5f1af3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2021-01-26 13:19:52 +00:00
Terje Rosten 5b3976c080 Update to 3.1.0 2020-11-07 11:35:43 +01:00
Orion Poplawski f4ddb88d4d Add upstream patches to fix s390x 2020-11-05 08:35:49 -07:00
Orion Poplawski ec467971bc Update to 3.0.0 2020-11-02 19:53:47 -07:00
Terje Rosten 3760a575bc Add openmpi and mpich subpackages 2020-07-27 21:30:20 +02:00
Orion Poplawski 57f4bdd69a Rebuild for hdf5 1.10.6 2020-06-25 14:21:02 -06:00
Miro Hrončok f10434f374 Rebuilt for Python 3.9 2020-05-26 02:48:00 +02:00
Terje Rosten 597e33f43a Add commits from 2.10.x branch 2020-05-17 13:00:48 +02:00
7 changed files with 239 additions and 803 deletions

7
.gitignore vendored
View File

@ -13,3 +13,10 @@
/h5py-2.7.1.tar.gz
/h5py-2.8.0.tar.gz
/h5py-2.9.0.tar.gz
/h5py-2.10.0.tar.gz
/h5py-3.0.0.tar.gz
/h5py-3.1.0.tar.gz
/h5py-3.2.1.tar.gz
/h5py-3.4.0.tar.gz
/h5py-3.6.0.tar.gz
/h5py-3.7.0.tar.gz

View File

@ -1,592 +0,0 @@
diff --git a/h5py/h5t.pyx b/h5py/h5t.pyx
index ff53509..e05cd74 100644
--- a/h5py/h5t.pyx
+++ b/h5py/h5t.pyx
@@ -253,9 +253,11 @@ def _get_available_ftypes():
available_ftypes[np.dtype(ftype).itemsize].append(ftype)
sorted_ftypes = []
+ seen_ftypes = set()
for size, ftypes in sorted(available_ftypes.items()):
for ftype in sorted(ftypes, key=cmp_ftype):
- if ftype not in sorted_ftypes:
+ if ftype not in seen_ftypes:
+ seen_ftypes.add(ftype)
sorted_ftypes.append((ftype, np.finfo(ftype), size))
return tuple(sorted_ftypes)
@@ -297,8 +299,8 @@ available_ftypes = _DeprecatedMapping(available_ftypes,
@with_phil
def create(int classtype, size_t size):
"""(INT classtype, UINT size) => TypeID
-
- Create a new HDF5 type object. Legal class values are
+
+ Create a new HDF5 type object. Legal class values are
COMPOUND and OPAQUE. Use enum_create for enums.
"""
@@ -323,7 +325,7 @@ def array_create(TypeID base not None, object dims_tpl):
"""(TypeID base, TUPLE dimensions) => TypeArrayID
Create a new array datatype, using and HDF5 parent type and
- dimensions given via a tuple of positive integers. "Unlimited"
+ dimensions given via a tuple of positive integers. "Unlimited"
dimensions are not allowed.
"""
cdef hsize_t rank
@@ -360,7 +362,7 @@ def vlen_create(TypeID base not None):
"""
return typewrap(H5Tvlen_create(base.id))
-
+
@with_phil
def decode(char* buf):
"""(STRING buf) => TypeID
@@ -405,7 +407,7 @@ cdef class TypeID(ObjectID):
return NotImplemented
if isinstance(other, TypeID):
truthval = self.equal(other)
-
+
if how == 2:
return truthval
return not truthval
@@ -439,7 +441,7 @@ cdef class TypeID(ObjectID):
"""
H5Tcommit2(group.id, name, self.id, pdefault(lcpl),
H5P_DEFAULT, H5P_DEFAULT)
-
+
@with_phil
def committed(self):
@@ -458,7 +460,7 @@ cdef class TypeID(ObjectID):
"""
return typewrap(H5Tcopy(self.id))
-
+
@with_phil
def equal(self, TypeID typeid):
"""(TypeID typeid) => BOOL
@@ -468,7 +470,7 @@ cdef class TypeID(ObjectID):
"""
return <bint>(H5Tequal(self.id, typeid.id))
-
+
@with_phil
def lock(self):
"""()
@@ -479,7 +481,7 @@ cdef class TypeID(ObjectID):
H5Tlock(self.id)
self.locked = 1
-
+
@with_phil
def get_class(self):
"""() => INT classcode
@@ -489,7 +491,7 @@ cdef class TypeID(ObjectID):
return <int>H5Tget_class(self.id)
- @with_phil
+ @with_phil
def set_size(self, size_t size):
"""(UINT size)
@@ -497,7 +499,7 @@ cdef class TypeID(ObjectID):
"""
H5Tset_size(self.id, size)
-
+
@with_phil
def get_size(self):
""" () => INT size
@@ -506,7 +508,7 @@ cdef class TypeID(ObjectID):
"""
return H5Tget_size(self.id)
-
+
@with_phil
def get_super(self):
"""() => TypeID
@@ -516,7 +518,7 @@ cdef class TypeID(ObjectID):
return typewrap(H5Tget_super(self.id))
- @with_phil
+ @with_phil
def detect_class(self, int classtype):
"""(INT classtype) => BOOL class_is_present
@@ -552,7 +554,7 @@ cdef class TypeID(ObjectID):
with phil:
return (type(self), (-1,), self.encode())
-
+
def __setstate__(self, char* state):
with phil:
self.id = H5Tdecode(<unsigned char*>state)
@@ -566,7 +568,7 @@ cdef class TypeArrayID(TypeID):
Represents an array datatype
"""
-
+
@with_phil
def get_array_ndims(self):
"""() => INT rank
@@ -575,7 +577,7 @@ cdef class TypeArrayID(TypeID):
"""
return H5Tget_array_ndims(self.id)
-
+
@with_phil
def get_array_dims(self):
"""() => TUPLE dimensions
@@ -583,7 +585,7 @@ cdef class TypeArrayID(TypeID):
Get the dimensions of the given array datatype as
a tuple of integers.
"""
- cdef hsize_t rank
+ cdef hsize_t rank
cdef hsize_t* dims = NULL
rank = H5Tget_array_dims(self.id, NULL, NULL)
@@ -611,7 +613,7 @@ cdef class TypeOpaqueID(TypeID):
Represents an opaque type
"""
-
+
@with_phil
def set_tag(self, char* tag):
"""(STRING tag)
@@ -621,7 +623,7 @@ cdef class TypeOpaqueID(TypeID):
"""
H5Tset_tag(self.id, tag)
-
+
@with_phil
def get_tag(self):
"""() => STRING tag
@@ -649,7 +651,7 @@ cdef class TypeStringID(TypeID):
String datatypes, both fixed and vlen.
"""
-
+
@with_phil
def is_variable_str(self):
"""() => BOOL is_variable
@@ -658,7 +660,7 @@ cdef class TypeStringID(TypeID):
"""
return <bint>(H5Tis_variable_str(self.id))
-
+
@with_phil
def get_cset(self):
"""() => INT character_set
@@ -667,7 +669,7 @@ cdef class TypeStringID(TypeID):
"""
return <int>H5Tget_cset(self.id)
-
+
@with_phil
def set_cset(self, int cset):
"""(INT character_set)
@@ -676,7 +678,7 @@ cdef class TypeStringID(TypeID):
"""
H5Tset_cset(self.id, <H5T_cset_t>cset)
-
+
@with_phil
def get_strpad(self):
"""() => INT padding_type
@@ -694,7 +696,7 @@ cdef class TypeStringID(TypeID):
"""
return <int>H5Tget_strpad(self.id)
-
+
@with_phil
def set_strpad(self, int pad):
"""(INT pad)
@@ -730,13 +732,13 @@ cdef class TypeVlenID(TypeID):
"""
Non-string vlen datatypes.
"""
-
+
cdef object py_dtype(self):
-
+
# get base type id
cdef TypeID base_type
base_type = self.get_super()
-
+
return special_dtype(vlen=base_type.dtype)
cdef class TypeTimeID(TypeID):
@@ -758,7 +760,7 @@ cdef class TypeReferenceID(TypeID):
"""
HDF5 object or region reference
"""
-
+
cdef object py_dtype(self):
if H5Tequal(self.id, H5T_STD_REF_OBJ):
return special_dtype(ref=Reference)
@@ -776,7 +778,7 @@ cdef class TypeAtomicID(TypeID):
Base class for atomic datatypes (float or integer)
"""
-
+
@with_phil
def get_order(self):
"""() => INT order
@@ -788,7 +790,7 @@ cdef class TypeAtomicID(TypeID):
"""
return <int>H5Tget_order(self.id)
-
+
@with_phil
def set_order(self, int order):
"""(INT order)
@@ -800,7 +802,7 @@ cdef class TypeAtomicID(TypeID):
"""
H5Tset_order(self.id, <H5T_order_t>order)
-
+
@with_phil
def get_precision(self):
"""() => UINT precision
@@ -809,16 +811,16 @@ cdef class TypeAtomicID(TypeID):
"""
return H5Tget_precision(self.id)
-
+
@with_phil
def set_precision(self, size_t precision):
"""(UINT precision)
-
+
Set the number of significant bits (excludes padding).
"""
H5Tset_precision(self.id, precision)
-
+
@with_phil
def get_offset(self):
"""() => INT offset
@@ -827,7 +829,7 @@ cdef class TypeAtomicID(TypeID):
"""
return H5Tget_offset(self.id)
-
+
@with_phil
def set_offset(self, size_t offset):
"""(UINT offset)
@@ -836,7 +838,7 @@ cdef class TypeAtomicID(TypeID):
"""
H5Tset_offset(self.id, offset)
-
+
@with_phil
def get_pad(self):
"""() => (INT lsb_pad_code, INT msb_pad_code)
@@ -852,7 +854,7 @@ cdef class TypeAtomicID(TypeID):
H5Tget_pad(self.id, &lsb, &msb)
return (<int>lsb, <int>msb)
-
+
@with_phil
def set_pad(self, int lsb, int msb):
"""(INT lsb_pad_code, INT msb_pad_code)
@@ -872,7 +874,7 @@ cdef class TypeIntegerID(TypeAtomicID):
Integer atomic datatypes
"""
-
+
@with_phil
def get_sign(self):
"""() => INT sign
@@ -887,7 +889,7 @@ cdef class TypeIntegerID(TypeAtomicID):
"""
return <int>H5Tget_sign(self.id)
-
+
@with_phil
def set_sign(self, int sign):
"""(INT sign)
@@ -904,7 +906,7 @@ cdef class TypeIntegerID(TypeAtomicID):
cdef object py_dtype(self):
# Translation function for integer types
- return dtype( _order_map[self.get_order()] +
+ return dtype( _order_map[self.get_order()] +
_sign_map[self.get_sign()] + str(self.get_size()) )
@@ -914,7 +916,7 @@ cdef class TypeFloatID(TypeAtomicID):
Floating-point atomic datatypes
"""
-
+
@with_phil
def get_fields(self):
"""() => TUPLE field_info
@@ -932,9 +934,9 @@ cdef class TypeFloatID(TypeAtomicID):
H5Tget_fields(self.id, &spos, &epos, &esize, &mpos, &msize)
return (spos, epos, esize, mpos, msize)
-
+
@with_phil
- def set_fields(self, size_t spos, size_t epos, size_t esize,
+ def set_fields(self, size_t spos, size_t epos, size_t esize,
size_t mpos, size_t msize):
"""(UINT spos, UINT epos, UINT esize, UINT mpos, UINT msize)
@@ -943,7 +945,7 @@ cdef class TypeFloatID(TypeAtomicID):
"""
H5Tset_fields(self.id, spos, epos, esize, mpos, msize)
-
+
@with_phil
def get_ebias(self):
"""() => UINT ebias
@@ -952,7 +954,7 @@ cdef class TypeFloatID(TypeAtomicID):
"""
return H5Tget_ebias(self.id)
-
+
@with_phil
def set_ebias(self, size_t ebias):
"""(UINT ebias)
@@ -961,7 +963,7 @@ cdef class TypeFloatID(TypeAtomicID):
"""
H5Tset_ebias(self.id, ebias)
-
+
@with_phil
def get_norm(self):
"""() => INT normalization_code
@@ -974,7 +976,7 @@ cdef class TypeFloatID(TypeAtomicID):
"""
return <int>H5Tget_norm(self.id)
-
+
@with_phil
def set_norm(self, int norm):
"""(INT normalization_code)
@@ -987,7 +989,7 @@ cdef class TypeFloatID(TypeAtomicID):
"""
H5Tset_norm(self.id, <H5T_norm_t>norm)
-
+
@with_phil
def get_inpad(self):
"""() => INT pad_code
@@ -1000,7 +1002,7 @@ cdef class TypeFloatID(TypeAtomicID):
"""
return <int>H5Tget_inpad(self.id)
-
+
@with_phil
def set_inpad(self, int pad_code):
"""(INT pad_code)
@@ -1059,7 +1061,7 @@ cdef class TypeCompositeID(TypeID):
Base class for enumerated and compound types.
"""
-
+
@with_phil
def get_nmembers(self):
"""() => INT number_of_members
@@ -1068,11 +1070,11 @@ cdef class TypeCompositeID(TypeID):
"""
return H5Tget_nmembers(self.id)
-
+
@with_phil
def get_member_name(self, int member):
"""(INT member) => STRING name
-
+
Determine the name of a member of a compound or enumerated type,
identified by its index (0 <= member < nmembers).
"""
@@ -1091,7 +1093,7 @@ cdef class TypeCompositeID(TypeID):
return pyname
-
+
@with_phil
def get_member_index(self, char* name):
"""(STRING name) => INT index
@@ -1143,7 +1145,7 @@ cdef class TypeCompoundID(TypeCompositeID):
raise ValueError("Member index must be non-negative.")
return typewrap(H5Tget_member_type(self.id, member))
-
+
@with_phil
def insert(self, char* name, size_t offset, TypeID field not None):
"""(STRING name, UINT offset, TypeID field)
@@ -1154,7 +1156,7 @@ cdef class TypeCompoundID(TypeCompositeID):
"""
H5Tinsert(self.id, name, offset, field.id)
-
+
@with_phil
def pack(self):
"""()
@@ -1175,7 +1177,7 @@ cdef class TypeCompoundID(TypeCompositeID):
field_offsets = []
nfields = self.get_nmembers()
- # First step: read field names and their Numpy dtypes into
+ # First step: read field names and their Numpy dtypes into
# two separate arrays.
for i from 0 <= i < nfields:
tmp_type = self.get_member_type(i)
@@ -1245,7 +1247,7 @@ cdef class TypeEnumID(TypeCompositeID):
Define a new member of an enumerated type. The value will be
automatically converted to the base type defined for this enum. If
- the conversion results in overflow, the value will be silently
+ the conversion results in overflow, the value will be silently
clipped.
"""
cdef long long buf
@@ -1254,7 +1256,7 @@ cdef class TypeEnumID(TypeCompositeID):
self.enum_convert(&buf, 0)
H5Tenum_insert(self.id, name, &buf)
-
+
@with_phil
def enum_nameof(self, long long value):
"""(LONG value) => STRING name
@@ -1274,7 +1276,7 @@ cdef class TypeEnumID(TypeCompositeID):
retstring = name
return retstring
-
+
@with_phil
def enum_valueof(self, char* name):
"""(STRING name) => LONG value
@@ -1287,7 +1289,7 @@ cdef class TypeEnumID(TypeCompositeID):
self.enum_convert(&buf, 1)
return buf
-
+
@with_phil
def get_member_value(self, int idx):
"""(UINT index) => LONG value
@@ -1316,7 +1318,7 @@ cdef class TypeEnumID(TypeCompositeID):
for idx in xrange(nmembers):
name = self.get_member_name(idx)
- val = self.get_member_value(idx)
+ val = self.get_member_value(idx)
members[name] = val
ref = {cfg._f_name: 0, cfg._t_name: 1}
@@ -1324,7 +1326,7 @@ cdef class TypeEnumID(TypeCompositeID):
# Boolean types have priority over standard enums
if members == ref:
return dtype('bool')
-
+
# Convert strings to appropriate representation
members_conv = {}
for name, val in members.iteritems():
@@ -1599,7 +1601,7 @@ cdef TypeStringID _c_vlen_unicode():
H5Tset_size(tid, H5T_VARIABLE)
H5Tset_cset(tid, H5T_CSET_UTF8)
return TypeStringID(tid)
-
+
cdef TypeReferenceID _c_ref(object refclass):
if refclass is Reference:
return STD_REF_OBJ
@@ -1634,7 +1636,7 @@ cpdef TypeID py_create(object dtype_in, bint logical=0, bint aligned=0):
# Float
if kind == c'f':
return _c_float(dt)
-
+
# Integer
elif kind == c'u' or kind == c'i':
@@ -1714,7 +1716,7 @@ def special_dtype(**kwds):
Create a NumPy representation of an HDF5 object or region reference
type.
"""
-
+
if len(kwds) != 1:
raise TypeError("Exactly one keyword may be provided")
@@ -1745,7 +1747,7 @@ def special_dtype(**kwds):
return dtype('O', metadata={'ref': val})
raise TypeError('Unknown special type "%s"' % name)
-
+
@with_phil
def check_dtype(**kwds):
@@ -1819,7 +1821,7 @@ def find(TypeID src not None, TypeID dst not None):
"""
cdef H5T_cdata_t *data
cdef H5T_conv_t result = NULL
-
+
try:
result = H5Tfind(src.id, dst.id, &data)
if result == NULL:
@@ -1867,5 +1869,3 @@ cpdef object py_get_vlen(object dt_in):
warn("Deprecated; use check_dtype(vlen=dtype) instead",
H5pyDeprecationWarning)
return check_dtype(vlen=dt_in)
-
-

View File

@ -1,152 +0,0 @@
diff --git a/h5py/h5t.pyx b/h5py/h5t.pyx
index 7d1d7a1..30746f9 100644
--- a/h5py/h5t.pyx
+++ b/h5py/h5t.pyx
@@ -231,6 +231,14 @@ IEEE_F128LE = IEEE_F128BE.copy()
IEEE_F128LE.set_order(H5T_ORDER_LE)
IEEE_F128LE.lock()
+LDOUBLE_LE = NATIVE_LDOUBLE.copy()
+LDOUBLE_LE.set_order(H5T_ORDER_LE)
+LDOUBLE_LE.lock()
+
+LDOUBLE_BE = NATIVE_LDOUBLE.copy()
+LDOUBLE_BE.set_order(H5T_ORDER_BE)
+LDOUBLE_BE.lock()
+
# Custom Python object pointer type
cdef hid_t H5PY_OBJ = H5Tcreate(H5T_OPAQUE, sizeof(PyObject*))
H5Tset_tag(H5PY_OBJ, "PYTHON:OBJECT")
@@ -294,6 +302,29 @@ available_ftypes = _DeprecatedMapping(available_ftypes,
"h5py. See https://github.com/h5py/h5py/pull/926 for details.")
)
+
+cdef (int, int, int) _correct_float_info(ftype_, finfo):
+ nmant = finfo.nmant
+ maxexp = finfo.maxexp
+ minexp = finfo.minexp
+ # workaround for numpy's buggy finfo on float128 on ppc64 archs
+ if ftype_ == np.longdouble and MACHINE == 'ppc64':
+ # values reported by hdf5
+ nmant = 116
+ maxexp = 1024
+ minexp = -1022
+ elif ftype_ == np.longdouble and MACHINE == 'ppc64le':
+ # values reported by hdf5
+ nmant = 52
+ maxexp = 1024
+ minexp = -1022
+ elif nmant == 63 and finfo.nexp == 15:
+ # This is an 80-bit float, correct mantissa size
+ nmant += 1
+
+ return nmant, maxexp, minexp
+
+
# === General datatype operations =============================================
@with_phil
@@ -1025,23 +1056,7 @@ cdef class TypeFloatID(TypeAtomicID):
# Handle non-standard exponent and mantissa sizes.
for ftype_, finfo, size in _available_ftypes:
- nmant = finfo.nmant
- maxexp = finfo.maxexp
- minexp = finfo.minexp
- # workaround for numpy's buggy finfo on float128 on ppc64 archs
- if ftype_ == np.longdouble and MACHINE == 'ppc64':
- # values reported by hdf5
- nmant = 116
- maxexp = 1024
- minexp = -1022
- elif ftype_ == np.longdouble and MACHINE == 'ppc64le':
- # values reported by hdf5
- nmant = 52
- maxexp = 1024
- minexp = -1022
- elif nmant == 63 and finfo.nexp == 15:
- # This is an 80-bit float, correct mantissa size
- nmant += 1
+ nmant, maxexp, minexp = _correct_float_info(ftype_, finfo)
if (size >= self.get_size() and m_size <= nmant and
(2**e_size - e_bias - 1) <= maxexp and (1 - e_bias) >= minexp):
new_dtype = np.dtype(ftype_).newbyteorder(order)
@@ -1353,29 +1368,30 @@ cdef class TypeEnumID(TypeCompositeID):
def _get_float_dtype_to_hdf5():
float_le = {}
float_be = {}
- h5_be_list = [IEEE_F16BE, IEEE_F32BE, IEEE_F64BE, IEEE_F128BE]
- h5_le_list = [IEEE_F16LE, IEEE_F32LE, IEEE_F64LE, IEEE_F128LE]
+ h5_be_list = [IEEE_F16BE, IEEE_F32BE, IEEE_F64BE, IEEE_F128BE,
+ LDOUBLE_BE]
+ h5_le_list = [IEEE_F16LE, IEEE_F32LE, IEEE_F64LE, IEEE_F128LE,
+ LDOUBLE_LE]
for ftype_, finfo, size in _available_ftypes:
+ nmant, maxexp, minexp = _correct_float_info(ftype_, finfo)
for h5type in h5_be_list:
spos, epos, esize, mpos, msize = h5type.get_fields()
ebias = h5type.get_ebias()
- if (finfo.iexp == esize and finfo.nmant == msize and
- (finfo.maxexp - 1) == ebias
+ if (finfo.iexp == esize and nmant == msize and
+ (maxexp - 1) == ebias
):
float_be[ftype_] = h5type
for h5type in h5_le_list:
spos, epos, esize, mpos, msize = h5type.get_fields()
ebias = h5type.get_ebias()
- if (finfo.iexp == esize and finfo.nmant == msize and
- (finfo.maxexp - 1) == ebias
+ if (finfo.iexp == esize and nmant == msize and
+ (maxexp - 1) == ebias
):
float_le[ftype_] = h5type
if ORDER_NATIVE == H5T_ORDER_LE:
float_nt = dict(float_le)
else:
float_nt = dict(float_be)
- if np.longdouble not in float_nt:
- float_nt[np.longdouble] = NATIVE_LDOUBLE
return float_le, float_be, float_nt
cdef dict _float_le
diff --git a/h5py/tests/hl/test_datatype.py b/h5py/tests/hl/test_datatype.py
index 51bdcb2..e718285 100644
--- a/h5py/tests/hl/test_datatype.py
+++ b/h5py/tests/hl/test_datatype.py
@@ -179,7 +179,6 @@ class TestOffsets(TestCase):
with h5py.File(fname, 'r') as f:
self.assertArrayEqual(f['data'], data)
-
def test_out_of_order_offsets(self):
dt = np.dtype({
'names' : ['f1', 'f2', 'f3'],
@@ -198,3 +197,26 @@ class TestOffsets(TestCase):
with h5py.File(fname, 'r') as fd:
self.assertArrayEqual(fd['data'], data)
+
+ def test_float_round_tripping(self):
+ dtypes = set(f for f in np.typeDict.values()
+ if (np.issubdtype(f, np.floating) or
+ np.issubdtype(f, np.complexfloating))
+ )
+
+ dtype_dset_map = {str(j): d
+ for j, d in enumerate(dtypes)}
+
+ fname = self.mktemp()
+
+ with h5py.File(fname, 'w') as f:
+ for n, d in dtype_dset_map.items():
+ data = np.arange(10,
+ dtype=d)
+
+ f.create_dataset(n, data=data)
+
+ with h5py.File(fname, 'r') as f:
+ for n, d in dtype_dset_map.items():
+ ldata = f[n][:]
+ self.assertEqual(ldata.dtype, d)

View File

@ -0,0 +1,23 @@
diff -up h5py-3.7.0/h5py/h5t.pyx.orig h5py-3.7.0/h5py/h5t.pyx
--- h5py-3.7.0/h5py/h5t.pyx.orig 2022-06-14 16:31:22.964458579 +0000
+++ h5py-3.7.0/h5py/h5t.pyx 2022-06-14 16:31:46.404768118 +0000
@@ -282,18 +282,7 @@ cdef (int, int, int) _correct_float_info
nmant = finfo.nmant
maxexp = finfo.maxexp
minexp = finfo.minexp
- # workaround for numpy's buggy finfo on float128 on ppc64 archs
- if ftype_ == np.longdouble and MACHINE == 'ppc64':
- # values reported by hdf5
- nmant = 116
- maxexp = 1024
- minexp = -1022
- elif ftype_ == np.longdouble and MACHINE == 'ppc64le':
- # values reported by hdf5
- nmant = 52
- maxexp = 1024
- minexp = -1022
- elif nmant == 63 and finfo.nexp == 15:
+ if nmant == 63 and finfo.nexp == 15:
# This is an 80-bit float, correct mantissa size
nmant += 1

View File

@ -1,37 +0,0 @@
diff --git a/lzf/lzf_filter.c b/lzf/lzf_filter.c
index 0e3a58b..52abcad 100644
--- a/lzf/lzf_filter.c
+++ b/lzf/lzf_filter.c
@@ -26,7 +26,7 @@
#include <stdio.h>
#include <errno.h>
#include "hdf5.h"
-#include "lzf/lzf.h"
+#include "lzf.h"
#include "lzf_filter.h"
/* Our own versions of H5Epush_sim, as it changed in 1.8 */
diff --git a/setup_build.py b/setup_build.py
index 85b321a..bf9512a 100644
--- a/setup_build.py
+++ b/setup_build.py
@@ -31,9 +31,7 @@ MODULES = ['defs','_errors','_objects','_proxy', 'h5fd', 'h5z',
'h5ds', 'h5ac']
-EXTRA_SRC = {'h5z': [ localpath("lzf/lzf_filter.c"),
- localpath("lzf/lzf/lzf_c.c"),
- localpath("lzf/lzf/lzf_d.c")]}
+EXTRA_SRC = {'h5z': [ localpath("lzf/lzf_filter.c")]}
FALLBACK_PATHS = {
'include_dirs': [],
@@ -41,7 +39,7 @@ FALLBACK_PATHS = {
}
COMPILER_SETTINGS = {
- 'libraries' : ['hdf5', 'hdf5_hl'],
+ 'libraries' : ['hdf5', 'hdf5_hl', 'lzf'],
'include_dirs' : [localpath('lzf')],
'library_dirs' : [],
'define_macros' : [('H5_USE_16_API', None)]

229
h5py.spec
View File

@ -1,25 +1,38 @@
%global commit a8e82bcd63de14daddbc84c250a36c0ee8c850f6
%global shortcommit %(c=%{commit}; echo ${c:0:7})
Summary: A Python interface to the HDF5 library
Name: h5py
Version: 2.9.0
Release: 8%{?dist}
Version: 3.7.0
Release: 3%{?dist}
License: BSD
URL: http://www.h5py.org/
Source0: https://files.pythonhosted.org/packages/source/h/h5py/h5py-%{version}.tar.gz
# patch to use a system liblzf rather than bundled liblzf
Patch0: h5py-system-lzf.patch
# revert these: https://github.com/h5py/h5py/issues/1164
Patch1: 1114.patch
Patch2: 1065.patch
# drop the unnecessary workaround for float128 type after
# https://fedoraproject.org/wiki/Changes/PPC64LE_Float128_Transition
# in F-36
Patch0: h5py-3.7.0-ppc-float128.patch
BuildRequires: gcc
BuildRequires: hdf5-devel
BuildRequires: liblzf-devel
BuildRequires: python%{python3_pkgversion}-Cython >= 0.23
BuildRequires: python%{python3_pkgversion}-devel >= 3.2
BuildRequires: python%{python3_pkgversion}-setuptools
BuildRequires: python%{python3_pkgversion}-cached_property
BuildRequires: python%{python3_pkgversion}-numpy >= 1.7
BuildRequires: python%{python3_pkgversion}-pkgconfig
BuildRequires: python%{python3_pkgversion}-pip
BuildRequires: python%{python3_pkgversion}-pytest
BuildRequires: python%{python3_pkgversion}-pytest-mpi
BuildRequires: python%{python3_pkgversion}-six
BuildRequires: python%{python3_pkgversion}-sphinx
BuildRequires: python%{python3_pkgversion}-numpy >= 1.7
BuildRequires: python%{python3_pkgversion}-Cython >= 0.23
# MPI builds
BuildRequires: hdf5-openmpi-devel
BuildRequires: openmpi-devel
BuildRequires: python%{python3_pkgversion}-mpi4py-openmpi
BuildRequires: hdf5-mpich-devel
BuildRequires: mpich-devel
BuildRequires: python%{python3_pkgversion}-mpi4py-mpich
%global _description\
The h5py package provides both a high- and low-level interface to the\
@ -34,44 +47,218 @@ simplifies the process of reading and writing data from Python.
%description %_description
%package -n python%{python3_pkgversion}-h5py
Summary: %{summary}
Requires: hdf5%{_isa} = %{_hdf5_version}
Requires: python%{python3_pkgversion}-cached_property
Requires: python%{python3_pkgversion}-numpy >= 1.7
Requires: python%{python3_pkgversion}-six
%{?python_provide:%python_provide python%{python3_pkgversion}-h5py}
%description -n python%{python3_pkgversion}-h5py %_description
%package -n python%{python3_pkgversion}-h5py-openmpi
Summary: A Python interface to the HDF5 library using OpenMPI
Requires: hdf5%{_isa} = %{_hdf5_version}
Requires: python%{python3_pkgversion}-cached_property
Requires: python%{python3_pkgversion}-numpy >= 1.7
Requires: python%{python3_pkgversion}-six
Requires: python3-mpi4py-openmpi
Requires: openmpi
%description -n python%{python3_pkgversion}-h5py-openmpi %_description
%package -n python%{python3_pkgversion}-h5py-mpich
Summary: A Python interface to the HDF5 library using MPICH
Requires: hdf5%{_isa} = %{_hdf5_version}
Requires: python%{python3_pkgversion}-cached_property
Requires: python%{python3_pkgversion}-numpy >= 1.7
Requires: python%{python3_pkgversion}-six
Requires: python3-mpi4py-openmpi
Requires: python3-mpi4py-mpich
Requires: mpich
%description -n python%{python3_pkgversion}-h5py-mpich %_description
%prep
%setup -q
# use system libzlf and remove private copy
%patch0 -p1 -b .lzf
%patch1 -p1 -R
%patch2 -p1 -R
rm -rf lzf/lzf
%setup -q -c -n %{name}-%{version}
%patch0
mv %{name}-%{version} serial
cd serial
%{__python3} api_gen.py
cd -
for x in mpich openmpi
do
cp -al serial $x
done
%build
# Upstream requires a specific numpy without this
export H5PY_SETUP_REQUIRES=0
export H5PY_SYSTEM_LZF=1
# serial
export CFLAGS="%{optflags} -fopenmp"
cd serial
%py3_build
cd -
# MPI
export CC=mpicc
export HDF5_MPI="ON"
# openmpi
cd openmpi
%{_openmpi_load}
%py3_build
%{_openmpi_unload}
cd -
# mpich
cd mpich
%{_mpich_load}
%py3_build
%{_mpich_unload}
cd -
%install
# Upstream requires a specific numpy without this
export H5PY_SETUP_REQUIRES=0
export H5PY_SYSTEM_LZF=1
# openmpi
cd openmpi
%py3_install
rm -rf %{buildroot}%{python3_sitearch}/h5py/tests
mkdir -p %{buildroot}%{python3_sitearch}/openmpi
mv %{buildroot}%{python3_sitearch}/%{name}/ \
%{buildroot}%{python3_sitearch}/%{name}*.egg-info \
%{buildroot}%{python3_sitearch}/openmpi
cd -
# mpich
cd mpich
%py3_install
rm -rf %{buildroot}%{python3_sitearch}/h5py/tests
mkdir -p %{buildroot}%{python3_sitearch}/mpich
mv %{buildroot}%{python3_sitearch}/%{name}/ \
%{buildroot}%{python3_sitearch}/%{name}*.egg-info \
%{buildroot}%{python3_sitearch}/mpich
cd -
# serial part must be last (not to overwrite files)
cd serial
%py3_install
rm -rf %{buildroot}%{python3_sitearch}/h5py/tests
cd -
%check
# Known failure due to hdf5 1.10.3+
# https://github.com/h5py/h5py/issues/1180
%{__python3} setup.py test || :
# Upstream requires a specific numpy without this
export H5PY_SETUP_REQUIRES=0
export H5PY_SYSTEM_LZF=1
# i686 test failure
# https://github.com/h5py/h5py/issues/1337
# s390x test failure
# https://github.com/h5py/h5py/issues/1739
%ifarch %ix86
fail=0
%else
fail=1
%endif
export PYTHONPATH=$(echo serial/build/lib*)
%{__python3} -m pytest --pyargs h5py -rxXs ${PYTHONPATH} || exit $fail
# openmpi
export PYTHONPATH=$(echo openmpi/build/lib*)
%{_openmpi_load}
mpirun %{__python3} -m pytest --pyargs h5py -rxXs --with-mpi ${PYTHONPATH} || exit $fail
%{_openmpi_unload}
# mpich
export PYTHONPATH=$(echo mpich/build/lib*)
%{_mpich_load}
mpirun %{__python3} -m pytest --pyargs h5py -rxXs --with-mpi ${PYTHONPATH} || exit $fail
%{_mpich_unload}
%files -n python%{python3_pkgversion}-h5py
%license licenses/*.txt
%doc ANN.rst README.rst examples
%license serial/licenses/*.txt
#doc serial/ANN.rst serial/README.rst serial/examples
%doc serial/README.rst serial/examples
%{python3_sitearch}/%{name}/
%{python3_sitearch}/%{name}-%{version}-*.egg-info
%files -n python%{python3_pkgversion}-h5py-openmpi
%license openmpi/licenses/*.txt
%doc openmpi/README.rst
%{python3_sitearch}/openmpi/%{name}/
%{python3_sitearch}/openmpi/%{name}-%{version}-*.egg-info
%files -n python%{python3_pkgversion}-h5py-mpich
%license mpich/licenses/*.txt
%doc mpich/README.rst
%{python3_sitearch}/mpich/%{name}/
%{python3_sitearch}/mpich/%{name}-%{version}-*.egg-info
%changelog
* Thu Jul 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 3.7.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
* Mon Jun 13 2022 Python Maint <python-maint@redhat.com> - 3.7.0-2
- Rebuilt for Python 3.11
* Tue May 24 2022 Terje Rosten <terje.rosten@ntnu.no> - 3.7.0-1
- Update to 3.7.0
* Sun Jan 23 2022 Terje Rosten <terje.rosten@ntnu.no> - 3.6.0-1
- Update to 3.6.0
* Thu Jan 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 3.4.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Sun Nov 21 2021 Orion Poplawski <orion@nwra.com> - 3.4.0-3
- Rebuild for hdf5 1.12.1
* Sun Oct 03 2021 Terje Rosten <terje.rosten@ntnu.no> - 3.4.0-2
- Revert an upstream commit that caused crash in PySCF (rhbz#2009628)
* Sat Sep 18 2021 Terje Rosten <terje.rosten@ntnu.no> - 3.4.0-1
- Update to 3.4.0
* Tue Aug 10 2021 Orion Poplawski <orion@nwra.com> - 3.2.1-4
- Rebuild for hdf5 1.10.7
* Thu Jul 22 2021 Fedora Release Engineering <releng@fedoraproject.org> - 3.2.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Fri Jun 04 2021 Python Maint <python-maint@redhat.com> - 3.2.1-2
- Rebuilt for Python 3.10
* Tue Mar 09 2021 Orion Poplawski <orion@nwra.com> - 3.2.1-1
- Update to 3.2.1
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 3.1.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Sat Nov 07 2020 Terje Rosten <terje.rosten@ntnu.no> - 3.1.0-1
- Update to 3.1.0
* Fri Oct 30 2020 Orion Poplawski <orion@nwra.com> - 3.0.0-1
- Update to 3.0.0
* Mon Jul 27 2020 Terje Rosten <terje.rosten@ntnu.no> - 2.10.0-4
- Add openmpi and mpich subpackages
* Thu Jun 25 2020 Orion Poplawski <orion@cora.nwra.com> - 2.10.0-3
- Rebuild for hdf5 1.10.6
* Tue May 26 2020 Miro Hrončok <mhroncok@redhat.com> - 2.10.0-2
- Rebuilt for Python 3.9
* Sun May 17 2020 Terje Rosten <terje.rosten@ntnu.no> - 2.10.0-1
- Add commits from 2.10.x branch
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.9.0-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild

View File

@ -1 +1 @@
SHA512 (h5py-2.9.0.tar.gz) = 73b1f59e3e2b3eceebf7b97e49bd8f5199afafd7ef29917af05ff8415c2f2129a5c59db9658944370c9bcf8fc04ab26948ee27fc6fd948a22d19cace1ce8c853
SHA512 (h5py-3.7.0.tar.gz) = c10a9a623c88dbc965238cb2057b8924492c762c29610cfdb24f26f878a7322e414d3e5c90d750c2f5cfe1b4949f884bc17f09a126b01a4721ad6e14761174a2