Пример #1
0
def run(config_file):
    conf = config.from_json(config_file)
    io.setup_output_dir(conf)
    nrn.load_neuron_modules(conf)
    graph = BioGraph.from_config(conf, property_schema=AIPropertySchema)
    net = BioNetwork.from_config(conf, graph)
    sim = Simulation.from_config(conf, network=net)
    sim.run()
    nrn.quit_execution()
Пример #2
0
def run(config_file):
    conf = config.from_json(config_file)  # build configuration
    io.setup_output_dir(conf)  # set up output directories
    nrn.load_neuron_modules(conf)  # load NEURON modules and mechanisms
    graph = BioGraph.from_config(conf,
                                 network_format=TabularNetwork_AI,
                                 property_schema=AIPropertySchema)

    net = BioNetwork.from_config(conf, graph)  # create network of in NEURON
    sim = Simulation(conf, network=net)  # initialize a simulation
    sim.attach_current_clamp()
    sim.set_recordings(
    )  # set recordings of relevant variables to be saved as an ouput
    sim.run()  # run simulation

    nrn.quit_execution()  # exit
Пример #3
0
def run(config_file):
    conf = config.from_json(config_file)  # build configuration
    io.setup_output_dir(conf)  # set up output directories
    nrn.load_neuron_modules(conf)  # load NEURON modules and mechanisms
    nrn.load_py_modules(
        cell_models=set_cell_params,  # load custom Python modules
        syn_models=set_syn_params,
        syn_weights=set_weights)

    graph = BioGraph.from_config(
        conf,  # create network graph containing parameters of the model
        network_format=TabularNetwork_AI,
        property_schema=AIPropertySchema)

    net = BioNetwork.from_config(
        conf, graph
    )  # create netwosim = Simulation.from_config(conf, network=net)  rk of in NEURON
    sim = Simulation.from_config(conf, network=net)  # initialize a simulation
    sim.run()  # run simulation

    if MPI_RANK == 0:
        try:
            # Check spikes
            print2log0('Checking spike times')
            assert (os.path.exists(conf['output']['spikes_ascii_file']))
            assert (spike_files_equal(conf['output']['spikes_ascii_file'],
                                      'expected/spikes.txt'))
            print2log0('Spikes passed!')

            # Check extracellular recordings
            print2log0('Checking ECP output')
            check_ecp()
            print2log0('ECP passed!')

            # Check saved variables
            print2log0('Checking NEURON saved variables')
            for saved_gids in conf['node_id_selections']['save_cell_vars']:
                check_cellvars(saved_gids, conf)
            print2log0('variables passed!')
        except AssertionError:
            _, _, tb = sys.exc_info()
            traceback.print_tb(tb)

    pc.barrier()
    nrn.quit_execution()  # exit
Пример #4
0
def run(config_file):
    conf = config.from_json(config_file)  # build configuration
    io.setup_output_dir(conf)  # set up output directories
    nrn.load_neuron_modules(conf)  # load NEURON modules and mechanisms
    nrn.load_py_modules(
        cell_models=set_cell_params,  # load custom Python modules
        syn_models=set_syn_params,
        syn_weights=set_weights)

    graph = BioGraph.from_config(
        conf)  # create network graph containing parameters of the model

    net = BioNetwork.from_config(conf, graph)  # create network of in NEURON
    sim = Simulation.from_config(conf, net)  # initialize a simulation
    # sim.set_recordings()                        # set recordings of relevant variables to be saved as an ouput
    sim.run()  # run simulation

    assert (os.path.exists(conf['output']['spikes_ascii_file']))
    assert (spike_files_equal(conf['output']['spikes_ascii_file'],
                              'expected/spikes.txt'))
    nrn.quit_execution()  # exit
Пример #5
0
def run(config_file):
    conf = config.from_json(config_file)  # build configuration
    io.setup_output_dir(conf)  # set up output directories
    nrn.load_neuron_modules(conf)  # load NEURON modules and mechanisms
    nrn.load_py_modules(
        cell_models=set_cell_params,  # load custom Python modules
        syn_models=set_syn_params,
        syn_weights=set_weights)

    graph = BioGraph.from_config(
        conf,  # create network graph containing parameters of the model
        network_format=TabularNetwork_AI,
        property_schema=AIPropertySchema)

    net = BioNetwork.from_config(
        conf, graph
    )  # create netwosim = Simulation.from_config(conf, network=net)  rk of in NEURON
    sim = Simulation.from_config(conf, network=net)  # initialize a simulation
    # sim.set_recordings()                        # set recordings of relevant variables to be saved as an ouput
    sim.run()  # run simulation

    assert (os.path.exists(conf['output']['spikes_ascii_file']))
    assert (spike_files_equal(conf['output']['spikes_ascii_file'],
                              'expected/spikes.txt'))

    # Test the results of the ecp
    SAMPLE_SIZE = 100
    expected_h5 = h5py.File('expected/ecp.h5', 'r')
    nrows, ncols = expected_h5['ecp'].shape
    expected_mat = np.matrix(expected_h5['ecp'])
    results_h5 = h5py.File('output/ecp.h5', 'r')
    assert ('ecp' in results_h5.keys())
    results_mat = np.matrix(results_h5['ecp'][:])

    assert (results_h5['ecp'].shape == (nrows, ncols))
    for i, j in zip(randint(0, nrows, size=SAMPLE_SIZE),
                    randint(0, ncols, size=SAMPLE_SIZE)):
        assert (results_mat[i, j] == expected_mat[i, j])

    nrn.quit_execution()  # exit
Пример #6
0
def run(config_file):
    conf = config.from_json(config_file)  # build configuration
    io.setup_output_dir(conf)  # set up output directories
    nrn.load_neuron_modules(conf)  # load NEURON modules and mechanisms
    nrn.load_py_modules(
        cell_models=set_cell_params,  # load custom Python modules
        syn_models=set_syn_params,
        syn_weights=set_weights)

    graph = BioGraph.from_config(
        conf,  # create network graph containing parameters of the model
        network_format=TabularNetwork_AI,
        property_schema=AIPropertySchema)

    net = BioNetwork.from_config(conf, graph)
    sim = Simulation.from_config(conf, network=net)
    sim.run()

    assert (os.path.exists(conf['output']['spikes_ascii_file']))
    assert (spike_files_equal(conf['output']['spikes_ascii_file'],
                              'expected/spikes.txt'))
    nrn.quit_execution()  # exit
Пример #7
0
def run(config_file):
    conf = config.from_json(config_file)  # build configuration
    io.setup_output_dir(conf)  # set up output directories
    nrn.load_neuron_modules(conf)  # load NEURON modules and mechanisms
    nrn.load_py_modules(
        cell_models=set_cell_params,  # load custom Python modules
        syn_models=set_syn_params,
        syn_weights=set_weights)

    graph = BioGraph.from_config(
        conf,  # create network graph containing parameters of the model
        #network_format=TabularNetwork_AI,
        property_schema=AIPropertySchema)
    '''
    graph = BioGraph.from_config(conf)
    '''

    net = BioNetwork.from_config(conf, graph)  # create network of in NEURON
    sim = Simulation(conf, network=net)  # initialize a simulation
    sim.set_recordings(
    )  # set recordings of relevant variables to be saved as an ouput
    sim.run()  # run simulation

    nrn.quit_execution()  # exit