File: run_popnet.py

package info (click to toggle)
bmtk 0.0%2Bgit20210109.8572664%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 74,876 kB
  • sloc: python: 24,853; javascript: 1,998; makefile: 34; sh: 16
file content (24 lines) | stat: -rw-r--r-- 635 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import sys
import os

from bmtk.simulator import popnet

from bmtk.analyzer.firing_rates import plot_rates_popnet

def main(config_file):
    configure = popnet.config.from_json(config_file)
    configure.build_env()
    network = popnet.PopNetwork.from_config(configure)
    sim = popnet.PopSimulator.from_config(configure, network)
    sim.run()

    cells_file = 'network/brunel_node_types.csv'
    rates_file = 'output/spike_rates.csv'
    plot_rates_popnet(cells_file, rates_file, model_keys='pop_name')


if __name__ == '__main__':
    if __file__ != sys.argv[-1]:
        main(sys.argv[-1])
    else:
        main('config.json')