Variables
SymbolWrapper(symbol, description='')
Bases: ABC
A class storing a sympy.Symbol
instance with other attributes.
PARAMETER | DESCRIPTION |
---|---|
symbol
|
the symbol to wrap
TYPE:
|
description
|
an optional description of the container contents
TYPE:
|
Source code in psymple/abstract.py
Variable(symbol, description='')
Bases: SymbolWrapper
A variable is a SymbolWrapper
instance together with a description.
Source code in psymple/abstract.py
Parameter(symbol, value, description='')
Bases: SymbolWrapper
A parameter is a SymbolWrapper
instance together with an
equivalent value and description.
PARAMETER | DESCRIPTION |
---|---|
symbol
|
the symbol to wrap.
TYPE:
|
value
|
the value represented by
TYPE:
|
description
|
an optional description of the container contents.
TYPE:
|
Source code in psymple/variables.py
ExpressionWrapper(expression, parsing_locals={})
Bases: ABC
A class storing a sympy.Basic
object: anything returned by sympy.sympify
.
PARAMETER | DESCRIPTION |
---|---|
expression
|
the expression to wrap. If it is not a
TYPE:
|
parsing_locals
|
a dictionary mapping strings to sympy objects.
TYPE:
|
Source code in psymple/abstract.py
UpdateRule(expression=0, variables=set(), parameters=set(), description='')
Bases: ExpressionWrapper
An update rule is an ExpressionWrapper
that is attached to a Variable
or Parameter
instance. It stores how the variable or parameter will evolve over time. An update rule
tracks the other variables or parameters which appear in its expression, so that it is
fully aware of its system dependencies.
METHOD | DESCRIPTION |
---|---|
sub_symbols |
substitute the symbols contained inside |
PARAMETER | DESCRIPTION |
---|---|
expression
|
the expression to wrap. If it is not a
TYPE:
|
variables
|
a set of variables of which the variables in the expression are a subset
TYPE:
|
parameters
|
a set of parameters of which the parameters in the expression are a subset
TYPE:
|
description
|
description of the rule
TYPE:
|
Source code in psymple/variables.py
sub_symbols(vars_dict, pars_dict)
Substitute the variables and parameters of self
according to dictionary mappings.
PARAMETER | DESCRIPTION |
---|---|
vars_dict
|
a dictionary providing mappings between
TYPE:
|
pars_dict
|
a dictionary providing mappings between
TYPE:
|