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#

SymbolicSpecs

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#
_dims: str = ''#

Dimensional expression (e.g., “L*T^-1”).

_units: str = ''#

Units of measure (e.g., “m/s”).

_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.

_std_units: str = ''#

Standardized units of measure. e.g km/h -> m/s, kByte/s -> bit/s.

_validate_exp(exp, regex)#

_validate_exp() Validates an expression using a regex pattern (inclde dimensions and units,).

Parameters:
  • dims (str) – Dimensions of the parameter. It is a string with the FDU formula of the parameter. e.g.: [T^2*L^-1]

  • exp (str)

  • regex (str)

Returns:

True if the dimensions are valid, False otherwise, ignoring null or empty strings.

Return type:

bool

_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.

Parameters:

dims (str) – Dimensional expression (e.g., “L*T^-1”).

Returns:

Standardized expression with parentheses (e.g., “L^(1)*T^(-1)”).

Return type:

str

_sort_dims(dims)#

_sort_dims() Sorts dimensions based on FDU precedence.

Parameters:

dims (str) – Standardized dimensional expression. e.g.: [T^2*L^-1].

Returns:

Sorted dimensional expression. e.g.: [L^(-1)*T^(2)].

Return type:

str

_setup_sympy(dims)#

_setup_sympy() Creates sympy-compatible expression.

Parameters:

dims (str) – Standardized dimensional expression. e.g.: [T^2*L^-1].

Returns:

Sympy-compatible expression. e.g.: [T**2* L**(-1)].

Return type:

str

_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:

str

property units: str#

units Get the units of measure.

Returns:

Units of measure. e.g.: m/s, kg/m3, etc.

Return type:

str

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