We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 18fb843 commit 8082a0cCopy full SHA for 8082a0c
1 file changed
odml/property.py
@@ -329,6 +329,14 @@ def uncertainty(self):
329
def uncertainty(self, new_value):
330
if new_value == "":
331
new_value = None
332
+
333
+ if new_value and not isinstance(new_value, (int, float)):
334
+ try:
335
+ new_value = float(new_value)
336
+ except ValueError:
337
+ raise ValueError("odml.Property.uncertainty: passed uncertainty '%s' "
338
+ "is not float or int." % new_value)
339
340
self._uncertainty = new_value
341
342
@property
0 commit comments