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

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

    simManager = nc.SimulationManager(projFile, numConcurrentSims, verbose)

    simManager.runMultipleSims(simConfigs=simConfigs,
                               simDt=simDt,
                               simulators=simulators,
                               runInBackground=runInBackground)

    simManager.reloadSims(plotVoltageOnly=plotVoltageOnly,
                          plotSims=plotSims,
                          analyseSims=analyseSims)

    # These were discovered using analyseSims = True above.
    # They need to hold for all simulators
    spikeTimesToCheck = {'CG_PyNN_EIFe_0' : [26.77, 82.15, 176.784, 285.342, 394.576], \
                         'CG_PyNN_IFa_0' : [35.342, 78.506, 121.67, 164.834, 207.998, 251.162, 294.326, 337.49, 380.654, 423.818, 466.982], \
                         'CG_PyNN_HH_0' : [11.584, 40.406, 69.272, 98.136, 127.0, 155.864, 184.728, 213.594, 242.458, 271.322, 300.186, 329.052, 357.916, 386.78, 415.644, 444.508, 473.374]}

    spikeTimeAccuracy = 0.81

    report = simManager.checkSims(spikeTimesToCheck=spikeTimesToCheck,
                                  spikeTimeAccuracy=spikeTimeAccuracy,
                                  threshold=-45.1)

    print report

    return report
Example #2
0
def testAll(argv=None):
    if argv is None:
        argv = sys.argv

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

    simManager = nc.SimulationManager(projFile, numConcurrentSims, verbose)

    simManager.runMultipleSims(simConfigs=simConfigs,
                               simDt=simDt,
                               simulators=simulators,
                               runInBackground=runInBackground)

    simManager.reloadSims(plotVoltageOnly=plotVoltageOnly,
                          plotSims=plotSims,
                          analyseSims=analyseSims)

    # These were discovered using analyseSims = True above.
    # They need to hold for all simulators
    spikeTimesToCheck = {
        'SampleCellGroup_0': [21.6, 35.171, 48.396, 61.602, 74.807]
    }

    spikeTimeAccuracy = 0.0

    report = simManager.checkSims(spikeTimesToCheck=spikeTimesToCheck,
                                  spikeTimeAccuracy=spikeTimeAccuracy)

    print report

    return report
Example #3
0
def testAll(argv=None):
    if argv is None:
        argv = sys.argv

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

    simManager = nc.SimulationManager(projFile,
                                      numConcurrentSims=numConcurrentSims,
                                      verbose=verbose)

    simManager.runMultipleSims(simConfigs=simConfigs,
                               simDt=simDt,
                               simulators=simulators,
                               runInBackground=runInBackground,
                               varTimestepNeuron=varTimestepNeuron,
                               varTimestepTolerance=varTimestepTolerance,
                               mpiConfig=mpiConfig,
                               suggestedRemoteRunTime=suggestedRemoteRunTime)

    simManager.reloadSims(plotVoltageOnly=plotVoltageOnly,
                          plotSims=plotSims,
                          analyseSims=analyseSims)

    report = ""

    if "Default Simulation Configuration" in simConfigs:

        # These were discovered using analyseSims = True above.
        # They need to hold for all simulators
        spikeTimesToCheck = {'CG_CML_0': [22.85, 46.34, 53.8, 77.55]}

        spikeTimeAccuracy = 0.02

        report0 = simManager.checkSims(spikeTimesToCheck=spikeTimesToCheck,
                                       spikeTimeAccuracy=spikeTimeAccuracy)

        print report0
        report = report + report0 + "\n"

    if "Cell2" in simConfigs:

        # These were discovered using analyseSims = True above.
        # They need to hold for all simulators
        spikeTimesToCheck = {
            'CGsuppyrFRB_0': [
                8.3, 99.2, 231.8, 377.1, 407.6, 416.5, 420.6, 451.0, 453.5,
                487.0, 489.5, 523.9, 526.4, 561.5, 564.0, 599.6, 602.2, 638.0,
                640.6, 676.9, 679.3, 750.9, 754.0
            ]
        }

        spikeTimeAccuracy = 1  # larger due to longer simulation duration...

        report2 = simManager.checkSims(spikeTimesToCheck=spikeTimesToCheck,
                                       spikeTimeAccuracy=spikeTimeAccuracy)

        print report2
        report = report + report2 + "\n"

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

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


    simManager = nc.SimulationManager(projFile,
                                      numConcurrentSims,
                                      verbose)

    simManager.runMultipleSims(simConfigs =           simConfigs,
                               simDt =                simDt,
                               simulators =           simulators,
                               runInBackground =      runInBackground,
                               varTimestepNeuron =    varTimestepNeuron)

    simManager.reloadSims(plotVoltageOnly =   plotVoltageOnly,
                          plotSims =          plotSims,
                          analyseSims =       analyseSims)


    spikeTimesToCheck = {'Golgi_CML_0': spike_times}
    
    
    spikeTimeAccuracy = 7.2 # ms in 4000 ms

    report = simManager.checkSims(spikeTimesToCheck = spikeTimesToCheck,
                                  spikeTimeAccuracy = spikeTimeAccuracy)

    print report

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

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

    simManager = nc.SimulationManager(projFile, verbose=verbose)

    simManager.runMultipleSims(simConfigs=simConfigs,
                               simDt=simDt,
                               simulators=simulators,
                               runInBackground=runInBackground,
                               varTimestepNeuron=varTimestepNeuron)

    simManager.reloadSims(plotVoltageOnly=plotVoltageOnly,
                          analyseSims=analyseSims)

    spikeTimesToCheck = {
        'FullCell_nml_0': [403.675, 416.9],
        'FullCell_nml_0.2674': [405.4, 417.4],
        'FullCell_nml_0.2720': [405.925]
    }

    spikeTimeAccuracy = 0.01

    report = simManager.checkSims(spikeTimesToCheck=spikeTimesToCheck,
                                  spikeTimeAccuracy=spikeTimeAccuracy,
                                  threshold=-10)

    print report

    return report
Example #6
0
def testAll(argv=None):
    if argv is None:
        argv = sys.argv

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


    simManager = nc.SimulationManager(projFile,
                                      numConcurrentSims,
                                      verbose)

    simManager.runMultipleSims(simConfigs =      simConfigs,
                               simDt =           simDt,
                               simulators =      simulators,
                               runInBackground = runInBackground)
    

    simManager.reloadSims(plotVoltageOnly =   plotVoltageOnly,
                          plotSims =          plotSims,
                          analyseSims =       analyseSims)


    # These were discovered using analyseSims = True above.
    # They need to hold for all simulators
    spikeTimesToCheck = {'CG1_0' : [21.13, 32.47, 43.28, 54.05, 64.82, 75.58],
                         'CG2_0' : [27.06, 38.52, 49.36, 60.13, 70.9, 81.67] }

    spikeTimeAccuracy = 0.01

    report = simManager.checkSims(spikeTimesToCheck = spikeTimesToCheck,
                                  spikeTimeAccuracy = spikeTimeAccuracy)

    print report

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

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

    simManager = nc.SimulationManager(projFile,
                                      numConcurrentSims=numConcurrentSims,
                                      verbose=verbose)

    simManager.runMultipleSims(simConfigs=simConfigs,
                               simDt=simDt,
                               simDtOverride=simDtOverride,
                               simulators=simulators,
                               runInBackground=runInBackground,
                               varTimestepNeuron=varTimestepNeuron,
                               varTimestepTolerance=varTimestepTolerance)

    simManager.reloadSims(plotVoltageOnly=plotVoltageOnly,
                          analyseSims=analyseSims)

    # These were discovered using analyseSims = True above.
    # They need to hold for all simulators
    spikeTimesToCheck = {'SomeXML_0': [36, 63.7]}

    spikeTimeAccuracy = 0.05

    report = simManager.checkSims(spikeTimesToCheck=spikeTimesToCheck,
                                  spikeTimeAccuracy=spikeTimeAccuracy)

    print report

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

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

    simManager = nc.SimulationManager(projFile, numConcurrentSims, verbose)

    simManager.runMultipleSims(simConfigs=simConfigs,
                               simDt=simDt,
                               simulators=simulators,
                               runInBackground=runInBackground,
                               varTimestepNeuron=varTimestepNeuron)

    simManager.reloadSims(plotVoltageOnly=plotVoltageOnly,
                          plotSims=plotSims,
                          analyseSims=analyseSims)

    # These were discovered using analyseSims = True above.
    # They need to hold for all simulators
    spikeTimesToCheck = {
        'CellGroup_NML1_0': [102.2, 118.4, 134.4, 150.3, 166.3, 182.3, 198.3]
    }

    spikeTimeAccuracy = 0.1

    report = simManager.checkSims(spikeTimesToCheck=spikeTimesToCheck,
                                  spikeTimeAccuracy=spikeTimeAccuracy)

    print report

    return report
