Unit styles of justunits¶
The formatting of units is sectioned into the separation of attribute/value-unit pairs and the styling of the units themself.
Defaults¶
justunits formats by these default definitions.
- justunits.DEFAULT_ATTRIBUTE_UNIT_SEPARATOR = AttributeUnitSeparators.WHITESPACE_IN
The style separating attributes/values from units.
- justunits.DEFAULT_ALLOWED_SEPARATORS = AttributeUnitSeparators.None
By default only 5 of 7 supported attribute unit separator are taken into account as the absolute certain separation of an single underline or whitespace separated unit is ambiguous, without limiting the results to the content of the unit library. Such a behaviour may be implemented in future releases, if it turns out to be necessary.
- justunits.DEFAULT_POWER_STYLE = UnitPowerStyle.SUPERSCRIPT
The default style how powers are represented.
- justunits.DEFAULT_DIVIDING_STYLE = UnitDividingStyle.SLASHED
The default style how unit fractions are represented.
- justunits.DEFAULT_SEPARATION_STYLE = UnitSeparationStyle.DOT
The default style by which character units are separated.
- justunits.DEFAULT_UNIT_STYLE = UnitPowerStyle.None
The default unit style composed of power-, dividing- and separation-style.
Seperation of attribute/value and unit¶
- AttributeUnitSeparators.WHITESPACE_BOXED = 1¶
Leads to ‘attribute [unit]’
- AttributeUnitSeparators.UNDERLINE_BOXED = 2¶
Leads to ‘attribute_[unit]’
- AttributeUnitSeparators.WHITESPACE_IN = 4¶
Leads to ‘attribute in unit’
- AttributeUnitSeparators.UNDERLINED_IN = 8¶
Leads to ‘attribute_in_unit’
- AttributeUnitSeparators.HASH_SIGN = 16¶
Leads to ‘attribute#unit’
- AttributeUnitSeparators.SINGLE_UNDERLINE = 32¶
Leads to ‘attribute_unit’
- AttributeUnitSeparators.SINGLE_WHITESPACE = 64¶
Leads to ‘attribute unit’
Styling of just units¶
Unit power style¶
- UnitPowerStyle.SUPERSCRIPT = 256¶
Leads to superscripting powers like a⁻¹
- UnitPowerStyle.CARET = 512¶
Powers are represented in ascii compatible like a^-1
Style of divisions¶
- UnitDividingStyle.SLASHED = 1024¶
Units are divided by a forward slash like a/b.
- UnitDividingStyle.BY_POWER = 2048¶
Divisions of units is represented using powers like a/b being a⋅b⁻¹.