def _validate_dataset(ds):
if not type(ds.data) is np.ndarray:
return ['Dataset.data must be a numpy.ndarray']
elif np.alen(ds.data) < 1:
return ['Dataset.data must not be empty']
elif not np.issubdtype(ds.data.dtype, np.float64):
return ['Dataset.data.dtype must be numpy.float64']
if ds.is_scale:
if len(ds.data.shape) != 1:
return ['Scales must be one-dimensional']
if np.any(np.diff(ds.data) <= 0):
return ['Scales must be strictly monotonic increasing']
else:
if (len(ds.data.shape) >= 1) and (ds.data.shape[0] > 0) and not (len(ds.data.shape) == len(ds.scales)):
return ['The number of scales does not match the number of dimensions']
return []
评论列表
文章目录