Skip to content

Commit e8b9a82

Browse files
committed
Added test example to models folder
1 parent b3096de commit e8b9a82

2 files changed

Lines changed: 71 additions & 2 deletions

File tree

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
from netpyne import specs
2+
3+
# Network parameters
4+
netParams = {} # object of class NetParams to store the network parameters
5+
6+
netParams['cellParams'] = {}
7+
netParams['popParams'] = {}
8+
netParams['stimSourceParams'] = {}
9+
netParams['stimTargetParams'] = {}
10+
netParams['synMechParams'] = {}
11+
netParams['connParams'] = {}
12+
13+
## Cell parameters
14+
secs = {} # dict with section info
15+
secs['soma'] = {'geom': {}, 'mechs': {}}
16+
secs['soma']['geom'] = {'diam': 12, 'L': 12, 'Ra': 100.0, 'cm': 1} # soma geometry
17+
secs['soma']['mechs']['hh'] = {'gnabar': 0.12, 'gkbar': 0.036, 'gl': 0.0003, 'el': -54.3} # soma hh mechanism
18+
19+
secs['dend'] = {'geom': {}, 'mechs': {}}
20+
secs['dend']['geom'] = {'diam': 1.0, 'L': 200.0, 'Ra': 100.0, 'cm': 1}
21+
secs['dend']['topol'] = {'parentSec': 'soma', 'parentX': 1.0, 'childX': 0} # dend geometry
22+
secs['dend']['mechs']['pas'] = {'g': 0.001, 'e': -70} # dend pas mechanism
23+
24+
netParams['cellParams']['pyr'] = {'secs': secs} # add dict to list of cell parameters
25+
26+
## Population parameters
27+
netParams['popParams']['E'] = {'cellType': 'pyr', 'numCells': 40}
28+
29+
# Stimulation parameters
30+
netParams['stimSourceParams']['IClamp1'] = {'type': 'IClamp', 'dur': 5, 'del': 20, 'amp': 0.1}
31+
netParams['stimTargetParams']['IClamp1->cell0'] = {'source': 'IClamp1', 'conds': {'cellList':[0]}, 'sec':'dend', 'loc':1.0}
32+
33+
34+
# Synaptic mechanism parameters
35+
netParams['synMechParams']['exc'] = {'mod': 'Exp2Syn', 'tau1': 0.1, 'tau2': 1.0, 'e': 0}
36+
37+
38+
# Connectivity parameters
39+
netParams['connParams']['E->E'] = {
40+
'preConds': {'pop': 'E'},
41+
'postConds': {'pop': 'E'},
42+
'weight': 0.005, # weight of each connection
43+
'probability': 0.1,
44+
'delay': 5, # delay min=0.2, mean=13.0, var = 1.4
45+
'synMech': 'exc',
46+
'sec': 'dend'}
47+
48+
# Simulation options
49+
simConfig = specs.SimConfig() # object of class SimConfig to store simulation configuration
50+
51+
simConfig.duration = 0.2*1e3 # Duration of the simulation, in ms
52+
simConfig.dt = 0.1 # Internal integration timestep to use
53+
simConfig.verbose = False # Show detailed messages
54+
simConfig.recordTraces = {'V_soma':{'sec':'soma','loc':0.5,'var':'v'},
55+
'V_dend': {'sec': 'dend', 'loc': 1.0, 'var':'v'}} # Dict with traces to record
56+
simConfig.recordCells = [0]
57+
simConfig.recordStep = 0.1 # Step size in ms to save data (eg. V traces, LFP, etc)
58+
simConfig.filename = 'gui_tut1' # Set file output name
59+
simConfig.saveJson = False # Save params, network and sim output to pickle file
60+
simConfig.analysis['iplotTraces'] = {'include': [0], 'overlay': True}
61+
simConfig.analysis['iplotRaster'] = {'markerSize': 5, 'showFig': True}
62+
63+
64+
if __name__ == '__main__':
65+
netpyne_geppetto.netParams=netParams
66+
netpyne_geppetto.simConfig=simConfig
67+
68+
#from netpyne import sim
69+
#sim.createSimulateAnalyze(netParams, simConfig)

tests/backend/netypne_model_importer_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,10 @@ def test_dict_import_1(self):
4848
netpyne_info['compileMod'] = False
4949
netpyne_info['loadMod'] = False
5050
netpyne_info['modFolder'] = "mod"
51-
netpyne_info['netParamsPath'] = "."
51+
netpyne_info['netParamsPath'] = sys.path[1] + '/models'
5252
netpyne_info['netParamsModuleName'] = "gui_import_dict"
5353
netpyne_info['netParamsVariable'] = "netParams"
54-
netpyne_info['simConfigPath'] = "."
54+
netpyne_info['simConfigPath'] = sys.path[1] + '/models'
5555
netpyne_info['simConfigModuleName'] = "gui_import_dict"
5656
netpyne_info['simConfigVariable'] = "simConfig"
5757

0 commit comments

Comments
 (0)