isqx (core, fmt)
The top-level isqx
public API contains the re-exports of the following modules:
isqx._core
: Expression tree, simplification, conversion.isqx._fmt
: Serialisationisqx._iso80000
: SI base units, derived units (meters, kilograms, newtons, joules, etc.) and quantity kinds.
Restrictions for composing expressions with examples:
Inner → Outer ↓ |
isqx.BaseDimension |
isqx.BaseUnit |
isqx.Dimensionless |
isqx.Exp |
isqx.Mul |
isqx.Scaled |
isqx.Aliased |
isqx.Tagged |
isqx.Translated |
isqx.Log |
---|---|---|---|---|---|---|---|---|---|---|
isqx.Exp __pow__ |
✅ \(\text{L}^2\) |
✅ \(\text{m}^2\) |
✅ \(\text{Re}^{1/5}\) |
✅ \((\text{m}^2)^2\) |
✅ \((\text{m}\cdot\text{s}^{-1})^2\) |
✅ \(\text{ft}^2\) |
✅ | ✅ | ❌¹ \(\degree\text{C}^2\) |
❌¹³ \(\text{dBV}^2\) |
isqx.Mul __mul__ |
✅ \(\text{L}\cdot\text{T}^{-2}\) |
✅ \(\text{N}\cdot\text{m}\) |
✅ \(\text{rad}\cdot\text{s}^{-1}\) |
✅ \(\text{m}\cdot\text{s}^{-2}\) |
✅ \((\text{kg}\cdot\text{m}\cdot\text{s}^{-1})\cdot\text{s}^{-1}\) |
✅ \(\text{lbf}\cdot\text{ft}\) |
✅ \(\text{N}\cdot\text{m}\) |
✅ \(\text{m}_\text{geometric}\cdot\text{s}^{-2}\) |
❌¹ \(\text{J}\cdot\degree\text{C}^{-1}\) |
⚠️¹⁴ \(\text{dBV}\cdot\text{s}^{-1}\) |
isqx.Scaled __rmul__ |
❌ | ✅ \(1000\cdot\text{m}\) |
❌ | ✅ \(100\cdot\text{m}^2\) |
✅ \(3.6\cdot(\text{m}\cdot\text{s}^{-1})\) |
✅ \(\frac{1}{12}\text{ft}\) |
✅ \(10^3\text{J}\) |
✅ \(\text{ft}_\text{geometric} = 0.3048\cdot\text{m}_\text{geometric}\) |
❌¹ \(1.8\cdot\degree\text{C}\) |
✅ \(10\cdot \text{B}\) |
isqx.Prefix ^__mul__ |
❌² | ✅³ \(\text{km}\) |
❌² \(\text{kilo}\cdot\text{Re}\) |
❌⁴ \(\text{kilo}\cdot\text{m}^2\) |
❌⁴ \(\text{kilo}\cdot(\text{m}\cdot\text{s}^{-1})\) |
❌⁴ \(\text{kilo}\cdot\text{ft}\) |
✅⁶ \(\text{kJ}\) |
⚠️⁷ \(\text{km}_\text{geometric}\) |
❌¹ \(\text{kilo}\cdot\degree\text{C}\) |
✅⁵ \(\text{mNp}\) |
isqx.Aliased .alias |
❌⁸ | ❌⁸ | ❌⁸ | ✅ \(\text{sqft} = \text{ft}^2\) |
✅ \(\text{J}=\text{N}\cdot\text{m}\) |
✅ \(\text{ft} = 0.3048\cdot\text{m}\) |
❌⁹ | ✅ \(\text{N}_\text{thrust}\) |
❌¹ | ✅ \(\text{B} = \log...\) |
isqx.Tagged __getitem__ |
✅ \(\text{L}_\text{geometric}\) |
✅ \(\text{m}_\text{geometric}\) |
✅ \(\text{Re}_\text{chord}\) |
✅ \(({\text{m}^2})_\text{surface}\) |
✅ \((\text{N}\cdot\text{m})_\text{torque}\) |
✅ \(\text{ft}_\text{geometric}\) |
✅ \(\text{N}_\text{thrust}\) |
⚠️¹⁰ | ✅ \((\degree\text{C})_\text{surface}\) |
✅ \(\text{dB(A)}\) |
isqx.Translated |
❌¹¹ \(\text{L} + 13\) |
✅ \(\text{K} - 273.15\) |
❌¹¹ \(\text{Re} - 13\) |
❌¹¹ \(\text{m}^2 + 13\) |
❌¹¹ \((\text{N}\cdot\text{m}) + 13\) |
✅ \(\degree\text{R} - 459.67\) |
⚠️ | ✅ \(\text{K}_\text{ambient} + 13\) |
❌¹ \(\degree\text{C} + 13\) |
❌¹ \(\text{dBV} + 10\) |
isqx.Log |
❌¹² | ❌¹² | ✅ \(\text{B}\) |
❌¹² \(\log(\text{m}^2)\) |
❌¹² \(\log(\text{W}\cdot\text{m}^{-2}\cdot\text{Hz}^{-1})\) |
❌¹² \(\log(\text{mW})\) |
❌¹² \(\log(\text{W})\) |
✅ \(\log(\text{ratio}_\text{V/V})\) |
❌¹ \(\log(\degree\text{C})\) |
❌¹² \(\log(\text{dBV})\) |
^ a prefix is not an expression, but a factory that produces an aliased scaled unit.
isqx.Translated
is considered terminal and cannot be further composed with other expressions, except for being tagged. for example,℃²
is physically meaningless, as arekilo(℃)
. operations on intervals must use the absolute reference unit (e.g.,J K⁻¹
instead ofJ ℃⁻¹
).- prefixes like
kilo-
ormilli-
can only be applied to units, not dimensionless numbers or dimensions. - prefixes can be applied to any
isqx.BaseUnit
except for the kilogram. - a prefix must be applied to a named unit, which is either a
isqx.BaseUnit
or anisqx.Aliased
. it cannot be applied to structural expressions likeExp
,Mul
, orScaled
directly. - a logarithmic can only be prefixed if its
allow_prefix
flag isTrue
. - a prefix can be applied to an
isqx.Aliased
if itsallow_prefix
flag isTrue
(e.g.,kilo * N
). - the legality of wrapping a
isqx.Tagged
type depends on the rules for its inner reference. for example,Prefix * N["thrust"]
is legal becausePrefix * N
is legal. - an
isqx.Aliased
must wrap a structural expression (Exp
,Mul
,Scaled
). it cannot wrap fundamental, terminal or aliased expressions. - nesting
isqx.Aliased
types is forbidden. - nesting
isqx.Tagged
types is forbidden. repeated__getitem__
calls will "extend" the tag tuple. - a translated unit (like Celsius) must have a
isqx.BaseUnit
or aisqx.Scaled
unit (like Rankine) as its reference. - a logarithmic expression must wrap a dimensionless expression. it cannot wrap another logarithmic expression or an expression with a physical dimension.
- a logarithmic expression is considered terminal and cannot be exponentiated.
- a product can contain at most one logarithmic expression. this is to allow common units like
dB/m
ordB/Hz
while forbidding physically meaningless compositions likedB·m
ordB²
.
_core
¤
SupportsDecimal
¤
Bases: SupportsFloat
, SupportsAbs[object]
, Protocol
Name
¤
A unique slug to identify the expression. This is used by the default basic
formatter to display the expression and hence should not contain any spaces
to avoid ambiguity. For example, meter
, newton
, reynolds
AliasMixin
¤
alias
¤
Wrap this expression with a name.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
Name
|
Name of this alias, e.g. |
required |
allow_prefix
|
bool
|
Whether to allow prefixes to be attached. This should only be true for some units like |
False
|
Source code in src/isqx/_core.py
85 86 87 88 89 90 91 92 |
|
FormatMixin
¤
__format__
¤
Source code in src/isqx/_core.py
96 97 98 99 |
|
ExprBase
¤
Bases: FormatMixin
A base class for a "unit-like" expression.
It may be of the following forms:
Type | Example |
---|---|
dimensionless number¹ | Reynolds , Prandtl |
base dimension¹ | length |
base unit¹ | meter |
expression raised to a power² | Exp(M, 2) |
product of expressions² | Mul(A, S) |
scaled expression²⁴ | Scaled(M, 0.3048) |
aliased¹ | newton = kg m s⁻² |
translated expression³ | Translated(K, -273.15) |
logarithmic expression¹³ | dB |
tagged⁵ | true vs ground speed |
¹ these expressions are associated with a name.
² these expressions can be aliased with a name.
³ these expressions are terminal, meaning it cannot be further
exponentiated, multiplied, scaled,
translated or aliased to form a more
complex expression. However, it can be further tagged
(e.g. surface temperature vs ISA temperature).
⁴ can be created by multiplying a prefix (e.g. milli
)
⁵ can be created by calling a quantity kind with a unit
Operator overloading is provided for ergonomic expression construction.
Note
While dividing expressions is supported, it is strongly discouraged as
it can lead to operator precedence ambiguity. For example, while Python
interprets J / KG / K
as (J / KG) / K
, it is often clearer to
represent it as J * KG**-1 * K**-1
.
__pow__
¤
Source code in src/isqx/_core.py
142 143 |
|
__mul__
¤
__mul__(rhs: LazyProduct | Number) -> Scaled
__mul__(rhs: Expr | LazyProduct | Number) -> Mul | Scaled
Source code in src/isqx/_core.py
152 153 154 155 156 157 158 159 160 |
|
__rmul__
¤
__rmul__(lhs: LazyProduct | Number | Prefix) -> Scaled
Source code in src/isqx/_core.py
162 163 164 165 |
|
__truediv__
¤
__truediv__(rhs: LazyProduct | Number) -> Scaled
__truediv__(
rhs: Expr | LazyProduct | Number,
) -> Mul | Scaled
Source code in src/isqx/_core.py
173 174 175 176 177 178 179 180 181 182 |
|
__getitem__
¤
Attach tags to this expresson.
Source code in src/isqx/_core.py
184 185 186 187 188 189 |
|
__format__
¤
Source code in src/isqx/_core.py
96 97 98 99 |
|
Dimensionless
¤
Dimensionless(name: Name)
__format__
¤
Source code in src/isqx/_core.py
96 97 98 99 |
|
__str__
¤
__str__() -> str
Source code in src/isqx/_core.py
101 102 |
|
__pow__
¤
Source code in src/isqx/_core.py
142 143 |
|
__mul__
¤
__mul__(rhs: LazyProduct | Number) -> Scaled
__mul__(rhs: Expr | LazyProduct | Number) -> Mul | Scaled
Source code in src/isqx/_core.py
152 153 154 155 156 157 158 159 160 |
|
__rmul__
¤
__rmul__(lhs: LazyProduct | Number | Prefix) -> Scaled
Source code in src/isqx/_core.py
162 163 164 165 |
|
__truediv__
¤
__truediv__(rhs: LazyProduct | Number) -> Scaled
__truediv__(
rhs: Expr | LazyProduct | Number,
) -> Mul | Scaled
Source code in src/isqx/_core.py
173 174 175 176 177 178 179 180 181 182 |
|
__getitem__
¤
Attach tags to this expresson.
Source code in src/isqx/_core.py
184 185 186 187 188 189 |
|
BaseDimension
¤
BaseDimension(name: Name)
__format__
¤
Source code in src/isqx/_core.py
96 97 98 99 |
|
__str__
¤
__str__() -> str
Source code in src/isqx/_core.py
101 102 |
|
__pow__
¤
Source code in src/isqx/_core.py
142 143 |
|
__mul__
¤
__mul__(rhs: LazyProduct | Number) -> Scaled
__mul__(rhs: Expr | LazyProduct | Number) -> Mul | Scaled
Source code in src/isqx/_core.py
152 153 154 155 156 157 158 159 160 |
|
__rmul__
¤
__rmul__(lhs: LazyProduct | Number | Prefix) -> Scaled
Source code in src/isqx/_core.py
162 163 164 165 |
|
__truediv__
¤
__truediv__(rhs: LazyProduct | Number) -> Scaled
__truediv__(
rhs: Expr | LazyProduct | Number,
) -> Mul | Scaled
Source code in src/isqx/_core.py
173 174 175 176 177 178 179 180 181 182 |
|
__getitem__
¤
Attach tags to this expresson.
Source code in src/isqx/_core.py
184 185 186 187 188 189 |
|
BaseUnit
¤
BaseUnit(_dimension: BaseDimension, name: Name)
__format__
¤
Source code in src/isqx/_core.py
96 97 98 99 |
|
__str__
¤
__str__() -> str
Source code in src/isqx/_core.py
101 102 |
|
__pow__
¤
Source code in src/isqx/_core.py
142 143 |
|
__mul__
¤
__mul__(rhs: LazyProduct | Number) -> Scaled
__mul__(rhs: Expr | LazyProduct | Number) -> Mul | Scaled
Source code in src/isqx/_core.py
152 153 154 155 156 157 158 159 160 |
|
__rmul__
¤
__rmul__(lhs: LazyProduct | Number | Prefix) -> Scaled
Source code in src/isqx/_core.py
162 163 164 165 |
|
__truediv__
¤
__truediv__(rhs: LazyProduct | Number) -> Scaled
__truediv__(
rhs: Expr | LazyProduct | Number,
) -> Mul | Scaled
Source code in src/isqx/_core.py
173 174 175 176 177 178 179 180 181 182 |
|
__getitem__
¤
Attach tags to this expresson.
Source code in src/isqx/_core.py
184 185 186 187 188 189 |
|
Exponent
¤
An exponent, generally small integers, which can be positive, negative, or a fraction, but not zero
Exp
¤
Exp(base: _ComposableExpr, exponent: Exponent)
Bases: AliasMixin
, ExprBase
An expression raised to an exponent.
For example, BaseUnit("meter", Dimension("L")), 2)
is m².
Can be recursively nested, e.g. Exp(Exp(METER, 2), Fraction(1, 2))
exponent
¤
exponent: Exponent
Exponent. Avoid using zero to represent dimensionless numbers:
use isqx.Dimensionless
with a name instead.
__post_init__
¤
__post_init__() -> None
Source code in src/isqx/_core.py
231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 |
|
__format__
¤
Source code in src/isqx/_core.py
96 97 98 99 |
|
__str__
¤
__str__() -> str
Source code in src/isqx/_core.py
101 102 |
|
__pow__
¤
Source code in src/isqx/_core.py
142 143 |
|
__mul__
¤
__mul__(rhs: LazyProduct | Number) -> Scaled
__mul__(rhs: Expr | LazyProduct | Number) -> Mul | Scaled
Source code in src/isqx/_core.py
152 153 154 155 156 157 158 159 160 |
|
__rmul__
¤
__rmul__(lhs: LazyProduct | Number | Prefix) -> Scaled
Source code in src/isqx/_core.py
162 163 164 165 |
|
__truediv__
¤
__truediv__(rhs: LazyProduct | Number) -> Scaled
__truediv__(
rhs: Expr | LazyProduct | Number,
) -> Mul | Scaled
Source code in src/isqx/_core.py
173 174 175 176 177 178 179 180 181 182 |
|
__getitem__
¤
Attach tags to this expresson.
Source code in src/isqx/_core.py
184 185 186 187 188 189 |
|
alias
¤
Wrap this expression with a name.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
Name
|
Name of this alias, e.g. |
required |
allow_prefix
|
bool
|
Whether to allow prefixes to be attached. This should only be true for some units like |
False
|
Source code in src/isqx/_core.py
85 86 87 88 89 90 91 92 |
|
Mul
¤
Mul(terms: tuple[_ComposableExpr, ...])
Bases: AliasMixin
, ExprBase
Products of powers of an expression.
terms
¤
terms: tuple[_ComposableExpr, ...]
A tuple of expressions to be multiplied, preserving the order.
__post_init__
¤
__post_init__() -> None
Source code in src/isqx/_core.py
268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 |
|
__format__
¤
Source code in src/isqx/_core.py
96 97 98 99 |
|
__str__
¤
__str__() -> str
Source code in src/isqx/_core.py
101 102 |
|
__pow__
¤
Source code in src/isqx/_core.py
142 143 |
|
__mul__
¤
__mul__(rhs: LazyProduct | Number) -> Scaled
__mul__(rhs: Expr | LazyProduct | Number) -> Mul | Scaled
Source code in src/isqx/_core.py
152 153 154 155 156 157 158 159 160 |
|
__rmul__
¤
__rmul__(lhs: LazyProduct | Number | Prefix) -> Scaled
Source code in src/isqx/_core.py
162 163 164 165 |
|
__truediv__
¤
__truediv__(rhs: LazyProduct | Number) -> Scaled
__truediv__(
rhs: Expr | LazyProduct | Number,
) -> Mul | Scaled
Source code in src/isqx/_core.py
173 174 175 176 177 178 179 180 181 182 |
|
__getitem__
¤
Attach tags to this expresson.
Source code in src/isqx/_core.py
184 185 186 187 188 189 |
|
alias
¤
Wrap this expression with a name.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
Name
|
Name of this alias, e.g. |
required |
allow_prefix
|
bool
|
Whether to allow prefixes to be attached. This should only be true for some units like |
False
|
Source code in src/isqx/_core.py
85 86 87 88 89 90 91 92 |
|
Scaled
¤
Scaled(
reference: BaseUnit
| Exp
| Mul
| Scaled
| Aliased
| Tagged
| Log,
factor: Number | LazyProduct | Prefix,
)
Bases: AliasMixin
, ExprBase
reference
¤
The unit or dimension that this unit or dimension is based on.
factor
¤
factor: Number | LazyProduct | Prefix
The exact factor to multiply to this unit to convert it to the reference.
For example, 1 ft = 0.3048 m
, so the factor is 0.3048.
__post_init__
¤
__post_init__() -> None
Source code in src/isqx/_core.py
302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 |
|
__format__
¤
Source code in src/isqx/_core.py
96 97 98 99 |
|
__str__
¤
__str__() -> str
Source code in src/isqx/_core.py
101 102 |
|
__pow__
¤
Source code in src/isqx/_core.py
142 143 |
|
__mul__
¤
__mul__(rhs: LazyProduct | Number) -> Scaled
__mul__(rhs: Expr | LazyProduct | Number) -> Mul | Scaled
Source code in src/isqx/_core.py
152 153 154 155 156 157 158 159 160 |
|
__rmul__
¤
__rmul__(lhs: LazyProduct | Number | Prefix) -> Scaled
Source code in src/isqx/_core.py
162 163 164 165 |
|
__truediv__
¤
__truediv__(rhs: LazyProduct | Number) -> Scaled
__truediv__(
rhs: Expr | LazyProduct | Number,
) -> Mul | Scaled
Source code in src/isqx/_core.py
173 174 175 176 177 178 179 180 181 182 |
|
__getitem__
¤
Attach tags to this expresson.
Source code in src/isqx/_core.py
184 185 186 187 188 189 |
|
alias
¤
Wrap this expression with a name.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
Name
|
Name of this alias, e.g. |
required |
allow_prefix
|
bool
|
Whether to allow prefixes to be attached. This should only be true for some units like |
False
|
Source code in src/isqx/_core.py
85 86 87 88 89 90 91 92 |
|
Log
¤
Log(reference: Dimensionless | Tagged, base: Number)
Bases: AliasMixin
, ExprBase
The logarithm of a dimensionless expression [ISO 80000-2:2019 2-13.4].
__post_init__
¤
__post_init__() -> None
Source code in src/isqx/_core.py
341 342 343 344 345 346 347 348 349 350 351 352 |
|
__format__
¤
Source code in src/isqx/_core.py
96 97 98 99 |
|
__str__
¤
__str__() -> str
Source code in src/isqx/_core.py
101 102 |
|
__pow__
¤
Source code in src/isqx/_core.py
142 143 |
|
__mul__
¤
__mul__(rhs: LazyProduct | Number) -> Scaled
__mul__(rhs: Expr | LazyProduct | Number) -> Mul | Scaled
Source code in src/isqx/_core.py
152 153 154 155 156 157 158 159 160 |
|
__rmul__
¤
__rmul__(lhs: LazyProduct | Number | Prefix) -> Scaled
Source code in src/isqx/_core.py
162 163 164 165 |
|
__truediv__
¤
__truediv__(rhs: LazyProduct | Number) -> Scaled
__truediv__(
rhs: Expr | LazyProduct | Number,
) -> Mul | Scaled
Source code in src/isqx/_core.py
173 174 175 176 177 178 179 180 181 182 |
|
__getitem__
¤
Attach tags to this expresson.
Source code in src/isqx/_core.py
184 185 186 187 188 189 |
|
alias
¤
Wrap this expression with a name.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
Name
|
Name of this alias, e.g. |
required |
allow_prefix
|
bool
|
Whether to allow prefixes to be attached. This should only be true for some units like |
False
|
Source code in src/isqx/_core.py
85 86 87 88 89 90 91 92 |
|
Aliased
¤
An alias for an expression, used to give a more readable name.
Note that unlike a tagged expression, simplification will effectively elide this class.
reference
¤
Expression to be aliased, e.g. Mul((KG, M, Exp(S, -2)))
allow_prefix
¤
allow_prefix: bool = False
Whether to allow prefixes to be attached.
This should only be true for some units like liter
.
__post_init__
¤
__post_init__() -> None
Source code in src/isqx/_core.py
371 372 373 374 375 376 377 378 379 |
|
__format__
¤
Source code in src/isqx/_core.py
96 97 98 99 |
|
__str__
¤
__str__() -> str
Source code in src/isqx/_core.py
101 102 |
|
__pow__
¤
Source code in src/isqx/_core.py
142 143 |
|
__mul__
¤
__mul__(rhs: LazyProduct | Number) -> Scaled
__mul__(rhs: Expr | LazyProduct | Number) -> Mul | Scaled
Source code in src/isqx/_core.py
152 153 154 155 156 157 158 159 160 |
|
__rmul__
¤
__rmul__(lhs: LazyProduct | Number | Prefix) -> Scaled
Source code in src/isqx/_core.py
162 163 164 165 |
|
__truediv__
¤
__truediv__(rhs: LazyProduct | Number) -> Scaled
__truediv__(
rhs: Expr | LazyProduct | Number,
) -> Mul | Scaled
Source code in src/isqx/_core.py
173 174 175 176 177 178 179 180 181 182 |
|
__getitem__
¤
Attach tags to this expresson.
Source code in src/isqx/_core.py
184 185 186 187 188 189 |
|
Translated
¤
An expression offsetted from some reference unit.
reference
¤
The expression that this expression is based on (e.g., K
for DEGC
)
offset
¤
offset: Number
The exact offset to add to the reference to get this unit.
For example, ℃ = K - 273.15
, so the offset is -273.15.
__post_init__
¤
__post_init__() -> None
Source code in src/isqx/_core.py
393 394 395 396 397 398 399 400 401 402 403 404 405 406 |
|
__format__
¤
Source code in src/isqx/_core.py
96 97 98 99 |
|
__str__
¤
__str__() -> str
Source code in src/isqx/_core.py
101 102 |
|
__pow__
¤
Source code in src/isqx/_core.py
142 143 |
|
__mul__
¤
__mul__(rhs: LazyProduct | Number) -> Scaled
__mul__(rhs: Expr | LazyProduct | Number) -> Mul | Scaled
Source code in src/isqx/_core.py
152 153 154 155 156 157 158 159 160 |
|
__rmul__
¤
__rmul__(lhs: LazyProduct | Number | Prefix) -> Scaled
Source code in src/isqx/_core.py
162 163 164 165 |
|
__truediv__
¤
__truediv__(rhs: LazyProduct | Number) -> Scaled
__truediv__(
rhs: Expr | LazyProduct | Number,
) -> Mul | Scaled
Source code in src/isqx/_core.py
173 174 175 176 177 178 179 180 181 182 |
|
__getitem__
¤
Attach tags to this expresson.
Source code in src/isqx/_core.py
184 185 186 187 188 189 |
|
Tagged
¤
Bases: AliasMixin
, ExprBase
An expression decorated with one of more semantic context tag.
Similar to how:
Annotated[T, M1, M2, ...]
attaches metadata to some typeT
,expr[C1, C2, ...]
attaches context to an expression.
This allows one to "disambiguate" between quantities that share the same physical dimension, but have different meanings, e.g. geopotential altitude vs. geometric altitude.
__post_init__
¤
__post_init__() -> None
Source code in src/isqx/_core.py
426 427 428 429 430 431 432 433 434 435 |
|
__format__
¤
Source code in src/isqx/_core.py
96 97 98 99 |
|
__str__
¤
__str__() -> str
Source code in src/isqx/_core.py
101 102 |
|
__pow__
¤
Source code in src/isqx/_core.py
142 143 |
|
__mul__
¤
__mul__(rhs: LazyProduct | Number) -> Scaled
__mul__(rhs: Expr | LazyProduct | Number) -> Mul | Scaled
Source code in src/isqx/_core.py
152 153 154 155 156 157 158 159 160 |
|
__rmul__
¤
__rmul__(lhs: LazyProduct | Number | Prefix) -> Scaled
Source code in src/isqx/_core.py
162 163 164 165 |
|
__truediv__
¤
__truediv__(rhs: LazyProduct | Number) -> Scaled
__truediv__(
rhs: Expr | LazyProduct | Number,
) -> Mul | Scaled
Source code in src/isqx/_core.py
173 174 175 176 177 178 179 180 181 182 |
|
__getitem__
¤
Attach tags to this expresson.
Source code in src/isqx/_core.py
184 185 186 187 188 189 |
|
alias
¤
Wrap this expression with a name.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
Name
|
Name of this alias, e.g. |
required |
allow_prefix
|
bool
|
Whether to allow prefixes to be attached. This should only be true for some units like |
False
|
Source code in src/isqx/_core.py
85 86 87 88 89 90 91 92 |
|
HasTagValidation
¤
__validate_tag__
¤
Check that this tag can be applied to the given expression.
For example, this can be used to ensure:
decibel
(log level) with log reference unitvoltage
but notreynolds number
with log reference unitvoltage
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
reference
|
Expr
|
The expression to apply the tags to. |
required |
tags
|
tuple[Tag, ...]
|
The tags being applied to the expression. This can be used to enforce complex rules (e.g. no duplicates) |
required |
Raises:
Type | Description |
---|---|
CompositionError
|
if the tag cannot be applied to the expression |
Source code in src/isqx/_core.py
440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 |
|
Expr
¤
Expr: TypeAlias = Union[
Dimensionless,
BaseDimension,
BaseUnit,
Exp,
Mul,
Scaled,
Aliased,
Translated,
Log,
Tagged,
]
NamedExpr
¤
NamedExpr: TypeAlias = Union[
Dimensionless,
BaseDimension,
BaseUnit,
Aliased,
Translated,
]
Prefix
¤
A prefix, which when multiplied by a base unit or aliased unit, returns a scaled unit.
Note that this is not an isqx.Expr
.
mul
¤
Source code in src/isqx/_core.py
520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 |
|
QtyKind
¤
An abstract kind of quantity (ISO 80000-1) represents a "concept" (e.g. speed) without a specific unit tied to it.
When called with a unit, it becomes a concrete unit with tagged context.
unit_si_coherent
¤
unit_si_coherent: _TaggedAllowedExpr
The coherent SI unit (i.e. no conversion factors involved, e.g.
M_PERS
for speed, not KM_PERHOUR
)
si_coherent
¤
si_coherent() -> Expr
Return the SI coherent unit with tags.
Source code in src/isqx/_core.py
578 579 580 581 582 |
|
__getitem__
¤
Attach additional tags to this quantity kind.
Source code in src/isqx/_core.py
584 585 586 587 588 589 |
|
__call__
¤
__call__(unit: _TaggedAllowedExpr) -> Expr
Create a tagged unit from this quantity kind.
Source code in src/isqx/_core.py
591 592 593 594 595 596 597 598 599 600 601 602 |
|
DELTA
¤
DELTA = _Delta('finite')
A tag to indicate a finite change in a quantity \(\Delta Q\).
Example: duration in time
DIFFERENTIAL
¤
DIFFERENTIAL = _Delta('differential')
A tag to indicate an exact differential \(dQ\) (whose integral is path-independent).
Example: volume element
INEXACT_DIFFERENTIAL
¤
INEXACT_DIFFERENTIAL = _Delta('inexact_differential')
A tag to indicate an inexact differential \(\delta Q\) (whose integral is path-dependent).
Example: inexact differential in heat
Quantity
¤
Quantity(value: Number | LazyProduct, unit: PhysicalUnit)
A simple data container for a value and its unit, for use in specifying the origin of a point on the scale.
Warning
This is not an isqx.Expr
should not be further composed.
OriginAt
¤
Bases: HasTagValidation
A tag to specify the origin for a point on the scale. Commonly combined
with isqx.DELTA
to also represent a change in the quantity.
Examples:
- Unix epoch:
S[OriginAt("unix epoch")]
- difference in actual temperature and ISA temperature:
K[DELTA, OriginAt((15, CELSIUS))]
- difference in pressure:
Pa[DELTA, OriginAt((100, PSI))]
location
¤
The location of the "zero point" of the measurement.
Can be a quantity (value + unit, e.g. (100, PSI)
) or simply a hashable
object (e.g. the string "unix epoch"). Hashable objects are useful for
scenarios where the origin itself is contextual, for example:
- the height above the ground is dependent on the geographic location
- the stock price relative to yesterday's close
- time elapsed relative to the engine ignition
__validate_tag__
¤
Source code in src/isqx/_core.py
692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 |
|
ratio
¤
Returns a dimensionless between two expressions of the same dimension.
The denominator can be a quantity (value + unit) to
represent logarithmic units like isqx.DBW
.
See: https://en.wikipedia.org/wiki/Dimensionless_quantity#Ratios,_proportions,_and_angles
Source code in src/isqx/_core.py
720 721 722 723 724 725 726 727 |
|
VECTOR
¤
VECTOR = _Tensor(rank=1)
A tag to indicate that the quantity can be a vector. [ISO 80000-2:2019 2-18.1]. It is not restricted to three dimensions.
Examples:
- velocity vector:
M_PERS[VECTOR]
- force vector:
F[VECTOR]
TENSOR_SECOND_ORDER
¤
TENSOR_SECOND_ORDER = _Tensor(rank=2)
A tag to indicate that the quantity can be a second-order tensor.
Examples:
- stress tensor:
(N * M**-2)["stress", TENSOR_SECOND_ORDER]
CARTESIAN
¤
CARTESIAN = _CoordinateSystem(name='cartesian')
A tag to indicate that the quantity is expressed in Cartesian coordinates (\(x\), \(y\), \(z\)) [ISO 80000-2:2019 2-17.1].
The position vector is \(\mathbf{r} = x \mathbf{e}_x + y \mathbf{e}_y + z \mathbf{e}_z\), and its differential is \(d\mathbf{r} = dx \mathbf{e}_x + dy \mathbf{e}_y + dz \mathbf{e}_z\).
CYLINDRICAL
¤
CYLINDRICAL = _CoordinateSystem(name='cylindrical')
A tag to indicate that the quantity is expressed in cylindrical coordinates (radial distance \(\rho\), azimuth \(\varphi\), axial coordinate or height \(z\)) [ISO 80000-2:2019 2-17.2].
The position vector is \(\mathbf{r} = \rho \mathbf{e}_\rho(\varphi) + z \mathbf{e}_z\), and its differential is \(d\mathbf{r} = d\rho \mathbf{e}_\rho(\varphi) + \rho d\varphi \mathbf{e}_\varphi(\varphi) + dz \mathbf{e}_z\).
If \(z = 0\), it is equivalent to polar coordinates.
SPHERICAL
¤
SPHERICAL = _CoordinateSystem(name='spherical')
A tag to indicate that the quantity is expressed in spherical coordinates (radial distance \(r\), polar angle \(\theta\), azimuthal angle \(\varphi\)) [ISO 80000-2:2019 2-17.3].
The position vector is \(\mathbf{r} = r \mathbf{e}_r(\theta, \varphi)\), and its differential is \(d\mathbf{r} = dr \mathbf{e}_r(\theta, \varphi) + r d\theta \mathbf{e}_\theta(\theta, \varphi) + r \sin(\theta) d\varphi \mathbf{e}_\varphi(\theta, \varphi)\).
PhotometricCondition
¤
PhotometricCondition(
kind: Literal[
"photopic",
"scotopic",
"mesopic",
"photopic_cie_1964_10degree",
"photopic_cie_1988_mod_2degree",
]
| str,
)
Bases: HasTagValidation
Photometric condition [ISO 80000-7]. Can be:
- Photopic vision (cones in human vision, in daylight)
- Scotopic vision (rods in human vision, at night)
- Mesopic/twilight vision (rods and cones in human vision)
- CIE 1964 standard colorimetric observer (10° photopic photometric observer)
- CIE 1988 modified 2° spectral luminous efficiency function for photopic vision
- Any other custom condition.
kind
¤
kind: (
Literal[
"photopic",
"scotopic",
"mesopic",
"photopic_cie_1964_10degree",
"photopic_cie_1988_mod_2degree",
]
| str
)
__validate_tag__
¤
Source code in src/isqx/_core.py
876 877 |
|
Tag
¤
Tag: TypeAlias = Union[
OriginAt,
_RatioBetween,
_Delta,
_Tensor,
_CoordinateSystem,
_Complex,
PhotometricCondition,
HasTagValidation,
Hashable,
]
A tag can be any hashable object (e.g. frozen dataclasses or strings).
dimension
¤
dimension(expr: Dimensionless) -> Dimensionless
dimension(expr: BaseDimension) -> BaseDimension
dimension(expr: BaseUnit) -> BaseDimension
dimension(expr: Log) -> Dimensionless
dimension(expr: Aliased | Scaled | Translated) -> Expr
Return the dimension of this "unit-like" expression. Note that it does not perform simplification.
Examples:
Exp(M, 2)
->Exp(DIM_LENGTH, 2)
Mul(M, Exp(S, -1))
->Mul(DIM_LENGTH, Exp(DIM_TIME, -1))
Source code in src/isqx/_core.py
936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 |
|
kind
¤
kind(expr: Dimensionless | Log) -> Literal['dimensionless']
kind(expr: BaseDimension) -> Literal['dimension']
Whether this expression is a unit, dimension, or dimensionless.
Source code in src/isqx/_core.py
986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 |
|
SimplifiedExpr
¤
SimplifiedExpr: TypeAlias = Union[
Dimensionless,
BaseDimension,
BaseUnit,
Exp,
Mul,
Scaled,
Translated,
Log,
Tagged,
]
simplify
¤
simplify(expr: Dimensionless) -> Dimensionless
simplify(expr: BaseDimension) -> BaseDimension
simplify(expr: Aliased) -> SimplifiedExpr
simplify(expr: Translated) -> Translated
simplify(
expr: Exp | Mul | Scaled,
) -> Union[
Dimensionless,
BaseDimension,
BaseUnit,
Exp,
Mul,
Scaled,
Translated,
]
simplify(expr: Expr) -> SimplifiedExpr
Source code in src/isqx/_core.py
1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 |
|
SupportsConversion
¤
Bases: Protocol
__call__
¤
__call__(value)
Convert a value in the origin unit to the target unit.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value
|
An |
required |
Source code in src/isqx/_core.py
1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 |
|
NonAffineConverter
¤
convert
¤
convert(
origin: Expr,
target: Expr,
*,
exact: bool = False,
ctx: decimal.Context | None = None,
) -> Converter | NonAffineConverter
Create a new unit converter from one unit to another.
Checks that the underlying dimension are compatible
(e.g. USD/year
and HKD/hour
) and computes the total scaling factor.
Source code in src/isqx/_core.py
1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 |
|
LazyProduct
¤
Bases: SupportsFloat
Represents a lazy product of a sequence of numbers raised to an optional exponent, i.e. \(\prod_i x_i\), or \(\prod_i x_i^{e_i}\).
Lazy evaluation allows the choice between evaluating it to an exact value (taking longer to compute, useful for financial calculations) or an approximate float.
from_derived_conversions
¤
from_derived_conversions(
derived_conversions: Sequence[tuple[Scaled, Exponent]],
) -> LazyProduct
Source code in src/isqx/_core.py
1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 |
|
to_approx
¤
to_approx() -> float
Reduce it to an approximate float value. Good enough for most applications.
Source code in src/isqx/_core.py
1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 |
|
__float__
¤
__float__() -> float
Source code in src/isqx/_core.py
1582 1583 |
|
to_exact
¤
Reduce it to an exact fraction or decimal.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
ctx
|
decimal.Context
|
The decimal context (precision, rounding, etc.) to use. |
required |
Source code in src/isqx/_core.py
1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 |
|
StdUncertainty
¤
StdUncertainty(value: int)
Concise notation for the one-standard-deviation uncertainty of a numerical value.
For example, the parentheses in 12.3456(89) kg
means:
numerical value = 12.3456
standard uncertainty = 0.0089
typing.Annotated
to attach the uncertainty information to the value:
from decimal import Decimal
from typing import Annotated
from isqx import KG, StdUncertainty
CONST_FOO: Annotated[Decimal, KG, StdUncertainty(89)] = Decimal("12.3456")
PI
¤
PI: Final[_PI] = _PI()
The ratio of the circumference of a circle to its diameter ISO 80000-2:2019 2-14.1.
AnnotatedMetadata
¤
AnnotatedMetadata(
unit: Expr | None,
std_uncertainty: StdUncertainty | None,
)
from_args
¤
from_args(args: Sequence[Any]) -> AnnotatedMetadata
Extract metadata from the args of an Annotated
type.
Example:
>>> from typing import Annotated
>>> from isqx import KG, StdUncertainty
>>> from dataclasses import dataclass
>>> @dataclass
... class Foo:
... class_member: Annotated[float, KG, StdUncertainty(13)]
...
>>> def bar(function_arg: Annotated[float, KG]) -> None:
... ...
...
>>> from isqx import AnnotatedMetadata
>>> def print_metadata(obj) -> None:
... for name, ann in get_type_hints(obj, include_extras=True).items():
... print(f"{name}: {AnnotatedMetadata.from_args(get_args(ann))}")
...
>>> print_metadata(Foo)
class_member: AnnotatedMetadata(unit=kilogram, std_uncertainty=StdUncertainty(value=13))
>>> print_metadata(bar)
function_arg: AnnotatedMetadata(unit=kilogram)
return: AnnotatedMetadata(unit=None)
Source code in src/isqx/_core.py
1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 |
|
module_attribute_metadata
¤
module_attribute_metadata(
module_rt: ModuleType,
) -> Generator[tuple[str, AnnotatedMetadata], None, None]
Yields all (name, metadata) pairs for module attributes that are annotated with valid unit expressions and/or standard uncertainties in the given module.
Effectively returns the units and uncertainties of all constants. Example:
>>> from isqx import module_attribute_metadata, iso80000
>>> for name, metadata in module_attribute_metadata(iso80000):
... print(f"{name}: {metadata}")
...
CONST_SPEED_OF_LIGHT_VACUUM: AnnotatedMetadata(unit=meter · second⁻¹)
CONST_PLANCK: AnnotatedMetadata(unit=joule · second
- joule = newton · meter
- newton = kilogram · meter · second⁻²)
CONST_REDUCED_PLANCK: AnnotatedMetadata(unit=joule · second
- joule = newton · meter
- newton = kilogram · meter · second⁻²)
...
Source code in src/isqx/_core.py
1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 |
|
Anchor
¤
A simple wrapper over a text with an external link.
It is used to:
- yield a bare string or a "link" in
isqx.BasicFormatter
. - create a hyperlink in the where clause of a definition
- render a link in the HTML documentation.
CompositionError
¤
Bases: IsqxError
__str__
¤
__str__() -> str
Source code in src/isqx/_core.py
1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 |
|
MixedKindError
¤
Bases: IsqxError
__str__
¤
__str__() -> str
Source code in src/isqx/_core.py
1892 1893 1894 1895 1896 1897 1898 1899 |
|
DimensionMismatchError
¤
Bases: IsqxError
__str__
¤
__str__() -> str
Source code in src/isqx/_core.py
1923 1924 1925 1926 1927 1928 1929 |
|
UnitKindMismatchError
¤
Bases: IsqxError
__str__
¤
__str__() -> str
Source code in src/isqx/_core.py
1939 1940 1941 1942 1943 1944 1945 1946 1947 |
|
NonLinearConversionError
¤
Bases: IsqxError
__str__
¤
__str__() -> str
Source code in src/isqx/_core.py
1955 1956 1957 1958 1959 1960 1961 1962 1963 |
|
DuplicateAnnotationError
¤
DuplicateAnnotationError(
annotation_args: Sequence[Any],
conflicting_arg: _TaggedAllowedExpr | StdUncertainty,
)
Bases: IsqxError
__str__
¤
__str__() -> str
Source code in src/isqx/_core.py
1971 1972 1973 1974 1975 1976 1977 |
|
_fmt
¤
fmt
¤
Source code in src/isqx/_fmt.py
54 55 56 57 58 59 60 61 62 |
|
Formatter
¤
Bases: Protocol
fmt
¤
fmt(expr: Expr) -> Generator[StrFragment, None, None]
Source code in src/isqx/_fmt.py
67 |
|
Precedence
¤
PRECEDENCE
¤
PRECEDENCE: dict[type[Expr], Precedence] = {
Mul: Precedence.MUL,
Scaled: Precedence.SCALED,
Log: Precedence.LOG,
Tagged: Precedence.TAGGED,
Exp: Precedence.EXP,
BaseUnit: Precedence.ATOM,
BaseDimension: Precedence.ATOM,
Dimensionless: Precedence.ATOM,
Aliased: Precedence.ATOM,
Translated: Precedence.ATOM,
}
Visitor
¤
Bases: Protocol[_VisitorState, _VisitorResult]
visit_named
¤
visit_named(
expr: NamedExpr, state: _VisitorState
) -> _VisitorResult
Source code in src/isqx/_fmt.py
103 104 105 |
|
visit_exp
¤
visit_exp(
expr: Exp, state: _VisitorState
) -> _VisitorResult
Source code in src/isqx/_fmt.py
107 |
|
visit_mul
¤
visit_mul(
expr: Mul, state: _VisitorState
) -> _VisitorResult
Source code in src/isqx/_fmt.py
109 |
|
visit_scaled
¤
visit_scaled(
expr: Scaled, state: _VisitorState
) -> _VisitorResult
Source code in src/isqx/_fmt.py
111 112 113 |
|
visit_tagged
¤
visit_tagged(
expr: Tagged, state: _VisitorState
) -> _VisitorResult
Source code in src/isqx/_fmt.py
115 116 117 |
|
visit_translated
¤
visit_translated(
expr: Translated, state: _VisitorState
) -> _VisitorResult
Source code in src/isqx/_fmt.py
119 120 121 |
|
visit_expr
¤
visit_expr(
visitor: Visitor[_VisitorState, _VisitorResult],
expr: Expr,
state: _VisitorState,
) -> _VisitorResult
Source code in src/isqx/_fmt.py
126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 |
|
BasicFormatter
¤
BasicFormatter(
overrides: dict[Name, str] = dict(),
verbose: bool = False,
infix_mul: str = " · ",
)
Bases: Visitor[_BasicFormatterState, Generator[StrFragment, None, None]]
, Formatter
fmt
¤
fmt(expr: Expr) -> Generator[StrFragment, None, None]
Source code in src/isqx/_fmt.py
179 180 181 182 183 184 185 186 187 188 189 190 191 |
|
visit
¤
visit(
expr: Expr, state: _BasicFormatterState
) -> Generator[StrFragment, None, None]
Source code in src/isqx/_fmt.py
223 224 225 226 227 228 229 230 231 232 |
|
visit_named
¤
visit_named(
expr: NamedExpr, state: _BasicFormatterState
) -> Generator[StrFragment, None, None]
Source code in src/isqx/_fmt.py
236 237 238 239 240 241 242 243 244 245 246 |
|
visit_tagged
¤
visit_tagged(
expr: Tagged, state: _BasicFormatterState
) -> Generator[StrFragment, None, None]
Source code in src/isqx/_fmt.py
248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 |
|
visit_exp
¤
visit_exp(
expr: Exp, state: _BasicFormatterState
) -> Generator[StrFragment, None, None]
Source code in src/isqx/_fmt.py
299 300 301 302 303 304 |
|
visit_mul
¤
visit_mul(
expr: Mul, state: _BasicFormatterState
) -> Generator[StrFragment, None, None]
Source code in src/isqx/_fmt.py
306 307 308 309 310 311 312 313 314 |
|
visit_scaled
¤
visit_scaled(
expr: Scaled, state: _BasicFormatterState
) -> Generator[StrFragment, None, None]
Source code in src/isqx/_fmt.py
316 317 318 319 320 321 322 323 324 325 |
|
visit_translated
¤
visit_translated(
expr: Translated, state: _BasicFormatterState
) -> Generator[StrFragment, None, None]
Source code in src/isqx/_fmt.py
327 328 329 330 |
|
visit_log
¤
visit_log(
expr: Log, state: _BasicFormatterState
) -> Generator[StrFragment, None, None]
Source code in src/isqx/_fmt.py
332 333 334 335 336 337 338 339 340 341 342 343 |
|
_citations
¤
Citations for isqx
.
They can be used for cross-references in the documentation, e.g.
see [special publication 811][isqx._citations.SP811]
.
A tiny griffe extension is used to copy the runtime value into the docstring.
SI
¤
SI = "```bibtex\n@techreport{si,\n author = {{Bureau International des Poids et Mesures}},\n title = {The International System of Units ({SI})},\n edition = {9th},\n year = {2019},\n note = {Version 3.01, updated August 2024},\n institution = {Bureau International des Poids et Mesures (BIPM)},\n address = {Sèvres, France},\n url = {https://www.bipm.org/documents/20126/41483022/SI-Brochure-9-EN.pdf}\n}\n```"
@techreport{si,
author = {{Bureau International des Poids et Mesures}},
title = {The International System of Units ({SI})},
edition = {9th},
year = {2019},
note = {Version 3.01, updated August 2024},
institution = {Bureau International des Poids et Mesures (BIPM)},
address = {Sèvres, France},
url = {https://www.bipm.org/documents/20126/41483022/SI-Brochure-9-EN.pdf}
}
IUPAP1
¤
IUPAP1 = "```bibtex\n@techreport{iupap1,\n author = {{IUPAP Commission C2 on Symbols, Units, Nomenclature, Atomic Masses and Fundamental Constants}},\n title = {Symbols, Units, Nomenclature and Fundamental Constants in Physics},\n year = {1987},\n institution = {International Union of Pure and Applied Physics (IUPAP)},\n url = {https://archive2.iupap.org/wp-content/uploads/2014/05/A4.pdf}\n}\n```"
@techreport{iupap1,
author = {{IUPAP Commission C2 on Symbols, Units, Nomenclature, Atomic Masses and Fundamental Constants}},
title = {Symbols, Units, Nomenclature and Fundamental Constants in Physics},
year = {1987},
institution = {International Union of Pure and Applied Physics (IUPAP)},
url = {https://archive2.iupap.org/wp-content/uploads/2014/05/A4.pdf}
}
SP811
¤
SP811 = "```bibtex\n@techreport{sp811,\n title = {Guide for the Use of the International System of Units ({SI})},\n year = {2008},\n edition = {2008},\n institution = {National Institute of Standards and Technology},\n type = {Special Publication},\n number = {811},\n address = {Gaithersburg, MD},\n url = {https://www.nist.gov/pml/special-publication-811}\n}\n```"
@techreport{sp811,
title = {Guide for the Use of the International System of Units ({SI})},
year = {2008},
edition = {2008},
institution = {National Institute of Standards and Technology},
type = {Special Publication},
number = {811},
address = {Gaithersburg, MD},
url = {https://www.nist.gov/pml/special-publication-811}
}
CODATA2022
¤
CODATA2022 = "```bibtex\n@techreport{codata2022,\n title = {{CODATA} Recommended Values of the Fundamental Physical Constants: 2022},\n year = {2024},\n month = {May},\n institution = {National Institute of Standards and Technology},\n type = {Special Publication},\n number = {961},\n url = {https://physics.nist.gov/cuu/pdf/sp961.pdf}\n}\n```"
@techreport{codata2022,
title = {{CODATA} Recommended Values of the Fundamental Physical Constants: 2022},
year = {2024},
month = {May},
institution = {National Institute of Standards and Technology},
type = {Special Publication},
number = {961},
url = {https://physics.nist.gov/cuu/pdf/sp961.pdf}
}
ISO_80000_2
¤
ISO_80000_2 = "```bibtex\n@standard{iso_80000_2,\n organization = {International Organization for Standardization},\n title = {Quantities and units - Part 2: Mathematics},\n year = {2019},\n number = {ISO 80000-2:2019},\n url = {https://www.iso.org/standard/76921.html}\n}\n```"
@standard{iso_80000_2,
organization = {International Organization for Standardization},
title = {Quantities and units - Part 2: Mathematics},
year = {2019},
number = {ISO 80000-2:2019},
url = {https://www.iso.org/standard/76921.html}
}
ISO_80000_3
¤
ISO_80000_3 = "```bibtex\n@standard{iso_80000_3,\n organization = {International Organization for Standardization},\n title = {Quantities and units - Part 3: Space and time},\n year = {2019},\n number = {ISO 80000-3:2019},\n url = {https://www.iso.org/standard/64974.html}\n}\n```"
@standard{iso_80000_3,
organization = {International Organization for Standardization},
title = {Quantities and units - Part 3: Space and time},
year = {2019},
number = {ISO 80000-3:2019},
url = {https://www.iso.org/standard/64974.html}
}
ISO_80000_4
¤
ISO_80000_4 = "```bibtex\n@standard{iso_80000_4,\n organization = {International Organization for Standardization},\n title = {Quantities and units - Part 4: Mechanics},\n year = {2019},\n number = {ISO 80000-4:2019},\n url = {https://www.iso.org/standard/64975.html}\n}\n```"
@standard{iso_80000_4,
organization = {International Organization for Standardization},
title = {Quantities and units - Part 4: Mechanics},
year = {2019},
number = {ISO 80000-4:2019},
url = {https://www.iso.org/standard/64975.html}
}
ISO_80000_5
¤
ISO_80000_5 = "```bibtex\n@standard{iso_80000_5,\n organization = {International Organization for Standardization},\n title = {Quantities and units - Part 5: Thermodynamics},\n year = {2019},\n number = {ISO 80000-5:2019},\n url = {https://www.iso.org/standard/64976.html}\n}\n```"
@standard{iso_80000_5,
organization = {International Organization for Standardization},
title = {Quantities and units - Part 5: Thermodynamics},
year = {2019},
number = {ISO 80000-5:2019},
url = {https://www.iso.org/standard/64976.html}
}
IEC_80000_6
¤
IEC_80000_6 = "```bibtex\n@standard{iec_80000_6,\n organization = {International Electrotechnical Commission},\n title = {Quantities and units - Part 6: Electromagnetism},\n year = {2022},\n number = {IEC 80000-6:2022},\n url = {https://www.iso.org/standard/77846.html}\n}\n```"
@standard{iec_80000_6,
organization = {International Electrotechnical Commission},
title = {Quantities and units - Part 6: Electromagnetism},
year = {2022},
number = {IEC 80000-6:2022},
url = {https://www.iso.org/standard/77846.html}
}
IEV
¤
IEV = "```bibtex\n@misc{iev,\n author = {{IEC}},\n title = {Electropedia - International Electrotechnical Vocabulary},\n organization = {International Electrotechnical Commission},\n url = {https://www.electropedia.org/}\n}\n```"
@misc{iev,
author = {{IEC}},
title = {Electropedia - International Electrotechnical Vocabulary},
organization = {International Electrotechnical Commission},
url = {https://www.electropedia.org/}
}
ISO_80000_7
¤
ISO_80000_7 = "```bibtex\n@standard{iso_80000_7,\n organization = {International Organization for Standardization},\n title = {Quantities and units - Part 7: Light and radiation},\n year = {2019},\n number = {ISO 80000-7:2019},\n url = {https://www.iso.org/standard/64977.html}\n}\n```"
@standard{iso_80000_7,
organization = {International Organization for Standardization},
title = {Quantities and units - Part 7: Light and radiation},
year = {2019},
number = {ISO 80000-7:2019},
url = {https://www.iso.org/standard/64977.html}
}
ISO_80000_8
¤
ISO_80000_8 = "```bibtex\n@standard{iso_80000_8,\n organization = {International Organization for Standardization},\n title = {Quantities and units - Part 8: Acoustics},\n year = {2020},\n number = {ISO 80000-8:2020},\n url = {https://www.iso.org/standard/64978.html}\n}\n```"
@standard{iso_80000_8,
organization = {International Organization for Standardization},
title = {Quantities and units - Part 8: Acoustics},
year = {2020},
number = {ISO 80000-8:2020},
url = {https://www.iso.org/standard/64978.html}
}
ISO_80000_9
¤
ISO_80000_9 = "```bibtex\n@standard{iso_80000_9,\n organization = {International Organization for Standardization},\n title = {Quantities and units - Part 9: Physical chemistry and molecular physics},\n year = {2019},\n number = {ISO 80000-9:2019},\n url = {https://www.iso.org/standard/64979.html}\n}\n```"
@standard{iso_80000_9,
organization = {International Organization for Standardization},
title = {Quantities and units - Part 9: Physical chemistry and molecular physics},
year = {2019},
number = {ISO 80000-9:2019},
url = {https://www.iso.org/standard/64979.html}
}
ISO_80000_10
¤
ISO_80000_10 = "```bibtex\n@standard{iso_80000_10,\n organization = {International Organization for Standardization},\n title = {Quantities and units - Part 10: Atomic and nuclear physics},\n year = {2019},\n number = {ISO 80000-10:2019},\n url = {https://www.iso.org/standard/64980.html}\n}\n```"
@standard{iso_80000_10,
organization = {International Organization for Standardization},
title = {Quantities and units - Part 10: Atomic and nuclear physics},
year = {2019},
number = {ISO 80000-10:2019},
url = {https://www.iso.org/standard/64980.html}
}
ISO_80000_11
¤
ISO_80000_11 = "```bibtex\n@standard{iso_80000_11,\n organization = {International Organization for Standardization},\n title = {Quantities and units - Part 11: Characteristic numbers},\n year = {2019},\n number = {ISO 80000-11:2019},\n url = {https://www.iso.org/standard/64982.html}\n}\n```"
@standard{iso_80000_11,
organization = {International Organization for Standardization},
title = {Quantities and units - Part 11: Characteristic numbers},
year = {2019},
number = {ISO 80000-11:2019},
url = {https://www.iso.org/standard/64982.html}
}
ISO_80000_12
¤
ISO_80000_12 = "```bibtex\n@standard{iso_80000_12,\n organization = {International Organization for Standardization},\n title = {Quantities and units - Part 12: Solid state physics},\n year = {2019},\n number = {ISO 80000-12:2019},\n url = {https://www.iso.org/standard/63480.html}\n}\n```"
@standard{iso_80000_12,
organization = {International Organization for Standardization},
title = {Quantities and units - Part 12: Solid state physics},
year = {2019},
number = {ISO 80000-12:2019},
url = {https://www.iso.org/standard/63480.html}
}
ISO_80000_13
¤
ISO_80000_13 = "```bibtex\n@standard{iso_80000_13,\n organization = {International Organization for Standardization},\n title = {Quantities and units - Part 13: Information science and technology},\n year = {2025},\n number = {ISO 80000-13},\n url = {https://www.iso.org/standard/87648.html}\n}\n```"
@standard{iso_80000_13,
organization = {International Organization for Standardization},
title = {Quantities and units - Part 13: Information science and technology},
year = {2025},
number = {ISO 80000-13},
url = {https://www.iso.org/standard/87648.html}
}
MP_UNITS
¤
MP_UNITS = "```bibtex\n@software{mp_units,\n author = {Pusz, Mateusz and Guerrero Peña, Johel Ernesto and Hogg, Chip and {The mp-units project team}},\n license = {MIT},\n month = nov,\n title = {{mp-units}},\n url = {https://github.com/mpusz/mp-units},\n version = {2.4.0},\n year = {2024}\n}\n```"
@software{mp_units,
author = {Pusz, Mateusz and Guerrero Peña, Johel Ernesto and Hogg, Chip and {The mp-units project team}},
license = {MIT},
month = nov,
title = {{mp-units}},
url = {https://github.com/mpusz/mp-units},
version = {2.4.0},
year = {2024}
}
H44
¤
H44 = "```bibtex\n@techreport{h44,\n author = {{NIST}},\n title = {NIST Handbook 44 - 2024 - Appendix C. General Tables of Units of Measurement},\n year = {2024},\n institution = {National Institute of Standards and Technology},\n url = {https://www.nist.gov/document/nist-handbook-44-2024-appendix-c-pdf}\n}\n```"
@techreport{h44,
author = {{NIST}},
title = {NIST Handbook 44 - 2024 - Appendix C. General Tables of Units of Measurement},
year = {2024},
institution = {National Institute of Standards and Technology},
url = {https://www.nist.gov/document/nist-handbook-44-2024-appendix-c-pdf}
}
WMA1985
¤
WMA1985 = "```bibtex\n@misc{wma1985,\n title = {Weights and Measures Act 1985},\n year = {1985},\n organization = {{legislation.gov.uk}},\n url = {https://www.legislation.gov.uk/ukpga/1985/72/contents}\n}\n```"
@misc{wma1985,
title = {Weights and Measures Act 1985},
year = {1985},
organization = {{legislation.gov.uk}},
url = {https://www.legislation.gov.uk/ukpga/1985/72/contents}
}
ICAO
¤
ICAO = "```bibtex\n@misc{icao,\n author = {{ICAO}},\n title = {Annex 5 - Units of Measurement to be Used in the Air and Ground Services},\n organization = {International Civil Aviation Organization},\n url = {https://store.icao.int/en/annex-5-units-of-measurement-to-be-used-in-the-air-and-ground-services}\n}\n```"
@misc{icao,
author = {{ICAO}},
title = {Annex 5 - Units of Measurement to be Used in the Air and Ground Services},
organization = {International Civil Aviation Organization},
url = {https://store.icao.int/en/annex-5-units-of-measurement-to-be-used-in-the-air-and-ground-services}
}