|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
convertPowers(s,
target='pow')
convertPowers takes a string argument and maps all occurrences of
power sub-expressions into the chosen target syntax. |
source code
|
|
|
|
ensureints(t)
Ensure that any floating point constants appearing in t that are
round numbers get converted to integer representations. |
source code
|
|
|
|
splitargs(da,
lbraces=['('],
rbraces=[')'])
Function to split string-delimited arguments in a string without
being fooled by those that occur in function calls. |
source code
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| ensureparen(t,
flag=0,
ismul=0,
do_decimal=False) |
source code
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
isHierarchicalName(s,
sep='.',
treatMultiRefs=False) |
source code
|
|
|
|
|
|
|
|
|
|
|
|
|
replaceSepInv(spec)
Invert default name separator replacement. |
source code
|
|
|
|
replaceSep(spec,
sourcesep='.',
targetsep='_')
Replace hierarchy separator character with another and return spec
string. |
source code
|
|
|
|
mapNames(themap,
target)
Map names in <target> argument using the symbolMapClass object
<themap>, returning a renamed version of the target. |
source code
|
|
|
|
| replaceSepQSpec(spec,
sourcesep,
targetsep) |
source code
|
|
|
|
|
|
|
joinStrs(strlist)
Join a list of strings into a single string (in order). |
source code
|
|
|
|
joinAsStrs(objlist,
sep='')
Join a list of objects in their string representational form. |
source code
|
|
|
|
count_sep(specstr,
sep=',')
Count number of specified separators (default = ',') in given string,
avoiding occurrences of the separator inside nested braces |
source code
|
|
|
|
parseMatrixStrToDictStr(specstr,
specvars,
m=0)
Convert string representation of m-by-n matrix into a single string,
assuming a nested comma-delimited list representation in the input,
and outputting a dictionary of the sub-lists, indexed by the ordered
list of names specvars (specified as an argument). |
source code
|
|
|
|
readArgs(argstr,
lbchar='(',
rbchar=')')
Parse arguments out of string beginning and ending with braces
(default: round brace). |
source code
|
|
|
|
findEndBrace(s,
lbchar='(',
rbchar=')')
Find position in string (or list of strings), s, at which final
matching brace occurs (if at all). |
source code
|
|
|
|
makeParList(objlist,
prefix='')
wrap objlist into a comma separated string of str(objects) |
source code
|
|
|
|
wrapArgInCall(source,
callfn,
wrapL,
wrapR=None,
argnums=[0],
notFirst=False)
Add delimiters to single argument in function call. |
source code
|
|
|
|
replaceCallsWithDummies(source,
callfns,
used_dummies=None,
notFirst=False)
Replace all function calls in source with dummy names, for the
functions listed in callfns. |
source code
|
|
|
|
addArgToCalls(source,
callfns,
arg,
notFirst='')
Add an argument to calls in source, to the functions listed in
callfns. |
source code
|
|
|
|
proper_match(specstr,
term)
Determine whether string argument 'term' appears one or more times in
string argument 'specstr' as a proper symbol (not just as part of a
longer symbol string or a number). |
source code
|
|
|
|
|
|
|
all
|
|
|
predicate_op
|
|
|
less
|
|
|
putmask
|
|
|
shape
|
|
|
complexfloating
|
|
|
DomainType
|
|
|
swapaxes
|
|
|
float32
|
|
|
int32
|
|
|
greater
|
|
|
float96
|
|
|
complex_
|
|
|
ones
|
|
|
integer
|
|
|
API = API_class()
|
|
|
targetLangs = ['c', 'python', 'matlab']
|
|
|
isfinite
|
|
|
API_class
|
|
|
argmax
|
|
|
sign
|
|
|
Macheps
|
|
|
asarray
|
|
|
Continuous = Continuous Domain
|
|
|
intersect
|
|
|
null_predicate = null_predicate_class(None)
|
|
|
complex64
|
|
|
atleast_1d
|
|
|
Discrete = Discrete Domain
|
|
|
float64
|
|
|
float_
|
|
|
less_equal
|
|
|
os
|
|
|
float
|
|
|
array
|
|
|
log
|
|
|
complex128
|
|
|
zeros
|
|
|
ndarray
|
|
|
int_
|
|
|
complex192
|
|
|
int0
|
|
|
int8
|
|
|
argmin
|
|
|
double
|
|
|
remain
|
|
|
norm
|
|
|
Inf
|
|
|
finfo
|
|
|
spy
|
|
|
clip
|
|
|
int
|
|
|
logical_or
|
|
|
floating
|
|
|
any
|
|
|
null_predicate_class
|
|
|
NaN
|
|
|
sqrt
|
|
|
complex
|
|
|
take
|
|
|
LargestInt32 = 2147483647
|
|
|
fit_function
|
|
|
int16
|
|
|
mat
|
|
|
sys
|
|
|
npy
|
|
|
minpack
|
|
|
types
|
|
|
searchsorted
|
|
|
int64
|
|
|
exp
|
|
|
time
|
|
|
DO_POW = True
|
|
|
DO_DEC = True
|
|
|
protected_scipynames = ['sign', 'mod']
|
|
|
specialfns = ['airy', 'airye', 'ai_zeros', 'bi_zeros', 'ellipj...
|
|
|
protected_specialfns = ['special_airy', 'special_airye', 'spec...
|
|
|
protected_mathnames = ['acos', 'asin', 'atan', 'atan2', 'ceil'...
|
|
|
protected_randomnames = ['BPF', 'LOG4', 'NV_MAGICCONST', 'RECI...
|
|
|
builtin_auxnames = ['globalindepvar', 'initcond', 'heav', 'if'...
|
|
|
protected_macronames = ['for', 'if', 'max', 'min', 'sum']
|
|
|
reserved_keywords = ['and', 'not', 'or', 'del', 'for', 'if', '...
|
|
|
convert_power_reserved_keywords = ['del', 'for', 'if', 'is', '...
|
|
|
protected_allnames = ['acos', 'asin', 'atan', 'atan2', 'ceil',...
|
|
|
builtinFnSigInfo = {'for': 4, 'getbound': 2, 'getindex': 1, 'g...
|
|
|
_functions = ['readArgs', 'findEndBrace', 'makeParList', 'join...
|
|
|
_objects = ['protected_auxnamesDB', 'protected_allnames', 'pro...
|
|
|
_classes = ['symbolMapClass', 'parserObject', 'auxfnDBclass']
|
|
|
_constants = ['name_chars_RE', 'num_chars', 'ZEROS', 'ONES', '...
|
|
|
_symbfuncs = ['simplify', 'simplify_str', 'ensurebare', 'ensur...
|
|
|
_symbconsts = ['syms']
|
|
|
name_chars_RE = re.compile(r'\w')
|
|
|
alphabet_chars_RE = re.compile(r'[a-zA-Z0-9]')
|
|
|
num_chars = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']
|
|
|
POW_STR = 'pow(%s,%s)'
|
|
|
ZEROS = ['0', '0.0', '0.', '(0)', '(0.0)', '(0.)']
|
|
|
ONES = ['1', '1.0', '1.', '(1)', '(1.0)', '(1.)']
|
|
|
TENS = ['10', '10.0', '10.', '(10)', '(10.0)', '(10.)']
|
|
|
NAMESEP = '.'
|
|
|
_indentstr = ' '
|
|
|
syms = {0: 'ENDMARKER', 1: 'NAME', 2: 'NUMBER', 3: 'STRING', 4...
|
|
|
protected_auxnamesDB = ModelSpec internal helper class: auxfnD...
|
|
|
_all_complex = (<type 'complex'>, <type 'numpy.complexfloating...
|
|
|
_all_float = (<type 'float'>, <type 'numpy.floating'>, <type '...
|
|
|
_all_int = (<type 'int'>, <type 'numpy.integer'>, <type 'numpy...
|
|
|
_all_numpy_complex = (<type 'numpy.complex128'>, <type 'numpy....
|
|
|
_all_numpy_float = (<type 'numpy.float64'>, <type 'numpy.float...
|
|
|
_all_numpy_int = (<type 'numpy.int32'>, <type 'numpy.int32'>, ...
|
|
|
_complex_types = (<type 'complex'>, <type 'numpy.complexfloati...
|
|
|
_float_types = (<type 'float'>, <type 'numpy.floating'>)
|
|
|
_int_types = (<type 'int'>, <type 'numpy.integer'>)
|
|
|
_num_equivtype = {<type 'float'>: <type 'numpy.float64'>, <typ...
|
|
|
_num_maxmin = {<type 'numpy.int32'>: [-2147483648, 2147483647]...
|
|
|
_num_name2equivtypes = {'float': (<type 'float'>, <type 'numpy...
|
|
|
_num_name2type = {'float': <type 'numpy.float64'>, 'int': <typ...
|
|
|
_num_type2name = {<type 'float'>: 'float', <type 'int'>: 'int'...
|
|
|
_num_types = (<type 'float'>, <type 'int'>, <type 'numpy.float...
|
|
|
_pytypefromtype = {<type 'numpy.int32'>: <type 'int'>, <type '...
|
|
|
_real_types = (<type 'int'>, <type 'numpy.integer'>, <type 'fl...
|
|
|
_seq_types = (<type 'list'>, <type 'tuple'>, <type 'numpy.ndar...
|
|
|
s = 339
|