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

Python project.ProjectManager类代码示例

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

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



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

示例1: load_project

 def load_project(self, fname):
     file = File(fname)
     print 'Loading project file: ', file.getAbsolutePath()
     pm = ProjectManager()
     project = pm.loadProject(file)
     print pm.status()
     return project
开发者ID:OpenSourceBrain,项目名称:korngreen-pyramidal,代码行数:7,代码来源:create_nc_cell.py


示例2: testAll

def testAll(argv=None):
    if argv is None:
        argv = sys.argv

    print "Loading project from "+ projFile.getCanonicalPath()
    
    projectManager = ProjectManager()
    project = projectManager.loadProject(projFile)

    assert(len(project.getProjectDescription())>0)

    assert(len(project.cellManager.getAllCells())>=7)

    assert(len(project.cellGroupsInfo.getAllCellGroupNames())>=4)

    assert(project.simulationParameters.getDt()-0.0125<=1e-6)

    assert(project.neuronSettings.isVarTimeStep())

    assert(project.neuronSettings.getDataSaveFormat().equals(NeuronSettings.DataSaveFormat.TEXT_NC))

    assert(project.simulationParameters.getTemperature()- 6.3<=1e-6)
    
    defSimConfig = project.simConfigInfo.getSimConfig("Default Simulation Configuration")
    assert(str(defSimConfig.getCellGroups())=='[CellGroup_1]')
    assert(project.cellGroupsInfo.getCellType("CellGroup_1")=='L5PC')


    print "\n**************************************"
    print "    All tests passed!"
    print "**************************************\n"
开发者ID:OpenSourceBrain,项目名称:L5bPyrCellHayEtAl2011,代码行数:31,代码来源:TestProject.py


示例3: testAll

def testAll(argv=None):
    if argv is None:
        argv = sys.argv

    print "Loading project from "+ projFile.getCanonicalPath()
    
    projectManager = ProjectManager()
    project = projectManager.loadProject(projFile)

    assert(len(project.getProjectDescription())>0)

    assert(len(project.cellManager.getAllCells())>=6)

    #assert(project.proj3Dproperties.getDisplayOption() == Display3DProperties.DISPLAY_SOMA_SOLID_NEURITE_LINE)

    assert(abs(project.simulationParameters.getDt()-0.005)<=1e-9)
    
    assert(abs(project.simulationParameters.getTemperature() - 10) < 1e-6)

    assert(not project.neuronSettings.isVarTimeStep())

    assert(project.neuronSettings.getDataSaveFormat().equals(NeuronSettings.DataSaveFormat.TEXT_NC))

    #assert(project.genesisSettings.isSymmetricCompartments())

    assert(project.genesisSettings.isSIUnits())

    print "\n**************************************"
    print "    All tests passed!"
    print "**************************************\n"
开发者ID:OpenSourceBrain,项目名称:PyloricNetwork,代码行数:30,代码来源:CheckProject.py


示例4: testAll

def testAll(argv=None):
    if argv is None:
        argv = sys.argv

    print "Loading project from " + projFile.getCanonicalPath()

    projectManager = ProjectManager()
    project = projectManager.loadProject(projFile)

    assert len(project.getProjectDescription()) > 0

    assert len(project.cellManager.getAllCells()) >= 22

    assert len(project.cellGroupsInfo.getAllCellGroupNames()) >= 6

    assert project.proj3Dproperties.getDisplayOption() == Display3DProperties.DISPLAY_SOMA_SOLID_NEURITE_LINE

    assert project.simulationParameters.getDt() - 0.025 <= 1e-6

    assert not project.neuronSettings.isVarTimeStep()

    assert project.neuronSettings.getDataSaveFormat().equals(NeuronSettings.DataSaveFormat.TEXT_NC)

    assert project.simulationParameters.getTemperature() == 34

    sci = project.simConfigInfo
    cgi = project.cellGroupsInfo

    assert cgi.getCellType("Channeltestgroup") == "Channeltest_Cell"
    assert cgi.getCellType("CMLtestGroup") == "CMLtest_Cell"
    assert cgi.getCellType("pyr_group") == "LarkumPyr"
    assert cgi.getCellType("pyrCML_group") == "LarkumPyr_NML"

    arrayListsIdentical(
        sci.getSimConfig("Default Simulation Configuration").getCellGroups(), ["Channeltestgroup", "CMLtestGroup"]
    )
    arrayListsIdentical(sci.getSimConfig("test_IClamp").getCellGroups(), ["pyr_group", "pyrCML_group"])
    arrayListsIdentical(sci.getSimConfig("background activity").getCellGroups(), ["pyr_group"])

    print "\n**************************************"
    print "    All tests passed!"
    print "**************************************\n"
开发者ID:pgleeson,项目名称:TestArea,代码行数:42,代码来源:TestProject.py


