Exemplo n.º 1
0
def checkGetRatesOfChangeEx(testId):
    print string.ljust("Check " + testId, rpadding),
    errorFlag = False
    inputConcs = asarray(readLine().split(), dtype=float64)
    values = rrPython.getRatesOfChangeEx(inputConcs)
    outputRates = asarray(readLine().split(), dtype=float64)
    if not allclose(values, outputRates):
        errorFlag = True
    print passMsg(errorFlag)
Exemplo n.º 2
0
def checkGetRatesOfChangeEx (testId):
  print string.ljust ("Check " + testId, rpadding),
  errorFlag = False
  inputConcs = asarray (readLine().split(), dtype=float64)
  values = rrPython.getRatesOfChangeEx (inputConcs)
  outputRates = asarray (readLine().split(), dtype=float64)
  if not allclose (values, outputRates):
    errorFlag = True
  print passMsg (errorFlag)
import rrPython
import os
import csv
os.chdir('C:\\RoadRunner\\bin')

function = 'getRatesOfChangeEx'
rrPython.loadSBMLFromFile('C:\\RoadRunner\\Models\\feedback.xml')
rrPython.simulate()

SpeciesArray = [1.0,.9,.8,.6]

try:
    rates = rrPython.getRatesOfChangeEx(SpeciesArray)
    if str(rates) is not False:
        result = 'True'
    else:
        result = 'False'
except:
    result = 'False'


PythonTestResults = open('C:\\RoadRunner\\PythonTestResults.csv','a')
writer = csv.writer(PythonTestResults)
writevar = function + '=' + result
writer.writerow([writevar])
PythonTestResults.close()
import rrPython
import os
import csv
os.chdir('C:\\RoadRunner\\bin')

function = 'getRatesOfChangeEx'
rrPython.loadSBMLFromFile('C:\\RoadRunner\\Models\\feedback.xml')
rrPython.simulate()

SpeciesArray = [1.0, .9, .8, .6]

try:
    rates = rrPython.getRatesOfChangeEx(SpeciesArray)
    if str(rates) is not False:
        result = 'True'
    else:
        result = 'False'
except:
    result = 'False'

PythonTestResults = open('C:\\RoadRunner\\PythonTestResults.csv', 'a')
writer = csv.writer(PythonTestResults)
writevar = function + '=' + result
writer.writerow([writevar])
PythonTestResults.close()