<commit_before>from netpyne import specs, sim

netParams = specs.NetParams()

#Create artificial cell with spike times
netParams.popParams['bkg'] = {'cellModel' : 'VecStim', 'numCells': 5, 'spkTimes': [100, 200, 300, 400, 500]}

#Create cell type
netParams.popParams['S'] = {'cellType': 'PYR', 'numCells': 20, 'cellModel': 'HH'}

#Define cell characteristics
cellRule = {'conds': {'cellType': 'PYR'},  'secs': {}}    # cell rule dict
cellRule['secs']['soma'] = {'geom': {}, 'mechs': {}}                                   # soma params dict
cellRule['secs']['soma']['geom'] = {'diam': 18.8, 'L': 18.8, 'Ra': 123.0}                             # soma geometry
cellRule['secs']['soma']['mechs']['hh'] = {'gnabar': 0.12, 'gkbar': 0.036, 'gl': 0.003, 'el': -70}        # soma hh mechanisms
cellRule['secs']['dend'] = {'geom': {}, 'topol': {}, 'mechs': {}}                          # dend params dict
cellRule['secs']['dend']['geom'] = {'diam': 5.0, 'L': 150.0, 'Ra': 150.0, 'cm': 1}                     # dend geometry
cellRule['secs']['dend']['topol'] = {'parentSec': 'soma', 'parentX': 1.0, 'childX': 0}                  # dend topology 
cellRule['secs']['dend']['mechs']['pas'] = {'g': 0.0000357, 'e': -70}                               # dend mechanisms
netParams.cellParams['PYRrule'] = cellRule
   
#Import synaptic mechanism
netParams.synMechParams['exc'] = {'mod': 'Exp2Syn', 'tau1': 0.1, 'tau2': 5.0, 'e': 0}

#Connect artificial cell to regular cells with 100% probability
netParams.connParams['bkg->S'] = {'preConds': {'popLabel': 'bkg'}, 
   'postConds': {'popLabel': 'S'},
   'probability': 1,          # probability of connection
   'weight': 2,          # synaptic weight 
   'delay': 5,               # transmission delay (ms) 
   'sec': 'adend',            # section to connect to
   'loc': 0.5,               # location of synapse
   'synMech': 'exc'}         # target synaptic mechanism
   
#Simulate
simConfig = specs.SimConfig()      # object of class SimConfig to store simulation configuration

simConfig.duration = 1*1e3          # Duration of the simulation, in ms
simConfig.dt = 0.025             # Internal integration timestep to use
simConfig.recordStep = 0.25          # Step size in ms to save data (eg. V traces, LFP, etc)

simConfig.analysis['plotRaster'] = True         # Plot a raster
simConfig.analysis['plot2Dnet']  = True          # plot 2D visualization of cell positions and connections

# Create network and run simulation
sim.createSimulateAnalyze(netParams = netParams, simConfig = simConfig)    
   
import pylab; pylab.show()  # this line is only necessary in certain systems where figures appear empty
<commit_msg>debugging issue with plotTraces<commit_after>
from neuron import h
h.load_file('stdrun.hoc')

pc = h.ParallelContext()
pc.set_maxstep(10)

h.dt = 0.1
tstop = 1.0
s = h.Section()
t = h.Vector()
v = h.Vector()
v.record(s(0.5)._v_)
#t.record(h._ref_t)

h.stdinit()
pc.psolve(tstop)

print list(v)
{'fraction_non_alphanumeric': 0.17028493894165536, 'fraction_numerical': 0.03426051560379918, 'mean_word_length': 3.1072423398328692, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '92422', 'n_tokens_mistral': 1063, 'n_tokens_neox': 960, 'n_words': 273}