We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1231d2f commit 82ed96cCopy full SHA for 82ed96c
1 file changed
odml/property.py
@@ -247,6 +247,9 @@ def _validate_values(self, values):
247
try:
248
dtypes.get(v, self.dtype)
249
except Exception:
250
+ raise ValueError("odml.Property.values: passed value \'%s\' are not of "
251
+ "consistent type \'%s\'! Format should be \'%s\'." %
252
+ (v, self._dtype, dtypes.default_values(self._dtype)))
253
return False
254
return True
255
@@ -327,9 +330,7 @@ def values(self, new_value):
327
330
if self._dtype is None:
328
331
self._dtype = dtypes.infer_dtype(new_value[0])
329
332
- if not self._validate_values(new_value):
- raise ValueError("odml.Property.values: passed values are not of "
- "consistent type!")
333
+ self._validate_values(new_value)
334
self._values = [dtypes.get(v, self.dtype) for v in new_value]
335
336
@property
0 commit comments