Package PyDSTool :: Module Symbolic :: Class QuantSpec
[hide private]
[frames] | no frames]

Class QuantSpec

source code

object --+
         |
        QuantSpec

Specification for a symbolic numerical quantity.

Instance Methods [hide private]
 
__init__(self, subjectToken, specStr='', specType=None, includeProtected=True, treatMultiRefs=True, preserveSpace=False, ignoreSpecial=None)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
_check_self_ref(self) source code
 
redefine(self, specStr) source code
 
isspecdefined(self) source code
 
isDefined(self, verbose=False) source code
 
__call__(self, *args)
str(x)
source code
 
isCompound(self, ops=['+', '-', '*', '/']) source code
 
__contains__(self, tok) source code
 
__getitem__(self, ix) source code
 
__setitem__(self, ix, s) source code
 
__delitem__(self, ix) source code
 
__combine(self, other, opstr, reverseorder=0) source code
 
__add__(self, other) source code
 
__mul__(self, other) source code
 
__sub__(self, other) source code
 
__div__(self, other) source code
 
__radd__(self, other) source code
 
__rmul__(self, other) source code
 
__rsub__(self, other) source code
 
__rdiv__(self, other) source code
 
__truediv__(self, other) source code
 
__rtruediv__(self, other) source code
 
__rpow__(self, other) source code
 
__pow__(self, other, reverseorder=0) source code
 
__neg__(self) source code
 
__pos__(self) source code
 
__len__(self) source code
 
__repr__(self)
repr(x)
source code
 
__str__(self, *args)
str(x)
source code
 
__eq__(self, other, diff=False) source code
 
__ne__(self, other) source code
 
difference(self, other)
Show differences in comparison to another QuantSpec.
source code
 
isvector(self)
Is the quantity spec of the form [a,b,c]
source code
 
fromvector(self, ix=None)
Turn the QuantSpec's specification of a vector to a list of the element's specifications.
source code
 
simplify(self)
Simplify expression *IN PLACE*, but do not substitute terms from other quantities or reduce constants such as Pi to a floating point number.
source code
 
renderForCode(self)
Return code-ready version of spec (e.g.
source code
 
eval(self, *scopearg, **defs)
Evaluate expression, in an optional scope dictionary (defaults to locals).
source code
 
_eval(self, eval_type, *scopearg, **defs)
Internal helper function for eval.
source code
 
tonumeric(self) source code
 
mapNames(self, nameMap)
Can pass a dictionary or a symbolMapClass instance to this method, but it will convert it internally to a symbolMapClass.
source code
 
__copy__(self) source code
 
__deepcopy__(self, memo=None, _nil=[]) source code

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, subjectToken, specStr='', specType=None, includeProtected=True, treatMultiRefs=True, preserveSpace=False, ignoreSpecial=None)
(Constructor)

source code 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Overrides: object.__init__
(inherited documentation)

__repr__(self)
(Representation operator)

source code 

repr(x)

Overrides: object.__repr__
(inherited documentation)

__str__(self, *args)
(Informal representation operator)

source code 

str(x)

Overrides: object.__str__
(inherited documentation)

renderForCode(self)

source code 

Return code-ready version of spec (e.g. uncapitalize built-in function names)

eval(self, *scopearg, **defs)

source code 

Evaluate expression, in an optional scope dictionary (defaults to locals). Explicit definitions override scope dictionary definitions.

Scope dictionary maps variable name -> defining object.

_eval(self, eval_type, *scopearg, **defs)

source code 

Internal helper function for eval. The use of indirection using _eval actually allows the correct scope to be accessed by whoQ when this function automatically collects definitions.