[h5py] 131/455: Remove extraneous h5o/h5l proxies
Ghislain Vaillant
ghisvail-guest at moszumanska.debian.org
Thu Jul 2 18:19:25 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 ca6f8a7449d323f39e713ef7eb47ff5d23613848
Author: andrewcollette <andrew.collette at gmail.com>
Date: Mon Sep 29 23:31:28 2008 +0000
Remove extraneous h5o/h5l proxies
---
h5py/h5l18.pyx | 66 ---------------------------
h5py/h5o18.pyx | 139 ---------------------------------------------------------
2 files changed, 205 deletions(-)
diff --git a/h5py/h5l18.pyx b/h5py/h5l18.pyx
deleted file mode 100644
index 8932364..0000000
--- a/h5py/h5l18.pyx
+++ /dev/null
@@ -1,66 +0,0 @@
-#+
-#
-# This file is part of h5py, a low-level Python interface to the HDF5 library.
-#
-# Copyright (C) 2008 Andrew Collette
-# http://h5py.alfven.org
-# License: BSD (See LICENSE.txt for full license)
-#
-# $Date$
-#
-#-
-
-"""
- API for the "H5L" family of link-related operations
-"""
-
-include "config.pxi"
-include "sync.pxi"
-
-from h5 cimport init_hdf5
-init_hdf5()
-
-cdef class LinkProxy(ObjectID):
-
- """
- Proxy class which provides access to the HDF5 "H5L" API.
-
- These come attached to GroupID objects as "obj.links". Since every
- H5L function operates on at least one group, the methods provided
- operate on their parent group identifier. For example:
-
- >>> g = h5g.open(fid, '/')
- >>> g.links.exists("MyGroup")
- True
- >>> g.links.exists("FooBar")
- False
-
- Hashable: No
- Equality: Undefined
- """
-
- def __cinit__(self, hid_t id_):
- # At this point the ObjectID constructor has already been called.
-
- # The identifier in question is the hid_t for the parent GroupID.
- # We need to manually incref the identifier because it's now
- # shared by both this object and the parent.
- H5Iinc_ref(self.id)
-
- def __richcmp__(self, object other, int how):
- return NotImplemented
-
- def __hash__(self):
- raise TypeError("Link proxies are unhashable; use the parent group instead.")
-
- @sync
- def exists(self, char* name):
- """ (STRING name) => BOOL
-
- Check if a link of the specified name exists in this group.
- """
- return <bint>(H5Lexists(self.id, name, H5P_DEFAULT))
-
-
-
-
diff --git a/h5py/h5o18.pyx b/h5py/h5o18.pyx
deleted file mode 100644
index 9728190..0000000
--- a/h5py/h5o18.pyx
+++ /dev/null
@@ -1,139 +0,0 @@
-#+
-#
-# This file is part of h5py, a low-level Python interface to the HDF5 library.
-#
-# Copyright (C) 2008 Andrew Collette
-# http://h5py.alfven.org
-# License: BSD (See LICENSE.txt for full license)
-#
-# $Date$
-#
-#-
-
-include "config.pxi"
-include "sync.pxi"
-
-# Module for the new "H5O" functions introduced in HDF5 1.8.0. Not even
-# built with API compatibility level below 1.8.
-
-# Pyrex compile-time imports
-from h5 cimport init_hdf5, ObjectID
-from h5i cimport wrap_identifier
-
-# Initialization
-init_hdf5()
-
-cdef class ObjInfo:
-
- cdef H5O_info_t infostruct
- cdef object __weakref__
-
- property fileno:
- def __get__(self):
- return self.infostruct.fileno
- property addr:
- def __get__(self):
- return self.infostruct.addr
- property type:
- def __get__(self):
- return <int>self.infostruct.type
- property rc:
- def __get__(self):
- return self.infostruct.rc
-
- def __copy__(self):
- cdef ObjInfo newcopy
- newcopy = ObjInfo()
- newcopy.infostruct = self.infostruct
- return newcopy
-
- at sync
-def get_info(ObjectID obj not None):
- """ (ObjectID obj) => ObjInfo
- """
-
- cdef ObjInfo info
- info = ObjInfo()
-
- H5Oget_info(obj.id, &info.infostruct)
- return info
-
-cdef class _Visit_Data:
-
- cdef object func
- cdef object exc
- cdef object retval
- cdef ObjInfo objinfo
-
- def __init__(self, func):
- self.func = func
- self.exc = None
- self.retval = None
- self.objinfo = ObjInfo()
-
-cdef herr_t visit_cb(hid_t obj, char* name, H5O_info_t *info, void* data):
-
- cdef _Visit_Data wrapper
- wrapper = <_Visit_Data>data
-
- wrapper.objinfo.infostruct = info[0]
-
- try:
- retval = wrapper.func(name, wrapper.objinfo)
- except StopIteration:
- return 1
- except BaseException, e: # The exception MUST be trapped, including SystemExit
- wrapper.exc = e
- return 1
-
- if retval is not None:
- wrapper.retval = retval
- return 1
-
- return 0
-
- at sync
-def visit(ObjectID obj not None, object func, int idx_type=H5_INDEX_NAME,
- int order=H5_ITER_NATIVE):
- """ (ObjectID obj, CALLABLE func, INT idx_type=, INT order=)
-
- Recursively iterate a function or callable object over this group's
- contents. Your callable should match the signature:
-
- func(name, info)
-
- where "name" is (a) name relative to the starting group, and "info" is
- an ObjInfo instance describing each object. Please note the same
- ObjInfo instance is provided call to call, with its values mutated.
- Don't store references to it; use the copy module instead.
-
- Your callable should also conform to the following behavior:
-
- 1. Return None for normal iteration; raise StopIteration to cancel
- and return None from h5o.visit.
-
- 2. Returning a value other than None cancels iteration and immediately
- returns that value from h5o.visit.
-
- 3. Raising any other exception aborts iteration; the exception will
- be correctly propagated.
- """
- cdef _Visit_Data wrapper
- wrapper = _Visit_Data(func)
-
- H5Ovisit(obj.id, <H5_index_t>idx_type, <H5_iter_order_t>order, visit_cb, <void*>wrapper)
-
- if wrapper.exc is not None:
- raise wrapper.exc
-
- return wrapper.retval # None or custom value
-
-
-
-
-
-
-
-
-
-
--
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