[h5py] 384/455: Default property lists

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Thu Jul 2 18:19:53 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 bdb25caf4d05de06d2ffd568e41ef7611de1cd68
Author: andrewcollette <andrew.collette at gmail.com>
Date:   Sun Feb 7 21:57:03 2010 +0000

    Default property lists
---
 h5py/highlevel.py            | 17 +++++++++++++++++
 h5py/tests/high/test_file.py | 23 ++++++++++++++++++++++-
 2 files changed, 39 insertions(+), 1 deletion(-)

diff --git a/h5py/highlevel.py b/h5py/highlevel.py
index 082241c..49d5345 100644
--- a/h5py/highlevel.py
+++ b/h5py/highlevel.py
@@ -704,6 +704,23 @@ class File(Group):
                    h5fd.WINDOWS: 'windows'}
         return drivers.get(self.fid.get_access_plist().get_driver(), 'unknown')
 
+    @cproperty('_xlapl')
+    def _lapl(self):
+        """Default link access property list (1.8)"""
+
+        lapl = h5p.create(h5p.LINK_ACCESS)
+        fapl = h5p.create(h5p.FILE_ACCESS)
+        fapl.set_fclose_degree(h5f.CLOSE_STRONG)
+        lapl.set_elink_fapl(fapl)
+        return lapl
+
+    @cproperty('_xlcpl')
+    def _lcpl(self):
+        """Default link creation property list (1.8)"""
+        lcpl = h5p.create(h5p.LINK_CREATE)
+        lcpl.set_create_intermediate_group(True)
+        return lcpl
+
     # --- Public interface (File) ---------------------------------------------
 
     def __init__(self, name, mode=None, driver=None, **kwds):
diff --git a/h5py/tests/high/test_file.py b/h5py/tests/high/test_file.py
index c322fb4..d0864c2 100644
--- a/h5py/tests/high/test_file.py
+++ b/h5py/tests/high/test_file.py
@@ -198,7 +198,28 @@ class TestUnicode(FileBase):
         self.assertEqual(self.f.filename, self.name)
         self.assert_(isinstance(self.f.filename, unicode))
 
-    
+class TestProps(FileBase):
+
+    def setUp(self):
+        self.name = mktemp()
+        self.f = h5py.File(self.name, 'w')
+
+    def tearDown(self):
+        if self.f:
+            self.f.close()
+        import os
+        os.unlink(self.name)
+
+    @tests.require(api=18)
+    def test_lcpl(self):
+        lcpl = self.f._lcpl
+        self.assertIsInstance(lcpl, h5py.h5p.PropLCID)
+
+    @tests.require(api=18)
+    def test_lapl(self):
+        lapl = self.f._lapl
+        self.assertIsInstance(lapl, h5py.h5p.PropLAID)
+
 
 
 

-- 
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