[h5py] 374/455: Implement missing datatype reference handler
Ghislain Vaillant
ghisvail-guest at moszumanska.debian.org
Thu Jul 2 18:19:52 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 476374c5f0301effde93b3653b0651e458d2cc6b
Author: andrewcollette <andrew.collette at gmail.com>
Date: Fri Jan 29 05:13:46 2010 +0000
Implement missing datatype reference handler
---
h5py/highlevel.py | 6 ++++--
h5py/tests/high/test_refs.py | 1 -
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/h5py/highlevel.py b/h5py/highlevel.py
index cef9b33..082241c 100644
--- a/h5py/highlevel.py
+++ b/h5py/highlevel.py
@@ -332,6 +332,8 @@ class Group(HLObject, _DictCompat):
return Group(self, None, _rawid=h5r.dereference(name, self.id))
elif kind == h5g.DATASET:
return Dataset(self, None, _rawid=h5r.dereference(name, self.id))
+ elif kind == h5g.TYPE:
+ return Datatype(self, None, _rawid=h5r.dereference(name, self.id))
raise ValueError("Unrecognized reference object type")
@@ -1422,11 +1424,11 @@ class Datatype(HLObject):
"""Numpy dtype equivalent for this datatype"""
return self.id.dtype
- def __init__(self, grp, name):
+ def __init__(self, grp, name, _rawid=None):
""" Private constructor.
"""
with phil:
- id = h5t.open(grp.id, name)
+ id = _rawid if _rawid is not None else h5t.open(grp.id, name)
HLObject.__init__(self, id)
def __repr__(self):
diff --git a/h5py/tests/high/test_refs.py b/h5py/tests/high/test_refs.py
index d1e3931..4a78ec8 100644
--- a/h5py/tests/high/test_refs.py
+++ b/h5py/tests/high/test_refs.py
@@ -28,7 +28,6 @@ class TestObjRef(Base):
self.assertIsInstance(x, h5py.Group)
self.assertEqual(x, g)
- @tests.fixme("Unimplemented in __getitem__")
def test_dtype(self):
""" (Refs) Named type reference round-trip """
dt = np.dtype('f')
--
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