summaryrefslogtreecommitdiff
path: root/silx/io/utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'silx/io/utils.py')
-rw-r--r--silx/io/utils.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/silx/io/utils.py b/silx/io/utils.py
index 5b0de54..654bfe3 100644
--- a/silx/io/utils.py
+++ b/silx/io/utils.py
@@ -55,6 +55,10 @@ except ImportError as e:
logger = logging.getLogger(__name__)
+NEXUS_HDF5_EXT = [".h5", ".nx5", ".nxs", ".hdf", ".hdf5", ".cxi"]
+"""List of possible extensions for HDF5 file formats."""
+
+
class H5Type(enum.Enum):
"""Identify a set of HDF5 concepts"""
DATASET = 1
@@ -204,7 +208,7 @@ def save1D(fname, x, y, xlabel=None, ylabels=None, filetype=None,
# make sure y_array is a 2D array even for a single curve
if len(y_array.shape) == 1:
- y_array.shape = (1, y_array.shape[0])
+ y_array = y_array.reshape(1, y_array.shape[0])
elif len(y_array.shape) > 2 or len(y_array.shape) < 1:
raise IndexError("y must be a 1D or 2D array")
@@ -820,7 +824,7 @@ def get_data(url):
if fabio_file.nframes == 1:
if index != 0:
- raise ValueError("Only a single frame availalbe. Slice %s out of range" % index)
+ raise ValueError("Only a single frame available. Slice %s out of range" % index)
data = fabio_file.data
else:
data = fabio_file.getframe(index).data