示例5: __init__

 def __init__(self, pconf):
     configDict = pconf.parse_project_data()
     self.pconf = pconf
     self.logger = pconf.get_logger("neurosim")
     self.proj_path = self.pconf.local_path(configDict["proj_path"])
     self.pm = ProjectManager()
     
     projFile = File(self.proj_path)
     self.sim_timeout = self.pconf.get_float("sim_timeout", "Simulation")
     self.myProject = self.pm.loadProject(projFile)
     self.simConfig = self.myProject.simConfigInfo.getSimConfig(self.pconf.get("sim_config", "Simulation"))
开发者ID:ChristophMetzner,项目名称:ROB-SS14-BachProj,代码行数:11,代码来源:neurosim.py


示例6: testAll

def testAll(argv=None):
    if argv is None:
        argv = sys.argv

    print "Loading project from "+ projFile.getCanonicalPath()
    
    projectManager = ProjectManager()
    project = projectManager.loadProject(projFile)

    assert(len(project.getProjectDescription())>0)

    assert(len(project.cellManager.getAllCells())>=6)

    #assert(project.proj3Dproperties.getDisplayOption() == Display3DProperties.DISPLAY_SOMA_SOLID_NEURITE_LINE)

    assert(abs(project.simulationParameters.getDt()-0.01)<=1e-9)
    
    assert(abs(project.simulationParameters.getTemperature() - 6.3) < 1e-6)

    assert(not project.neuronSettings.isVarTimeStep())

    assert(project.neuronSettings.getDataSaveFormat().equals(NeuronSettings.DataSaveFormat.TEXT_NC))

    assert(project.genesisSettings.isSymmetricCompartments())

    assert(project.genesisSettings.isSIUnits())
    
    defSimConfig = project.simConfigInfo.getSimConfig("Default Simulation Configuration")
    assert(str(defSimConfig.getCellGroups())=='[baskets, pyramidals]')
    
    smallNetSimConfig = project.simConfigInfo.getSimConfig("SmallNetwork")
    
    assert(smallNetSimConfig.getCellGroups().size()==2)
    assert(smallNetSimConfig.getNetConns().size()==4)
    assert(smallNetSimConfig.getInputs().size()==1)
    assert(project.cellGroupsInfo.getCellPackingAdapter("pyramidals_48").getMaxNumberCells()==48)
    assert(project.cellGroupsInfo.getCellPackingAdapter("baskets_12").getMaxNumberCells()==12)

    print "\n**************************************"
    print "    All tests passed!"
    print "**************************************\n"
开发者ID:JustasB,项目名称:ACnet2,代码行数:41,代码来源:CheckProject.py


示例7: testAll

def testAll(argv=None):
    if argv is None:
        argv = sys.argv

    print "Loading project from "+ projFile.getCanonicalPath()
    
    projectManager = ProjectManager()
    project = projectManager.loadProject(projFile)

    assert(len(project.getProjectDescription())>0)

    assert(len(project.cellManager.getAllCells())>=7)

    assert(len(project.cellGroupsInfo.getAllCellGroupNames())>=4)

    assert(project.simulationParameters.getDt()-0.0125<=1e-6)

    assert(project.neuronSettings.isVarTimeStep())

    assert(project.neuronSettings.getDataSaveFormat().equals(NeuronSettings.DataSaveFormat.TEXT_NC))

    assert(project.simulationParameters.getTemperature() == 34)

    '''
    sci = project.simConfigInfo
    cgi = project.cellGroupsInfo

    assert(cgi.getCellType("Channeltestgroup") == "Channeltest_Cell")
    assert(cgi.getCellType("CMLtestGroup") == "CMLtest_Cell")
    assert(cgi.getCellType("pyr_group") == "LarkumPyr")
    assert(cgi.getCellType("pyrCML_group") == "LarkumPyr_NML")

    arrayListsIdentical(sci.getSimConfig("Default Simulation Configuration").getCellGroups(), ["Channeltestgroup", "CMLtestGroup"])
    arrayListsIdentical(sci.getSimConfig("test_IClamp").getCellGroups(), ["pyr_group", "pyrCML_group"])
    arrayListsIdentical(sci.getSimConfig("background activity").getCellGroups(), ["pyr_group"])
    '''

    print "\n**************************************"
    print "    All tests passed!"
    print "**************************************\n"
开发者ID:OpenSourceBrain,项目名称:korngreen-pyramidal,代码行数:40,代码来源:TestProject.py


示例8: testAll

