• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python moose.delete函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中moose.delete函数的典型用法代码示例。如果您正苦于以下问题:Python delete函数的具体用法?Python delete怎么用?Python delete使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了delete函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: _addSpine

 def _addSpine( self, parent, spineProto, pos, angle, x, y, z, size, k ):
     spine = moose.copy( spineProto, parent.parent, 'spine' + str(k) )
     kids = spine[0].children
     coords = []
     ppos = np.array( [parent.x0, parent.y0, parent.z0] )
     for i in kids:
         #print i.name, k
         j = i[0]
         j.name += str(k)
         #print 'j = ', j
         coords.append( [j.x0, j.y0, j.z0] )
         coords.append( [j.x, j.y, j.z] )
         self._scaleSpineCompt( j, size )
         moose.move( i, self.elecid )
     origin = coords[0]
     #print 'coords = ', coords
     # Offset it so shaft starts from surface of parent cylinder
     origin[0] -= parent.diameter / 2.0 
     coords = np.array( coords )
     coords -= origin # place spine shaft base at origin.
     rot = np.array( [x, [0,0,0], [0,0,0]] )
     coords = np.dot( coords, rot )
     moose.delete( spine )
     moose.connect( parent, "raxial", kids[0], "axial" )
     self._reorientSpine( kids, coords, ppos, pos, size, angle, x, y, z )
开发者ID:DineshDevPandey,项目名称:moose,代码行数:25,代码来源:rdesigneur.py


示例2: saveAndClearPlots

def saveAndClearPlots( name ):
    print 'saveAndClearPlots( ', name, ' )'
    for i in moose.wildcardFind( "/graphs/#" ):
        #print i
        #plot stuff
        i.xplot( name + '.xplot', i.name )
    moose.delete( "/graphs" )
开发者ID:NeuroArchive,项目名称:moose,代码行数:7,代码来源:chansFromProtoScript.py


示例3: loadAndRun

def loadAndRun(solver=True):
    simtime = 500e-3
    model = moose.loadModel('../data/h10.CNG.swc', '/cell')
    comp = moose.element('/cell/apical_e_177_0')
    soma = moose.element('/cell/soma')
    for i in range(10):
        moose.setClock(i, dt)
    if solver:
        solver = moose.HSolve('/cell/solver')
        solver.target = soma.path
        solver.dt = dt
    stim = moose.PulseGen('/cell/stim')
    stim.delay[0] = 50e-3
    stim.delay[1] = 1e9
    stim.level[0] = 1e-9
    stim.width[0] = 2e-3    
    moose.connect(stim, 'output', comp, 'injectMsg')
    tab = moose.Table('/cell/Vm')
    moose.connect(tab, 'requestOut', comp, 'getVm')
    tab_soma = moose.Table('/cell/Vm_soma')
    moose.connect(tab_soma, 'requestOut', soma, 'getVm')
    moose.reinit()
    print('[INFO] Running for %s' % simtime)
    moose.start(simtime )
    vec = tab_soma.vector 
    moose.delete( '/cell' )
    return vec
开发者ID:rahulgayatri23,项目名称:moose-core,代码行数:27,代码来源:issue_93.py


示例4: buildModel

    def buildModel( self, modelPath ):
        if not moose.exists( '/library' ):
            library = moose.Neutral( '/library' )
        if moose.exists( modelPath ):
            print "rdesigneur::buildModel: Build failed. Model '", \
                modelPath, "' already exists."
            return
        self.model = moose.Neutral( modelPath )
        try:
            self.buildCellProto()
            self.buildChanProto()
            self.buildSpineProto()
            self.buildChemProto()
            # Protos made. Now install the elec and chem protos on model.
            self.installCellFromProtos()
            # Now assign all the distributions
            self.buildPassiveDistrib()
            self.buildChanDistrib()
            self.buildSpineDistrib()
            self.buildChemDistrib()
            self._configureSolvers()
            self.buildAdaptors()
            self._configureClocks()
            self._printModelStats()

        except BuildError, msg:
            print "Error: rdesigneur: model build failed: ", msg
            moose.delete( self.model )
开发者ID:DineshDevPandey,项目名称:moose,代码行数:28,代码来源:rdesigneur.py


示例5: main

