Commit 7277b6a8 authored by Javier Quinteros's avatar Javier Quinteros
Browse files

Raise NoData when no data has been declared in any channel

parent 669c09de
__version__ = '0.7b1'
__version__ = '0.8a1'
......@@ -425,8 +425,11 @@ class TDMS(object):
try:
self.__readmetadata()
return
except NoData:
logging.error('No Data was found in the metadata definition')
self.__currentfile += 1
except PotentialGap:
logging.debug('Potential gap detected!')
logging.warning('Potential gap detected!')
self.__currentfile += 1
# Rename to make it accessible to users
......@@ -443,7 +446,7 @@ class TDMS(object):
def __readmetadata(self):
"""Read metadata of the current file
:raise Exception: if datatype definition is not found in any channel, or if the data type is not
:raise NoData: if datatype definition is not found in any channel, or if the data type is not
supported, or if no valid channel IDs could be selected
"""
# Metadata
......@@ -525,7 +528,7 @@ class TDMS(object):
# Set the data type as numpy expects it
if datatype is None:
raise Exception('datatype definition not found in any channel!')
raise NoData('datatype definition not found in any channel!')
if self.__data2mask[datatype][0] == 'b':
self.__datatype = '%ci1' % self.__endian
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment