sasdata.quantities.units module¶
This file is autogenerated!
Do not edit by hand, instead edit the files that build it (_build_tables.py, _units_base.py)
# DDDDDDDDDDDDD NNNNNNNN NNNNNNNN tttt # D::::::::::::DDD N:::::::N N::::::N ttt:::t # D:::::::::::::::DD N::::::::N N::::::N t:::::t # DDD:::::DDDDD:::::D N:::::::::N N::::::N t:::::t # D:::::D D:::::D ooooooooooo N::::::::::N N::::::N ooooooooooo ttttttt:::::ttttttt # D:::::D D:::::D oo:::::::::::oo N:::::::::::N N::::::N oo:::::::::::oo t:::::::::::::::::t # D:::::D D:::::Do:::::::::::::::o N:::::::N::::N N::::::No:::::::::::::::ot:::::::::::::::::t # D:::::D D:::::Do:::::ooooo:::::o N::::::N N::::N N::::::No:::::ooooo:::::otttttt:::::::tttttt # D:::::D D:::::Do::::o o::::o N::::::N N::::N:::::::No::::o o::::o t:::::t # D:::::D D:::::Do::::o o::::o N::::::N N:::::::::::No::::o o::::o t:::::t # D:::::D D:::::Do::::o o::::o N::::::N N::::::::::No::::o o::::o t:::::t # D:::::D D:::::D o::::o o::::o N::::::N N:::::::::No::::o o::::o t:::::t tttttt # DDD:::::DDDDD:::::D o:::::ooooo:::::o N::::::N N::::::::No:::::ooooo:::::o t::::::tttt:::::t # D:::::::::::::::DD o:::::::::::::::o N::::::N N:::::::No:::::::::::::::o tt::::::::::::::t # D::::::::::::DDD oo:::::::::::oo N::::::N N::::::N oo:::::::::::oo tt:::::::::::tt # DDDDDDDDDDDDD ooooooooooo NNNNNNNN NNNNNNN ooooooooooo ttttttttttt # # # # # # # # # dddddddd # EEEEEEEEEEEEEEEEEEEEEE d::::::d iiii tttt BBBBBBBBBBBBBBBBB # E::::::::::::::::::::E d::::::d i::::i ttt:::t B::::::::::::::::B # E::::::::::::::::::::E d::::::d iiii t:::::t B::::::BBBBBB:::::B # EE::::::EEEEEEEEE::::E d:::::d t:::::t BB:::::B B:::::B # E:::::E EEEEEE ddddddddd:::::d iiiiiiittttttt:::::ttttttt B::::B B:::::Byyyyyyy yyyyyyy # E:::::E dd::::::::::::::d i:::::it:::::::::::::::::t B::::B B:::::B y:::::y y:::::y # E::::::EEEEEEEEEE d::::::::::::::::d i::::it:::::::::::::::::t B::::BBBBBB:::::B y:::::y y:::::y # E:::::::::::::::E d:::::::ddddd:::::d i::::itttttt:::::::tttttt B:::::::::::::BB y:::::y y:::::y # E:::::::::::::::E d::::::d d:::::d i::::i t:::::t B::::BBBBBB:::::B y:::::y y:::::y # E::::::EEEEEEEEEE d:::::d d:::::d i::::i t:::::t B::::B B:::::B y:::::y y:::::y # E:::::E d:::::d d:::::d i::::i t:::::t B::::B B:::::B y:::::y:::::y # E:::::E EEEEEEd:::::d d:::::d i::::i t:::::t tttttt B::::B B:::::B y:::::::::y # EE::::::EEEEEEEE:::::Ed::::::ddddd::::::ddi::::::i t::::::tttt:::::t BB:::::BBBBBB::::::B y:::::::y # E::::::::::::::::::::E d:::::::::::::::::di::::::i tt::::::::::::::t B:::::::::::::::::B y:::::y # E::::::::::::::::::::E d:::::::::ddd::::di::::::i tt:::::::::::tt B::::::::::::::::B y:::::y # EEEEEEEEEEEEEEEEEEEEEE ddddddddd dddddiiiiiiii ttttttttttt BBBBBBBBBBBBBBBBB y:::::y # y:::::y # y:::::y # y:::::y # y:::::y # yyyyyyy # # # # dddddddd # HHHHHHHHH HHHHHHHHH d::::::d # H:::::::H H:::::::H d::::::d # H:::::::H H:::::::H d::::::d # HH::::::H H::::::HH d:::::d # H:::::H H:::::H aaaaaaaaaaaaa nnnn nnnnnnnn ddddddddd:::::d # H:::::H H:::::H a::::::::::::a n:::nn::::::::nn dd::::::::::::::d # H::::::HHHHH::::::H aaaaaaaaa:::::an::::::::::::::nn d::::::::::::::::d # H:::::::::::::::::H a::::ann:::::::::::::::nd:::::::ddddd:::::d # H:::::::::::::::::H aaaaaaa:::::a n:::::nnnn:::::nd::::::d d:::::d # H::::::HHHHH::::::H aa::::::::::::a n::::n n::::nd:::::d d:::::d # H:::::H H:::::H a::::aaaa::::::a n::::n n::::nd:::::d d:::::d # H:::::H H:::::H a::::a a:::::a n::::n n::::nd:::::d d:::::d # HH::::::H H::::::HHa::::a a:::::a n::::n n::::nd::::::ddddd::::::dd # H:::::::H H:::::::Ha:::::aaaa::::::a n::::n n::::n d:::::::::::::::::d # H:::::::H H:::::::H a::::::::::aa:::a n::::n n::::n d:::::::::ddd::::d # HHHHHHHHH HHHHHHHHH aaaaaaaaaa aaaa nnnnnn nnnnnn ddddddddd ddddd
- exception sasdata.quantities.units.DimensionError¶
Bases:
Exception
- class sasdata.quantities.units.Dimensions(length: int = 0, time: int = 0, mass: int = 0, current: int = 0, temperature: int = 0, moles_hint: int = 0, angle_hint: int = 0)¶
Bases:
objectNote that some SI Base units are not useful from the perspecive of the sasview project, and make things behave badly. In particular: moles and angular measures are dimensionless, and candelas are really a weighted measure of power.
We do however track angle and amount, because its really useful for formatting units
- property is_dimensionless¶
Is this dimension dimensionless (ignores moles_hint and angle_hint)
- si_repr()¶
- class sasdata.quantities.units.GreedyAbsDimensionUnitFormatProcessor(unit: Unit)¶
Bases:
UnitFormatProcessorThis processor minimises the dimensionality of the unit by multiplying by as many units of the specified type as needed
- apply(scale, dimensions) tuple[ProcessedUnitToken, float, Dimensions]¶
This will be called to deal with each processing stage
- class sasdata.quantities.units.NamedUnit(si_scaling_factor: float, dimensions: Dimensions, name: str | None = None, ascii_symbol: str | None = None, latex_symbol: str | None = None, symbol: str | None = None)¶
Bases:
UnitUnits, but they have a name, and a symbol
- Si_scaling_factor:
Number of these units per SI equivalent
- Parameters:
dimensions – Dimensions object representing the dimensionality of these units
name – Name of unit - string without unicode
ascii_symbol – Symbol for unit without unicode
symbol – Unicode symbol
- startswith(prefix: str) bool¶
Check if any representation of the unit begins with the prefix string
- class sasdata.quantities.units.ProcessedUnitToken(base_string: str, exponent_string: str, latex_exponent_string: str, exponent: int)¶
Bases:
objectMid processing representation of formatted units
- base_string: str¶
- exponent: int¶
- exponent_string: str¶
- latex_exponent_string: str¶
- class sasdata.quantities.units.RequiredUnitFormatProcessor(unit: Unit, power: int = 1)¶
Bases:
UnitFormatProcessorThis unit is required to exist in the formatting
- apply(scale, dimensions) tuple[float, Dimensions, ProcessedUnitToken]¶
This will be called to deal with each processing stage
- class sasdata.quantities.units.Unit(si_scaling_factor: float, dimensions: Dimensions)¶
Bases:
object- si_equivalent()¶
Get the SI unit corresponding to this unit
- class sasdata.quantities.units.UnitFormatProcessor¶
Bases:
objectRepresents a step in the unit processing pipeline
- apply(scale, dimensions) tuple[ProcessedUnitToken, float, Dimensions]¶
This will be called to deal with each processing stage