def main( runTime ):
    try:
        moose.delete('/acc92')
        print("Deleted old model")
    except Exception as  e:
        print("Could not clean. model not loaded yet")

    moose.loadModel('acc92_caBuff.g',loadpath,'gsl')  
    ca = moose.element(loadpath+'/kinetics/Ca')
    pr = moose.element(loadpath+'/kinetics/protein')
    clockdt = moose.Clock('/clock').dts 
    moose.setClock(8, 0.1)#simdt
    moose.setClock(18, 0.1)#plotdt
    print clockdt
    print " \t \t simdt ", moose.Clock('/clock').dts[8],"plotdt ",moose.Clock('/clock').dts[18]
    ori =  ca.concInit
    tablepath = loadpath+'/kinetics/Ca'
    tableele = moose.element(tablepath)
    table = moose.Table2(tablepath+'.con')
    x = moose.connect(table, 'requestOut', tablepath, 'getConc')
    tablepath1 = loadpath+'/kinetics/protein'
    tableele1 = moose.element(tablepath1)
    table1 = moose.Table2(tablepath1+'.con')
    x1 = moose.connect(table1, 'requestOut', tablepath1, 'getConc')

    ca.concInit = ori
    print("[INFO] Running for 4000 with Ca.conc %s " % ca.conc)
    moose.start(4000)

    ca.concInit = 5e-03
    print("[INFO] Running for 20 with Ca.conc %s " % ca.conc)
    moose.start(20)

    ca.concInit = ori
    moose.start( runTime ) #here give the interval time 

    ca.concInit = 5e-03
    print("[INFO] Running for 20 with Ca.conc %s " % ca.conc)
    moose.start(20)

    ca.concInit = ori
    print("[INFO] Running for 2000 with Ca.conc %s " % ca.conc)
    moose.start(2000)

    pylab.figure()
    pylab.subplot(2, 1, 1)
    t = numpy.linspace(0.0, moose.element("/clock").runTime, len(table.vector)) # sec
    pylab.plot( t, table.vector, label="Ca Conc (interval- 8000s)" )
    pylab.legend()
    pylab.subplot(2, 1, 2)
    t1 = numpy.linspace(0.0, moose.element("/clock").runTime, len(table1.vector)) # sec
    pylab.plot( t1, table1.vector, label="Protein Conc (interval- 8000s)" )
    pylab.legend()
    pylab.savefig( os.path.join( dataDir, '%s_%s.png' % (table1.name, runTime) ) )

    print('[INFO] Saving data to csv files in %s' % dataDir)
    tabPath1 = os.path.join( dataDir, '%s_%s.csv' % (table.name, runTime))
    numpy.savetxt(tabPath1, numpy.matrix([t, table.vector]).T, newline='\n')
    tabPath2 = os.path.join( dataDir, '%s_%s.csv' % (table1.name, runTime) )
    numpy.savetxt(tabPath2, numpy.matrix([t1, table1.vector]).T, newline='\n')
开发者ID:Ainurrohmah,项目名称:Scripts,代码行数:60,代码来源:run92_simple.py


示例6: main

def main():
    global synSpineList 
    global synDendList 
    numpy.random.seed( 1234 )
    rdes = buildRdesigneur( )
    for i in elecFileNames:
        print(i)
        rdes.cellProtoList = [ ['./cells/' + i, 'elec'] ]
        rdes.buildModel( )
        assert( moose.exists( '/model' ) )
        synSpineList = moose.wildcardFind( "/model/elec/#head#/glu,/model/elec/#head#/NMDA" )
        temp = set( moose.wildcardFind( "/model/elec/#/glu,/model/elec/#/NMDA" ) )

        synDendList = list( temp - set( synSpineList ) )
        moose.reinit()
        buildPlots( rdes )
        # Run for baseline, tetanus, and post-tetanic settling time 
        t1 = time.time()
        probeStimulus( baselineTime )
        tetanicStimulus( tetTime )
        probeStimulus( postTetTime )
        print(('real time = ', time.time() - t1))

        printPsd( i + ".fig5" )
        saveAndClearPlots( i + ".fig5" )
        moose.delete( '/model' )
        rdes.elecid = moose.element( '/' )
