Skip to content

Commit e408109

Browse files
committed
IT2 validation
1 parent 4be3e56 commit e408109

File tree

218 files changed

+904744
-5061830
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

218 files changed

+904744
-5061830
lines changed

NeuroML2/compare_MC/IT2/IT2_json.py

Lines changed: 0 additions & 37 deletions
This file was deleted.

NeuroML2/compare_MC/IT2/IT2_netpy.py

Lines changed: 26 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,20 @@
1+
import os
2+
# Force headless plotting for Matplotlib (as in RE_netpy)
3+
os.environ["MPLBACKEND"] = "Agg"
4+
import matplotlib
5+
matplotlib.use("Agg")
6+
# Ensure NEURON runs headless in non-GUI environments
7+
os.environ["NEURON_NO_GUI"] = "1"
8+
os.environ.pop("DISPLAY", None)
9+
print(f"[IT2_netpy] Headless env: DISPLAY={os.environ.get('DISPLAY')}, NEURON_NO_GUI={os.environ.get('NEURON_NO_GUI')}, MPLBACKEND={os.environ.get('MPLBACKEND')}")
10+
111
from netpyne import specs, sim
212
import pprint
313

4-
netParams = specs.NetParams()
5-
## IT2 cell properties
6-
soma = {'geom': {}, 'ions': {}, 'mechs': {}, 'vinit': -85.7, 'threshold': 5.0}
14+
netParams = specs.NetParams()
15+
16+
## IT2 cell properties (NetPyNE version using same mechanisms as IT2_reduced_cell.nml)
17+
soma = {'geom': {}, 'ions': {}, 'mechs': {}, 'vinit': -85.7, 'threshold': 5.0}
718
soma['geom'] = {'diam': 28.2149102762, 'L': 48.4123467666, 'Ra': 70.0015514222, 'cm': 2.4998269977, 'nseg': 1, 'pt3d': []}
819
soma['geom']['pt3d'].append((0, 0, 0, 28.2149102762))
920
soma['geom']['pt3d'].append((0, 48.4123467666, 0, 28.2149102762))
@@ -144,28 +155,27 @@
144155

145156
netParams.popParams['IT2'] = {'cellType': 'IT2_HH_reduced', 'numCells': 1}
146157

147-
netParams.stimSourceParams['Input'] = {'type': 'IClamp', 'dur': 1600, 'del': 200, 'amp': 0.3}
158+
netParams.stimSourceParams['Input'] = {'type': 'IClamp', 'dur': 300, 'del': 200, 'amp': 0.3}
148159
netParams.stimTargetParams['Input->IT2'] = {'source': 'Input', 'sec': 'soma', 'loc': 0.5, 'conds': {'cellType': 'IT2_HH_reduced'}}
149160
netParams.defaultThreshold = 5.0
150161
# Simulation options
151162
simConfig = specs.SimConfig() # object of class SimConfig to store simulation configuration
152163

153164
simConfig.recordCells = ['all']
154165
simConfig.hParams['celsius'] = 34
155-
simConfig.duration = 2000 # Duration of the simulation, in ms
156-
simConfig.dt = 0.01
157-
# Internal integration timestep to use
166+
simConfig.duration = 700 # Duration of the simulation, in ms
167+
simConfig.dt = 0.025 # Internal integration timestep to use
158168
simConfig.verbose = False # Show detailed messages
159-
simConfig.recordTraces = {'V_soma':{'sec':'soma','loc':0.5,'var':'v'}} # Dict with traces to record
160-
simConfig.recordStep = 0.01 # Step size in ms to save data (eg. V traces, LFP, etc)
161-
simConfig.filename = 'IT2_reduced_all' # Set file output name
162-
simConfig.savePickle = False # Save params, network and sim output to pickle file
163-
simConfig.saveDataInclude = ['simData']
164-
simConfig.saveJson = True
165-
simConfig.analysis['plotTraces'] = {'include': [0], 'saveFig': True} # Plot recorded traces for this list of cells
166-
simConfig.analysis['plotRaster'] = {'saveFig': True} # Plot a raster
169+
simConfig.recordTraces = {'V_soma': {'sec': 'soma', 'loc': 0.5, 'var': 'v'}}
170+
simConfig.recordStep = 0.025 # Step size in ms to save data
171+
simConfig.filename = 'IT2_reduced_all'
172+
simConfig.savePickle = False
173+
simConfig.saveDataInclude = ['simData']
174+
simConfig.saveJson = True
175+
# Disable built-in plotting during headless runs
176+
simConfig.analysis = {}
167177

168178
# Create network and run simulation
169179
sim.createSimulateAnalyze(netParams = netParams, simConfig = simConfig)
170180

171-
#import pylab; pylab.show() # this line is only necessary in certain systems where figures appear empty
181+
#import pylab; pylab.show() # this line is only necessary in certain systems where figures appear empty

0 commit comments

Comments
 (0)