Scale¶
The scale module contains the class Scale which implements generic scale behaviour. This class represents the conventional notion of a measurement scale (also commonly called a unit).
Different categories of scale are implemented as classes derived from Scale:
- Instances of
RatioScalescales have an absolute zero, like the metre scale for length or the kelvin scale for thermodynamic temperature.IntervalScalescales are measurement scales with an arbitrary zero, like the Fahrenheit and Celsius temperature scales.
-
class
Scale(kind_of_quantity, name, symbol)¶ A Scale has a name (and a short name, or symbol) and contains a reference to the associated kind of quantity.
-
class
OrdinalScale(kind_of_quantity, name, symbol)¶
-
class
IntervalScale(kind_of_quantity, name, symbol)¶ An
IntervalScalehas an arbitrary origin. Units associated with an interval scale may not be multiplied or divided.-
static
value_conversion_function()¶ Generic conversion function from one interval scale to another
-
static
-
class
RatioScale(kind_of_quantity, name, symbol, conversion_factor=None)¶ A
RatioScaleis a metric scale. Units may be multiplied and divided.-
conversion_factor¶ Return a conversion factor for a value on this scale to one on the reference scale
-
static
value_conversion_function()¶ Generic conversion function from one ratio scale to another
-