开发者ID:dilawar,项目名称:moose-examples,代码行数:27,代码来源:Fig5BCD.py


示例7: main

def main():
    global synSpineList 
    global synDendList 
    numpy.random.seed( 1234 )
    rdes = buildRdesigneur()
    for i in elecFileNames:
        print(i)
        rdes.cellProtoList = [ ['./cells/' + i, 'elec'] ]
        rdes.buildModel( '/model' )
        rdes.soma.inject = inject
        assert( moose.exists( '/model' ) )
        synSpineList = moose.wildcardFind( "/model/elec/#head#/glu,/model/elec/#head#/NMDA" )
        temp = set( moose.wildcardFind( "/model/elec/#/glu,/model/elec/#/NMDA" ) )
        synDendList = list( temp - set( synSpineList ) )
        print("[INFO] reinitialzing")
        moose.reinit()
        buildPlots( rdes )
        # Run for baseline, tetanus, and post-tetanic settling time 
        t1 = time.time()
        moose.start( runtime )
        print('runtime = ', runtime, '; real time = ', time.time() - t1)

        saveAndClearPlots( "bigElec" )
        moose.delete( '/model' )
        rdes.elecid = moose.element( '/' )
开发者ID:BhallaLab,项目名称:benchmarks,代码行数:25,代码来源:bigElec.py


示例8: updateDisplay

def updateDisplay():
    makeYmodel()
    tabvec = moose.wildcardFind( '/model/graphs/plot#' )
    moose.element( '/model/elec/' ).name = 'Y'
    vecYdend = moose.wildcardFind( '/model/Y/soma,/model/Y/dend#' )
    vecYbranch1 = moose.wildcardFind( '/model/Y/branch1#' )
    vecYbranch2 = moose.wildcardFind( '/model/Y/branch2#' )
    moose.reinit()
    dt = interval1
    currtime = 0.0
    for i in lines:
        moose.start( dt )
        currtime += dt
        #print "############## NumDendData = ", len( vecYdend )
        i.YdendLines.set_ydata( [v.Vm*1000 for v in vecYdend] )
        i.Ybranch1Lines.set_ydata( [v.Vm*1000 for v in vecYbranch1] )
        i.Ybranch2Lines.set_ydata( [v.Vm*1000 for v in vecYbranch2] )
        dt = interval2

    moose.start( runtime - currtime )

    #print "############## len (tabvec)  = ", len( tabvec[0].vector )
    for i, tab in zip( tplot, tabvec ):
        i.set_ydata( tab.vector * 1000 )
    
    moose.delete( '/model' )
    moose.delete( '/library' )
开发者ID:dilawar,项目名称:moose-examples,代码行数:27,代码来源:ephys3_synaptic_summation.py


示例9: transformNMDAR

def transformNMDAR( path ):
    for i in moose.wildcardFind( path + "/##/#NMDA#[ISA!=NMDAChan]" ):
        chanpath = i.path
        pa = i.parent
        i.name = '_temp'
        if ( chanpath[-3:] == "[0]" ):
            chanpath = chanpath[:-3]
        nmdar = moose.NMDAChan( chanpath )
        sh = moose.SimpleSynHandler( chanpath + '/sh' )
        moose.connect( sh, 'activationOut', nmdar, 'activation' )
        sh.numSynapses = 1
        sh.synapse[0].weight = 1
        nmdar.Ek = i.Ek
        nmdar.tau1 = i.tau1
        nmdar.tau2 = i.tau2
        nmdar.Gbar = i.Gbar
        nmdar.CMg = 12
        nmdar.KMg_A = 1.0 / 0.28
        nmdar.KMg_B = 1.0 / 62
        nmdar.temperature = 300
        nmdar.extCa = 1.5
        nmdar.intCa = 0.00008
        nmdar.intCaScale = 1
        nmdar.intCaOffset = 0.00008
        nmdar.condFraction = 0.02
        moose.delete( i )
        moose.connect( pa, 'channel', nmdar, 'channel' )
        caconc = moose.wildcardFind( pa.path + '/#[ISA=CaConcBase]' )
        if ( len( caconc ) < 1 ):
            print('no caconcs found on ', pa.path)
        else:
            moose.connect( nmdar, 'ICaOut', caconc[0], 'current' )
            moose.connect( caconc[0], 'concOut', nmdar, 'assignIntCa' )
