diff options
Diffstat (limited to 'silx/gui/hdf5/Hdf5Formatter.py')
-rw-r--r-- | silx/gui/hdf5/Hdf5Formatter.py | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/silx/gui/hdf5/Hdf5Formatter.py b/silx/gui/hdf5/Hdf5Formatter.py index 6802142..5754fe8 100644 --- a/silx/gui/hdf5/Hdf5Formatter.py +++ b/silx/gui/hdf5/Hdf5Formatter.py @@ -1,7 +1,7 @@ # coding: utf-8 # /*########################################################################## # -# Copyright (c) 2017 European Synchrotron Radiation Facility +# Copyright (c) 2017-2018 European Synchrotron Radiation Facility # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -30,14 +30,12 @@ __license__ = "MIT" __date__ = "06/06/2018" import numpy -from silx.third_party import six +import six + from silx.gui import qt from silx.gui.data.TextFormatter import TextFormatter -try: - import h5py -except ImportError: - h5py = None +import h5py class Hdf5Formatter(qt.QObject): @@ -162,10 +160,9 @@ class Hdf5Formatter(qt.QObject): compound = [self.humanReadableDType(d) for d in compound] return "compound(%s)" % ", ".join(compound) elif numpy.issubdtype(dtype, numpy.integer): - if h5py is not None: - enumType = h5py.check_dtype(enum=dtype) - if enumType is not None: - return "enum" + enumType = h5py.check_dtype(enum=dtype) + if enumType is not None: + return "enum" text = str(dtype.newbyteorder('N')) if numpy.issubdtype(dtype, numpy.floating): |