@@ -13,10 +13,10 @@ class BaseProperty(base.BaseObject):
13
13
"""An odML Property"""
14
14
_format = frmt .Property
15
15
16
- def __init__ (self , name = None , value = None , parent = None , unit = None ,
16
+ def __init__ (self , name = None , values = None , parent = None , unit = None ,
17
17
uncertainty = None , reference = None , definition = None ,
18
18
dependency = None , dependency_value = None , dtype = None ,
19
- value_origin = None , oid = None ):
19
+ value_origin = None , oid = None , value = None ):
20
20
"""
21
21
Create a new Property. If a value without an explicitly stated dtype
22
22
has been provided, the method will try to infer the value's dtype.
@@ -31,8 +31,8 @@ def __init__(self, name=None, value=None, parent=None, unit=None,
31
31
>>> p.dtype
32
32
>>> int
33
33
:param name: The name of the property.
34
- :param value : Some data value, it can be a single value or
35
- a list of homogeneous values.
34
+ :param values : Some data value, it can be a single value or
35
+ a list of homogeneous values.
36
36
:param unit: The unit of the stored data.
37
37
:param uncertainty: The uncertainty (e.g. the standard deviation)
38
38
associated with a measure value.
@@ -48,6 +48,8 @@ def __init__(self, name=None, value=None, parent=None, unit=None,
48
48
:param oid: object id, UUID string as specified in RFC 4122. If no id is provided,
49
49
an id will be generated and assigned. An id has to be unique
50
50
within an odML Document.
51
+ :param value: Legacy code to the 'values' attribute. If 'values' is provided,
52
+ any data provided via 'value' will be ignored.
51
53
"""
52
54
try :
53
55
if oid is not None :
@@ -79,7 +81,9 @@ def __init__(self, name=None, value=None, parent=None, unit=None,
79
81
print ("Warning: Unknown dtype '%s'." % dtype )
80
82
81
83
self ._values = []
82
- self .values = value
84
+ self .values = values
85
+ if not values and (value or isinstance (value , bool )):
86
+ self .values = value
83
87
84
88
self .parent = parent
85
89
0 commit comments