开发者ID:hrani,项目名称:moose-core,代码行数:33,代码来源:rdesigneurProtos.py


示例10: buildModel

    def buildModel( self, modelPath = '/model' ):
        if moose.exists( modelPath ):
            print("rdesigneur::buildModel: Build failed. Model '",
                modelPath, "' already exists.")
            return
        self.model = moose.Neutral( modelPath )
        self.modelPath = modelPath
        try:
            # Protos made in the init phase. Now install the elec and 
            # chem protos on model.
            self.installCellFromProtos()
            # Now assign all the distributions
            self.buildPassiveDistrib()
            self.buildChanDistrib()
            self.buildSpineDistrib()
            self.buildChemDistrib()
            self._configureSolvers()
            self.buildAdaptors()
            self._buildPlots()
            self._buildMoogli()
            self._buildStims()
            self._configureClocks()
            self._printModelStats()

        except BuildError as msg:
            print("Error: rdesigneur: model build failed:", msg)
            moose.delete( self.model )
开发者ID:asiaszmek,项目名称:moose-core,代码行数:27,代码来源:rdesigneur.py


示例11: newModelDialogSlot

    def newModelDialogSlot(self):
        if self.popup is not None:
            self.popup.close()
        newModelDialog = DialogWidget()
        if newModelDialog.exec_():
            modelPath = str(newModelDialog.modelPathEdit.text()).strip()
            if len(modelPath) == 0:
                raise mexception.ElementNameError('Model path cannot be empty')
            if re.search('[ /]',modelPath) is not None:
                raise mexception.ElementNameError('Model path should not containe / or whitespace')
            plugin = str(newModelDialog.getcurrentRadioButton())
            if moose.exists(modelPath+'/model'):
                moose.delete(modelPath)

            modelContainer = moose.Neutral('%s' %(modelPath))
            modelRoot = moose.Neutral('%s/%s' %(modelContainer.path,"model"))
            if not moose.exists(modelRoot.path+'/info'):
                moose.Annotator(modelRoot.path+'/info')
            
            modelAnno = moose.element(modelRoot.path+'/info')
            modelAnno.modeltype = "new_kkit"
            modelAnno.dirpath = " "
            self.loadedModelsAction(modelRoot.path,plugin)
            self.setPlugin(plugin, modelRoot.path)
            self.objectEditSlot('/', False)
开发者ID:dilawar,项目名称:moose-gui,代码行数:25,代码来源:MWindow.py


示例12: transformNMDAR

def transformNMDAR(path):
    for i in moose.wildcardFind(path + "/##/#NMDA#[ISA!=NMDAChan]"):
        chanpath = i.path
        pa = i.parent
        i.name = "_temp"
        if chanpath[-3:] == "[0]":
            chanpath = chanpath[:-3]
        nmdar = moose.NMDAChan(chanpath)
        sh = moose.SimpleSynHandler(chanpath + "/sh")
        moose.connect(sh, "activationOut", nmdar, "activation")
        sh.numSynapses = 1
        sh.synapse[0].weight = 1
        nmdar.Ek = i.Ek
        nmdar.tau1 = i.tau1
        nmdar.tau2 = i.tau2
        nmdar.Gbar = i.Gbar
        nmdar.CMg = 12
        nmdar.KMg_A = 1.0 / 0.28
        nmdar.KMg_B = 1.0 / 62
        nmdar.temperature = 300
        nmdar.extCa = 1.5
        nmdar.intCa = 0.00008
        nmdar.intCaScale = 1
        nmdar.intCaOffset = 0.00008
        nmdar.condFraction = 0.02
        moose.delete(i)
        moose.connect(pa, "channel", nmdar, "channel")
        caconc = moose.wildcardFind(pa.path + "/#[ISA=CaConcBase]")
        if len(caconc) < 1:
            print("no caconcs found on ", pa.path)
        else:
            moose.connect(nmdar, "ICaOut", caconc[0], "current")
            moose.connect(caconc[0], "concOut", nmdar, "assignIntCa")
开发者ID:BhallaLab,项目名称:moose,代码行数:33,代码来源:rdesigneurProtos.py


示例13: main

