Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
kmap
xsocs
Commits
b420043b
Commit
b420043b
authored
Nov 10, 2020
by
Thomas Vincent
Browse files
use h5py_read_dataset to read data to convert string to str
parent
1c712834
Changes
1
Hide whitespace changes
Inline
Side-by-side
xsocs/io/XsocsH5Base.py
View file @
b420043b
...
@@ -39,6 +39,11 @@ import numpy as _np
...
@@ -39,6 +39,11 @@ import numpy as _np
from
..util
import
text_type
from
..util
import
text_type
from
._utils
import
str_to_h5_utf8
from
._utils
import
str_to_h5_utf8
try
:
# silx >= 0.14
from
silx.io.utils
import
h5py_read_dataset
except
ImportError
:
# Fall back for silx < 0.14
from
..util.silx_io_utils
import
h5py_read_dataset
# We have to work around a limitation of the h5py.Group.copy method
# We have to work around a limitation of the h5py.Group.copy method
# that fails when a group already exists in the destination file.
# that fails when a group already exists in the destination file.
...
@@ -179,7 +184,7 @@ class XsocsH5Base(object):
...
@@ -179,7 +184,7 @@ class XsocsH5Base(object):
return
h5_file
[
path
].
shape
return
h5_file
[
path
].
shape
if
dtype
:
if
dtype
:
return
h5_file
[
path
].
dtype
return
h5_file
[
path
].
dtype
return
h5
_file
[
path
][()]
return
h5
py_read_dataset
(
h5_file
[
path
],
decode_ascii
=
True
)
except
KeyError
:
except
KeyError
:
return
None
return
None
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment