rem
stringlengths
0
322k
add
stringlengths
0
2.05M
context
stringlengths
8
228k
raise RuntimeError( 'Failed to set Entity property [%s],' + \ 'value =:\n%s\n' % ( aFullPN, aValue ) +\
raise RuntimeError( 'Failed to set Entity property [%s],' % aFullPN \ + 'value =:\n%s\n' % str( aValue ) +\
def __loadPropertyList( self, anEml, anEntityTypeString,\ aSystemPath, anIDList ):
if self.getStepType:
if self.getStepType():
def __stepSimulation( self, *arg ) : """steps simulation arg[0] --- stop button (gtk.Button) Returns None if step measure is second, then Session.run() if step measure is step than Session.step () """ if self.getStepType: self.theSession.run( self.getStepSize() ) else: self.theSession.step( self.getStepSize() )
self.setStartState() self.theSession.run( self.getStepSize() ) self.setStopState()
if( self.SimulationButton.getCurrentState() == "stop" ): self.setStartState() self.theSession.run( self.getStepSize() ) self.setStopState() else: self.theSession.run( self.getStepSize() )
def __stepSimulation( self, *arg ) : """steps simulation arg[0] --- stop button (gtk.Button) Returns None if step measure is second, then Session.run() if step measure is step than Session.step () """ if self.getStepType():
self.setStartState() self.theSession.step( self.getStepSize() ) self.setStopState()
if( self.SimulationButton.getCurrentState() == "stop" ): self.setStartState() self.theSession.step( self.getStepSize() ) self.setStopState() else: self.theSession.step( self.getStepSize() )
def __stepSimulation( self, *arg ) : """steps simulation arg[0] --- stop button (gtk.Button) Returns None if step measure is second, then Session.run() if step measure is step than Session.step () """ if self.getStepType():
aHeaderList.append( 'DATA: %s' %self.theDataName ) aHeaderList.append( 'SIZE: %d %d' %(self.theSizeOfColumn,self.theSizeOfLine) ) aHeaderList.append( 'LABEL: %s' %self.theLabel ) aHeaderList.append( 'NOTE: %s' %self.theNote ) aHeaderList.append( '' ) aHeaderList.append( '----------------------' )
aHeaderList.append( ' aHeaderList.append( ' aHeaderList.append( ' aHeaderList.append( ' aHeaderList.append( ' aHeaderList.append( '
def getHeaderList( self ):
if aFilename is not None:
if aFileName is not None:
def save( self, aFileName = None ):
self.logoMovable = True self['logo_animation_menu'].set_active(TRUE)
def openWindow( self ):
self['toolbar_menu'].set_active(TRUE) self.theToolbarVisible = True self['statusbar_menu'].set_active(TRUE) self.theStatusbarVisible = True
def openWindow( self ):
self.theMessageWindowVisible = True ( self['message_togglebutton'].get_child() ).set_active(TRUE) self['message_window_menu'].set_active(TRUE)
def openWindow( self ):
self.theEntityListWindowVisible = True self['entitylist_window_menu'].set_active(TRUE)
def openWindow( self ):
except:
self.update() self.theSession.updateFundamentalWindows() except: self['load_model_button'].set_sensitive(0) self['load_script_button'].set_sensitive(0) self['load_model_menu'].set_sensitive(0) self['load_script_menu'].set_sensitive(0)
def __loadData( self, *arg ) : """loads model or script file arg[0] --- ok button of FileSelection arg[1] --- 'Model'/'Script' (str) Return None """
self.update() self.theSession.updateFundamentalWindows()
def __loadData( self, *arg ) : """loads model or script file arg[0] --- ok button of FileSelection arg[1] --- 'Model'/'Script' (str) Return None """
aValue = self.theSimulator.getStepperProperty( aStepper, aProperty )
def __saveStepper( self , anEml ): """stepper loader"""
if anAttribute[0] == 0:
if anAttribute[1] == 0:
def __saveStepper( self , anEml ): """stepper loader"""
elif aValue == '':
elif anAttribute[0] == 0:
def __saveStepper( self , anEml ): """stepper loader"""
else: raise "unexpected error."
else: raise "unexpected error. %s should be System, Variable, or Process."%anEntityType
def createEntity( self, aClass, aFullID ):
raise "Entity [" + aFullID + "] not found."
raise "Entity [%s] not found."%aFullID
def __getEntityNode( self, aFullID ): # first look up the cache try: return self.__findInCache( aFullID ) except: pass
raise "System [" + aFullID + "] not found."
raise "System [%s] not found."%aFullID
def __getSystemNode( self, aSystemPath ):
self.__initializeSelection()
def openWindow( self ):
self.systemTree.set_model( treeStore ) self.processTree.set_search_column( 0 ) self.theSysSelection = self.systemTree.get_selection()
selection = self.processTree.get_selection() selection.set_mode( gtk.SELECTION_MULTIPLE ) selection.connect( 'changed', self.selectProcess ) selection = self.variableTree.get_selection() selection.set_mode( gtk.SELECTION_MULTIPLE ) selection.connect( 'changed', self.selectVariable )
def __initializeSystemTree( self ): """initialize SystemTree """ self.lastSelectedSystem = "" treeStore = gtk.TreeStore( gobject.TYPE_STRING ) self.theSysTreeStore = treeStore column = gtk.TreeViewColumn( 'System Tree', gtk.CellRendererText(), text=0 ) column.set_visible( True ) self.systemTree.append_column(column)
selection = self.processTree.get_selection() selection.set_mode( gtk.SELECTION_MULTIPLE ) selection.connect( 'changed', self.selectProcess )
def __initializeProcessTree( self ): """initialize ProcessTree """
selection = self.variableTree.get_selection() selection.set_mode( gtk.SELECTION_MULTIPLE ) selection.connect( 'changed', self.selectVariable )
def __initializeVariableTree( self ): """initializes VariableTree """
os.killProcess( pid)
self.killProcess( pid)
def mainfunction():\n\ list[0]=gtk.timeout_add(delay, timerhandler)\n\ try:\n\ loadModel('" + fileName + "')\n\ except:\n\ pass\n\ gtk.timeout_remove(list[0])\n\ fd.write(chr(10)+'loaded'+chr(10));fd.flush()\n\ try:\n\ #self.theSimulator.initialize()\n\ step(3)\n\ except:\n\ pass\n\ fd.write('finished'+chr(10));fd.clos...
messageString = message.join()
messageString = string.join( message )
def printMessage( self, message ): ''' This method appends a message at the end of the message area.
r' "(^"|.)*" ' t.value = Token( 'quotedstring', t.value[1:-1] )
r' "(^"|.)*" | \'(^\'|.)*\' ' t.value = Token( 'quotedstring', t.value )
def t_quotedstring(t): r' "(^"|.)*" ' t.value = Token( 'quotedstring', t.value[1:-1] ) return t
print t.slice
def p_stepper_stmt(t): ''' stepper_stmt : Stepper object_decl LBRACE propertylist RBRACE ''' print t.slice t[0] = createAst( 'stepper_stmt', t )
aTmpList = [ str( aParameter[4] ) ]
aTmpList = [ '1' ]
def convertSBML2EML( aSBMLString ): aSBMLDocument = libsbml.readSBMLFromString( aSBMLString ) aSBMLModel = aSBMLDocument.getModel() theModel = SBML_Model( aSBMLDocument, aSBMLModel ) theCompartment = SBML_Compartment( theModel ) theParameter = SBML_Parameter( theModel ) theSpecies = SBML_Species( theModel ) theRule =...
if len(self.available_colors)>0:
if len(self.available_colors)>0 and \ (not self.data_list.__contains__(aFullPNString)):
def addtrace(self, aFullPNString): #checks whether there's room for new traces if len(self.available_colors)>0: #allocates a color allocated_color=self.available_colors.pop() self.data_list.append(aFullPNString) self.trace_onoff[aFullPNString]=gtk.TRUE return self.register_color(aFullPNString,allocated_color) else: ret...
if points[fpn][1]>self.yframe[1] or points[fpn][1]<self.yframe[0]:
if (points[fpn][1]>self.yframe[1] or points[fpn][1]<self.yframe[0])\ and self.trace_onoff[fpn]==gtk.TRUE:
def addpoints(self, points): #must be zoom level 0 #if strip: redraw_flag=False
for dp in newdata: if dp[0]>self.xframe[1]: redraw_flag=True if dp[1]>self.yframe[1] or dp[1]<self.yframe[0]: redraw_flag=True
if self.trace_onoff[fpn]==gtk.TRUE: for dp in newdata: if dp[0]>self.xframe[1]: redraw_flag=True if dp[1]>self.yframe[1] or dp[1]<self.yframe[0]: redraw_flag=True
def addpoints(self, points): #must be zoom level 0 #if strip: redraw_flag=False
self['entryProcessVarRefTotal'].set_property( 'xalign', 0.5 ) self['entryProcessVarRefPositive'].set_property( 'xalign', 0.5 ) self['entryProcessVarRefZero'].set_property( 'xalign', 0.5 ) self['entryProcessVarRefNegative'].set_property( 'xalign', 0.5 )
self['entryProcessVarRefTotal'].set_property( 'xalign', 1 ) self['entryProcessVarRefPositive'].set_property( 'xalign', 1 ) self['entryProcessVarRefZero'].set_property( 'xalign', 1 ) self['entryProcessVarRefNegative'].set_property( 'xalign', 1 )
def openWindow( self ): #self.openWindow() OsogoPluginWindow.openWindow(self) # add handers self.addHandlers( { 'on_checkViewAll_toggled' : self.updateViewAllProperties } )
__getEntityNode( aFullID )
self.__getEntityNode( aFullID )
def isEntityExist( self, aFullID ):
def saveLoggerData( self, aFullPNString='', aStartTime=-1, aEndTime=-1, aInterval=-1, aSaveDirectory='./Data'):
def saveLoggerData( self, aFullPNString='', aStartTime=-1, anEndTime=-1, anInterval=-1, aSaveDirectory='./Data'):
def saveLoggerData( self, aFullPNString='', aStartTime=-1, aEndTime=-1, aInterval=-1, aSaveDirectory='./Data'):
self.log( "\'" + aSaveDirectory + "\'" + " file exists." ) aDataFileManager = ecell.DataFileManager.DataFileManager() aDataFileManager.setRootDirectory(aSaveDirectory) aFileIndex = 0
self.message( "\'" + aSaveDirectory + "\'" + " file exists." ) aLoggerNameList = []
def saveLoggerData( self, aFullPNString='', aStartTime=-1, aEndTime=-1, aInterval=-1, aSaveDirectory='./Data'):
aLoggerNameList = aFullPNString try:
aLoggerNameList.append( aFullPNString ) aDataFileManager = DataFileManager() aDataFileManager.setRootDirectory(aSaveDirectory) aFileIndex=0 try:
def saveLoggerData( self, aFullPNString='', aStartTime=-1, aEndTime=-1, aInterval=-1, aSaveDirectory='./Data'):
aFileName=string.split(string.join(string.split(aFullPNString,':')[1:],'-'),'/')[-1] aECDDataFile = ecell.ECDDataFile.ECDDataFile()
aRootIndex=find(aFullPNString,':/') aFileName=aFullPNString[:aRootIndex]+aFullPNString[aRootIndex+1:] aFileName=replace(aFileName,':','_') aFileName=replace(aFileName,'/','_') aECDDataFile = ECDDataFile()
def saveLoggerData( self, aFullPNString='', aStartTime=-1, aEndTime=-1, aInterval=-1, aSaveDirectory='./Data'):
aLogger = self.getLogger( aFullPNString ) if aStartTime == -1 or aEndTime == -1:
aLoggerStub = self.createLoggerStub( aFullPNString ) if not aLoggerStub.isExist(): aErrorMessage='\nLogger doesn\'t exist.!\n' self.message( aErrorMessage ) return None aLoggerStartTime= aLoggerStub.getStartTime() aLoggerEndTime= aLoggerStub.getEndTime() if aStartTime == -1 or anEndTime == -1:
def saveLoggerData( self, aFullPNString='', aStartTime=-1, aEndTime=-1, aInterval=-1, aSaveDirectory='./Data'):
aStartTime= aLogger.getStartTime() aEndTime = aLogger.getEndTime()
aStartTime = aLoggerStartTime anEndTime = aLoggerEndTime
def saveLoggerData( self, aFullPNString='', aStartTime=-1, aEndTime=-1, aInterval=-1, aSaveDirectory='./Data'):
if not (aLogger.getStartTime() < aStartTime < aLogger.getEndTime()): aStartTime = aLogger.getStartTime() if not (aLogger.getStartTime() < aEndTime < aLogger.getEndTime()): aEndTime = aLogger.getEndTime() if aInterval == -1: aMatrixData = aLogger.getData(aStartTime,aEndTime)
if not ( aLoggerStartTime < aStartTime < aLoggerEndTime ): aStartTime = aLoggerStartTime if not ( aLoggerStartTime < anEndTime < aLoggerEndTime ): anEndTime = aLoggerEndTime if anInterval == -1: aMatrixData = aLoggerStub.getData( aStartTime, anEndTime )
def saveLoggerData( self, aFullPNString='', aStartTime=-1, aEndTime=-1, aInterval=-1, aSaveDirectory='./Data'):
aMatrixData = aLogger.getData(aStartTime,aEndTime,aInterval)
aMatrixData = aLoggerStub.getData( aStartTime, anEndTime, anInterval )
def saveLoggerData( self, aFullPNString='', aStartTime=-1, aEndTime=-1, aInterval=-1, aSaveDirectory='./Data'):
aECDDataFile.setMatrixData(aMatrixData)
aECDDataFile.setData(aMatrixData)
def saveLoggerData( self, aFullPNString='', aStartTime=-1, aEndTime=-1, aInterval=-1, aSaveDirectory='./Data'):
except:
aDataFileManager.saveAll() except:
def saveLoggerData( self, aFullPNString='', aStartTime=-1, aEndTime=-1, aInterval=-1, aSaveDirectory='./Data'):
self.message( sys.exc_traceback )
import traceback print __name__, aErrorMessageList = traceback.format_exception(sys.exc_type,sys.exc_value,sys.exc_traceback) for aLine in aErrorMessageList: self.message( aLine )
def saveLoggerData( self, aFullPNString='', aStartTime=-1, aEndTime=-1, aInterval=-1, aSaveDirectory='./Data'):
return None aDataFileManager.saveAll() self.message( "All files are saved." )
sys.exit(0) else: aSuccessMessage= " All files you selected are saved. " self.message( aSuccessMessage )
def saveLoggerData( self, aFullPNString='', aStartTime=-1, aEndTime=-1, aInterval=-1, aSaveDirectory='./Data'):
aDialog = ConfirmWindow(0,aMessage,'Error!')
aDialog = ConfirmWindow.ConfirmWindow(0,aMessage,'Error!')
def __init__( self, aDirName, aData, aPluginManager, aRoot=None ):
self.theRuleFileSelection.set_modal(gtk.TRUE)
def openRuleFileSelection( self, anObject ) :
self.theScriptFileSelection.set_modal(gtk.TRUE)
def openScriptFileSelection( self, anObject ) :
self.CompartmentSize = {} self.CompartmentUnit = {}
self.setFunctionDefinitionToDictionaly() def setFunctionDefinitionToDictionaly( self ): if ( self.FunctionDefinitionList != [] ): for aFunctionDefinition in ( self.FunctionDefinitionList ): self.FunctionDefinition[ aFunctionDefinition[0] ] = aFunctionDefinition[2]
def __init__( self, aSBMLDocument, aSBMLmodel ):
for aCompartment in self.CompartmentList: if ( self.Level == 1 ):
if ( self.Level == 1 ): for aCompartment in self.CompartmentList:
def getPath( self, aCompartmentID ): for aCompartment in self.CompartmentList: if ( self.Level == 1 ): if ( aCompartment[1] == aCompartmentID ): if ( aCompartment[6] == '' ): aPath = '/' + aCompartmentID return aPath else: aPath = self.getPath( aCompartment[6] ) + '/' + aCompartmentID return aPath
elif( self.Level == 2 ):
elif( self.Level == 2 ): for aCompartment in self.CompartmentList:
def getPath( self, aCompartmentID ): for aCompartment in self.CompartmentList: if ( self.Level == 1 ): if ( aCompartment[1] == aCompartmentID ): if ( aCompartment[6] == '' ): aPath = '/' + aCompartmentID return aPath else: aPath = self.getPath( aCompartment[6] ) + '/' + aCompartmentID return aPath
for aSpecies in self.SpeciesList: if ( self.Level == 1 ):
if ( self.Level == 1 ): for aSpecies in self.SpeciesList:
def getSpeciesReferenceID( self, aSpeciesID ):
elif ( self.Level == 2 ):
elif ( self.Level == 2 ): for aSpecies in self.SpeciesList:
def getSpeciesReferenceID( self, aSpeciesID ):
else: print "Version",self.Level," ????" sys.exit(1)
else: print "Version",self.Level," ????" sys.exit(1) def convertUnit( self, aValueUnit, aValue ): if ( self.Level == 1 ): for unitList in self.UnitDefinitionList: if ( unitList[1] == aValueUnit ): for anUnit in unitList[2]: aValue = self.__getNewUnitValue( anUnit, aValue ) return aValue elif ( self.Level == 2 ):...
def getSpeciesReferenceID( self, aSpeciesID ):
def setCompartmentSize_Unit( self, aCompartment ):
def __setSizeToDictionary( self, aCompartment ):
def setCompartmentSize_Unit( self, aCompartment ):
self.Model.CompartmentSize[ aCompartment[1] ] = aCompartment[4] self.Model.CompartmentUnit[ aCompartment[1] ] = aCompartment[5]
if( aCompartment[4] != "Unknown" ): self.Model.CompartmentSize[ aCompartment[1] ] = aCompartment[4] else: self.Model.CompartmentSize[ aCompartment[1] ] = self.__getOutsideSize( aCompartment[6] )
def setCompartmentSize_Unit( self, aCompartment ):
self.Model.CompartmentUnit[ aCompartment[0] ] = aCompartment[5] elif( aCompartment[3] == "Unknown" ): [ self.Model.CompartmentSize[ aCompartment[0] ], self.Model.CompartmentUnit[ aCompartment[0] ] ] = self.__getCompartmentOutsideSize_Unit( aCompartment ) def __getCompartmentOutsideSize_Unit( self, aCompartment ): i...
else: self.Model.CompartmentSize[ aCompartment[0] ] = self.__getOutsideSize( aCompartment[6] ) def __setUnitToDictionary( self, aCompartment ): if( self.Model.Level == 1 ): aCompartmentID = aCompartment[1] elif( self.Model.Level == 2 ): aCompartmentID = aCompartment[0] if( aCompartment[5] != '' ): self.Model.Co...
def setCompartmentSize_Unit( self, aCompartment ):
print "Unexpected error" sys.exit(1)
self.Model.CompartmentUnit[ aCompartmentID ] = self.__getOutsideUnit( aCompartment[6] ) def __getOutsideSize( self, anOutsideCompartment ):
def __getCompartmentOutsideSize_Unit( self, aCompartment ):
def convertCompartmentUnit( self, aSBMLModel, aCompartmentSize, aCompartmentUnit ): convertedValueList = [] for anUnitDefinition in self.Model.UnitDefinitionList: if ( anUnitDefinition[0] == aCompartmentUnit ): for anUnit in anUnitDefinition[2]: if( anUnit[0] == "litre" or anUnit[0] == "metre" ): tmpValue = pow( aCo...
if ( anOutsideCompartment == '' ): return float( 1 ) else: return self.Model.CompartmentSize[ anOutsideCompartment ] def __getOutsideUnit( self, anOutsideCompartment ): if ( anOutsideCompartment == '' ): return '' else: return self.Model.CompartmentUnit[ anOutsideCompartment ] def getCompartmentSize( self, ...
def __getCompartmentOutsideSize_Unit( self, aCompartment ):
aValue = self.__convertSpeciesValue( aSpecies[3], aSpecies )
if ( aSpecies[7] == '' or aSpecies[7] == 'mole' ): return float( aSpecies[3] ) * N_A elif ( aSpecies[7] == 'item' ): return float( aSpecies[3] ) else: return ( self.Model.convertUnit( aSpecies[7], aSpecies[3] ) ) * N_A
def getSpeciesValue( self, aSpecies ):
print aSpecies[1] + " : InitialAmount must be defined, but this model is undefined." sys.exit(1)
raise ValueError, "InitialAmount must be defined, but this model is undefined."
def getSpeciesValue( self, aSpecies ):
aValue = self.__convertSpeciesValue( aSpecies[3], aSpecies )
if ( aSpecies[5] != '' and aSpecies[5] != 'mole' ): return ( self.Model.convertUnit( aSpecies[5], aSpecies[3] ) ) * N_A elif( aSpecies[5] == 'item' ): return float( aSpecies[3] ) else: return float( aSpecies[3] ) * N_A
def getSpeciesValue( self, aSpecies ):
aSize = self.Model.CompartmentSize[ aSpecies[2] ] aSize = self.__convertSpeciesSize( aSize, aSpecies ) aValue = aSpecies[4] * aSize aValue = self.__convertSpeciesValue( aValue, aSpecies )
aValue = aSpecies[4] aSize = self.Model.CompartmentSize[aSpecies[2]] aValue = aValue * aSize * N_A if ( aSpecies[5] != '' ): aValue = self.Model.convertUnit( aSpecies[5], aValue ) if ( aSpecies[6] != '' ): return self.Model.convertUnit( aSpecies[6], aValue ) else: aCompartmentUnit = self.Model.CompartmentU...
def getSpeciesValue( self, aSpecies ):
aValue = "Unknown" return aValue def __convertSpeciesValue( self, aValue, aSpecies ):
raise ValueError, "Value must be defined as InitialAmount or InitialConcentration" def getConstant( self, aSpecies ):
def getSpeciesValue( self, aSpecies ):
if( aSpecies[7] != '' ): if( aSpecies[7] == "item" ): return aValue else: return self.__convertSpeciesUnit( aValue, aSpecies[7] )
if ( aSpecies[9] == 1 ): return aSpecies[9]
def __convertSpeciesValue( self, aValue, aSpecies ):
return aValue * N_A
return 0
def __convertSpeciesValue( self, aValue, aSpecies ):
if( aSpecies[5] != '' ): if( aSpecies[5] == "item" ): return aValue else: return self.__convertSpeciesUnit( aValue, aSpecies[5] )
if ( aSpecies[11] == 1 ): return aSpecies[11]
def __convertSpeciesValue( self, aValue, aSpecies ):
return aValue * N_A def __convertSpeciesSize( self, aSize, aSpecies ): if ( aSpecies[6] != '' ): for aCompartment in self.Model.CompartmentList: if( aCompartment[0] == aSpecies[2] ): if( aCompartment[2] == 0 or aSpecies[8] == 1 ): print "Error : SpatialSizeUnits must not have a value if spatialDimensions on the comp...
return 0
def __convertSpeciesValue( self, aValue, aSpecies ):
return 'Process:/:Rule' + str( self.RuleNumber ) def __convertVariableName( self, aASTNode ): aNumChildren = aASTNode.getNumChildren()
return 'Process:/SBMLRule:Rule' + str( self.RuleNumber ) def getVariableType( self, aName ): for aSpecies in self.Model.SpeciesList: if ( ( self.Model.Level == 1 and aSpecies[1] == aName ) or ( self.Model.Level == 2 and aSpecies[0] == aName ) ): return libsbml.SBML_SPECIES for aParameter in self.Model.Parameter...
def getRuleID( self ):
self.__convertVariableName( aASTNode.getLeftChild() ) self.__convertVariableName( aASTNode.getRightChild() )
self.__convertVariableName( anASTNode.getLeftChild() ) self.__convertVariableName( anASTNode.getRightChild() )
def __convertVariableName( self, aASTNode ):
self.__convertVariableName( aASTNode.getLeftChild() )
self.__convertVariableName( anASTNode.getLeftChild() )
def __convertVariableName( self, aASTNode ):
if ( aASTNode.isNumber() == 1 ):
if ( anASTNode.isNumber() == 1 ):
def __convertVariableName( self, aASTNode ):
aName = aASTNode.getName()
aName = anASTNode.getName()
def __convertVariableName( self, aASTNode ):
for aSpecies in self.Model.SpeciesList: if ( aSpecies[0] == aName or aSpecies[1] == aName): aVariableList = [] aVariableList.append( 'Variable' + str( self.VariableNumber ) ) self.VariableNumber = self.VariableNumber + 1 aVariableID = self.Model.getSpeciesReferenceID( aName ) aVariableList.append( 'Variable:' + aVaria...
aType = self.getVariableType( aName ) if ( aType == libsbml.SBML_SPECIES ): self.setSpeciesToVariableReference( aName ) newName.append( self.getVariableMolarConc( aName ) ) anASTNode.setName( newName[0] ) return anASTNode if ( aType == libsbml.SBML_PARAMETER ):
def __convertVariableName( self, aASTNode ):
return aASTNode
self.setParameterToVariableReference( aName ) newName.append( self.getVariableValue( aName ) ) anASTNode.setName( newName[0] ) return anASTNode if ( aType == libsbml.SBML_COMPARTMENT ): self.setCompartmentToVariableReference( aName ) newName.append( self.getVariableValue( aName ) ) anASTNode.setName( newName[0] ) re...
def __convertVariableName( self, aASTNode ):
aASTRootNode = parseFormula( aFormula )
aASTRootNode = libsbml.parseFormula( aFormula )
def convertRuleFormula( self, aFormula ):
convertedFormula = formulaToString( convertedAST )
convertedFormula = libsbml.formulaToString( convertedAST )
def convertRuleFormula( self, aFormula ):
def __convertVariableName( self, aASTNode ): aNumChildren = aASTNode.getNumChildren()
def __convertVariableName( self, anASTNode ): aNumChildren = anASTNode.getNumChildren()
def __convertVariableName( self, aASTNode ):
self.__convertVariableName( aASTNode.getLeftChild() ) self.__convertVariableName( aASTNode.getRightChild() )
self.__convertVariableName( anASTNode.getLeftChild() ) self.__convertVariableName( anASTNode.getRightChild() ) return anASTNode
def __convertVariableName( self, aASTNode ):
self.__convertVariableName( aASTNode.getLeftChild() )
self.__convertVariableName( anASTNode.getLeftChild() ) return anASTNode
def __convertVariableName( self, aASTNode ):
aASTNode.setName( newName[0] )
anASTNode.setName( newName[0] ) return anASTNode
def __convertVariableName( self, aASTNode ):
aParameterList = [] aParameterList.append( 'Parameter' + str( self.ParameterNumber ) )
self.ParameterNumber = self.ParameterNumber + 1 aParameterList.append( 'Variable:/SBMLParameter:' + aName )
def __convertVariableName( self, aASTNode ):
self.ParameterNumber = self.ParameterNumber + 1 aParameterList.append( 'Variable:/SBMLParameter:' + aName )
aParameterList.append( '0' ) self.VariableReferenceList.append( aParameterList ) newName.append( aParameterList[0] + '.Value' ) anASTNode.setName( newName[0] ) return anASTNode if ( newName == [] ): for aCompartment in self.Model.CompartmentList: if ( aCompartment[0] == aName or aCompartment[1] == aName ): for a...
def __convertVariableName( self, aASTNode ):
aParameterList.append( '0' ) self.VariableReferenceList.append( aParameterList ) newName.append( aParameterList[0] + '.Value' ) aASTNode.setName( newName[0] ) return aASTNode def convertKineticLaw( self, aFormula ): aASTRootNode = parseFormula( aFormula )
aCompartmentList.append( 'Variable:' + self.Model.getPath( aName ) + ':SIZE' ) aCompartmentList.append( '0' ) self.VariableReferenceList.append( aCompartmentList ) newName.append( aCompartmentList[0] + '.Value' ) anASTNode.setName( newName[0] ) return anASTNode return anASTNode def convertKineticLawFormula( ...
def __convertVariableName( self, aASTNode ):
convertedFormula = []
def convertKineticLaw( self, aFormula ):
convertedFormula.append( "( " + formulaToString( convertedAST ) + " )" + " * S0.getSuperSystem().SizeN_A" )
aConvertedFormula = "( " + libsbml.formulaToString( convertedAST ) + " )" + " * S0.getSuperSystem().SizeN_A" elif( self.VariableReferenceList[0][0] == "P0" ):
def convertKineticLaw( self, aFormula ):
elif( self.VariableReferenceList[0][0] == "P0" ): convertedFormula.append( "( " + formulaToString( convertedAST ) + " )" + " * P0.getSuperSystem().SizeN_A" )
aConvertedFormula = "( " + libsbml.formulaToString( convertedAST ) + " )" + " * P0.getSuperSystem().SizeN_A"
def convertKineticLaw( self, aFormula ):
convertedFormula.append( "( " + formulaToString( convertedAST ) + " )" + " * C0.getSuperSystem().SizeN_A" )
aConvertedFormula = "( " + libsbml.formulaToString( convertedAST ) + " )" +" * C0.getSuperSystem().SizeN_A"
def convertKineticLaw( self, aFormula ):
pass if( convertedFormula == [] ): convertedFormula.append( formulaToString( convertedAST ) ) return convertedFormula[0]
aConvertedFormula = libsbml.formulaToString( convertedAST ) return aConvertedFormula
def convertKineticLaw( self, aFormula ):
print "Name Error: Parameter must set the Parameter Name" sys.exit(1)
raise NameError, "Parameter must set the Parameter Name"
def getParameterID( self, aParameter ): if ( self.Model.Level == 1 ): if ( aParameter[1] != '' ): return 'Variable:/SBMLParameter:' + aParameter[1] else: print "Name Error: Parameter must set the Parameter Name" sys.exit(1) elif ( self.Model.Level == 2 ): if ( aParameter[0] != '' ): return 'Variable:/SBMLParameter:' + ...
print "Name Error: Parameter must set the Parameter ID" sys.exit(1)
raise NameError, "Parameter must set the Parameter ID"
def getParameterID( self, aParameter ): if ( self.Model.Level == 1 ): if ( aParameter[1] != '' ): return 'Variable:/SBMLParameter:' + aParameter[1] else: print "Name Error: Parameter must set the Parameter Name" sys.exit(1) elif ( self.Model.Level == 2 ): if ( aParameter[0] != '' ): return 'Variable:/SBMLParameter:' + ...
anArgumentTuple = tuple( self.theDirectoryName ) + sim + data
anArgumentTuple = tuple( self.theDirectoryName ) + (sim,) + (data,)
def createInstance( self, sim, data, parent=None ): aConstructor = self.theModule.__dict__[self.theName] anArgumentTuple = tuple( self.theDirectoryName ) + sim + data apply( aConstructor, anArgumentTuple )
def createInstance( self, name, sim, data, parent=None ):
def createInstance( self, classname, sim, data, parent=None ):
def createInstance( self, name, sim, data, parent=None ): try: aPlugin = self.thePluginMap[ name ] except KeyError: aPlugin = PluginModule( name ) self.thePluginMap[ name ] = aPlugin
aPlugin = self.thePluginMap[ name ]
aPlugin = self.thePluginMap[ classname ]
def createInstance( self, name, sim, data, parent=None ): try: aPlugin = self.thePluginMap[ name ] except KeyError: aPlugin = PluginModule( name ) self.thePluginMap[ name ] = aPlugin
aPlugin = PluginModule( name ) self.thePluginMap[ name ] = aPlugin
aPlugin = PluginModule( classname ) self.thePluginMap[ classname ] = aPlugin
def createInstance( self, name, sim, data, parent=None ): try: aPlugin = self.thePluginMap[ name ] except KeyError: aPlugin = PluginModule( name ) self.thePluginMap[ name ] = aPlugin
newdata=self.theOwner.recache(fpn,lasttime,points[fpn][0],self.pixelwidth)
newdata=self.theOwner.recache(fpn,lasttime,points[fpn][0],self.pixelwidth/2)
def addpoints(self, points): #must be zoom level 0 #if strip: redraw_flag=False
data_to, self.pixelwidth)
data_to, self.pixelwidth/2)
def getxframe_from_logger(self,fpn): #refreshes the whole displayed interval newdatabuffer=[] data_from=max(min(self.xframe[0],self.loggerstartendmap[fpn][1]),self.loggerstartendmap[fpn][0]) data_to=min(self.xframe[1],self.loggerstartendmap[fpn][1]) if self.theOwner.haslogger(fpn): newdatabuffer=self.theOwner.recache(f...
if y0<self.plotaread[1] and y1>self.plotaread[1]:
if y0<self.plotaread[1] and y1>=self.plotaread[1]:
def drawpoint(self, aFullPNString, datapoint): #get datapoint x y values #convert to plot coordinates if self.trace_onoff[aFullPNString]==gtk.FALSE: return 0 x=self.convertx_to_plot(datapoint[0]) y=self.converty_to_plot(datapoint[1]) cur_point_within_frame=self.withinframes([x,y]) #getlastpoint, calculate change to the...
if y0>self.plotaread[3] and y1<self.plotaread[3]:
if y0>self.plotaread[3] and y1<=self.plotaread[3]:
def drawpoint(self, aFullPNString, datapoint): #get datapoint x y values #convert to plot coordinates if self.trace_onoff[aFullPNString]==gtk.FALSE: return 0 x=self.convertx_to_plot(datapoint[0]) y=self.converty_to_plot(datapoint[1]) cur_point_within_frame=self.withinframes([x,y]) #getlastpoint, calculate change to the...
if y1<self.plotaread[1] and y0>self.plotaread[1]:
if y1<self.plotaread[1] and y0>=self.plotaread[1]:
def drawpoint(self, aFullPNString, datapoint): #get datapoint x y values #convert to plot coordinates if self.trace_onoff[aFullPNString]==gtk.FALSE: return 0 x=self.convertx_to_plot(datapoint[0]) y=self.converty_to_plot(datapoint[1]) cur_point_within_frame=self.withinframes([x,y]) #getlastpoint, calculate change to the...
if y1>self.plotaread[3] and y0<self.plotaread[3]:
if y1>self.plotaread[3] and y0<=self.plotaread[3]:
def drawpoint(self, aFullPNString, datapoint): #get datapoint x y values #convert to plot coordinates if self.trace_onoff[aFullPNString]==gtk.FALSE: return 0 x=self.convertx_to_plot(datapoint[0]) y=self.converty_to_plot(datapoint[1]) cur_point_within_frame=self.withinframes([x,y]) #getlastpoint, calculate change to the...