def main( standalone = False ):
    runtime = 100
    makeModel()
    moose.reinit()
    moose.start( runtime )
    assert( almostEq( moose.element( 'model/compartment/s' ).conc,
        moose.element( '/model/endo/s' ).conc ) )
    moose.delete( '/model' )
开发者ID:hrani,项目名称:moose-core,代码行数:8,代码来源:test_Xreacs3.py


示例14: main

def main( standalone = False ):
    runtime = 200
    displayInterval = 2
    makeModel()
    moose.reinit()
    moose.start( runtime )
    assert( almostEq( 2.0 * moose.element( 'model/compartment/s' ).conc,
        moose.element( '/model/endo/s' ).conc ) )
    moose.delete( '/model' )
开发者ID:hrani,项目名称:moose-core,代码行数:9,代码来源:test_Xreacs4a.py


示例15: deleteSolver

def deleteSolver(modelRoot):
	compts = moose.wildcardFind(modelRoot+'/##[ISA=ChemCompt]')
	for compt in compts:
		if moose.exists(compt.path+'/stoich'):
			st = moose.element(compt.path+'/stoich')
			st_ksolve = st.ksolve
			moose.delete(st)
			if moose.exists((st_ksolve).path):
				moose.delete(st_ksolve)
开发者ID:asiaszmek,项目名称:moose,代码行数:9,代码来源:setsolver.py


示例16: remove_objects

def remove_objects():
    print ("setup before yield")
    yield
    print ("teardown after yield")
    for i in ('/data', '/pulse', '/D1', '/D2', '/library'):
        try:
            moose.delete(i)
        except ValueError:
            pass
开发者ID:neurord,项目名称:spspine,代码行数:9,代码来源:test_basic_simulation.py


示例17: main

def main():
	"""
You can use the PyRun class to run Python statements from MOOSE at
runtime. This opens up many possibilities of interleaving computing in
Python and MOOSE. You can also use this for debugging simulations.
	"""
	run_sequence()
	moose.delete('/model')
	input_output()
开发者ID:dilawar,项目名称:moose-examples,代码行数:9,代码来源:pyrun.py


示例18: moveCompt

def moveCompt( path, oldParent, newParent ):
	meshEntries = moose.element( newParent.path + '/mesh' )
	# Set up vol messaging from new compts to all their child objects.
	for x in moose.wildcardFind( path + '/##[ISA=PoolBase]' ):
		moose.connect( meshEntries, 'mesh', x, 'mesh', 'OneToOne' )
	orig = moose.element( path )
	moose.move( orig, newParent )
	moose.delete( moose.vec( oldParent.path ) )
	chem = moose.element( '/model/chem' )
	moose.move( newParent, chem )
开发者ID:NeuroArchive,项目名称:moose,代码行数:10,代码来源:x_compt.py


示例19: testDelete

 def testDelete(self):
     print('Testing delete ...', end=' ')
     msg = self.src1.connect('raxial', self.dest1, 'axial')
     src2 = moose.PulseGen('/pulsegen')
     msg2 = moose.connect(src2, 'output', self.dest1, 'injectMsg')
     moose.delete(msg)
     # accessing deleted element should raise error
     with self.assertRaises(ValueError):
         p = msg.path
     p = msg2.path # this should not raise any error
开发者ID:asiaszmek,项目名称:moose-core,代码行数:10,代码来源:test_pymoose.py


示例20: deleteSolver

def deleteSolver(modelRoot):
	if moose.wildcardFind(modelRoot+'/##[ISA=ChemCompt]'):
		compt = moose.wildcardFind(modelRoot+'/##[ISA=ChemCompt]')
		if ( moose.exists( compt[0].path+'/stoich' ) ):
			st = moose.element(compt[0].path+'/stoich')
			if moose.exists((st.ksolve).path):
				moose.delete(st.ksolve)
			moose.delete( compt[0].path+'/stoich' )
	for x in moose.wildcardFind( modelRoot+'/data/graph#/#' ):
                x.tick = -1
开发者ID:NeuroArchive,项目名称:moose,代码行数:10,代码来源:setsolver.py



注:本文中的moose.delete函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python moose.element函数代码示例发布时间:2022-05-27
下一篇:
Python moose.copy函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap