Пример #1
0
def setGetInitialFloatingSpeciesConcentrations(testId):
    print string.ljust("Check " + testId, rpadding),
    errorFlag = False
    getArray = rrPython.getFloatingSpeciesInitialConcentrations()
    setArray = zeros(len(getArray))
    for i in range(len(getArray)):
        value = random.random() * 10
        setArray[i] = value
    rrPython.setFloatingSpeciesInitialConcentrations(setArray)
    if (setArray != rrPython.getFloatingSpeciesInitialConcentrations()).all():
        errorFlag = True
    print passMsg(errorFlag)
Пример #2
0
def setGetInitialFloatingSpeciesConcentrations (testId):
  print string.ljust ("Check " + testId, rpadding),
  errorFlag = False
  getArray = rrPython.getFloatingSpeciesInitialConcentrations ()
  setArray = zeros(len(getArray))
  for i in range(len(getArray)):
      value = random.random()*10
      setArray[i] = value
  rrPython.setFloatingSpeciesInitialConcentrations (setArray)
  if (setArray != rrPython.getFloatingSpeciesInitialConcentrations()).all():
      errorFlag = True
  print passMsg (errorFlag)
Пример #3
0
def checkInitialConditions(testId):
    print string.ljust("Check " + testId, rpadding),
    errorFlag = False
    words = readLine().split()
    values = rrPython.getFloatingSpeciesInitialConcentrations()
    for i in range(len(words)):
        if expectApproximately(float(words[i]), values[i], 1E-6) == False:
            errorFlag = True
    print passMsg(errorFlag)
Пример #4
0
def checkInitialConditions(testId):
  print string.ljust ("Check " + testId, rpadding),
  errorFlag = False
  words = readLine().split()
  values = rrPython.getFloatingSpeciesInitialConcentrations()
  for i in range(len(words)):
      if expectApproximately (float (words[i]), values[i], 1E-6) == False:
        errorFlag = True
  print passMsg (errorFlag)
Пример #5
0
def setGetReset(testId):
    print string.ljust("Check " + testId, rpadding),
    errorFlag = False
    values = zeros(rrPython.getNumberOfFloatingSpecies())
    for i in range(len(values)):
        values[i] = random.random() * 10
    initial = rrPython.getFloatingSpeciesInitialConcentrations()
    rrPython.setFloatingSpeciesConcentrations(values)
    # Should reset the floats by to the current initial condition
    rrPython.reset()
    values = rrPython.getFloatingSpeciesConcentrations()
    if (values != initial).all():
        errorFlag = True
    print passMsg(errorFlag)
Пример #6
0
def setGetReset(testId):
  print string.ljust ("Check " + testId, rpadding),
  errorFlag = False
  values = zeros (rrPython.getNumberOfFloatingSpecies())
  for i in range (len (values)):
    values[i] = random.random()*10
  initial = rrPython.getFloatingSpeciesInitialConcentrations()
  rrPython.setFloatingSpeciesConcentrations (values)
  # Should reset the floats by to the current initial condition
  rrPython.reset()
  values = rrPython.getFloatingSpeciesConcentrations()
  if(values != initial).all():
    errorFlag = True
  print passMsg (errorFlag)
Пример #7
0
import rrPython
import os
import csv
os.chdir('C:\\RoadRunner\\bin')

function = 'getFloatingSpeciesInitialConcentrations'

try:
    concs = rrPython.getFloatingSpeciesInitialConcentrations()
    if str(concs) 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()