def checkRateRateOfChangeByIndex(testId): print string.ljust("Check " + testId, rpadding), errorFlag = False inputConcs = asarray(readLine().split(), dtype=float64) outputRates = asarray(readLine().split(), dtype=float64) rrPython.setFloatingSpeciesConcentrations(inputConcs) for i in range(len(inputConcs)): value = rrPython.getRateOfChange(i) if expectApproximately(value, outputRates[i], 1E-6) == False: errorFlag = True break print passMsg(errorFlag)
def checkRateRateOfChangeByIndex(testId): print string.ljust ("Check " + testId, rpadding), errorFlag = False inputConcs = asarray (readLine().split(), dtype=float64) outputRates = asarray (readLine().split(), dtype=float64) rrPython.setFloatingSpeciesConcentrations (inputConcs) for i in range (len (inputConcs)): value = rrPython.getRateOfChange (i) if expectApproximately (value, outputRates[i], 1E-6) == False: errorFlag = True break print passMsg (errorFlag)
import rrPython import os import csv os.chdir('C:\\RoadRunner\\bin') function = 'getRateOfChange' rrPython.loadSBMLFromFile('C:\\RoadRunner\\Models\\feedback.xml') try: rate = rrPython.getRateOfChange() if str(rate) 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 = 'getRateOfChange' rrPython.loadSBMLFromFile('C:\\RoadRunner\\Models\\feedback.xml') try: rate = rrPython.getRateOfChange() if str(rate) 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()