less picky on allowed datatypes

This commit is contained in:
Martin Diehl 2019-05-30 13:29:29 +02:00
parent 461611cde7
commit b00581f1be
1 changed files with 1 additions and 1 deletions

View File

@ -83,7 +83,7 @@ class Geom():
if microstructure is not None:
if len(microstructure.shape) != 3:
raise ValueError('Invalid microstructure shape {}'.format(*microstructure.shape))
elif microstructure.dtype not in [int,float]:
elif microstructure.dtype not in np.sctypes['float'] + np.sctypes['int']:
raise TypeError('Invalid data type {} for microstructure'.format(microstructure.dtype))
else:
self.microstructure = np.copy(microstructure)