Put overflow detector a bit higher

This commit is contained in:
Anne de Jong 2020-01-09 14:04:42 +01:00
parent 703fbf5031
commit 1748daab4c

View File

@ -327,12 +327,10 @@ class Measurement:
with self.file() as f: with self.file() as f:
for block in self.iterBlocks(f): for block in self.iterBlocks(f):
dtype = block.dtype dtype = block.dtype
print(dtype)
if dtype.kind == 'i': if dtype.kind == 'i':
# if dtype in ['
# minvalue = np.iinfo(dtype).min # minvalue = np.iinfo(dtype).min
maxvalue = np.iinfo(dtype).max maxvalue = np.iinfo(dtype).max
if np.max(np.abs(block)) > maxvalue / 2: if np.max(np.abs(block)) >= 0.9*maxvalue:
return True return True
else: else:
# Cannot check for floating point values. # Cannot check for floating point values.