The Attribute classΒΆ
The main characteristics of Attribute are described below.
label: The name of theAttribute. Comes from the standard and should not be changed.value: The value(s) specified for thisAttribute. In general, any type is allowed, but in most cases it is (a list of): str / int / float /EFLRItem/datetime.multivalued: a Boolean indicating whether thisAttributeinstance accepts a list of values (if True) or a single value (if False). Specified at initialisation of theAttribute(which usually takes place at initialisation of the relevant EFLR object).multidimensional: a Boolean indicating whether the value of thisAttributecan have multiple dimensions (be represented as a nested list). If True,multivaluedmust also be True.count: Number of values specified for theAttributeinstance. If theAttributeis notmultivalued,countis always 1. Otherwise, it is the number of values added to theAttribute(orNoneif no value is given).units: A string representing the units of thevalueof theAttribute- if relevant. The standard pre-defines a list of allowed units, but many DLIS readers accept any string value. For this reason, only a log warning is issued if the user specifies a unit other than those given by the standard.representation_code: indication of type of the value(s) of theAttributeand guidance on how they should be converted to bytes to be included in the file. Representation codes are either defined when the Attribute is initialised or are inferred from the provided value(s). They are not settable by the user.parent_eflr: TheEFLRIteminstance this attribute belongs to. Mainly used for string representation of theAttribute(e.g.Attribute 'description' of ToolItem 'TOOL-1', whereTOOL-1is the parent EFLR).converter: A callable which is used to convert the value passed by the user (or each of the individual items if theAttributeis multivalued) to fit the standard-imposed requirements for the givenAttribute. It can also include type checks etc. (for example, checking that the objects passed tocalibrated_channelsofCalibrationItem) are all instances ofChannelItem.
Settable parts of Attribute instance include: value, units, and converter.
Some subtypes of Attribute further restrict what can be set.