Example #9
0
def testAll(argv=None):
    if argv is None:
        argv = sys.argv

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


    simManager = nc.SimulationManager(projFile,
                                      numConcurrentSims = numConcurrentSims,
                                      verbose = verbose)

    simManager.runMultipleSims(simConfigs =              simConfigs,
                               simDt =                   simDt,
                               simulators =              simulators,
                               runInBackground =         runInBackground,
                               varTimestepNeuron =       varTimestepNeuron,
                               varTimestepTolerance =    varTimestepTolerance,
                               mpiConfig =               mpiConfig,
                               suggestedRemoteRunTime =  suggestedRemoteRunTime)

    simManager.reloadSims(plotVoltageOnly =   plotVoltageOnly,
                          plotSims =          plotSims,
                          analyseSims =       analyseSims)
                          
    report= ""
    
 
    

    print("Tests for default project simulation for %s with 0.01 dt in NEURON"%("Cell13-TCR-FigA7-600"))

    mep_from_nml2=nc.loadMepFile('../../NeuroML2/test/.test.TCRFigA7_600.mep')['TCRFigA7_600']

    for value in range(0,len(mep_from_nml2)):

        mep_from_nml2[value]=1000*mep_from_nml2[value]

    spikeTimesToCheck = {'CGTCR_0': mep_from_nml2}

    spikeTimeAccuracy =  0.00000001

    report2 = simManager.checkSims(spikeTimesToCheck = spikeTimesToCheck,spikeTimeAccuracy = spikeTimeAccuracy)

    print report2
    report = report + report2+ '\n' 

              
          
              

    return report
Example #10
0
def testAll(argv=None):
    if argv is None:
        argv = sys.argv

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

    simManager = nc.SimulationManager(projFile, numConcurrentSims, verbose)

    simManager.runMultipleSims(simConfigs=simConfigs,
                               simDt=simDt,
                               simulators=simulators,
                               runInBackground=runInBackground,
                               varTimestepNeuron=varTimestepNeuron)

    simManager.reloadSims(plotVoltageOnly=plotVoltageOnly,
                          plotSims=plotSims,
                          analyseSims=analyseSims)

    # These were discovered using analyseSims = True above.
    # They need to hold for all simulators
    spikeTimesToCheck = {
        'FS_0': [
            209.779, 219.611, 229.447, 239.287, 249.131, 258.979, 268.831,
            278.686, 288.546, 298.41, 308.277, 318.147, 328.022, 337.899,
            347.781, 357.665, 367.553, 377.445, 387.339, 397.236, 407.137,
            417.041, 426.948, 436.858, 446.771, 456.687, 466.606, 476.528,
            486.452, 496.378, 506.308, 516.24, 526.174, 536.112, 546.051,
            555.994, 565.938, 575.886, 585.835, 595.79
        ],
        'RS_04_0':
        [209.779, 222.027, 238.189, 261.603, 301.844, 387.788, 518.983],
        'RS_005_0': [
            209.779, 219.859, 230.202, 240.815, 251.709, 262.893, 274.376,
            286.169, 298.281, 310.722, 323.503, 336.63, 350.115, 363.967,
            378.194, 392.803, 407.802, 423.198, 438.997, 455.202, 471.816,
            488.843, 506.283, 524.135, 542.397, 561.066, 580.135, 599.598
        ]
    }

    spikeTimeAccuracy = 0.02

    report = simManager.checkSims(spikeTimesToCheck=spikeTimesToCheck,
                                  spikeTimeAccuracy=spikeTimeAccuracy,
                                  threshold=-50.01)

    print report

    return report
Example #11
0
def testAll(argv=None):
    if argv is None:
        argv = sys.argv

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

    simManager = nc.SimulationManager(projFile,
                                      numConcurrentSims=numConcurrentSims,
                                      verbose=verbose)

    simManager.runMultipleSims(simConfigs=simConfigs,
                               simDt=simDt,
                               simulators=simulators,
                               runInBackground=runInBackground,
                               varTimestepNeuron=varTimestepNeuron,
                               varTimestepTolerance=varTimestepTolerance)

    simManager.reloadSims(plotVoltageOnly=plotVoltageOnly,
                          plotSims=plotSims,
                          analyseSims=analyseSims)

    # These were discovered using analyseSims = True above.
    # They need to hold for all simulators
    spikeTimesToCheck = {
        'baskets_0': [
            112.662, 131.963, 151.266, 170.567, 189.868, 209.169, 228.47,
            247.773, 267.073, 286.375, 305.676, 324.978, 344.279, 363.583,
            382.883, 402.186, 421.485, 440.787, 460.089, 479.389, 498.691,
            517.992, 537.295, 556.597, 575.897, 595.198
        ],
        'pyramidals_0': [
            106.894, 126.718, 149.924, 177.179, 207.41, 239.11, 271.431,
            304.012, 336.686, 369.371, 402.028, 434.648, 467.226, 499.748,
            532.233, 564.671, 597.079
        ]
    }

    spikeTimeAccuracy = 0.59

    report = simManager.checkSims(spikeTimesToCheck=spikeTimesToCheck,
                                  spikeTimeAccuracy=spikeTimeAccuracy)

    print report

    return report
Example #12
0
def testAll(argv=None):
    if argv is None:
        argv = sys.argv

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

    simManager = nc.SimulationManager(projFile,
                                      numConcurrentSims=numConcurrentSims,
                                      verbose=verbose)

    simManager.runMultipleSims(simConfigs=simConfigs,
                               simDt=simDt,
                               simDtOverride=simDtOverride,
                               simulators=simulators,
                               runInBackground=runInBackground,
                               varTimestepNeuron=varTimestepNeuron)

    simManager.reloadSims(plotVoltageOnly=plotVoltageOnly,
                          plotSims=plotSims,
                          analyseSims=analyseSims)

    # These were discovered using analyseSims = True above.
    # They need to hold for all simulators
    spikeTimesToCheck = {
        'basket_soma_0': [
            109.942, 128.412, 146.881, 165.352, 183.823, 202.293, 220.763,
            239.233, 257.703, 276.173, 294.643, 313.114, 331.584, 350.054,
            368.524, 386.994, 405.464, 423.935, 442.404, 460.874, 479.345,
            497.815, 516.284, 534.755, 553.226, 571.696, 590.167
        ],
        'pyramidal_soma_0': [
            102.484, 120.743, 148.434, 255.779, 330.06, 407.046, 483.384,
            559.674
        ]
    }

    spikeTimeAccuracy = 0.31  # Works if no LEMS...
    spikeTimeAccuracy = 1.6  # Large due to LEMS...

    report = simManager.checkSims(spikeTimesToCheck=spikeTimesToCheck,
                                  spikeTimeAccuracy=spikeTimeAccuracy)

    print report

    return report
Example #13
0
def testAll(argv=None):
    if argv is None:
        argv = sys.argv

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

    simManager = nc.SimulationManager(projFile, verbose=verbose)

    simManager.runMultipleSims(simConfigs=simConfigs,
                               simDt=simDt,
                               simulators=simulators,
                               runInBackground=runInBackground,
                               varTimestepNeuron=varTimestepNeuron,
                               varTimestepTolerance=varTimestepTolerance)

    simManager.reloadSims(plotVoltageOnly=plotVoltageOnly,
                          plotSims=plotSims,
                          analyseSims=analyseSims)

    # These were discovered using analyseSims = True above.
    # They need to hold for all simulators
    spikeTimesToCheck = {
        'CellGroup_2_0': [
            37.6197, 188.486, 344.911, 500.767, 655.888, 810.396, 964.435,
            2047.61, 2110.95, 2199.24, 2283.86, 2367.08, 2450.04, 2533.3,
            2617.19, 2701.82, 2787.27, 2873.53, 2960.59, 3005.94, 3020.89,
            3048.46, 3077.9, 3107.75, 3137.63, 3167.37, 3196.95, 3226.37,
            3255.64, 3284.79, 3313.83, 3342.79, 3371.66, 3400.46, 3429.2,
            3457.88, 3486.51, 3515.11, 3543.67, 3572.2, 3600.72, 3629.2,
            3657.66, 3686.12, 3714.56, 3742.99, 3771.41, 3799.82, 3828.22,
            3856.62, 3885.02, 3913.42, 3941.82, 3970.22, 3998.62, 4152.13,
            4248.89, 4344.1, 4439.47, 4535.21, 4631.35, 4727.88, 4824.82,
            4922.14
        ]
    }

    spikeTimeAccuracy = 0.05

    report = simManager.checkSims(spikeTimesToCheck=spikeTimesToCheck,
                                  spikeTimeAccuracy=spikeTimeAccuracy)

    print report

    return report
