[h5py] 74/455: Release 0.2.0
Ghislain Vaillant
ghisvail-guest at moszumanska.debian.org
Thu Jul 2 18:19:19 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 67bb737bd68441f2119e2a71906eac3fe531d4f4
Author: andrewcollette <andrew.collette at gmail.com>
Date: Thu Jul 10 03:34:00 2008 +0000
Release 0.2.0
---
README.txt | 6 ++++--
h5py/h5.pxd | 2 +-
h5py/h5.pyx | 8 ++------
h5py/h5f.pyx | 14 +++++---------
h5py/h5g.pyx | 18 ++++++++++++++----
h5py/h5i.pyx | 7 ++++++-
h5py/h5p.pxd | 5 -----
h5py/h5p.pyx | 5 +----
h5py/h5t.pxd | 2 --
setup.py | 29 +++++++++++++++++++++++------
10 files changed, 56 insertions(+), 40 deletions(-)
diff --git a/README.txt b/README.txt
index 65ff137..752bac5 100644
--- a/README.txt
+++ b/README.txt
@@ -5,7 +5,7 @@ Copyright (c) 2008 Andrew Collette
* http://h5py.alfven.org
* mail: "h5py" at the domain "alfven dot org"
-Version 0.2.0
+**Version 0.2.0**
* `Introduction`_
* `Features`_
@@ -35,7 +35,7 @@ Extensive documentation is available through docstrings, as well as in
distribution. This document is an overview of some of the package's
features and highlights.
-__ http://h5py.alfven.org
+__ http://h5py.alfven.org/docs
Features
========
@@ -101,6 +101,7 @@ be painful to install manually.
Requires
--------
- Unix-like environment (created/tested on 32-bit Intel linux)
+- Python with headers for development ("python-dev")
- Numpy_ 1.0.3 or higher
- HDF5_ 1.6.5 or higher (1.8 support experimental)
- A working compiler for distutils
@@ -125,6 +126,7 @@ Additional options
--pyrex-force Recompile all pyx files, regardless of timestamps.
--no-pyrex Don't run Pyrex, no matter what
+ --hdf5=path Use alternate HDF5 directory (contains bin, include, lib)
--api=<n> Specifies API version. Only --api=16 is currently allowed.
--debug=<n> If nonzero, compile in debug mode. The number is
interpreted as a logging-module level number. Requires
diff --git a/h5py/h5.pxd b/h5py/h5.pxd
index 464013a..e84b45b 100644
--- a/h5py/h5.pxd
+++ b/h5py/h5.pxd
@@ -80,7 +80,7 @@ cdef extern from "hdf5.h":
H5E_EFL, # External file list
H5E_REFERENCE, # References
H5E_VFL, # Virtual File Layer
- H5E_TBBT, # Threaded, Balanced, Binary Trees
+# H5E_TBBT, # Threaded, Balanced, Binary Trees (removed)
H5E_TST, # Ternary Search Trees
H5E_RS, # Reference Counted Strings
H5E_ERROR, # Error API
diff --git a/h5py/h5.pyx b/h5py/h5.pyx
index ffbf759..a31dc37 100644
--- a/h5py/h5.pyx
+++ b/h5py/h5.pyx
@@ -280,11 +280,8 @@ class VirtualFileError(H5Error):
""" H5E_VFL """
pass
-# H5E_TBBT, # Threaded, Balanced, Binary Trees
-class TBBTError(H5Error):
- """ H5E_TBBT """
- pass
-
+# H5E_TBBT removed; does not appear in 1.8.X
+
# H5E_TST, # Ternary Search Trees
class TSTError(H5Error):
""" H5E_TST """
@@ -328,7 +325,6 @@ _exceptions = {
H5E_EFL: FileListError,
H5E_REFERENCE: RefError,
H5E_VFL: VirtualFileError,
- H5E_TBBT: TBBTError,
H5E_TST: TSTError,
H5E_RS: RSError,
H5E_ERROR: ErrorError,
diff --git a/h5py/h5f.pyx b/h5py/h5f.pyx
index 95c0142..2f23611 100644
--- a/h5py/h5f.pyx
+++ b/h5py/h5f.pyx
@@ -15,7 +15,7 @@
"""
# Pyrex compile-time imports
-from h5p cimport propwrap, pdefault, PropFAID, PropFCID, PropMID
+from h5p cimport propwrap, pdefault, PropFAID, PropFCID, H5P_DEFAULT
from h5t cimport typewrap
from h5a cimport AttrID
from h5d cimport DatasetID
@@ -101,16 +101,12 @@ def is_hdf5(char* name):
"""
return pybool(H5Fis_hdf5(name))
-def mount(ObjectID loc not None, char* name, FileID fid not None,
- PropMID mountlist=None):
- """ (ObjectID loc, STRING name, FileID fid, PropMID mountlist=None)
+def mount(ObjectID loc not None, char* name, FileID fid not None):
+ """ (ObjectID loc, STRING name, FileID fid)
- Mount an open file as "name" under group loc_id. If present, mountlist
- is a mount property list.
+ Mount an open file as "name" under group loc_id.
"""
- cdef hid_t plist_id
- plist_id = pdefault(mountlist)
- H5Fmount(loc.id, name, fid.id, plist_id)
+ H5Fmount(loc.id, name, fid.id, H5P_DEFAULT)
def unmount(ObjectID loc not None, char* name):
""" (ObjectID loc, STRING name)
diff --git a/h5py/h5g.pyx b/h5py/h5g.pyx
index 9852815..f275725 100644
--- a/h5py/h5g.pyx
+++ b/h5py/h5g.pyx
@@ -104,15 +104,19 @@ def create(ObjectID loc not None, char* name, int size_hint=-1):
cdef herr_t iter_cb_helper(hid_t gid, char *name, object int_tpl) except -1:
# Callback function for H5Giterate
+ # Automatic exception propagation breaks in 1.8 for some reason, so
+ # stuff the exception into a mutable object.
- loc, func, data = int_tpl
+ cdef list err_list
+ loc, func, data, err_list = int_tpl
- # An unhandled exception (anything except StopIteration) will
- # cause Pyrex to immediately return -1, which stops H5Giterate.
try:
func(loc, name, data)
except StopIteration:
return 1
+ except Exception, e:
+ err_list.append(e)
+ return 1
return 0
@@ -136,14 +140,20 @@ def iterate(GroupID loc not None, char* name, object func, object data=None,
exception is propagated.
"""
cdef int i
+ cdef list err_list
+ err_list = []
+
if startidx < 0:
raise ValueError("Starting index must be non-negative.")
i = startidx
- int_tpl = (loc, func, data)
+ int_tpl = (loc, func, data, err_list)
H5Giterate(loc.id, name, &i, <H5G_iterate_t>iter_cb_helper, int_tpl)
+ if len(err_list) > 0:
+ raise err_list[0]
+
# === Group member management =================================================
cdef class GroupID(ObjectID):
diff --git a/h5py/h5i.pyx b/h5py/h5i.pyx
index 5977168..eb95332 100644
--- a/h5py/h5i.pyx
+++ b/h5py/h5i.pyx
@@ -20,6 +20,7 @@ from utils cimport emalloc, efree
# Runtime imports
import h5
+from h5 import H5Error
# === Public constants and data structures ====================================
@@ -56,7 +57,11 @@ def get_name(ObjectID obj not None):
cdef int namelen
cdef char* name
- namelen = <int>H5Iget_name(obj.id, NULL, 0)
+ try:
+ namelen = <int>H5Iget_name(obj.id, NULL, 0)
+ except H5Error: # Later library versions raise an exception here
+ return None
+
if namelen == 0:
return None
diff --git a/h5py/h5p.pxd b/h5py/h5p.pxd
index a0b7c1b..f85526c 100644
--- a/h5py/h5p.pxd
+++ b/h5py/h5p.pxd
@@ -49,10 +49,6 @@ cdef class PropFAID(PropInstanceID):
""" File access property list """
pass
-cdef class PropMID(PropInstanceID):
- """ Mount property list """
- pass
-
cdef hid_t pdefault(PropID pid)
cdef object propwrap(hid_t id_in)
@@ -113,7 +109,6 @@ cdef extern from "hdf5.h":
hid_t H5P_FILE_ACCESS
hid_t H5P_DATASET_CREATE
hid_t H5P_DATASET_XFER
- hid_t H5P_MOUNT
# --- Property list operations ----------------------------------------------
# General operations
diff --git a/h5py/h5p.pyx b/h5py/h5p.pyx
index d88ab70..846f741 100644
--- a/h5py/h5p.pyx
+++ b/h5py/h5p.pyx
@@ -43,8 +43,6 @@ cdef object propwrap(hid_t id_in):
pcls = PropDCID
elif H5Pequal(clsid, H5P_DATASET_XFER):
pcls = PropDXID
- elif H5Pequal(clsid, H5P_MOUNT):
- pcls = PropMID
else:
raise ValueError("No class found for ID %d" % id_in)
@@ -68,7 +66,7 @@ FILE_CREATE = lockcls(H5P_FILE_CREATE)
FILE_ACCESS = lockcls(H5P_FILE_ACCESS)
DATASET_CREATE = lockcls(H5P_DATASET_CREATE)
DATASET_XFER = lockcls(H5P_DATASET_XFER)
-MOUNT = lockcls(H5P_MOUNT)
+# MOUNT renamed in 1.8.X; removed for now
DEFAULT = None # In the HDF5 header files this is actually 0, which is an
# invalid identifier. The new strategy for default options
@@ -86,7 +84,6 @@ def create(PropClassID cls not None):
FILE_ACCESS
DATASET_CREATE
DATASET_XFER
- MOUNT
"""
cdef hid_t newid
newid = H5Pcreate(cls.id)
diff --git a/h5py/h5t.pxd b/h5py/h5t.pxd
index 7bb395c..1072b4d 100644
--- a/h5py/h5t.pxd
+++ b/h5py/h5t.pxd
@@ -234,8 +234,6 @@ cdef extern from "hdf5.h":
# Not for public API
herr_t H5Tconvert(hid_t src_id, hid_t dst_id, size_t nelmts, void *buf, void *background, hid_t plist_id) except *
- ctypedef herr_t (*H5T_overflow_t)(hid_t src_id, hid_t dst_id, void *src_buf, void *dst_buf) except -1
- herr_t H5Tset_overflow(H5T_overflow_t func) except *
# Atomic datatypes
herr_t H5Tset_size(hid_t type_id, size_t size) except *
diff --git a/setup.py b/setup.py
index 52bd43c..6d0e350 100644
--- a/setup.py
+++ b/setup.py
@@ -35,6 +35,7 @@
--pyrex-force Recompile all pyx files, regardless of timestamps.
--no-pyrex Don't run Pyrex, no matter what
+ --hdf5=path Use alternate HDF5 directory (contains bin, include, lib)
--api=<n> Specifies API version. Only "16" is currently allowed.
--debug=<n> If nonzero, compile in debug mode. The number is
interpreted as a logging-module level number.
@@ -89,6 +90,7 @@ PYREX_FORCE_OFF = False # Flag: Don't run Pyrex, no matter what
API_VERS = (1,6)
DEBUG_LEVEL = 0
+HDF5_DIR = None
for arg in sys.argv[:]:
if arg == '--pyrex':
@@ -117,6 +119,12 @@ for arg in sys.argv[:]:
ENABLE_PYREX=True
DEBUG_LEVEL = int(arg[8:])
sys.argv.remove(arg)
+ elif arg.find('--hdf5=') == 0:
+ splitarg = arg.split('=',1)
+ if len(splitarg) != 2:
+ fatal("HDF5 directory not understood (wants --hdf5=/path/to/hdf5)")
+ HDF5_DIR = splitarg[1]
+ sys.argv.remove(arg)
if 'sdist' in sys.argv and os.path.exists('MANIFEST'):
warn("Cleaning up stale MANIFEST file")
@@ -164,11 +172,19 @@ pyx_extra_src = ['utils_low.c'] # C source files required for Pyrex code
pyx_libraries = ['hdf5'] # Libraries to link into Pyrex code
# Compile-time include and library dirs for Pyrex code
-pyx_include = [numpy.get_include()]
-pyx_include.extend(['/usr/include', '/usr/local/include'])
-pyx_include.extend(custom_include_dirs)
-pyx_library_dirs = ['/usr/lib', '/usr/local/lib']
-pyx_library_dirs.extend(custom_library_dirs)
+pyx_include = [numpy.get_include()]
+if HDF5_DIR is None:
+ pyx_include.extend(['/usr/include', '/usr/local/include'])
+ pyx_include.extend(custom_include_dirs)
+else:
+ pyx_include.extend([os.path.join(HDF5_DIR,'include')])
+
+
+if HDF5_DIR is None:
+ pyx_library_dirs = ['/usr/lib', '/usr/local/lib']
+ pyx_library_dirs.extend(custom_library_dirs)
+else:
+ pyx_library_dirs = [os.path.join(HDF5_DIR, 'lib')]
# Additional compiler flags for Pyrex code
pyx_extra_args = ['-Wno-unused', '-Wno-uninitialized', '-DH5_USE_16_API']
@@ -246,7 +262,8 @@ for module_name in pyx_modules:
sources,
include_dirs = pyx_include,
libraries = pyx_libraries,
- library_dirs = pyx_library_dirs,
+ library_dirs = pyx_library_dirs,
+ runtime_library_dirs = pyx_library_dirs,
extra_compile_args = extra_compile_args,
extra_link_args = extra_link_args
)
--
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