def testAll(argv=None):
    if argv is None:
        argv = sys.argv

    print "Loading project from "+ projFile.getCanonicalPath()
    
    projectManager = ProjectManager()
    project = projectManager.loadProject(projFile)

    assert(len(project.getProjectDescription())>0)

    assert(len(project.cellManager.getAllCells())>=1)

    #assert(project.proj3Dproperties.getDisplayOption() == Display3DProperties.DISPLAY_SOMA_SOLID_NEURITE_LINE)

    assert(abs(project.simulationParameters.getDt()-0.02)<=1e-9)
    
    assert(abs(project.simulationParameters.getTemperature() - 6.3) < 1e-6)

    assert(not project.neuronSettings.isVarTimeStep())

    assert(project.neuronSettings.getDataSaveFormat().equals(NeuronSettings.DataSaveFormat.TEXT_NC))

    assert(project.genesisSettings.isSIUnits())
    
    defSimConfig = project.simConfigInfo.getSimConfig("Default Simulation Configuration")
    assert(str(defSimConfig.getCellGroups())=='[SampleCellGroup]')
    
    assert(defSimConfig.getCellGroups().size()==1)
    
    assert(defSimConfig.getInputs().size()==1)
    

    print "\n**************************************"
    print "    All tests passed!"
    print "**************************************\n"
开发者ID:OpenSourceBrain,项目名称:osb-model-validation,代码行数:36,代码来源:CheckProject.py


示例9: quit

except ImportError:
    print "Note: this file should be run using ..\\nC.bat -python XXX.py' or './nC.sh -python XXX.py'"
    print "See http://www.neuroconstruct.org/docs/python.html for more details"
    quit()

from ucl.physiol.neuroconstruct.project import ProjectManager

from math import *


# Load an existing neuroConstruct project

projFile = File("TestPython/TestPython.neuro.xml")
print "Loading project from file: " + projFile.getAbsolutePath() + ", exists: " + str(projFile.exists())

pm = ProjectManager()
myProject = pm.loadProject(projFile)
print "Loaded project: " + myProject.getProjectName()


# Add a number of cells to the generatedCellPositions, connections to generatedNetworkConnections
# and electrical inputs to generatedElecInputs
numCells = 12

for i in range(0, numCells):
    x = 100 * sin(i * 2 * pi / numCells)
    y = 100 * cos(i * 2 * pi / numCells)
    myProject.generatedCellPositions.addPosition("SampleCellGroup", i, x, y, 0)

    if i != numCells - 1:
        myProject.generatedNetworkConnections.addSynapticConnection("NC1", i, i + 1)
开发者ID:ChristophMetzner,项目名称:ROB-SS14-BachProj,代码行数:31,代码来源:Ex4_SaveNetworkML.py


示例10: testAll