Example #14
0
def testAll(argv=None):
    if argv is None:
        argv = sys.argv

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

    simManager = nc.SimulationManager(projFile,
                                      numConcurrentSims=numConcurrentSims,
                                      verbose=verbose)

    simManager.runMultipleSims(simConfigs=simConfigs,
                               simDt=simDt,
                               simulators=simulators,
                               runInBackground=runInBackground,
                               varTimestepNeuron=varTimestepNeuron,
                               varTimestepTolerance=varTimestepTolerance,
                               mpiConfig=mpiConfig,
                               suggestedRemoteRunTime=suggestedRemoteRunTime)

    simManager.reloadSims(plotVoltageOnly=plotVoltageOnly,
                          plotSims=plotSims,
                          analyseSims=analyseSims)

    report = ""

    mep_from_nml2 = nc.loadMepFile(
        '../../NeuroML2/test/.test.supaxax.mep')['SupAxAx']

    for value in range(0, len(mep_from_nml2)):

        mep_from_nml2[value] = 1000 * mep_from_nml2[value]

    spikeTimesToCheck = {'CGsupaxax_0': mep_from_nml2}

    spikeTimeAccuracy = 0.711  # ms # could be more accurate with var time step in nrn, but need to compare these to jNeuroML_NEURON

    report2 = simManager.checkSims(spikeTimesToCheck=spikeTimesToCheck,
                                   spikeTimeAccuracy=spikeTimeAccuracy)

    print report2
    report = report + report2 + "\n"

    return report
Example #15
0
def testAll(argv=None):
    if argv is None:
        argv = sys.argv

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

    simManager = nc.SimulationManager(projFile,
                                      numConcurrentSims=2,
                                      verbose=verbose)

    simManager.runMultipleSims(simConfigs=simConfigs,
                               simDt=simDt,
                               simDtOverride=simDtOverride,
                               simulators=simulators,
                               runInBackground=runInBackground,
                               varTimestepNeuron=varTimestepNeuron,
                               varTimestepTolerance=varTimestepTolerance,
                               mpiConfig=mpiConfig)

    simManager.reloadSims(plotVoltageOnly=plotVoltageOnly,
                          plotSims=plotSims,
                          analyseSims=analyseSims)

    report = ""

    # These were discovered using analyseSims = True above.
    # They need to hold for all simulators
    spikeTimesToCheck = {
        'CG_CML_0': spike_times['Current clamp'],
        'CG_CML_0.0': spike_times['Current clamp']
    }

    spikeTimeAccuracy = 0.028

    report0 = simManager.checkSims(spikeTimesToCheck=spikeTimesToCheck,
                                   spikeTimeAccuracy=spikeTimeAccuracy)

    print report0
    report = report + report0 + "\n"

    return report
Example #16
0
def RunConfigs(projString, simConfigs, simDt, argv=None):

    projFile = File(os.getcwd(), projString)

    if argv is None:
        argv = sys.argv

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

    simManager = nc.SimulationManager(projFile,
                                      numConcurrentSims=numConcurrentSims,
                                      verbose=verbose)

    simManager.runMultipleSims(simConfigs=simConfigs,
                               simDt=simDt,
                               simulators=simulators,
                               runInBackground=runInBackground,
                               varTimestepNeuron=varTimestepNeuron,
                               varTimestepTolerance=varTimestepTolerance,
                               mpiConfig=mpiConfig,
                               suggestedRemoteRunTime=suggestedRemoteRunTime)
def testAll(argv=None):
    if argv is None:
        argv = sys.argv

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

    simManager = nc.SimulationManager(projFile,
                                      verbose=verbose,
                                      numConcurrentSims=numConcurrentSims)

    simManager.runMultipleSims(simConfigs=simConfigs,
                               simDt=simDt,
                               simDtOverride=simDtOverride,
                               simulators=simulators,
                               runInBackground=runInBackground,
                               varTimestepNeuron=varTimestepNeuron,
                               varTimestepTolerance=varTimestepTolerance)

    simManager.reloadSims(plotVoltageOnly=plotVoltageOnly,
                          plotSims=plotSims,
                          analyseSims=analyseSims)

    # These were discovered using analyseSims = True above.
    # They need to hold for all simulators
    spikeTimesToCheck = {
        'Soma_CML_0': [
            87.227, 116.73, 137.124, 157.518, 177.911, 198.305, 218.699,
            239.092, 259.486, 279.88, 300.275, 395.835, 491.361, 586.888,
            917.153
        ]
    }

    spikeTimeAccuracy = 2.25  # Too big! LEMS's fault...

    report = simManager.checkSims(spikeTimesToCheck=spikeTimesToCheck,
                                  spikeTimeAccuracy=spikeTimeAccuracy)

    print report

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

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

    simManager = nc.SimulationManager(projFile, numConcurrentSims, verbose)

    simManager.runMultipleSims(simConfigs=simConfigs,
                               simDt=simDt,
                               simulators=simulators,
                               runInBackground=runInBackground,
                               varTimestepNeuron=varTimestepNeuron,
                               varTimestepTolerance=varTimestepTolerance)

    simManager.reloadSims(plotVoltageOnly=plotVoltageOnly,
                          plotSims=plotSims,
                          analyseSims=analyseSims)

    # These were discovered using analyseSims = True above.
    # They need to hold for all simulators
    spikes1 = [41.4668, 200.155, 364.018, 527.595, 690.82, 853.761]
    spikes2 = [
        10.6391, 52.8226, 80.4578, 123.375, 374.104, 553.999, 731.471, 907.215
    ]
    spikeTimesToCheck = {
        'Golgi_CML_0': spikes1,
        'Golgi_0': spikes1,
        'CML_0': spikes2,
        'mod_0': spikes2
    }

    spikeTimeAccuracy = 1.63  # in 1000ms

    report = simManager.checkSims(spikeTimesToCheck=spikeTimesToCheck,
                                  spikeTimeAccuracy=spikeTimeAccuracy)

    print report

    return report
Example #19
0
def testAll(argv=None):
    if argv is None:
        argv = sys.argv

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


    simManager = nc.SimulationManager(projFile,
                                      numConcurrentSims = numConcurrentSims,
                                      verbose = verbose)

    simManager.runMultipleSims(simConfigs =           simConfigs,
                               simDt =                simDt,
                               simulators =           simulators,
                               runInBackground =      runInBackground,
                               varTimestepNeuron =    varTimestepNeuron,
                               varTimestepTolerance = varTimestepTolerance)

    simManager.reloadSims(plotVoltageOnly =   plotVoltageOnly,
                          plotSims =          plotSims,
                          analyseSims =       analyseSims)

    # These were discovered using analyseSims = True above.
    # They need to hold for all simulators
    pyr_times = [106.83, 126.59, 149.69, 176.83, 206.94, 238.54, 270.78, 303.27, 335.85, 368.45, 401.03, 433.57, 466.05, 498.49, 530.88, 563.24, 595.56]
    bask_times = [112.66, 131.97, 151.27, 170.57, 189.87, 209.17, 228.48, 247.78, 267.08, 286.38, 305.68, 324.98, 344.29, 363.59, 382.89, 402.19, 421.49, 440.80, 460.1, 479.4, 498.7, 518.0, 537.3, 556.6, 575.91, 595.21]
    spikeTimesToCheck = {'pyramidals_0': pyr_times,
                         'pyramidals_GEN_0': pyr_times,
                         'baskets_0': bask_times,
                         'baskets_GEN_0': bask_times}

    spikeTimeAccuracy = 1

    report = simManager.checkSims(spikeTimesToCheck = spikeTimesToCheck,
                                  spikeTimeAccuracy = spikeTimeAccuracy)

    print report

    return report
Example #20
0
def testAll(argv=None):
    if argv is None:
        argv = sys.argv

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

    simManager = nc.SimulationManager(projFile,
                                      verbose=verbose,
                                      numConcurrentSims=numConcurrentSims)

    simManager.runMultipleSims(simConfigs=simConfigs,
                               simDt=simDt,
                               simDtOverride=simDtOverride,
                               simulators=simulators,
                               runInBackground=runInBackground,
                               varTimestepNeuron=varTimestepNeuron,
                               varTimestepTolerance=varTimestepTolerance)

    simManager.reloadSims(plotVoltageOnly=plotVoltageOnly,
                          plotSims=plotSims,
                          analyseSims=analyseSims)

    # These were discovered using analyseSims = True above.
    # They need to hold for all simulators
    spikeTimesToCheck = {'Gran_0': [108.25, 135.861, 161.793, 187.234, 212.362, \
                                    237.349, 262.302, 287.2, 312.079, 336.969, \
                                    361.881, 386.779, 411.68, 436.46, 461.4, \
                                    486.3, 511.2, 536.1, 561.05, 586]}

    #spikeTimeAccuracy = 1.1 # Too long!! Lems's fault...
    spikeTimeAccuracy = 0.25

    report = simManager.checkSims(spikeTimesToCheck=spikeTimesToCheck,
                                  spikeTimeAccuracy=spikeTimeAccuracy)

    print report

    return report
Example #21
0
	def get_sim_manager(self,project_path=None):
		"""Instantiates a NeuroConstruct SimulationManager class."""
		if project_path is None:
			project_path = os.path.join(OSB_MODELS, 
			                        	CELL_TYPE, 
			                        	MODEL_NAME,
			                        	"neuroConstruct") # Default OSB path. 
		'''
			file_name = MODEL_NAME + '.ncx' 

		else:
			project_path = os.path.abspath(project_path)
			base_path,project_dir = os.path.split(project_path)
			if project_dir == 'neuroConstruct':
				base_path,project_dir = os.path.split(base_path)
			file_name = project_dir + '.ncx'
		'''
		file_name = self.get_ncx_file(project_path)
		file_path = os.path.join(project_path,  
			                     file_name) # Location of an nC file.  
		f = File(file_path) 
		sim = ncutils.SimulationManager(f)
		return sim
