projects
/
h5config.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
25216ab
)
Allow HDF5_Storage to be initialized without a filename.
author
W. Trevor King
<wking@drexel.edu>
Fri, 16 Mar 2012 08:30:57 +0000
(
04:30
-0400)
committer
W. Trevor King
<wking@drexel.edu>
Fri, 16 Mar 2012 08:30:57 +0000
(
04:30
-0400)
If you use an `h5py.Group` instance for the group, you don't need to
open any files.
h5config/storage/hdf5.py
patch
|
blob
|
history
diff --git
a/h5config/storage/hdf5.py
b/h5config/storage/hdf5.py
index 65b2ba7996b83fe8a70811d5a2b521ea8f45f71c..2f1d6608f4fa7c11da7036b6d23d962127cb571b 100644
(file)
--- a/
h5config/storage/hdf5.py
+++ b/
h5config/storage/hdf5.py
@@
-133,11
+133,14
@@
class HDF5_Storage (_FileStorage):
def __init__(self, group='/', **kwargs):
super(HDF5_Storage, self).__init__(**kwargs)
- assert group.startswith('/'), group
- if not group.endswith('/'):
- group += '/'
+ if isinstance(group, _h5py.Group):
+ self._file_checked = True
+ else:
+ assert group.startswith('/'), group
+ if not group.endswith('/'):
+ group += '/'
+ self._file_checked = False
self.group = group
- self._file_checked = False
def _check_file(self):
if self._file_checked: