Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions odml/property.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,9 @@ def _validate_values(self, values):
try:
dtypes.get(v, self.dtype)
except Exception:
raise ValueError("odml.Property.values: passed value \'%s\' are not of "
Comment thread
mpsonntag marked this conversation as resolved.
Outdated
"consistent type \'%s\'! Format should be \'%s\'." %
(v, self._dtype, dtypes.default_values(self._dtype)))
return False
Comment thread
mpsonntag marked this conversation as resolved.
return True

Expand Down Expand Up @@ -327,9 +330,7 @@ def values(self, new_value):
if self._dtype is None:
self._dtype = dtypes.infer_dtype(new_value[0])

if not self._validate_values(new_value):
raise ValueError("odml.Property.values: passed values are not of "
"consistent type!")
self._validate_values(new_value)
self._values = [dtypes.get(v, self.dtype) for v in new_value]

@property
Expand Down