def testAll(argv=None):
    if argv is None:
        argv = sys.argv

    if len(argv)==1:
        print("\nNo options specified! Run this file using\n" + \
              "   nC.sh -python %s [-neuron|-genesis]\n"%argv[0])
        quit()
    
    if '-neuron' in argv:
        simulators.append('NEURON')
    if '-genesis' in argv:
        simulators.append('GENESIS_SI')
        
        
    if '-neuroml2' in argv:
        # Not yet working...
        nc.generateNeuroML2(projFile, simConfigs)
    
    if len(simulators)>0:
        print "Loading project from "+ projFile.getCanonicalPath()

        simManager = nc.SimulationManager(projFile,
                                          numConcurrentSims = numConcurrentSims,
                                          verbose = verbose)

        simManager.runMultipleSims(simConfigs =           simConfigs,
                                   simDt =                simDt,
                                   simulators =           simulators,
                                   runInBackground =      runInBackground,
                                   varTimestepNeuron =    varTimestepNeuron,
                                   varTimestepTolerance = varTimestepTolerance)

        print("\nSimulation(s) set running. Check the ../simulations directory for output.\n")
        
    quit()
Example #23
0
def testAll(argv=None):
    if argv is None:
        argv = sys.argv

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

    simManager = nc.SimulationManager(projFile, numConcurrentSims, verbose)

    simManager.runMultipleSims(simConfigs=simConfigs,
                               simDt=simDt,
                               simulators=simulators,
                               runInBackground=runInBackground,
                               varTimestepNeuron=varTimestepNeuron)

    simManager.reloadSims(plotVoltageOnly=plotVoltageOnly,
                          plotSims=plotSims,
                          analyseSims=analyseSims)

    # These were discovered using analyseSims = True above.
    # They need to hold for all simulators
    spikeTimesToCheck = {
        'CG_GranCellTested_0': [
            108.257, 135.816, 161.78, 187.184, 212.318, 237.319, 262.257,
            287.166, 312.064, 336.96, 361.858, 386.761, 411.668, 436.58,
            461.497, 486.418, 511.342, 536.269, 561.199, 586.132
        ]
    }

    spikeTimeAccuracy = 2

    report = simManager.checkSims(spikeTimesToCheck=spikeTimesToCheck,
                                  spikeTimeAccuracy=spikeTimeAccuracy)

    print report

    return report
Example #24
0
def testAll(argv=None):
    if argv is None:
        argv = sys.argv

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

    simManager = nc.SimulationManager(projFile, numConcurrentSims, verbose)

    simManager.runMultipleSims(simConfigs=simConfigs,
                               simDt=simDt,
                               simulators=simulators,
                               runInBackground=runInBackground,
                               varTimestepNeuron=varTimestepNeuron)

    simManager.reloadSims(plotVoltageOnly=plotVoltageOnly,
                          plotSims=plotSims,
                          analyseSims=analyseSims)

    # These were discovered using analyseSims = True above.
    # They need to hold for all simulators
    spikeTimesToCheck = {
        'SampleCellGroup_0': [102.2, 118.4, 134.4, 150.4, 166.4, 182.3, 198.3],
        'SampleCellGroup_lowQ10ExpTemp_0': [
            101.87, 110.581, 119.215, 127.845, 136.474, 145.104, 153.734,
            162.363, 170.993, 179.622, 188.252, 196.882
        ]
    }

    spikeTimeAccuracy = 0.1

    report = simManager.checkSims(spikeTimesToCheck=spikeTimesToCheck,
                                  spikeTimeAccuracy=spikeTimeAccuracy)

    print report

    return report
Example #25
0
analyseStartTime = stimDel + 200  # So it's firing at a steady rate...
analyseStopTime = simDuration
analyseThreshold = -20  # mV

mpiConfig = MpiSettings.LOCAL_SERIAL  # Default setting: run on one local processor
#mpiConfig =            MpiSettings.MATLEM_1PROC    # Run on one processor on UCL cluster

numConcurrentSims = 4
if mpiConfig != MpiSettings.LOCAL_SERIAL: numConcurrentSims = 30
suggestedRemoteRunTime = 9  # mins

# Load neuroConstruct project

projFile = File("../DentateGyrus.ncx")

simManager = nc.SimulationManager(projFile, numConcurrentSims)

simConfig = "OneBC"

