Package PyDSTool :: Package Toolbox :: Module NineML
[hide private]
[frames] | no frames]

Module NineML

source code

PySCes interface code for systems biology modeling and SBML model markup.

This toolbox assumes you have PySCes installed.

R. Clewley, 2012

Classes [hide private]
  NineMLModel
Functions [hide private]
 
get_nineml_model(c, model_name, target='Vode', extra_args=None, alg_args=None, max_t=inf)
component is a NineML abstraction layer component, and assumes you have imported a NineML model through the Python API or built it directly.
source code
 
get_regime_model(r, fns, sigs) source code
Variables [hide private]
  acosh
  replaceSepStr
  newton_meth
  norm
  float96
  protected_randomnames
  ONES
  typeCounter
  specialfns
  ensuredecimalconst
  toCircumflexSyntax
  mathlookup
  Continuous = Continuous Domain
  toPowSyntax
  rerr = <PyDSTool.Redirector.Redirector object at 0x1686e50>
  sym2name
  sinh = <ufunc 'sinh'>
  getlftrtD
  doadd
  less_equal = <ufunc 'less_equal'>
  replaceCallsWithDummies
  randomlookup
  cPickle
  replaceSepQSpec
  feval_map_const
  protected_auxnamesDB = ModelSpec internal helper class: auxfnD...
  Inf = inf
  specTypes = ('RHSfuncSpec', 'ImpFuncSpec', 'ExpFuncSpec')
  MReg
  logical_or = <ufunc 'logical_or'>
  errorfields = {0: ['t', 'error info'], 10: ['t', 'event list']}
  tan = <ufunc 'tan'>
  math_dir
  atanh
  name_chars_RE
  temp_macro_names_inv
  arccos = <ufunc 'arccos'>
  isVectorClause
  POW_STR
  convert_power_reserved_keywords
  W_NONTERMSTATEBD = 21
  predicate_op
  cosh = <ufunc 'cosh'>
  arcsinh = <ufunc 'arcsinh'>
  dsInterface
  inverseMathNameMap = {'Random': 'Random', 'SystemRandom': 'Sys...
  degrees = <ufunc 'degrees'>
  greater = <ufunc 'greater'>
  E_NONUNIQUETERM = 10
  radians = <ufunc 'radians'>
  sin = <ufunc 'sin'>
  symbolMapClass
  token
  API = API_class()
  fmod = <ufunc 'fmod'>
  ensureints
  API_class
  funcnames
  mathNameMap = {'Abs': 'abs', 'Acos': 'acos', 'Asin': 'asin', '...
  alphabet_chars_RE
  re
  contained = contained
  toDoubleStarSyntax
  protected_allnames = ['acos', 'asin', 'atan', 'atan2', 'ceil',...
  ensureparen
  traceback
  math_globals
  ZEROS
  reserved_keywords
  arctan2 = <ufunc 'arctan2'>
  ldexp = <ufunc 'ldexp'>
  mapNames
  trysimple
  replaceSep
  complex192
  temp_macro_names
  arctanh = <ufunc 'arctanh'>
  string2ast
  W_UNCERTVAL = 0
  null_predicate_class
  rout = <PyDSTool.Redirector.Redirector object at 0x1686550>
  dodiv
  parserObject
  simplify
  minpack
  feature_node
  isNameToken
  W_TERMSTATEBD = 11
  fit_function
  exp = <ufunc 'exp'>
  DO_POW
  nameResolver = ModelSpec internal helper class: nameResolver o...
  DomainType
  findEndBrace
  frexp = <ufunc 'frexp'>
  simplify_str
  mapPowStr
  ceil = <ufunc 'ceil'>
  builtin_auxnames
  ensurebare
  regObject
  targetLangs = ['c', 'python', 'matlab']
  allmathnames = ['acos', 'asin', 'atan', 'atan2', 'ceil', 'cos'...
  isnan = <ufunc 'isnan'>
  strIfSeq
  feval_map_symb
  isIntegerToken
  protected_specialfns
  cos = <ufunc 'cos'>
  theGenSpecHelper = GenSpecHelper()
  feature_leaf
  whoQ
  dofun
  replaceSepListInv
  HAVE_PSYCO = True
  replaceSepInv
  protected_mathnames
  utils_info
  pi = 3.14159265359
  asinh
  arcsin = <ufunc 'arcsin'>
  doneg
  accrueCompTypes
  count_sep
  uncertain = uncertain
  protected_macronames
  tanh = <ufunc 'tanh'>
  DO_DEC
  builtinlookup
  getdim
  fabs = <ufunc 'fabs'>
  NaN = nan
  sqrt = <ufunc 'sqrt'>
  complex
  ensureparen_div
  LargestInt32 = 2147483647
  allCompTypes
  splitargs
  splitastLR
  dopower
  TENS
  processMultiDef
  W_NONTERMEVENT = 20
  joinStrs
  qtypes
  less = <ufunc 'less'>
  W_TERMEVENT = 10
  verstr_parts = ['0', '7', '0']
  errmessages = {0: 'Computation of trajectory failed', 10: 'Mor...
  process_raw_residual
  W_BISECTLIMIT = 12
  isNumericToken
  isHierarchicalName
  genDB = Generator internal database class: []
  mod = <ufunc 'remainder'>
  builtinFnSigInfo
  warnfields = {0: ['value', 'interval'], 10: ['t', 'event list'...
  Macheps
  hypot = <ufunc 'hypot'>
  ast2string
  domul
  remove_indices_from_range
  null_predicate = null_predicate_class(None)
  collect_numbers
  modf = <ufunc 'modf'>
  power = <ufunc 'power'>
  syms
  Discrete = Discrete Domain
  findNumTailPos
  makeParList
  num_chars
  readArgs
  notcontained = notcontained
  symbolMapDict = {}
  resolveSpecTypeCombos
  joinAsStrs
  proper_match
  log = <ufunc 'log'>
  allmathnames_symbolic = ['Acos', 'Asin', 'Atan', 'Atan2', 'Cei...
  log10 = <ufunc 'log10'>
  ast2shortlist
  modlookup
  isToken
  replaceSepList
  dosub
  arccosh = <ufunc 'arccosh'>
  parser
  E_COMPUTFAIL = 0
  parseMatrixStrToDictStr
  warnmessages = {0: 'Uncertain value computed', 10: 'Terminal e...
  floor = <ufunc 'floor'>
  arctan = <ufunc 'arctan'>
  local_fndef
  protected_scipynames
  symbol
  e = 2.71828182846
  NAMESEP
  _seq_types = (<type 'list'>, <type 'tuple'>, <type 'numpy.ndar...
  _num_types = (<type 'float'>, <type 'int'>, <type 'numpy.float...
  isfinite = <ufunc 'isfinite'>
  sign = <ufunc 'sign'>
  allODEgens = ['Radau_ODEsystem', 'ADMC_ODEsystem', 'Vode_ODEsy...
  _functions = ['get_nineml_model']
  _classes = ['NineMLModel']
  _features = []
  ALLOW_THREADS = 1
  Abs = Abs (ModelSpec wrapper)
  Acos = Acos (ModelSpec wrapper)
  Asin = Asin (ModelSpec wrapper)
  Atan = Atan (ModelSpec wrapper)
  Atan2 = Atan2 (ModelSpec wrapper)
  BUFSIZE = 10000
  Betavariate = Betavariate (ModelSpec wrapper)
  CLIP = 0
  Ceil = Ceil (ModelSpec wrapper)
  Choice = Choice (ModelSpec wrapper)
  Cos = Cos (ModelSpec wrapper)
  Cosh = Cosh (ModelSpec wrapper)
  Degrees = Degrees (ModelSpec wrapper)
  E = QuantSpec e (ExpFuncSpec)
  ERR_CALL = 3
  ERR_DEFAULT = 0
  ERR_DEFAULT2 = 2084
  ERR_IGNORE = 0
  ERR_LOG = 5
  ERR_PRINT = 4
  ERR_RAISE = 2
  ERR_WARN = 1
  Exp = Exp (ModelSpec wrapper)
  Expovariate = Expovariate (ModelSpec wrapper)
  FLOATING_POINT_SUPPORT = 1
  FPE_DIVIDEBYZERO = 1
  FPE_INVALID = 8
  FPE_OVERFLOW = 2
  FPE_UNDERFLOW = 4
  Fabs = Fabs (ModelSpec wrapper)
  False_ = False
  Floor = Floor (ModelSpec wrapper)
  Fmod = Fmod (ModelSpec wrapper)
  Frexp = Frexp (ModelSpec wrapper)
  Gammavariate = Gammavariate (ModelSpec wrapper)
  Gauss = Gauss (ModelSpec wrapper)
  Getrandbits = Getrandbits (ModelSpec wrapper)
  Getstate = Getstate (ModelSpec wrapper)
  Hypot = Hypot (ModelSpec wrapper)
  Infinity = inf
  Jumpahead = Jumpahead (ModelSpec wrapper)
  Ldexp = Ldexp (ModelSpec wrapper)
  Log = Log (ModelSpec wrapper)
  Log10 = Log10 (ModelSpec wrapper)
  Lognormvariate = Lognormvariate (ModelSpec wrapper)
  MAXDIMS = 32
  Max = Max (ModelSpec wrapper)
  Min = Min (ModelSpec wrapper)
  Modf = Modf (ModelSpec wrapper)
  NAN = nan
  NINF = -inf
  NZERO = -0.0
  Normalvariate = Normalvariate (ModelSpec wrapper)
  PINF = inf
  PZERO = 0.0
  Paretovariate = Paretovariate (ModelSpec wrapper)
  Pi = QuantSpec pi (ExpFuncSpec)
  Pow = Pow (ModelSpec wrapper)
  RAISE = 2
  Radians = Radians (ModelSpec wrapper)
  Randint = Randint (ModelSpec wrapper)
  Random = Random (ModelSpec wrapper)
  Randrange = Randrange (ModelSpec wrapper)
  SHIFT_DIVIDEBYZERO = 0
  SHIFT_INVALID = 9
  SHIFT_OVERFLOW = 3
  SHIFT_UNDERFLOW = 6
  Sample = Sample (ModelSpec wrapper)
  ScalarType = (<type 'int'>, <type 'float'>, <type 'complex'>, ...
  Seed = Seed (ModelSpec wrapper)
  Setstate = Setstate (ModelSpec wrapper)
  Shuffle = Shuffle (ModelSpec wrapper)
  Sin = Sin (ModelSpec wrapper)
  Sinh = Sinh (ModelSpec wrapper)
  Sqrt = Sqrt (ModelSpec wrapper)
  Sum = Sum (ModelSpec wrapper)
  Systemrandom = Systemrandom (ModelSpec wrapper)
  Tan = Tan (ModelSpec wrapper)
  Tanh = Tanh (ModelSpec wrapper)
  True_ = True
  UFUNC_BUFSIZE_DEFAULT = 10000
  UFUNC_PYVALS_NAME = 'UFUNC_PYVALS'
  Uniform = Uniform (ModelSpec wrapper)
  Vonmisesvariate = Vonmisesvariate (ModelSpec wrapper)
  WRAP = 1
  Weibullvariate = Weibullvariate (ModelSpec wrapper)
  Wichmannhill = Wichmannhill (ModelSpec wrapper)
  absolute = <ufunc 'absolute'>
  add = <ufunc 'add'>
  bitwise_and = <ufunc 'bitwise_and'>
  bitwise_not = <ufunc 'invert'>
  bitwise_or = <ufunc 'bitwise_or'>
  bitwise_xor = <ufunc 'bitwise_xor'>
  c_ = <numpy.lib.index_tricks.CClass object at 0x115c330>
  cast = {<type 'numpy.int64'>: <function <lambda> at 0x6d0c30>,...
  conj = <ufunc 'conjugate'>
  conjugate = <ufunc 'conjugate'>
  copysign = <ufunc 'copysign'>
  deg2rad = <ufunc 'deg2rad'>
  divide = <ufunc 'divide'>
  equal = <ufunc 'equal'>
  exp2 = <ufunc 'exp2'>
  expm1 = <ufunc 'expm1'>
  floor_divide = <ufunc 'floor_divide'>
  fmax = <ufunc 'fmax'>
  fmin = <ufunc 'fmin'>
  greater_equal = <ufunc 'greater_equal'>
  index_exp = <numpy.lib.index_tricks.IndexExpression object at ...
  inf = inf
  infty = inf
  invert = <ufunc 'invert'>
  isinf = <ufunc 'isinf'>
  left_shift = <ufunc 'left_shift'>
  little_endian = True
  log1p = <ufunc 'log1p'>
  logaddexp = <ufunc 'logaddexp'>
  logaddexp2 = <ufunc 'logaddexp2'>
  logical_and = <ufunc 'logical_and'>
  logical_not = <ufunc 'logical_not'>
  logical_xor = <ufunc 'logical_xor'>
  maximum = <ufunc 'maximum'>
  mgrid = <numpy.lib.index_tricks.nd_grid object at 0x1147490>
  minimum = <ufunc 'minimum'>
  multiply = <ufunc 'multiply'>
  n = 9
  nan = nan
  nbytes = {<type 'numpy.int64'>: 8, <type 'numpy.int16'>: 2, <t...
  negative = <ufunc 'negative'>
  newaxis = None
  nextafter = <ufunc 'nextafter'>
  not_equal = <ufunc 'not_equal'>
  ogrid = <numpy.lib.index_tricks.nd_grid object at 0x1147bb0>
  ones_like = <ufunc 'ones_like'>
  r_ = <numpy.lib.index_tricks.RClass object at 0x115c2f0>
  rad2deg = <ufunc 'rad2deg'>
  reciprocal = <ufunc 'reciprocal'>
  remainder = <ufunc 'remainder'>
  right_shift = <ufunc 'right_shift'>
  rint = <ufunc 'rint'>
  s_ = <numpy.lib.index_tricks.IndexExpression object at 0x115c3f0>
  sctypeDict = {0: <type 'numpy.bool_'>, 1: <type 'numpy.int8'>,...
  sctypeNA = {'?': 'Bool', 'B': 'UInt8', 'Bool': <type 'numpy.bo...
  sctypes = {'complex': [<type 'numpy.complex64'>, <type 'numpy....
  signbit = <ufunc 'signbit'>
  spacing = <ufunc 'spacing'>
  square = <ufunc 'square'>
  subtract = <ufunc 'subtract'>
  t = '0'
  true_divide = <ufunc 'true_divide'>
  trunc = <ufunc 'trunc'>
  typeDict = {0: <type 'numpy.bool_'>, 1: <type 'numpy.int8'>, 2...
  typeNA = {'?': 'Bool', 'B': 'UInt8', 'Bool': <type 'numpy.bool...
  typecodes = {'All': '?bhilqpBHILQPfdgFDGSUVOMm', 'AllFloat': '...
Function Details [hide private]

get_nineml_model(c, model_name, target='Vode', extra_args=None, alg_args=None, max_t=inf)

source code 

component is a NineML abstraction layer component, and assumes you have imported a NineML model through the Python API or built it directly.

Currently only works for 'flat' models


Variables Details [hide private]

protected_auxnamesDB

Value:
ModelSpec internal helper class: auxfnDBclass object

inverseMathNameMap

Value:
{'Random': 'Random',
 'SystemRandom': 'Systemrandom',
 'WichmannHill': 'Wichmannhill',
 'abs': 'Abs',
 'acos': 'Acos',
 'asin': 'Asin',
 'atan': 'Atan',
 'atan2': 'Atan2',
...

mathNameMap

Value:
{'Abs': 'abs',
 'Acos': 'acos',
 'Asin': 'asin',
 'Atan': 'atan',
 'Atan2': 'atan2',
 'Betavariate': 'betavariate',
 'Ceil': 'ceil',
 'Choice': 'choice',
...

protected_allnames

Value:
['acos',
 'asin',
 'atan',
 'atan2',
 'ceil',
 'cos',
 'cosh',
 'degrees',
...

nameResolver

Value:
ModelSpec internal helper class: nameResolver object

allmathnames

Value:
['acos',
 'asin',
 'atan',
 'atan2',
 'ceil',
 'cos',
 'cosh',
 'degrees',
...

errmessages

Value:
{0: 'Computation of trajectory failed',
 10: 'More than one terminal event found'}

warnfields

Value:
{0: ['value', 'interval'],
 10: ['t', 'event list'],
 11: ['t', 'var name', 'var value', '\n\tvalue interval'],
 12: ['t', 'event list'],
 20: ['t', 'event list'],
 21: ['t', 'var name', 'var value', '\n\tvalue interval']}

allmathnames_symbolic

Value:
['Acos',
 'Asin',
 'Atan',
 'Atan2',
 'Ceil',
 'Cos',
 'Cosh',
 'Degrees',
...

warnmessages

Value:
{0: 'Uncertain value computed',
 10: 'Terminal event(s) found',
 11: 'State variable reached bounds (terminal)',
 12: 'Bisection limit reached for event',
 20: 'Non-terminal event(s) found',
 21: 'State or input variable reached bounds (non-terminal)'}

_seq_types

Value:
(<type 'list'>, <type 'tuple'>, <type 'numpy.ndarray'>)

_num_types

Value:
(<type 'float'>,
 <type 'int'>,
 <type 'numpy.floating'>,
 <type 'numpy.integer'>)

allODEgens

Value:
['Radau_ODEsystem',
 'ADMC_ODEsystem',
 'Vode_ODEsystem',
 'Euler_ODEsystem',
 'Dopri_ODEsystem']

ScalarType

Value:
(<type 'int'>,
 <type 'float'>,
 <type 'complex'>,
 <type 'long'>,
 <type 'bool'>,
 <type 'str'>,
 <type 'unicode'>,
 <type 'buffer'>,
...

cast

Value:
{<type 'numpy.int64'>: <function <lambda> at 0x6d0c30>, <type 'numpy.i\
nt16'>: <function <lambda> at 0x6d0c70>, <type 'numpy.complex128'>: <f\
unction <lambda> at 0x6d0cb0>, <type 'numpy.uint64'>: <function <lambd\
a> at 0x6d0cf0>, <type 'numpy.complex256'>: <function <lambda> at 0x6d\
0d70>, <type 'numpy.float32'>: <function <lambda> at 0x6d0db0>, <type \
'numpy.bool_'>: <function <lambda> at 0x6d0d30>, <type 'numpy.uint8'>:\
 <function <lambda> at 0x6d0e30>, <type 'numpy.int32'>: <function <lam\
bda> at 0x6d0f30>, <type 'numpy.int8'>: <function <lambda> at 0x6d0df0\
...

index_exp

Value:
<numpy.lib.index_tricks.IndexExpression object at 0x115c3b0>

nbytes

Value:
{<type 'numpy.int64'>: 8, <type 'numpy.int16'>: 2, <type 'numpy.comple\
x128'>: 16, <type 'numpy.uint64'>: 8, <type 'numpy.bool_'>: 1, <type '\
numpy.complex256'>: 32, <type 'numpy.float32'>: 4, <type 'numpy.int8'>\
: 1, <type 'numpy.uint8'>: 1, <type 'numpy.uint16'>: 2, <type 'numpy.o\
bject_'>: 4, <type 'numpy.float64'>: 8, <type 'numpy.int32'>: 4, <type\
 'numpy.string_'>: 0, <type 'numpy.void'>: 0, <type 'numpy.float128'>:\
 16, <type 'numpy.int32'>: 4, <type 'numpy.uint32'>: 4, <type 'numpy.u\
nicode_'>: 0, <type 'numpy.complex64'>: 8, <type 'numpy.uint32'>: 4}

sctypeDict

Value:
{0: <type 'numpy.bool_'>,
 1: <type 'numpy.int8'>,
 2: <type 'numpy.uint8'>,
 3: <type 'numpy.int16'>,
 4: <type 'numpy.uint16'>,
 5: <type 'numpy.int32'>,
 6: <type 'numpy.uint32'>,
 7: <type 'numpy.int32'>,
...

sctypeNA

Value:
{'?': 'Bool',
 'B': 'UInt8',
 'Bool': <type 'numpy.bool_'>,
 'Complex128': <type 'numpy.complex256'>,
 'Complex32': <type 'numpy.complex64'>,
 'Complex64': <type 'numpy.complex128'>,
 'D': 'Complex64',
 'F': 'Complex32',
...

sctypes

Value:
{'complex': [<type 'numpy.complex64'>,
             <type 'numpy.complex128'>,
             <type 'numpy.complex256'>],
 'float': [<type 'numpy.float32'>,
           <type 'numpy.float64'>,
           <type 'numpy.float128'>],
 'int': [<type 'numpy.int8'>,
         <type 'numpy.int16'>,
...

typeDict

Value:
{0: <type 'numpy.bool_'>,
 1: <type 'numpy.int8'>,
 2: <type 'numpy.uint8'>,
 3: <type 'numpy.int16'>,
 4: <type 'numpy.uint16'>,
 5: <type 'numpy.int32'>,
 6: <type 'numpy.uint32'>,
 7: <type 'numpy.int32'>,
...

typeNA

Value:
{'?': 'Bool',
 'B': 'UInt8',
 'Bool': <type 'numpy.bool_'>,
 'Complex128': <type 'numpy.complex256'>,
 'Complex32': <type 'numpy.complex64'>,
 'Complex64': <type 'numpy.complex128'>,
 'D': 'Complex64',
 'F': 'Complex32',
...

typecodes

Value:
{'All': '?bhilqpBHILQPfdgFDGSUVOMm',
 'AllFloat': 'fdgFDG',
 'AllInteger': 'bBhHiIlLqQpP',
 'Character': 'c',
 'Complex': 'FDG',
 'Datetime': 'Mm',
 'Float': 'fdg',
 'Integer': 'bhilqp',
...