def download(): o = OFFLmodel(oString) fileType = request.args.get('selected_index') if fileType == 'ode': return jsonify({'downloadString': o.getOdeFile()}) if request.data == 'mathml': return jsonify({'downloadString': o.getMathML()}) if request.data == 'mathematica': return jsonify({'downloadString': o.getMathematicaCode()}) if request.data == 'latex': return jsonify({'downloadString': o.getLatex()}) if request.data == 'sql': return jsonify({'downloadString': o.getSqlDatabase()})
def download(): o = OFFLmodel(oString) fileType = request.args.get('selected_index') if fileType=='ode': return jsonify({'downloadString':o.getOdeFile()}) if request.data=='mathml': return jsonify({'downloadString':o.getMathML()}) if request.data=='mathematica': return jsonify({'downloadString':o.getMathematicaCode()}) if request.data=='latex': return jsonify({'downloadString':o.getLatex()}) if request.data=='sql': return jsonify({'downloadString':o.getSqlDatabase()})
def convertDictToOFFL(d): interactionList = [] for interaction in d['interactionList']: sourceEdges = [] targetEdges = [] for sourceEdge in interaction['sourceEdges']: sourceEdges.append( Edge(sourceEdge['species'], sourceEdge['weight'])) for targetEdge in interaction['targetEdges']: targetEdges.append( Edge(targetEdge['species'], targetEdge['weight'])) interactionList.append( Interaction(interaction['interactionFunction'], sourceEdges, targetEdges)) speciesList = d['speciesList'] initialValues = d['initialValues'] initialTime = d['initialTime'] independentVar = d['independentVariable'] endTime = d['endTime'] return OFFLmodel(interactionList, speciesList, initialValues, initialTime, independentVar, endTime)
def odeDownload(): o = OFFLmodel(oString) return o.getOdeFile()