src.pydasa.elements.specs.symbolic#
Symbolic perspective for variable representation.
This module defines the SymbolicSpecs class representing the mathematical and notational properties of a variable.
- Classes:
SymbolicSpecs: Symbolic variable specifications
IMPORTANT: Based on the theory from:
# H.Gorter, Dimensionalanalyse: Eine Theoririe der physikalischen Dimensionen mit Anwendungen
Classes#
Symbolic perspective: mathematical representation. Answers the question: "How do we WRITE this variable?" |
Module Contents#
- class src.pydasa.elements.specs.symbolic.SymbolicSpecs#
Symbolic perspective: mathematical representation. Answers the question: “How do we WRITE this variable?”
- This perspective focuses on:
Symbol notation (LaTeX, Python alias)
Dimensional formulas (L, M, T, etc.)
Unit systems (original and standardized)
Matrix representation for linear algebra
Integration with symbolic math libraries
- # From SymbolicSpecs
_dims (str): Dimensional expression (e.g., “L*T^-1”). _units (str): Units of measure (e.g., “m/s”). _std_dims (Optional[str]): Standardized dimensional expression. e.g.: from [T^2*L^-1] to [L^(-1)*T^(2)]. _sym_exp (Optional[str]): Sympy-compatible dimensional expression. e.g.: from [T^2*L^-1] to [T**2*L**(-1)]. _dim_col (List[int]): Dimensional column for matrix operations. e.g.: from [T^2*L^-1] to [2, -1]. _std_units (str): Standardized units of measure. e.g km/h -> m/s, kByte/s -> bit/s.
- _schema: pydasa.dimensional.vaschy.Schema | None#
- _std_dims: str | None = None#
from [T^2*L^-1] to [L^(-1)*T^(2)].
- Type:
Standardized dimensional expression. e.g.
- _sym_exp: str | None = None#
from [T^2*L^-1] to [T**2*L**(-1)].
- Type:
Sympy-compatible dimensional expression. e.g.
- _dim_col: List[int] = []#
from [T^2*L^-1] to [2, -1].
- Type:
Dimensional column for matrix operations. e.g.
- _validate_exp(exp, regex)#
_validate_exp() Validates an expression using a regex pattern (inclde dimensions and units,).
- _prepare_dims()#
_prepare_dims() Processes dimensional expressions for analysis.
Standardizes and sorts dimensions, creates sympy expression and dimensional column.
- Return type:
None
- _standardize_dims(dims)#
_standardize_dims() Standardizes dimensional expression format.
- _sort_dims(dims)#
_sort_dims() Sorts dimensions based on FDU precedence.
- _setup_sympy(dims)#
_setup_sympy() Creates sympy-compatible expression.
- _setup_column(dims)#
_setup_column() Generates dimensional column (list of exponents) in the Dimensional Matrix.
- Parameters:
dims (str) – Standardized dimensional expression. e.g.: [T^(2)*L^(-1)]
- Returns:
Exponents with the dimensional expression. e.g.: [2, -1]
- Return type:
List[int]
- Raises:
ValueError – If dimensional expression cannot be parsed.
- property dims: str#
dims Get the dimensional expression.
- Returns:
Dimensions. e.g.: [T^2*L^-1]
- Return type:
- property units: str#
units Get the units of measure.
- Returns:
Units of measure. e.g.: m/s, kg/m3, etc.
- Return type:
- property sym_exp: str | None#
sym_exp Get Sympy-compatible expression.
- Returns:
Sympy expression. e.g.: [T**2*L**(-1)]
- Return type:
Optional[str]
- property dim_col: List[int] | None#
dim_col Get dimensional column.
- Returns:
Dimensional exponents. e.g.: [2, -1]
- Return type:
Optional[List[int]]
- property std_dims: str | None#
std_dims Get the standardized dimensional expression.
- Returns:
Standardized dimensional expression. e.g.: [L^(-1)*T^(2)]
- Return type:
Optional[str]
- property std_units: str | None#
std_units Get the standardized Unit of Measure.
- Returns:
standardized Unit of Measure.
- Return type:
Optional[str]
- clear()#
clear() Reset symbolic attributes to default values.
Resets dimensions, units, and all processed dimensional attributes.
- Return type:
None