src.pydasa.dimensional.vaschy#
Module for Schema to manage Fundamental Dimensional Units (FDUs) for Dimensional Analysis in PyDASA.
This module provides the Schema class which manages dimensional frameworks, FDU precedence, and regex patterns for dimensional expression validation.
- Classes:
Schema: Manages dimensional frameworks and FDUs, providing methods for validation,
IMPORTANT: Based on the theory from:
# H.Gorter, Dimensionalanalyse: Eine Theoririe der physikalischen Dimensionen mit Anwendungen
Classes#
Schema Manages dimensional frameworks and FDUs for PyDASA. |
Module Contents#
- class src.pydasa.dimensional.vaschy.Schema#
Bases:
pydasa.core.basic.FoundationSchema Manages dimensional frameworks and FDUs for PyDASA.
Maintains a collection of Dimensions with their precedence, provides regex patterns for dimensional expressions, and manages the dimensional framework context.
- Parameters:
Foundation – Foundation class for validation of symbols and frameworks.
- _fdu_regex#
Regex pattern for matching dimensional expressions (e.g., ‘M/L*T^-2’ to ‘M^1*L^-1*T^-2’).
- Type:
- _fdu_pow_regex#
Regex pattern for matching dimensions with exponents. (e.g., ‘M*L^-1*T^-2’ to ‘M^(1)*L^(-1)*T^(-2)’).
- Type:
- _fdu_no_pow_regex#
Regex pattern for matching dimensions without exponents. (e.g., ‘M*L*T’ to ‘M^(1)*L^(1)*T^(1)’).
- Type:
- _fdu_sym_regex#
Regex pattern for matching FDUs in symbolic expressions. (e.g., ‘M^(1)*L^(-1)*T^(-2)’ to ‘L**(-1)*M**(1)*T**(-2)’).
- Type:
- __post_init__()#
__post_init__() Initializes the framework and sets up regex patterns.
- Return type:
None
- property fdu_lt: List[pydasa.dimensional.fundamental.Dimension]#
fdu_lt Get the list of FDUs in precedence order.
- Returns:
List of FDUs.
- Return type:
List[Dimension]
- property fdu_symbols: List[str]#
fdu_symbols Get the list of FDU symbols in precedence order.
- Returns:
List of FDU symbols.
- Return type:
List[str]
- property size: int#
size Get the number of FDUs in the framework.
- Returns:
Number of FDUs.
- Return type:
- property fdu_regex: str#
fdu_regex Get the FDU regex pattern.
- Returns:
Regex pattern for validating dimensional expressions.
- Return type:
- property fdu_pow_regex: str#
fdu_pow_regex Get the FDU powered regex pattern.
- Returns:
Regex pattern for matching dimensions with exponents.
- Return type:
- property fdu_no_pow_regex: str#
fdu_no_pow_regex Get the FDU no-power regex pattern.
- Returns:
Regex pattern for matching dimensions without exponents.
- Return type:
- property fdu_sym_regex: str#
fdu_sym_regex Get the FDU symbol regex pattern.
- Returns:
Regex pattern for matching FDUs in symbolic expressions.
- Return type:
- get_fdu(symbol)#
get_fdu() Get an FDU by its symbol.
- has_fdu(symbol)#
has_fdu() Check if an FDU with the given symbol exists.
- add_fdu(fdu)#
add_fdu() Add an FDU to the framework.
- Parameters:
fdu (Dimension) – FDU to add.
- Raises:
ValueError – If an FDU with the same symbol already exists.
ValueError – If the FDU framework does not match the current framework.
- Return type:
None
- remove_fdu(sym)#
remove_fdu() Remove an FDU from the framework.
- reset()#
- Return type:
None