simManager.generateFICurve("NEURON",
                           simConfig,
                           stimAmpLow,
                           stimAmpInc,
                           stimAmpHigh,
                           stimDel,
                           stimDur,
                           simDuration,
                           analyseStartTime,
                           analyseStopTime,
                           analyseThreshold,
                           mpiConfig=mpiConfig,
Example #26
0
def testAll(argv=None):
    if argv is None:
        argv = sys.argv

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

    simManager = nc.SimulationManager(projFile,
                                      numConcurrentSims=numConcurrentSims,
                                      verbose=verbose)

    simManager.runMultipleSims(simConfigs=simConfigs,
                               simDt=simDt,
                               simulators=simulators,
                               runInBackground=runInBackground,
                               varTimestepNeuron=varTimestepNeuron,
                               varTimestepTolerance=varTimestepTolerance,
                               mpiConfig=mpiConfig,
                               suggestedRemoteRunTime=suggestedRemoteRunTime)

    simManager.reloadSims(plotVoltageOnly=plotVoltageOnly,
                          plotSims=plotSims,
                          analyseSims=analyseSims)

    report = ""

    if simDt == 0.005:

        if "Default Simulation Configuration" in simConfigs:

            # These were discovered using analyseSims = True above.
            # They need to hold for all simulators
            spikeTimesToCheck = {
                'CG_CML_0':
                nc.loadMepFile('.testNoTable0005.mep')['Current clamp']
            }

            spikeTimeAccuracy = 0.0751  # could be more accurate with var time step in nrn, but need to compare these to jNeuroML_NEURON

            report0 = simManager.checkSims(spikeTimesToCheck=spikeTimesToCheck,
                                           spikeTimeAccuracy=spikeTimeAccuracy)

            print report0
            report = report + report0 + "\n"

            if "Cell7-tuftIB-FigA4-1300" in simConfigs:

                print(
                    "Tests for default project simulation for %s with 0.005 dt in NEURON"
                    % ("Cell7-tuftIB-FigA4-1300"))

                spikeTimesToCheck = {
                    'CGtuftIB_0':
                    nc.loadMepFile('.test.tuftIBFigA4_1300_0005NoTable.mep')
                    ['FigA4']
                }

                spikeTimeAccuracy = 0  #  # could be more accurate with var time step in nrn, but need to compare these to jNeuroML_NEURON

                report2 = simManager.checkSims(
                    spikeTimesToCheck=spikeTimesToCheck,
                    spikeTimeAccuracy=spikeTimeAccuracy)

                print report2
                report = report + report2 + '\n'

            if "Cell7-tuftIB-FigA4-1500" in simConfigs:

                print(
                    "Tests for default project simulation for %s with 0.01 dt in NEURON"
                    % ("Cell7-tuftIB-FigA4-1500"))

                spikeTimesToCheck = {
                    'CGtuftIB_0':
                    nc.loadMepFile('.test.tuftIBFigA4_1500_0005NoTable.mep')
                    ['tuftIBFigA4_1500']
                }

                spikeTimeAccuracy = 0

                report2 = simManager.checkSims(
                    spikeTimesToCheck=spikeTimesToCheck,
                    spikeTimeAccuracy=spikeTimeAccuracy)

                print report2
                report = report + report2 + '\n'

    ######## added by Rokas Stanislovas : tests for all figures with 0.01 dt and default project spatial discretization in NEURON

    if "NEURON" == simulators[0]:

        if simDt == 0.01:

            if "Cell1-supppyrRS-FigA1RS" in simConfigs:

                print(
                    "Tests for default project simulation for %s with 0.01 dt in NEURON"
                    % ("Cell1-supppyrRS-FigA1RS"))

                spikeTimesToCheck = {
                    'CGsuppyrRS_0':
                    nc.loadMepFile('.test.FigA1RSNoTable.mep')['FigA1RS']
                }

                spikeTimeAccuracy = 0

                report2 = simManager.checkSims(
                    spikeTimesToCheck=spikeTimesToCheck,
                    spikeTimeAccuracy=spikeTimeAccuracy)

                print report2
                report = report + report2 + '\n'

            if "Default Simulation Configuration" in simConfigs:

                # These were discovered using analyseSims = True above.
                # They need to hold for all simulators
                spikeTimesToCheck = {
                    'CG_CML_0':
                    nc.loadMepFile('.testNoTable.mep')['Current clamp']
                }

                spikeTimeAccuracy = 0.0751  # could be more accurate with var time step in nrn, but need to compare these to jNeuroML_NEURON

                report0 = simManager.checkSims(
                    spikeTimesToCheck=spikeTimesToCheck,
                    spikeTimeAccuracy=spikeTimeAccuracy)

                print report0
                report = report + report0 + "\n"

    return report
Example #27
0
def testAll(argv=None):
    if argv is None:
        argv = sys.argv

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


    simManager = nc.SimulationManager(projFile,
                                      numConcurrentSims = numConcurrentSims,
                                      verbose = verbose)

    simManager.runMultipleSims(simConfigs =              simConfigs,
                               simDt =                   simDt,
                               simulators =              simulators,
                               runInBackground =         runInBackground,
                               varTimestepNeuron =       varTimestepNeuron,
                               varTimestepTolerance =    varTimestepTolerance,
                               mpiConfig =               mpiConfig,
                               suggestedRemoteRunTime =  suggestedRemoteRunTime)

    simManager.reloadSims(plotVoltageOnly =   plotVoltageOnly,
                          plotSims =          plotSims,
                          analyseSims =       analyseSims)
                          
    report= ""
    
    
    if simDt==0.005:

       if "Default Simulation Configuration" in simConfigs:
      
          # These were discovered using analyseSims = True above.
          # They need to hold for all simulators
          
          mep_from_nml2=nc.loadMepFile('../generatedNeuroML2/.test.mep')['Current clamp']
          
          for value in range(0,len(mep_from_nml2)):
              
              mep_from_nml2[value]=1000*mep_from_nml2[value]
          
          spikeTimesToCheck = {'CG_CML_0': mep_from_nml2}

          spikeTimeAccuracy = 0.0751  # could be more accurate with var time step in nrn, but need to compare these to jNeuroML_NEURON

          report0 = simManager.checkSims(spikeTimesToCheck = spikeTimesToCheck,
				    spikeTimeAccuracy = spikeTimeAccuracy)

          print report0
          report = report + report0+"\n"
    
       if "Cell2-suppyrFRB-FigA1FRB" in simConfigs:
	
          # These were discovered using analyseSims = True above.
          # They need to hold for all simulators
          
          mep_from_nml2=nc.loadMepFile('../../NeuroML2/test/.test.l23frb.mep')['L23FRB']
          
          for value in range(0,len(mep_from_nml2)):
              
              mep_from_nml2[value]=1000*mep_from_nml2[value]
          
          spikeTimesToCheck = {'CGsuppyrFRB_0': mep_from_nml2}

          spikeTimeAccuracy = 2.32 #  # could be more accurate with var time step in nrn, but need to compare these to jNeuroML_NEURON

          report2 = simManager.checkSims(spikeTimesToCheck = spikeTimesToCheck,
				    spikeTimeAccuracy = spikeTimeAccuracy)

          print report2
          report = report + report2+ '\n'
      
       if "Cell4-supaxax-FigA2a" in simConfigs:
       
          mep_from_nml2=nc.loadMepFile('../../NeuroML2/test/.test.supaxax.mep')['SupAxAx']
          
          for value in range(0,len(mep_from_nml2)):
              
              mep_from_nml2[value]=1000*mep_from_nml2[value]
	
          spikeTimesToCheck = {'CGsupaxax_0': mep_from_nml2}

          spikeTimeAccuracy = 0.711 # ms # could be more accurate with var time step in nrn, but need to compare these to jNeuroML_NEURON

          report2 = simManager.checkSims(spikeTimesToCheck = spikeTimesToCheck,
				    spikeTimeAccuracy = spikeTimeAccuracy)

          print report2
          report = report + report2+"\n"
      
       if "Cell14-nRT-FigA8-00" in simConfigs:
       
          mep_from_nml2=nc.loadMepFile('../../NeuroML2/test/.test.nrt.mep')['nRT']
          
          for value in range(0,len(mep_from_nml2)):
              
              mep_from_nml2[value]=1000*mep_from_nml2[value]
	
          spikeTimesToCheck = {'CGnRT_0': mep_from_nml2}

          spikeTimeAccuracy = 0.271 # ms  # could be more accurate with var time step in nrn, but need to compare these to jNeuroML_NEURON

          report2 = simManager.checkSims(spikeTimesToCheck = spikeTimesToCheck,
				    spikeTimeAccuracy = spikeTimeAccuracy)

          print report2
          report = report + report2+"\n"
       ###### the .mep tests below are NEURON specific - not tested on other simulators; added by Rokas Stanislovas GSoC 2016 project Cortical Networks
       if "NEURON"==simulators[0]:
          
          if "Cell1-supppyrRS-FigA1RS" in simConfigs:
             
              print("Tests for default project simulation for %s with 0.005 dt in NEURON"%("Cell1-supppyrRS-FigA1RS"))
              
              mep_from_nml2=nc.loadMepFile('../../NeuroML2/test/.test.FigA1RS0005.mep')['FigA1RS']
              
              for value in range(0,len(mep_from_nml2)):
              
                  mep_from_nml2[value]=1000*mep_from_nml2[value]
	
              spikeTimesToCheck = {'CGsuppyrRS_0': mep_from_nml2 }

              spikeTimeAccuracy = 0.00000001
  
              report2 = simManager.checkSims(spikeTimesToCheck = spikeTimesToCheck,spikeTimeAccuracy = spikeTimeAccuracy)

              print report2
              report = report + report2+ '\n'
              
          if "Cell2-suppyrFRB-FigA1FRB" in simConfigs:
              
              print("Tests for default project simulation for %s with 0.005 dt in NEURON"%("Cell2-suppyrFRB-FigA1FRB"))
              
              mep_from_nml2=nc.loadMepFile('../../NeuroML2/test/.test.FigA1FRB0005.mep')['FigA1FRB']
              
              for value in range(0,len(mep_from_nml2)):
              
                  mep_from_nml2[value]=1000*mep_from_nml2[value]
	
              spikeTimesToCheck = {'CGsuppyrFRB_0': mep_from_nml2 }

              spikeTimeAccuracy = 0.00000001

              report2 = simManager.checkSims(spikeTimesToCheck = spikeTimesToCheck,
				    spikeTimeAccuracy = spikeTimeAccuracy)

              print report2
              report = report + report2+ '\n' 
    
    ###########################
    if "NEURON"==simulators[0]:
    
       if simDt==0.01:
          
          if "Cell1-supppyrRS-FigA1RS" in simConfigs:
             
              print("Tests for default project simulation for %s with 0.01 dt in NEURON"%("Cell1-supppyrRS-FigA1RS"))
              
              mep_from_nml2=nc.loadMepFile('../../NeuroML2/test/.test.FigA1RS.mep')['FigA1RS']
              
              for value in range(0,len(mep_from_nml2)):
              
                  mep_from_nml2[value]=1000*mep_from_nml2[value]
	
              spikeTimesToCheck = {'CGsuppyrRS_0': mep_from_nml2}

              spikeTimeAccuracy = 0.00000001
  
              report2 = simManager.checkSims(spikeTimesToCheck = spikeTimesToCheck,spikeTimeAccuracy = spikeTimeAccuracy)

              print report2
              report = report + report2+ '\n' 
              
          if "Cell2-suppyrFRB-FigA1FRB" in simConfigs:
          
              print("Tests for default project simulation for %s with 0.01 dt in NEURON"%("Cell2-suppyrFRB-FigA1FRB"))
              
              mep_from_nml2=nc.loadMepFile('../../NeuroML2/test/.test.FigA1FRB.mep')['FigA1FRB']
              
              for value in range(0,len(mep_from_nml2)):
              
                  mep_from_nml2[value]=1000*mep_from_nml2[value]
	 
              spikeTimesToCheck = {'CGsuppyrFRB_0': mep_from_nml2}

              spikeTimeAccuracy = 0.00000001
  
              report2 = simManager.checkSims(spikeTimesToCheck = spikeTimesToCheck,spikeTimeAccuracy = spikeTimeAccuracy)

              print report2
              report = report + report2+ '\n' 
              
          if  "Cell3-supbask-FigA2a" in simConfigs:
          
              print("Tests for default project simulation for %s with 0.01 dt in NEURON"%("Cell3-supbask-FigA2a"))
              
              mep_from_nml2=nc.loadMepFile('../../NeuroML2/test/.test.supbaskFigA2a.mep')['supbaskFigA2a']
              
              for value in range(0,len(mep_from_nml2)):
              
                  mep_from_nml2[value]=1000*mep_from_nml2[value]

              spikeTimesToCheck = {'CGsupbask_0': mep_from_nml2}

              spikeTimeAccuracy =  0.00000001
  
              report2 = simManager.checkSims(spikeTimesToCheck = spikeTimesToCheck,spikeTimeAccuracy = spikeTimeAccuracy)

              print report2
              report = report + report2+ '\n' 
              
          if  "Cell4-supaxax-FigA2a" in simConfigs:
          
              print("Tests for default project simulation for %s with 0.01 dt in NEURON"%("Cell4-supaxax-FigA2a"))
              
              mep_from_nml2=nc.loadMepFile('../../NeuroML2/test/.test.supaxaxFigA2a.mep')['supaxaxFigA2a']
              
              for value in range(0,len(mep_from_nml2)):
              
                  mep_from_nml2[value]=1000*mep_from_nml2[value]
	 
              spikeTimesToCheck = {'CGsupaxax_0': mep_from_nml2}

              spikeTimeAccuracy =  0.00000001
  
              report2 = simManager.checkSims(spikeTimesToCheck = spikeTimesToCheck,spikeTimeAccuracy = spikeTimeAccuracy)

              print report2
              report = report + report2+ '\n' 
              
          if  "Cell5-supLTS-FigA2b" in simConfigs:
          
              print("Tests for default project simulation for %s with 0.01 dt in NEURON"%("Cell5-supLTS-FigA2b"))
              
              mep_from_nml2=nc.loadMepFile('../../NeuroML2/test/.test.supLTSFigA2b.mep')['supLTSFigA2b']
              
              for value in range(0,len(mep_from_nml2)):
              
                  mep_from_nml2[value]=1000*mep_from_nml2[value]
                 
              spikeTimesToCheck = {'CGsupLTS_0': mep_from_nml2}

              spikeTimeAccuracy = 0.00000001
  
              report2 = simManager.checkSims(spikeTimesToCheck = spikeTimesToCheck,spikeTimeAccuracy = spikeTimeAccuracy)

              print report2
              report = report + report2+ '\n' 
              
          if  "Cell6-spinstell-FigA3-333" in simConfigs:
              
              print("Tests for default project simulation for %s with 0.01 dt in NEURON"%("Cell6-spinstell-FigA3-333"))
              
              mep_from_nml2=nc.loadMepFile('../../NeuroML2/test/.test.spinstellFigA3_333.mep')['spinstellFigA3_333']
              
              for value in range(0,len(mep_from_nml2)):
              
                  mep_from_nml2[value]=1000*mep_from_nml2[value]
	
              spikeTimesToCheck = {'CGspinstell_0': mep_from_nml2 }

              spikeTimeAccuracy = 0.00000001
  
              report2 = simManager.checkSims(spikeTimesToCheck = spikeTimesToCheck,spikeTimeAccuracy = spikeTimeAccuracy)

              print report2
              report = report + report2+ '\n' 
              
          if  "Cell7-tuftIB-FigA4-1300" in simConfigs:
          
              print("Tests for default project simulation for %s with 0.01 dt in NEURON"%("Cell7-tuftIB-FigA4-1300"))
              
              mep_from_nml2=nc.loadMepFile('../../NeuroML2/test/.test.tuftIBFigA4_1300.mep')['tuftIBFigA4_1300']
              
              for value in range(0,len(mep_from_nml2)):
              
                  mep_from_nml2[value]=1000*mep_from_nml2[value]
	 
              spikeTimesToCheck = {'CGtuftIB_0': mep_from_nml2}

              spikeTimeAccuracy = 0.00000001
  
              report2 = simManager.checkSims(spikeTimesToCheck = spikeTimesToCheck,spikeTimeAccuracy = spikeTimeAccuracy)

              print report2
              report = report + report2+ '\n' 
              
          if  "Cell7-tuftIB-FigA4-1500" in simConfigs:
          
              print("Tests for default project simulation for %s with 0.01 dt in NEURON"%("Cell7-tuftIB-FigA4-1500"))
              
              mep_from_nml2=nc.loadMepFile('../../NeuroML2/test/.test.tuftIBFigA4_1500.mep')['tuftIBFigA4_1500']
              
              for value in range(0,len(mep_from_nml2)):
              
                  mep_from_nml2[value]=1000*mep_from_nml2[value]
	 
              spikeTimesToCheck = {'CGtuftIB_0': mep_from_nml2}

              spikeTimeAccuracy = 0.00000001
  
              report2 = simManager.checkSims(spikeTimesToCheck = spikeTimesToCheck,spikeTimeAccuracy = spikeTimeAccuracy)

              print report2
              report = report + report2+ '\n' 
              
          if  "Cell8-tuftRS-Fig5A-1400" in simConfigs:
          
              print("Tests for default project simulation for %s with 0.01 dt in NEURON"%("Cell8-tuftRS-Fig5A-1400"))
              
              mep_from_nml2=nc.loadMepFile('../../NeuroML2/test/.test.tuftRSFig5A_1400.mep')['tuftRSFig5A_1400']
              
              for value in range(0,len(mep_from_nml2)):
              
                  mep_from_nml2[value]=1000*mep_from_nml2[value]
	 
              spikeTimesToCheck = {'CGtuftRS_0': mep_from_nml2}

              spikeTimeAccuracy = 0.00000001
  
              report2 = simManager.checkSims(spikeTimesToCheck = spikeTimesToCheck,spikeTimeAccuracy = spikeTimeAccuracy)

              print report2
              report = report + report2+ '\n' 
              
          if "Cell9-nontuftRS-FigA6-1000" in simConfigs:
       
              print("Tests for default project simulation for %s with 0.01 dt in NEURON"%("Cell9-nontuftRS-FigA6-1000"))
              
              mep_from_nml2=nc.loadMepFile('../../NeuroML2/test/.test.nontuftRSFigA6_1000.mep')['nontuftRSFigA6_1000']
              
              for value in range(0,len(mep_from_nml2)):
              
                  mep_from_nml2[value]=1000*mep_from_nml2[value]
	 
              spikeTimesToCheck = {'CGnontuftRS_0': mep_from_nml2}

              spikeTimeAccuracy = 0.00000001
  
              report2 = simManager.checkSims(spikeTimesToCheck = spikeTimesToCheck,spikeTimeAccuracy = spikeTimeAccuracy)

              print report2
              report = report + report2+ '\n' 
              
          if "Cell12-deepLTS-FigA2b" in simConfigs:
       
              print("Tests for default project simulation for %s with 0.01 dt in NEURON"%("Cell12-deepLTS-FigA2b"))
              
              mep_from_nml2=nc.loadMepFile('../../NeuroML2/test/.test.deepLTSFigA2b.mep')['deepLTSFigA2b']
              
              for value in range(0,len(mep_from_nml2)):
              
                  mep_from_nml2[value]=1000*mep_from_nml2[value]
	 
              spikeTimesToCheck = {'CGdeepLTS_0': mep_from_nml2}

              spikeTimeAccuracy =  0.00000001
  
              report2 = simManager.checkSims(spikeTimesToCheck = spikeTimesToCheck,spikeTimeAccuracy = spikeTimeAccuracy)

              print report2
              report = report + report2+ '\n' 
              
          if "Cell13-TCR-FigA7-600" in simConfigs:
       
              print("Tests for default project simulation for %s with 0.01 dt in NEURON"%("Cell13-TCR-FigA7-600"))
              
              mep_from_nml2=nc.loadMepFile('../../NeuroML2/test/.test.TCRFigA7_600.mep')['TCRFigA7_600']
	 
              for value in range(0,len(mep_from_nml2)):
              
                  mep_from_nml2[value]=1000*mep_from_nml2[value]
	 
              spikeTimesToCheck = {'CGTCR_0': mep_from_nml2}

              spikeTimeAccuracy =  0.00000001
  
              report2 = simManager.checkSims(spikeTimesToCheck = spikeTimesToCheck,spikeTimeAccuracy = spikeTimeAccuracy)

              print report2
              report = report + report2+ '\n' 
              
          if "Cell14-nRT-FigA8-00" in simConfigs:
       
              print("Tests for default project simulation for %s with 0.01 dt in NEURON"%("Cell14-nRT-FigA8-00"))
              
              mep_from_nml2=nc.loadMepFile('../../NeuroML2/test/.test.nRTFigA8_00.mep')['nRTFigA8_00']
              
              for value in range(0,len(mep_from_nml2)):
              
                  mep_from_nml2[value]=1000*mep_from_nml2[value]
	 
              spikeTimesToCheck = {'CGnRT_0': mep_from_nml2}

              spikeTimeAccuracy =  0.00000001
  
              report2 = simManager.checkSims(spikeTimesToCheck = spikeTimesToCheck,spikeTimeAccuracy = spikeTimeAccuracy)

              print report2
              report = report + report2+ '\n'      
               
          if  "Cell1-supppyrRS-10ms" in simConfigs:
       
              print("Tests for default project simulation for %s with 0.01 dt in NEURON"%("Cell1-supppyrRS-10ms"))
              
              mep_from_nml2=nc.loadMepFile('../../NeuroML2/test/.test.suppyrRS10ms.mep')['suppyrRS10ms']
              
              for value in range(0,len(mep_from_nml2)):
              
                  mep_from_nml2[value]=1000*mep_from_nml2[value]
	 
              spikeTimesToCheck = {'CGsuppyrRS_0': mep_from_nml2 }

              spikeTimeAccuracy =  0.00000001
  
              report2 = simManager.checkSims(spikeTimesToCheck = spikeTimesToCheck,spikeTimeAccuracy = spikeTimeAccuracy)

              print report2
              report = report + report2+ '\n'  
              
          if  "Cell2-suppyrFRB-10ms" in simConfigs:
       
              print("Tests for default project simulation for %s with 0.01 dt in NEURON"%("Cell2-suppyrFRB-10ms"))
              
              mep_from_nml2=nc.loadMepFile('../../NeuroML2/test/.test.suppyrFRB10ms.mep')['suppyrFRB10ms']
              
              for value in range(0,len(mep_from_nml2)):
              
                  mep_from_nml2[value]=1000*mep_from_nml2[value]
	 
              spikeTimesToCheck = {'CGsuppyrFRB_0': mep_from_nml2 }

              spikeTimeAccuracy = 0.00000001
  
              report2 = simManager.checkSims(spikeTimesToCheck = spikeTimesToCheck,spikeTimeAccuracy = spikeTimeAccuracy)

              print report2
              report = report + report2+ '\n'  
              
          if  "Cell3-supbask-10ms" in simConfigs:
       
              print("Tests for default project simulation for %s with 0.01 dt in NEURON"%("Cell3-supbask-10ms"))
              
              mep_from_nml2=nc.loadMepFile('../../NeuroML2/test/.test.supbask10ms.mep')['supbask10ms']
              
              for value in range(0,len(mep_from_nml2)):
              
                  mep_from_nml2[value]=1000*mep_from_nml2[value]
	 
              spikeTimesToCheck = {'CGsupbask_0': mep_from_nml2 }

              spikeTimeAccuracy = 0.00000001
  
              report2 = simManager.checkSims(spikeTimesToCheck = spikeTimesToCheck,spikeTimeAccuracy = spikeTimeAccuracy)

              print report2
              report = report + report2+ '\n'  
              
          if  "Cell4-supaxax-10ms" in simConfigs:
       
              print("Tests for default project simulation for %s with 0.01 dt in NEURON"%("Cell4-supaxax-10ms"))
              
              mep_from_nml2=nc.loadMepFile('../../NeuroML2/test/.test.supaxax10ms.mep')['supaxax10ms']
              
              for value in range(0,len(mep_from_nml2)):
              
                  mep_from_nml2[value]=1000*mep_from_nml2[value]
	
              spikeTimesToCheck = {'CGsupaxax_0': mep_from_nml2 }

              spikeTimeAccuracy = 0.00000001
  
              report2 = simManager.checkSims(spikeTimesToCheck = spikeTimesToCheck,spikeTimeAccuracy = spikeTimeAccuracy)

              print report2
              report = report + report2+ '\n'  
              
          if "Cell5-supLTS-10ms" in simConfigs:
       
              print("Tests for default project simulation for %s with 0.01 dt in NEURON"%("Cell5-supLTS-10ms"))
              
              mep_from_nml2=nc.loadMepFile('../../NeuroML2/test/.test.supLTS10ms.mep')['supLTS10ms']
              
              for value in range(0,len(mep_from_nml2)):
              
                  mep_from_nml2[value]=1000*mep_from_nml2[value]
	 
              spikeTimesToCheck = {'CGsupLTS_0': mep_from_nml2 }

              spikeTimeAccuracy =  0.00000001
  
              report2 = simManager.checkSims(spikeTimesToCheck = spikeTimesToCheck,spikeTimeAccuracy = spikeTimeAccuracy)

              print report2
              report = report + report2+ '\n'  
               
          if "Cell6-spinstell-10ms" in simConfigs:
       
              print("Tests for default project simulation for %s with 0.01 dt in NEURON"%("Cell6-spinstell-10ms"))
              
              mep_from_nml2=nc.loadMepFile('../../NeuroML2/test/.test.spinstell10ms.mep')['spinstell10ms']
              
              for value in range(0,len(mep_from_nml2)):
              
                  mep_from_nml2[value]=1000*mep_from_nml2[value]
	 
              spikeTimesToCheck = {'CGspinstell_0': mep_from_nml2}

              spikeTimeAccuracy =  0.00000001
  
              report2 = simManager.checkSims(spikeTimesToCheck = spikeTimesToCheck,spikeTimeAccuracy = spikeTimeAccuracy)

              print report2
              report = report + report2+ '\n'  
              
          if "Cell7-tuftIB-10ms" in simConfigs:
       
              print("Tests for default project simulation for %s with 0.01 dt in NEURON"%("Cell7-tuftIB-10ms"))
              
              mep_from_nml2= nc.loadMepFile('../../NeuroML2/test/.test.tuftIB10ms.mep')['tuftIB10ms']
              
              for value in range(0,len(mep_from_nml2)):
              
                  mep_from_nml2[value]=1000*mep_from_nml2[value]
	 
              spikeTimesToCheck = {'CGtuftIB_0': mep_from_nml2}

              spikeTimeAccuracy =  0.00000001
  
              report2 = simManager.checkSims(spikeTimesToCheck = spikeTimesToCheck,spikeTimeAccuracy = spikeTimeAccuracy)

              print report2
              report = report + report2+ '\n'  
              
          if "Cell8-tuftRS-10ms" in simConfigs:
       
              print("Tests for default project simulation for %s with 0.01 dt in NEURON"%("Cell8-tuftRS-10ms"))
              
              mep_from_nml2=nc.loadMepFile('../../NeuroML2/test/.test.tuftRS10ms.mep')['tuftRS10ms']
              
              for value in range(0,len(mep_from_nml2)):
              
                  mep_from_nml2[value]=1000*mep_from_nml2[value]
	 
              spikeTimesToCheck = {'CGtuftRS_0': mep_from_nml2}

              spikeTimeAccuracy = 0.00000001
  
              report2 = simManager.checkSims(spikeTimesToCheck = spikeTimesToCheck,spikeTimeAccuracy = spikeTimeAccuracy)

              print report2
              report = report + report2+ '\n'
              
          if "Cell9-nontuftRS-10ms" in simConfigs:
       
              print("Tests for default project simulation for %s with 0.01 dt in NEURON"%("Cell9-nontuftRS-10ms"))
              
              mep_from_nml2=nc.loadMepFile('../../NeuroML2/test/.test.nontuftRS10ms.mep')['nontuftRS10ms']
              
              for value in range(0,len(mep_from_nml2)):
              
                  mep_from_nml2[value]=1000*mep_from_nml2[value]
	 
              spikeTimesToCheck = {'CGnontuftRS_0': mep_from_nml2}

              spikeTimeAccuracy = 0.00000001
  
              report2 = simManager.checkSims(spikeTimesToCheck = spikeTimesToCheck,spikeTimeAccuracy = spikeTimeAccuracy)

              print report2
              report = report + report2+ '\n'
              
          if "Cell10-deepbask-10ms" in simConfigs:
      
              print("Tests for default project simulation for %s with 0.01 dt in NEURON"%("Cell10-deepbask-10ms"))
              
              mep_from_nml2=nc.loadMepFile('../../NeuroML2/test/.test.deepbask10ms.mep')['deepbask10ms']
              
              for value in range(0,len(mep_from_nml2)):
              
                  mep_from_nml2[value]=1000*mep_from_nml2[value]
	 
              spikeTimesToCheck = {'CGdeepbask_0': mep_from_nml2}

              spikeTimeAccuracy = 0.00000001
  
              report2 = simManager.checkSims(spikeTimesToCheck = spikeTimesToCheck,spikeTimeAccuracy = spikeTimeAccuracy)

              print report2
              report = report + report2+ '\n' 
              
          if "Cell11-deepaxax-10ms" in simConfigs:
      
              print("Tests for default project simulation for %s with 0.01 dt in NEURON"%("Cell11-deepaxax-10ms"))
              
              mep_from_nml2=nc.loadMepFile('../../NeuroML2/test/.test.deepaxax10ms.mep')['deepaxax10ms']
              
              for value in range(0,len(mep_from_nml2)):
              
                  mep_from_nml2[value]=1000*mep_from_nml2[value]
	 
              spikeTimesToCheck = {'CGdeepaxax_0': mep_from_nml2}

              spikeTimeAccuracy = 0.00000001
  
              report2 = simManager.checkSims(spikeTimesToCheck = spikeTimesToCheck,spikeTimeAccuracy = spikeTimeAccuracy)

              print report2
              report = report + report2+ '\n' 
              
          if "Cell12-deepLTS-10ms" in simConfigs:
      
              print("Tests for default project simulation for %s with 0.01 dt in NEURON"%("Cell12-deepLTS-10ms"))
              
              mep_from_nml2=nc.loadMepFile('../../NeuroML2/test/.test.deepLTS10ms.mep')['deepLTS10ms']
              
              for value in range(0,len(mep_from_nml2)):
              
                  mep_from_nml2[value]=1000*mep_from_nml2[value]
	 
              spikeTimesToCheck = {'CGdeepLTS_0': mep_from_nml2}

              spikeTimeAccuracy =  0.00000001
  
              report2 = simManager.checkSims(spikeTimesToCheck = spikeTimesToCheck,spikeTimeAccuracy = spikeTimeAccuracy)

              print report2
              report = report + report2+ '\n' 
              
          if "Cell13-TCR-10ms" in simConfigs:
      
              print("Tests for default project simulation for %s with 0.01 dt in NEURON"%("Cell13-TCR-10ms"))
              
              mep_from_nml2=nc.loadMepFile('../../NeuroML2/test/.test.TCR10ms.mep')['TCR10ms']
              
              for value in range(0,len(mep_from_nml2)):
              
                  mep_from_nml2[value]=1000*mep_from_nml2[value]
	    
              spikeTimesToCheck = {'CGTCR_0': mep_from_nml2 }

              spikeTimeAccuracy = 0.00000001
  
              report2 = simManager.checkSims(spikeTimesToCheck = spikeTimesToCheck,spikeTimeAccuracy = spikeTimeAccuracy)

              print report2
              report = report + report2+ '\n' 
              
          if "Cell14-nRT-10ms" in simConfigs:
      
              print("Tests for default project simulation for %s with 0.01 dt in NEURON"%("Cell14-nRT-10ms"))
              
              mep_from_nml2=nc.loadMepFile('../../NeuroML2/test/.test.nRT10ms.mep')['nRT10ms']
              
              for value in range(0,len(mep_from_nml2)):
              
                  mep_from_nml2[value]=1000*mep_from_nml2[value]
	 
              spikeTimesToCheck = {'CGnRT_min75init_0': mep_from_nml2}

              spikeTimeAccuracy =  0.00000001
  
              report2 = simManager.checkSims(spikeTimesToCheck = spikeTimesToCheck,spikeTimeAccuracy = spikeTimeAccuracy)

              print report2
              report = report + report2+ '\n' 
          
              

    return report
neuroConstructSeed = 1631914719
simulatorSeed = 2104606939
#mpiConf =               MpiSettings.LEGION_8PROC

simulators = ["NEURON"]

varTimestepNeuron = False

plotSims = True
plotVoltageOnly = True
runInBackground = True
analyseSims = True
verbose = False

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

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

simManager = nc.SimulationManager(projFile, 1, verbose)

simManager.runMultipleSims(simConfigs=simConfigs,
                           simDt=simDt,
                           simDuration=simDuration,
                           simulators=simulators,
                           neuroConstructSeed=neuroConstructSeed,
                           simulatorSeed=simulatorSeed,
                           runInBackground=runInBackground,
                           varTimestepNeuron=varTimestepNeuron)

simManager.reloadSims(plotVoltageOnly=plotVoltageOnly, analyseSims=analyseSims)
Example #29
0
def testAll(argv=None):
    if argv is None:
        argv = sys.argv

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

    simManager = nc.SimulationManager(projFile, numConcurrentSims, verbose)

    simManager.runMultipleSims(simConfigs=simConfigs,
                               simDt=simDt,
                               simulators=simulators,
                               runInBackground=runInBackground,
                               runSims=runSims,
                               varTimestepNeuron=varTimestepNeuron)

    simManager.reloadSims(plotVoltageOnly=plotVoltageOnly,
                          plotSims=plotSims,
                          analyseSims=analyseSims)

    # These were discovered using analyseSims = True above.
    # They need to hold for all simulators
    '''spikeTimesToCheck = {'CGAbst_0'  : [17.9716, 22.4136, 27.1705, 32.3506, 38.134, 44.8546, 53.2245, 64.6112, 75.5588, 86.8877, 97.8855],
                         'CGAbst2_0'  : [24.3711, 25.5105, 26.722, 28.018, 29.415, 30.9363, 32.6154, 34.506, 36.7044, 39.4271, 43.6248, 77.6337, 79.3465, 81.2841, 83.5555, 86.423, 91.5845, 125.478, 127.191, 129.128, 131.4, 134.267, 139.428, 173.322, 175.035, 176.972, 179.244, 182.111, 187.273],
                         'CGIaF_0'   : [27.3298, 55.0556, 82.7814, 104.1956, 118.0584, 131.9214, 145.7844, 159.6474, 173.5104, 187.3734],
                         'CGIaFRef_0'   : [40.9952, 92.5842, 144.173, 195.762]}'''

    spikeTimesToCheck = {
        'CGIaF_0': [
            27.3298, 55.0556, 82.7814, 104.1956, 118.0584, 131.9214, 145.7844,
            159.6474, 173.5104, 187.3734
        ],
        'CGIaFRef_0': [40.9952, 92.5842, 144.173, 195.762],
        'CG_IaF_GrC_0': [
            51.8383, 55.1162, 58.3941, 61.672, 64.9499, 68.2278, 71.5057,
            74.7836, 78.0615, 81.3394, 84.6173, 87.8952, 91.1731, 94.451,
            97.7289, 101.007, 104.285, 107.563, 110.841, 114.118, 117.396,
            120.674, 123.952, 127.23, 130.508, 133.786, 137.064, 140.342,
            143.62, 146.898
        ],
        'CG_IaF_GrC_NoRef_0': [
            51.8383, 53.1175, 54.3967, 55.6759, 56.9551, 58.2343, 59.5135,
            60.7927, 62.0719, 63.3511, 64.6303, 65.9095, 67.1887, 68.4679,
            69.7471, 71.0263, 72.3055, 73.5847, 74.8639, 76.1431, 77.4223,
            78.7015, 79.9807, 81.2599, 82.5391, 83.8183, 85.0975, 86.3767,
            87.6559, 88.9351, 90.2143, 91.4935, 92.7727, 94.0519, 95.3311,
            96.6103, 97.8895, 99.1687, 100.448, 101.727, 103.006, 104.286,
            105.565, 106.844, 108.123, 109.402, 110.682, 111.961, 113.24,
            114.519, 115.798, 117.078, 118.357, 119.636, 120.915, 122.194,
            123.474, 124.753, 126.032, 127.311, 128.59, 129.87, 131.149,
            132.428, 133.707, 134.986, 136.266, 137.545, 138.824, 140.103,
            141.382, 142.662, 143.941, 145.22, 146.499, 147.778, 149.057
        ]
    }

    spikeTimeAccuracy = 0.52

    threshold = {
        'CGAbst_0': -41,
        'CGAbst2_0': 0,
        'CGIaF_0': -55.1,
        'CGIaFRef_0': -55.1,
        'CG_IaF_GrC_0': -40.1,
        'CG_IaF_GrC_NoRef_0': -40.1
    }

    report = simManager.checkSims(spikeTimesToCheck=spikeTimesToCheck,
                                  spikeTimeAccuracy=spikeTimeAccuracy,
                                  threshold=threshold)

    print report

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

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


    simManager = nc.SimulationManager(projFile,
                                      numConcurrentSims = numConcurrentSims,
                                      verbose = verbose)

    ### Change num in each cell group

    simManager.project.cellGroupsInfo.getCellPackingAdapter("ExcCells").setMaxNumberCells(numExcCells)
    simManager.project.cellGroupsInfo.getCellPackingAdapter("INCells").setMaxNumberCells(numINCells)

    ### Change weights in synapses/gap junctions

    simConfig = simManager.project.simConfigInfo.getSimConfig(simConfigName)

    for netConnName in simConfig.getNetConns():
        print "Changing synaptic delay in %s to %f"%(netConnName, defaultSynapticDelay)
        delayGen = NumberGenerator(defaultSynapticDelay)
        for synProps in simManager.project.morphNetworkConnectionsInfo.getSynapseList(netConnName):
            synProps.setDelayGenerator(delayGen)

    # defaultSynapticDelay will be recorded in simulation.props and listed in SimulationBrowser GUI
    SimulationsInfo.addExtraSimProperty("defaultSynapticDelay", str(defaultSynapticDelay))



    allSims = simManager.runMultipleSims(simConfigs =     [simConfigName],
                               simDt =                   simDt,
                               simDuration =             simDuration,
                               simulators =              simulators,
                               runInBackground =         runInBackground,
                               varTimestepNeuron =       varTimestepNeuron,
                               mpiConfigs =              mpiConfigs,
                               suggestedRemoteRunTime =  suggestedRemoteRunTime,
                               simRefGlobalPrefix =      simAllPrefix,
                               runSims =                 runSims,
                               neuroConstructSeed =      neuroConstructSeed,
                               simulatorSeed =           simulatorSeed)

    while (len(simManager.allRunningSims)>0):
        print "Waiting for the following sims to finish: "+str(simManager.allRunningSims)
        time.sleep(5) # wait a while...
        simManager.updateSimsRunning()

    for sim in allSims:
        simDir = File(projFile.getParentFile(), "/simulations/"+sim)

        try:
            simData = SimulationData(simDir)
            simData.initialise()
            simTime = simData.getSimulationProperties().getProperty("RealSimulationTime")
            print "Simulation: %s took %s seconds"%(sim, simTime)

        except:
            print "Error analysing simulation data from: %s"%simDir.getCanonicalPath()

    if mpiConfigs == [MpiSettings.LOCAL_SERIAL] or mpiConfigs == [MpiSettings.MATLEM_1PROC]:
        simManager.reloadSims(plotVoltageOnly =   True,
                          plotSims =          plotSims,
                          analyseSims =       analyseSims)