src.pydasa.elements.parameter#

Module for representing Variable entities in Dimensional Analysis for PyDASA.

Classes:

Variable: Represents a Variable with dimensional properties, value ranges, and validation.

IMPORTANT: Based on the theory from:

# H.Gorter, Dimensionalanalyse: Eine Theoririe der physikalischen Dimensionen mit Anwendungen

Classes#

Variable

Variable class for Dimensional Analysis in PyDASA.

Module Contents#

class src.pydasa.elements.parameter.Variable#

Bases: pydasa.elements.specs.ConceptualSpecs, pydasa.elements.specs.SymbolicSpecs, pydasa.elements.specs.NumericalSpecs, pydasa.elements.specs.StatisticalSpecs

Variable class for Dimensional Analysis in PyDASA.

A comprehensive implementation that combines Parameter and Variable functionality for use in dimensional analysis calculations, simulations, and sensitivity analysis.

This class composes four philosophical perspectives through multiple inheritance: - ConceptualSpecs: Identity and classification (what IS this variable?) - SymbolicSpecs: Mathematical representation (how do we WRITE it?) - NumericalSpecs: Computational values (what VALUES can it take?) - StatisticalSpecs: Probabilistic modeling (how do we MODEL uncertainty?)

All attributes, properties, and methods are inherited from the spec classes.

This class only provides integration logic and utility methods.

# From Foundation
Type:

via ConceptualSpecs

_name#

User-friendly name of the variable.

Type:

str

description#

Brief summary of the variable.

Type:

str

_idx#

Index/precedence in the dimensional matrix.

Type:

int

_sym#

Symbol representation (LaTeX or alphanumeric).

Type:

str

_alias#

Python-compatible alias for use in code.

Type:

str

_fwk#

Frameworks context (PHYSICAL, COMPUTATION, SOFTWARE, CUSTOM).

Type:

str

# From ConceptualSpecs - Identity and Classification
_cat#

Category (INPUT, OUT, CTRL).

Type:

str

_schema#

Reference to the dimensional framework or FDUs list.

Type:

Schema

relevant#

Flag indicating if variable is relevant for analysis.

Type:

bool

# From SymbolicSpecs - Dimensional Properties
_dims#

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

Type:

str

_units#

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

Type:

str

_sym_exp#

Sympy-compatible expression.

Type:

str

_dim_col#

Dimensional column for matrix operations.

Type:

List[int]

# From SymbolicSpecs - Standardized Dimensional Properties
_std_dims#

Standardized dimensional expression.

Type:

str

_std_units#

Standardized units of measure.

Type:

str

# From NumericalSpecs - Value Ranges
Type:

Original Units

_min#

Minimum value in original units.

Type:

float

_max#

Maximum value in original units.

Type:

float

_mean#

Mean value in original units.

Type:

float

_dev#

Standard deviation in original units.

Type:

float

# From NumericalSpecs - Value Ranges
Type:

Standardized Units

_std_min#

Minimum value in standard units.

Type:

float

_std_max#

Maximum value in standard units.

Type:

float

_std_mean#

Mean value in standard units.

Type:

float

_std_dev#

Standard deviation in standard units.

Type:

float

_step#

Step size for simulations.

Type:

float

_std_range#

Range array for analysis.

Type:

np.ndarray

# From StatisticalSpecs - Distribution Specifications
_dist_type#

Type of distribution (e.g., ‘uniform’, ‘normal’).

Type:

str

_dist_params#

Parameters for the distribution.

Type:

Dict[str, Any]

_depends#

List of variable names that this variable depends on.

Type:

List[str]

_dist_func#

Callable representing the distribution function.

Type:

Callable

__post_init__()#

__post_init__() Initializes the variable and validates its properties.

Performs validation of core properties and processes dimensional expressions. Sets up range arrays if all required values are provided.

Raises:

ValueError – If dimensional expression is invalid.

Return type:

None

clear()#

clear() Reset all attributes to default values.

Resets all variable properties to their initial state by calling clear() on all composed perspective classes.

Return type:

None

to_dict()#

to_dict() Convert variable to dictionary representation.

Returns:

Dictionary representation of variable.

Return type:

Dict[str, Any]

classmethod from_dict(data)#

from_dict() Create variable from dictionary representation.

Parameters:

data (Dict[str, Any]) – Dictionary representation of variable.

Returns:

New variable instance.

Return type:

Variable