def testAll(argv=None):
    if argv is None:
        argv = sys.argv

    # Load an existing neuroConstruct project
    projFile = File("../CElegans.ncx")
    print "Loading project from file: " + projFile.getAbsolutePath() + ", exists: " + str(projFile.exists())

    pm = ProjectManager()
    project = pm.loadProject(projFile)
    print "Loaded project: " + project.getProjectName()

    defSimConfig = project.simConfigInfo.getDefaultSimConfig()
    cellsOnlySimConfig = project.simConfigInfo.getSimConfig("CellsOnly")
    pharyngealSimConfig = project.simConfigInfo.getSimConfig("PharyngealNeurons")

    expectedNumberCells = 302

    ##########################

    print "\n----- Test 1: Check number of cells in sim config " + defSimConfig.getName() + "..."

    pm.doGenerate(defSimConfig.getName(), 1234)

    while pm.isGenerating():
        print "Waiting for the project to be generated with Simulation Configuration: " + str(defSimConfig)
        sleep(2)

    numGenerated = project.generatedCellPositions.getNumberInAllCellGroups()

    print "Number of cells generated: " + str(numGenerated)

    assert numGenerated == expectedNumberCells

    print "Correct number of cells generated!"

    ##########################

    print "\n---- Test 2: number of cells in sim config " + cellsOnlySimConfig.getName() + "..."

    pm.doGenerate(cellsOnlySimConfig.getName(), 1234)

    while pm.isGenerating():
        print "Waiting for the project to be generated with Simulation Configuration: " + str(cellsOnlySimConfig)
        sleep(2)

    numGenerated = project.generatedCellPositions.getNumberInAllCellGroups()

    print "Number of cells generated: " + str(numGenerated)

    assert numGenerated == expectedNumberCells

    print "Correct number of cells generated!"

    ##########################

    filename = "../../CElegansNeuronTables.xls"
    print "\n---- Test 3: confirm settings in project match those in  " + filename + "..."

    from xlrd import open_workbook

    rb = open_workbook(filename)

    print "Opened Excel file: " + filename

    confirmed = 0
    prefix = "NCXLS_"

    for row in range(1, rb.sheet_by_index(0).nrows):
        pre = rb.sheet_by_index(0).cell(row, 0).value
        post = rb.sheet_by_index(0).cell(row, 1).value
        syntype = rb.sheet_by_index(0).cell(row, 2).value
        num = int(rb.sheet_by_index(0).cell(row, 3).value)
        synclass = rb.sheet_by_index(0).cell(row, 4).value

        # print "------------------------------------------\nConnection %i has %i from %s to %s (type: %s, synapse: %s)" %(row, num, pre, post, syntype, synclass)

        netConnName = prefix + pre + "_" + post

        if "GapJunction" in syntype:
            netConnName = netConnName + "_GJ"

        src = project.morphNetworkConnectionsInfo.getSourceCellGroup(netConnName)
        tgt = project.morphNetworkConnectionsInfo.getTargetCellGroup(netConnName)

        if not (src == pre and tgt == post):
            print "------------------------------------------\nConnection %i has %i from %s to %s (type: %s, synapse: %s)" % (
                row,
                num,
                pre,
                post,
                syntype,
                synclass,
            )
            print "*** Couldn't find connection: %s, src: %s, tgt: %s" % (netConnName, src, tgt)
            assert src == pre
            assert tgt == post

        if src == tgt:
            print "------------------------------------------\nConnection %i has %i from %s to %s (type: %s, synapse: %s)" % (
#.........这里部分代码省略.........
开发者ID:mattions,项目名称:CElegansNeuroML,代码行数:101,代码来源:CheckProject.py


示例11: testAll

def testAll(argv=None):
    if argv is None:
        argv = sys.argv

    # Load an existing neuroConstruct project
    projFile = File("../CElegans.ncx")
    print "Loading project from file: " + projFile.getAbsolutePath()+", exists: "+ str(projFile.exists())

    pm = ProjectManager()
    project = pm.loadProject(projFile)
    print "Loaded project: " + project.getProjectName()


    defSimConfig = project.simConfigInfo.getDefaultSimConfig()
    cellsOnlySimConfig = project.simConfigInfo.getSimConfig("CellsOnly")
    pharyngealSimConfig = project.simConfigInfo.getSimConfig("PharyngealNeurons")
    mdl08SimConfig = project.simConfigInfo.getSimConfig("MDL08Connections")

    expectedNumberCells = 302 

    
    ##########################
    
    print "\n----- Test 1: Check number of cells in sim config "+defSimConfig.getName()+"..."


    pm.doGenerate(defSimConfig.getName(), 1234)

    while pm.isGenerating():
            print "Waiting for the project to be generated with Simulation Configuration: "+str(defSimConfig)
            sleep(2)

    numGenerated = project.generatedCellPositions.getNumberInAllCellGroups()

    print "Number of cells generated: " + str(numGenerated)

    assert numGenerated == expectedNumberCells

    print "Correct number of cells generated!"

    ##########################

    print "\n---- Test 2: number of cells in sim config "+cellsOnlySimConfig.getName()+"..."


    pm.doGenerate(cellsOnlySimConfig.getName(), 1234)

    while pm.isGenerating():
            print "Waiting for the project to be generated with Simulation Configuration: "+str(cellsOnlySimConfig)
            sleep(2)

    numGenerated = project.generatedCellPositions.getNumberInAllCellGroups()

    print "Number of cells generated: " + str(numGenerated)

    assert numGenerated == expectedNumberCells

    print "Correct number of cells generated!"
    
    ##########################

    filename = "../../CElegansNeuronTables.xls"
    print "\n---- Test 3: confirm settings in project match those in  "+filename+"..."

    from xlrd import open_workbook
    rb = open_workbook(filename)

    print "Opened Excel file: "+ filename

    confirmed = 0
    prefix = "NCXLS_"

    for row in range(1,rb.sheet_by_index(0).nrows):
      pre = rb.sheet_by_index(0).cell(row,0).value
      post = rb.sheet_by_index(0).cell(row,1).value
      syntype = rb.sheet_by_index(0).cell(row,2).value
      num = int(rb.sheet_by_index(0).cell(row,3).value)
      synclass = rb.sheet_by_index(0).cell(row,4).value

      #print "------------------------------------------\nConnection %i has %i from %s to %s (type: %s, synapse: %s)" %(row, num, pre, post, syntype, synclass)


      netConnName = prefix+pre+"_"+post

      if "GapJunction" in syntype:
            netConnName = netConnName + "_GJ"

      src = project.morphNetworkConnectionsInfo.getSourceCellGroup(netConnName)
      tgt = project.morphNetworkConnectionsInfo.getTargetCellGroup(netConnName)

      synlist = project.morphNetworkConnectionsInfo.getSynapseList(netConnName)

      #print synlist

      assert synclass == synlist[0].getSynapseType()

      if '_GJ' in synclass and synclass != 'Generic_GJ':
        print "Only allowed gap junction synapse is Generic_GJ, not "+synclass
        assert synclass == 'Generic_GJ'
      
#.........这里部分代码省略.........
开发者ID:Jueast,项目名称:CElegansNeuroML,代码行数:101,代码来源:CheckProject.py


示例12: quit

except ImportError:
    print "Note: this file should be run using ..\\nC.bat -python XXX.py' or './nC.sh -python XXX.py'"
    print "See http://www.neuroconstruct.org/docs/python.html for more details"
    quit()

from ucl.physiol.neuroconstruct.project import ProjectManager
from ucl.physiol.neuroconstruct.project import SimConfig

from math import *
from random import *

# Load an existing neuroConstruct project
projFile = File("../../CElegans.ncx")
print "Loading project from file: " + projFile.getAbsolutePath()+", exists: "+ str(projFile.exists())

pm = ProjectManager()
project = pm.loadProject(projFile)
print "Loaded project: " + project.getProjectName()


##########################

newSimConfig = "MDL08Connections"
newSimConfigDesc = "Generates a subset of the CElegans neural system consisting of the MDL08 muscle and motor neurons which connect to it. See https://github.com/openworm/OpenWorm/issues/53"
cells = ["AS1", "AS2", "DA1", "DA2", "DB1", "DD1", "SMDDL", "SMDDR", "MDL08"]


##########################

simConfig = SimConfig(newSimConfig, newSimConfigDesc)
开发者ID:Jueast,项目名称:CElegansNeuroML,代码行数:30,代码来源:CreateSimConfigSubset.py


示例13: File

from ucl.physiol.neuroconstruct.gui.plotter import PlotManager
from ucl.physiol.neuroconstruct.gui.plotter import PlotCanvas
from ucl.physiol.neuroconstruct.dataset import DataSet
from math import *
import time
import shutil
import random
import os
import subprocess

# Load the original project
projName = "LarkumEtAl2009"
projFile = File("/home/matteo/neuroConstruct/models/"+projName+"/"+projName+".ncx")

print "Loading project from file: " + projFile.getAbsolutePath()+", exists: "+ str(projFile.exists())
pm = ProjectManager()
myProject = pm.loadProject(projFile)
simConfig = myProject.simConfigInfo.getSimConfig("Default Simulation Configuration")#
randomseed = random.randint(1000,5000)
pm.doGenerate(simConfig.getName(),  randomseed)
while pm.isGenerating():
    print "Waiting for the project to be generated..."
    time.sleep(2)    
numGenerated = myProject.generatedCellPositions.getNumberInAllCellGroups()

simsRunning = []
def updateSimsRunning():
    simsFinished = []
    for sim in simsRunning:
        timeFile = File(myProject.getProjectMainDirectory(), "simulations/"+sim+"/time.dat")
        #print "Checking file: "+timeFile.getAbsolutePath() +", exists: "+ str(timeFile.exists())
开发者ID:pgleeson,项目名称:TestArea,代码行数:31,代码来源:PNMDAs_distributedinput.py


示例14: testAll

def testAll(argv=None):
    if argv is None:
        argv = sys.argv

    print "Loading project from "+ projFile.getCanonicalPath()
    
    projectManager = ProjectManager()
    project = projectManager.loadProject(projFile)

    assert(len(project.getProjectDescription())>0)

    assert(len(project.cellManager.getAllCells())>=22)

    assert(len(project.cellGroupsInfo.getAllCellGroupNames())>=36)


    synSetupFile = open("netbuild/makeSyns.sh", 'r')

    for line in synSetupFile:
        line = line.strip()

        if len(line)>0 and not line.startswith("#"):
            words = line.split()
            if len(words)>=6 and words[2].startswith("Syn_"):
                synName = words[2]
                cm = project.cellMechanismInfo.getCellMechanism(synName)
                print "Checked syn %s"%cm.getInstanceName()


    netConnList = open("netbuild/netConnList", 'r')



    for line in netConnList:
        line = line.strip()

        if len(line)>0 and not line.startswith("#"):

            #print "\n\n---- Deciphering line: "+ line
            words = line.split()
            source = words[0]
            target = words[1]
            syns = words[2].strip("[]").split(",")
            netConnName = "NC3D_"+source[5:]+"_"+target[5:]
            assert(source == project.morphNetworkConnectionsInfo.getSourceCellGroup(netConnName))
            assert(target == project.morphNetworkConnectionsInfo.getTargetCellGroup(netConnName))
            print "Checked %s"%netConnName


    assert(project.proj3Dproperties.getDisplayOption() == Display3DProperties.DISPLAY_SOMA_SOLID_NEURITE_LINE)

    assert(abs(project.simulationParameters.getDt()-0.025)<=1e-9)

    assert(not project.neuronSettings.isVarTimeStep())

    assert(project.neuronSettings.isForceCorrectInit())

    assert(project.neuronSettings.getDataSaveFormat().equals(NeuronSettings.DataSaveFormat.TEXT_NC))

    assert(not project.genesisSettings.isSymmetricCompartments())

    assert(project.genesisSettings.isPhysiologicalUnits())

    print "\n**************************************"
    print "    All tests passed!"
    print "**************************************\n"
开发者ID:RokasSt,项目名称:Thalamocortical,代码行数:66,代码来源:TestTraub.py


示例15: runColumnSimulation

def runColumnSimulation(simConfig=    			"TempSimConfig",
		        simDuration = 			100,
			simDt = 			0.025, 
			neuroConstructSeed = 		1234,
			simulatorSeed = 		1234,
			simulators = 			["NEURON"],
			simRefPrefix =          	"Net_",
			suggestedRemoteRunTime = 	120,
			defaultSynapticDelay =  	0.05,
			mpiConf = 			MpiSettings.LOCAL_SERIAL,
			scaleCortex = 			0.1,
			scaleThalamus = 		0,
			gabaScaling = 			1,
			l4ssAmpaScaling = 		1,
			l5PyrGapScaling = 		1,
			inNrtTcrNmdaScaling = 		1,
			pyrSsNmdaScaling = 		1,
			deepBiasCurrent = 		-1,
			maxElecLenFRB = 		0.01,
			maxElecLenRS =          	0.01,
			maxElecLenIN =         		0.01,
			maxElecLenSS =         		0.01,
			somaNseg =              	-1,
			varTimestepNeuron =     	False,
			verbose =               	True,
			runInBackground = 		False):
			  
    print "Running new column simulation..."

    ############################################

    # Full column populations

    numFRB =                50       #   full model: 50
    numRS =                 1000     #   full model: 1000
    numSupBask =            90       #   full model: 90
    numSupAxAx =            90       #   full model: 90
    numSupLTS =             90       #   full model: 90
    numL4SpinStell =        240      #   full model: 240
    numL5TuftIB =           800      #   full model: 800
    numL5TuftRS =           200      #   full model: 200
    numDeepBask =           100      #   full model: 100
    numDeepAxAx =           100      #   full model: 100
    numDeepLTS =            100      #   full model: 100
    numL6NonTuftRS =        500      #   full model: 500


    numTCR =                100      #   full model: 100
    numnRT =                100      #   full model: 100


    #######################################


    ### Load neuroConstruct project


    import datetime

    start = datetime.datetime.now()

    print "Loading project %s from at %s " % (projFile.getCanonicalPath(),start.strftime("%Y-%m-%d %H:%M"))

    pm = ProjectManager()
    project = pm.loadProject(projFile)


    ### Set duration & timestep & simulation configuration

    project.simulationParameters.setDt(simDt)
    simConfig = project.simConfigInfo.getSimConfig(simConfig)
    simConfig.setSimDuration(simDuration)


    ### Set simulation reference

    index = 0
    simRef = "%s%i"%(simRefPrefix,index)


    while File( "%s/simulations/%s_N"%(project.getProjectMainDirectory().getCanonicalPath(), simRef)).exists():
	simRef = "%s%i"%(simRefPrefix,index)
	index = index+1

    project.simulationParameters.setReference(simRef)


    ### Change num in each cell group

    numFRB = int(scaleCortex * numFRB)
    numRS = int(scaleCortex * numRS)
    numSupBask = int(scaleCortex * numSupBask)
    numSupAxAx = int(scaleCortex * numSupAxAx)
    numSupLTS = int(scaleCortex * numSupLTS)
    numL4SpinStell = int(scaleCortex * numL4SpinStell)
    numL5TuftIB = int(scaleCortex * numL5TuftIB)
    numL5TuftRS = int(scaleCortex * numL5TuftRS)
    numDeepBask = int(scaleCortex * numDeepBask)
    numDeepAxAx = int(scaleCortex * numDeepAxAx)
    numDeepLTS = int(scaleCortex * numDeepLTS)
#.........这里部分代码省略.........
开发者ID:OpenSourceBrain,项目名称:Thalamocortical,代码行数:101,代码来源:RunColumn.py


示例16: set_tonic_GABA

    set_tonic_GABA(work_dir, total_GABA_conductance_in_nS)

    # scale excitatory conductance by modifying the AMPA and NMDA
    # synaptic models. In general, the amplitude of the excitatory
    # conductances is inversely proportional to the number of
    # dendrites divided by 4, with the exc_cond_scaling parameter as
    # the proportionality constant. If this is set to zero, the
    # conductances are not scaled.
    if point.exc_cond_scaling:
        exc_scaling_factor = point.exc_cond_scaling / (float(point.n_grc_dend)/4)
        scale_excitatory_conductances(work_dir, exc_scaling_factor)

    # load project and initialise
    project_file = java.io.File(work_dir + "/" + project_filename)
    print ('Loading project from file: ' + project_file.getAbsolutePath() + ", exists: " + str(project_file.exists()))
    pm = ProjectManager(None, None)
    project = pm.loadProject(project_file)
    print 'Loaded project: ' + project.getProjectName()

    # load existing simulation configurations and set sim duration and a
    # couple of neuron options
    sim_config = project.simConfigInfo.getSimConfig(sim_config_name)
    sim_config.setSimDuration(point.sim_duration)
    project.neuronSettings.setNoConsole()
    project.neuronSettings.setCopySimFiles(1)

    # generate network
    generate_nC_network(point, pm, project, sim_config)

    # generate saves
    generate_nC_saves(point, project)
开发者ID:epiasini,项目名称:BillingsEtAl2014_GCL_SpikingSimulationAndAnalysis,代码行数:31,代码来源:export_NeuroML_network_realisation.py


示例17: SingleCellNML2generator

def SingleCellNML2generator(projString=" ",ConfigDict={},ElecLenList=[],somaNseg=None,savingDir=None,shell=None):
    
    projFile=File(os.getcwd(),projString)
    
    pm=ProjectManager()
    
    for config in ConfigDict.keys():
    
        project=pm.loadProject(projFile)
        
        nmlfm = NeuroMLFileManager(project)
        
        compSummary={}
       
        compSummary[config]={}
        
        if " " in config:
           configPath=config.replace(" ","_")
        else:
           configPath=config
           
        if savingDir !=None:
        
           full_path_to_config=r'../%s/%s'%(savingDir,configPath)
           
        else:
        
           full_path_to_config=r'../%s'%(configPath)
        
        for maxElecLen in ElecLenList:
            compSummary[config][str(maxElecLen)]={}
            cell=project.cellManager.getCell(ConfigDict[config])
            
            if maxElecLen > 0:

	       info = CellTopologyHelper.recompartmentaliseCell(cell, maxElecLen, project)
	       print "Recompartmentalising cell %s"%ConfigDict[config]
	       if somaNseg != None:
	          cell.getSegmentWithId(0).getSection().setNumberInternalDivisions(somaNseg)
	       if savingDir !=None: 
	          cellpath = r'../%s/%s/%s_%f'%(savingDir,configPath,configPath,maxElecLen)
	       else:
	          cellpath = r'../%s/%s_%f'%(configPath,configPath,maxElecLen)
	       
	    else:
	       if savingDir !=None:
	          cellpath = r'../%s/%s/%s_default'%(savingDir,configPath,configPath)
	       else:
	          cellpath = r'../%s/%s_default'%(configPath,configPath)
	       
	    summary=str(cell.getMorphSummary()) 
	    summary_string=summary.split("_")
	    for feature in summary_string:
	        feature_split=feature.split(":")
	        compSummary[config][str(maxElecLen)][feature_split[0]]=feature_split[1]
	    # the format of summary :  Segs:122_Secs:61_IntDivs:1458
	    print("Will be printing a cell morphology summary")
	    print compSummary[config][str(maxElecLen)]
	    ######### it turns out that this does not save recompartmentalized cells - all saved cells have identical spatial discretization; 
	    ##### generateNeuroML2 receives the parent projFile but not the loaded project which is  modified by the CellTopologyHelper.recompartmentaliseCell()
	    
	    ##################### neuroConstruct block #############################################################################
	    
	    neuroConstructSeed=1234
	    verbose=True
	    pm.doGenerate(config, neuroConstructSeed)

            while pm.isGenerating():
                  if verbose: 
                     print("Waiting for the project to be generated with Simulation Configuration: "+config)
                     time.sleep(5)
                     
	    simConfig = project.simConfigInfo.getSimConfig(config)
	    
	    seed=1234
	    genDir = File(projFile.getParentFile(), "generatedNeuroML2")
            nmlfm.generateNeuroMLFiles(simConfig,
                                       NeuroMLConstants.NeuroMLVersion.getLatestVersion(),
                                       LemsConstants.LemsOption.LEMS_WITHOUT_EXECUTE_MODEL,
                                       OriginalCompartmentalisation(),
                                       seed,
                                       False,
                                       True,
                                       genDir,
                                       "GENESIS Physiological Units",
                                       False)
            
            ########################################################################################################################
            
            if not os.path.exists(cellpath):
               print("Creating a new directory %s"%cellpath)
               os.makedirs(cellpath)
            else:
               print("A directory %s already exists"%cellpath)
              
               
            src_files = os.listdir("../../neuroConstruct/generatedNeuroML2/")
            for file_name in src_files:
                full_file_name = os.path.join("../../neuroConstruct/generatedNeuroML2/", file_name)
                if (os.path.isfile(full_file_name)):
#.........这里部分代码省略.........
开发者ID:OpenSourceBrain,项目名称:Thalamocortical,代码行数:101,代码来源:RunNeuroConstruct.py


示例18: quit

	print "Note: this file should be run using ..\\nC.bat -python XXX.py' or './nC.sh -python XXX.py'"
	print "See http://www.neuroconstruct.org/docs/python.html for more details"
	quit()
	
import sys
from time import *

from ucl.physiol.neuroconstruct.project import ProjectManager



# Load an existing neuroConstruct project
projFile = File("../CElegans.ncx")
print "Loading project from file: " + projFile.getAbsolutePath()+", exists: "+ str(projFile.exists())

pm = ProjectManager()
project = pm.loadProject(projFile)
print "Loaded project: " + project.getProjectName()


simConfig = project.simConfigInfo.getSimConfig("CellsOnly")

expectedNumberCells = 302


##########################


pm.doGenerate(simConfig.getName(), 1234)

while pm.isGenerating():
开发者ID:mattions,项目名称:CElegansNeuroML,代码行数:31,代码来源:GenerateNeuroML.py


示例19: generateV_ICurve

	def generateV_ICurve(self,
                         projFile,
                         simulator,
                         simConfig,
                         stimAmpLow, stimAmpInc, stimAmpHigh,
                         stimDur,
                         simDuration,
                         maxNumSimultaneousSims = 4):

			# Load neuroConstruct project

			print "Loading project from file: " + projFile.getAbsolutePath()+", exists: "+ str(projFile.exists())

			pm = ProjectManager()
			self.myProject = pm.loadProject(projFile)
			self.simulator = simulator

			simConfig = self.myProject.simConfigInfo.getSimConfig(simConfig)

			simConfig.setSimDuration(simDuration)

			pm.doGenerate(simConfig.getName(), self.neuroConstructSeed)

			while pm.isGenerating():
					print "Waiting for the project to be generated with Simulation Configuration: "+str(simConfig)
					time.sleep(2)

			numGenerated = self.myProject.generatedCellPositions.getNumberInAllCellGroups()

			print "Number of cells generated: " + str(numGenerated)

			simReferences = {}


			if numGenerated > 0:

					print "Generating scripts for simulator: %s..."%simulator

					if simulator == 'NEURON':
						self.myProject.neuronFileManager.setQuitAfterRun(1) # Remove this line to leave the NEURON sim windows open after finishing
						self.myProject.neuronSettings.setCopySimFiles(1) # 1 copies hoc/mod files to PySim_0 etc. and will allow multiple sims to run at once
						self.myProject.neuronSettings.setGraphicsMode(0) # 0 hides graphs during execution
                        
					if simulator == 'GENESIS':
						self.myProject.genesisFileManager.setQuitAfterRun(1) # Remove this line to leave the NEURON sim windows open after finishing
						self.myProject.genesisSettings.setCopySimFiles(1) # 1 copies hoc/mod files to PySim_0 etc. and will allow multiple sims to run at once
						self.myProject.genesisSettings.setGraphicsMode(0) # 0 hides graphs during execution


					stimAmp = stimAmpLow

					ADD_TO_BEFORE_INIT = self.myProject.neuronSettings.getNativeBlock(NativeCodeLocation.BEFORE_INITIAL)
					ADD_TO_RECORD_I = self.myProject.neuronSettings.getNativeBlock(NativeCodeLocation.AFTER_SIMULATION)
					ADD_TO_START_FINITIALIZE = self.myProject.neuronSettings.getNativeBlock(NativeCodeLocation.START_FINITIALIZE)

					while stimAmp <= stimAmpHigh:

							while (len(self.simsRunning)>=maxNumSimultaneousSims):
									print "Sims currently running: "+str(self.simsRunning)
									print "Waiting..."
									time.sleep(3) # wait a while...
									self.updateSimsRunning()


							simRef = "PySim_"+str(float(stimAmp))

							print "Going to run simulation: "+simRef

							########  Adjusting the amplitude of the Voltage clamp ###############

                                                        TEXT_BEFORE_CREATION = "objref clampobj" + "\n" + "objref record_current" + "\n" + "objref data_save" + "\n"

                                                        # TEXT_BEFORE_INIT = "GranuleCell_mod_tonic[0].Soma {\n" + "clampobj = new SEClamp(0.5)\n" + "clampobj.dur1 = 150.0" + "\n" + "clampobj.amp1 = -100.0" + "\n" + "clampobj.dur2 = " + str(stimDur) + "\n" + "clampobj.amp2 = " + str(stimAmp) + "\n" + "clampobj.dur3 = 150.0" + "\n" + "clampobj.amp3 = -100.0" + "\n" + "clampobj.rs = 0.00001\n " + "}\n" # This should do the trick

                                                        # TEXT_BEFORE_INIT = TEXT_BEFORE_INIT + ADD_TO_BEFORE_INIT

                                                        TEXT_START_FINITIALIZE = "GranuleCell_mod_tonic[0].Soma {\n" + "clampobj = new SEClamp(0.5)\n" + "clampobj.dur1 = 150.0" + "\n" + "clampobj.amp1 = -100.0" + "\n" + "clampobj.dur2 = " + str(stimDur) + "\n" + "clampobj.amp2 = " + str(stimAmp) + "\n" + "clampobj.dur3 = 150.0" + "\n" + "clampobj.amp3 = -40.0" + "\n" + "clampobj.rs = 0.00001\n" + "record_current = new Vector()" + "\n" + "record_current.record(&clampobj.i)" + "\n" + "}\n" #This should do the trick

                                                        TEXT_START_FINITIALIZE = TEXT_START_FINITIALIZE + ADD_TO_START_FINITIALIZE

                                                        TEXT_TO_RECORD_I = """data_save = new File() \n""" + """strdef filename \n""" + """sprint(filename,  

鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Python ucsmo.ManagedObject类代码示例发布时间:2022-05-27
下一篇:
Python ucl.load函数代码示例发布时间: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