Skip to content

isqx.details

details ¤

Dimensionless quantities and quantity kinds themselves do not store the precise definition of how it is derived.

This module contains optional details that "link" them together. It is stored in a dictionary of expressions to its details. A detail can contain multiple equations or common symbols.

Our mkdocs plugin reads dictionaries from this module to "inject" information into docstrings.

SELF ¤

SELF = _RefSelf()

A special marker to represent a reference to "itself" in the meaning of a definition's where clause.

RefDetail ¤

RefDetail: TypeAlias = Union[
    QtyKind, Dimensionless, Tagged, LazyProduct, Number
]

A reference to a quantity kind, dimensionless number, a numerical constant, or a string

WhereFragment ¤

WhereFragment: TypeAlias = Union[
    _RefSelf, RefDetail, StrFragment
]

WhereValue ¤

WhereValue: TypeAlias = Union[
    WhereFragment, tuple[WhereFragment, ...]
]

Where ¤

Where: TypeAlias = dict[str, WhereValue]

Wikidata ¤

Wikidata(qcode: str)

Stores the Wikidata Q-code for a quantity kind.

qcode ¤

qcode: str

HasKaTeXWhere ¤

Bases: Protocol

katex ¤

katex: str

A \(\KaTeX\) string

where ¤

where: Where | None

A mapping of the symbols in the \(\KaTeX\) string to their meanings.

Symbol ¤

Symbol(
    katex: str,
    where: Where | None = None,
    remarks: str | None = None,
)

Bases: HasKaTeXWhere

Stores a common symbol for a quantity kind.

Since the equation class already contains the symbol, adding the symbol is not necessary. However, it is useful when the quantity kind is not defined by an equation.

katex ¤

katex: str

where ¤

where: Where | None = None

remarks ¤

remarks: str | None = None

A description of when this symbol should be used, e.g. for mole fraction, x_X is used for condensed phase and y_X is used for gaseous mixtures.

Equation ¤

Equation(
    katex: str,
    where: Where | None = None,
    assumptions: set[StrFragment | tuple[StrFragment, ...]]
    | None = None,
)

Bases: HasKaTeXWhere

Stores the equation for a quantity kind.

katex ¤

katex: str

where ¤

where: Where | None = None

assumptions ¤

assumptions: (
    set[StrFragment | tuple[StrFragment, ...]] | None
) = None

A set of assumptions under which the definition is valid.

DetailKey ¤

DetailKey: TypeAlias = Union[
    QtyKind,
    Dimensionless,
    Tagged,
    Scaled,
    LazyProduct,
    Number,
]

Detail ¤

Detail: TypeAlias = Union[Wikidata, Symbol, Equation]

Details ¤

Details: TypeAlias = dict[
    Union[DetailKey, Callable[..., DetailKey]],
    Union[Detail, tuple[Detail, ...]],
]