Skip to content

Commit 3bd99e9

Browse files
Docs: Conceal private setup methods (Issue #816)
1 parent c6a7dbe commit 3bd99e9

File tree

6 files changed

+34
-34
lines changed

6 files changed

+34
-34
lines changed

netpyne/sim/__init__.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@
2121
# import setup functions
2222
from .setup import (
2323
initialize,
24-
setNet,
25-
setNetParams,
26-
setSimCfg,
27-
createParallelContext,
24+
_setNet,
25+
_setNetParams,
26+
_setSimCfg,
27+
_createParallelContext,
2828
readCmdLineArgs,
2929
setupRecording,
30-
setupRecordLFP,
31-
setGlobals,
30+
_setupRecordLFP,
31+
_setGlobals,
3232
)
3333

3434
# import run functions

netpyne/sim/gather.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,7 @@ def sort(popKeyAndValue):
440440
allPops[popLabel] = pop['tags']
441441

442442
if 'simConfig' in data.keys():
443-
setup.setSimCfg(data['simConfig'])
443+
setup._setSimCfg(data['simConfig'])
444444
if 'net' in data and gatherLFP:
445445
if 'recXElectrode' in data['net']:
446446
xElectrode = data['net']['recXElectrode']

netpyne/sim/load.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ def loadSimCfg(filename, data=None, variable='simConfig', setLoaded=True):
158158
if variable in data:
159159
rawSimConfig = data[variable]
160160
if setLoaded:
161-
setup.setSimCfg(rawSimConfig)
161+
setup._setSimCfg(rawSimConfig)
162162
else:
163163
return specs.SimConfig(rawSimConfig)
164164
else:
@@ -204,7 +204,7 @@ def loadNetParams(filename, data=None, variable=None, setLoaded=True):
204204
return
205205

206206
if setLoaded:
207-
setup.setNetParams(rawNetParams)
207+
setup._setNetParams(rawNetParams)
208208
else:
209209
return specs.NetParams(rawNetParams)
210210

netpyne/sim/run.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def preRun():
3131
sim.cvode.use_fast_imem(sim.cfg.use_fast_imem)
3232

3333
# set h global params
34-
sim.setGlobals()
34+
sim._setGlobals()
3535

3636
# set h.dt
3737
h.dt = sim.cfg.dt

netpyne/sim/setup.py

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,10 @@ def initialize(netParams=None, simConfig=None, net=None):
6262
sim.nextHost = 0 # initialize next host
6363
sim.timingData = Dict() # dict to store timing
6464

65-
sim.createParallelContext() # inititalize PC, nhosts and rank
65+
sim._createParallelContext() # inititalize PC, nhosts and rank
6666
sim.cvode = h.CVode()
6767

68-
sim.setSimCfg(simConfig) # set simulation configuration
68+
sim._setSimCfg(simConfig) # set simulation configuration
6969

7070
# for testing validation
7171
# if simConfig.exitOnError:
@@ -80,11 +80,11 @@ def initialize(netParams=None, simConfig=None, net=None):
8080
sim.timing('start', 'totalTime')
8181

8282
if net:
83-
sim.setNet(net) # set existing external network
83+
sim._setNet(net) # set existing external network
8484
else:
85-
sim.setNet(sim.Network()) # or create new network
85+
sim._setNet(sim.Network()) # or create new network
8686

87-
sim.setNetParams(netParams) # set network parameters
87+
sim._setNetParams(netParams) # set network parameters
8888

8989
if sim.nhosts > 1:
9090
sim.cfg.validateNetParams = False # turn of error chceking if using multiple cores
@@ -113,9 +113,9 @@ def initialize(netParams=None, simConfig=None, net=None):
113113
# ------------------------------------------------------------------------------
114114
# Set network object to use in simulation
115115
# ------------------------------------------------------------------------------
116-
def setNet(net):
116+
def _setNet(net):
117117
"""
118-
Function for/to <short description of `netpyne.sim.setup.setNet`>
118+
Function for/to <short description of `netpyne.sim.setup._setNet`>
119119
120120
Parameters
121121
----------
@@ -134,9 +134,9 @@ def setNet(net):
134134
# ------------------------------------------------------------------------------
135135
# Set network params to use in simulation
136136
# ------------------------------------------------------------------------------
137-
def setNetParams(params):
137+
def _setNetParams(params):
138138
"""
139-
Function for/to <short description of `netpyne.sim.setup.setNetParams`>
139+
Function for/to <short description of `netpyne.sim.setup._setNetParams`>
140140
141141
Parameters
142142
----------
@@ -150,7 +150,7 @@ def setNetParams(params):
150150
from .. import sim
151151

152152
if not hasattr(sim, 'net'):
153-
sim.setNet(sim.Network()) # create new network if one doesn't exist
153+
sim._setNet(sim.Network()) # create new network if one doesn't exist
154154

155155
if params and isinstance(params, specs.NetParams):
156156
paramsDict = utils.replaceKeys(params.todict(), 'popLabel', 'pop') # for backward compatibility
@@ -171,9 +171,9 @@ def setNetParams(params):
171171
# ------------------------------------------------------------------------------
172172
# Set simulation config
173173
# ------------------------------------------------------------------------------
174-
def setSimCfg(cfg):
174+
def _setSimCfg(cfg):
175175
"""
176-
Function for/to <short description of `netpyne.sim.setup.setSimCfg`>
176+
Function for/to <short description of `netpyne.sim.setup._setSimCfg`>
177177
178178
Parameters
179179
----------
@@ -207,9 +207,9 @@ def setSimCfg(cfg):
207207
# ------------------------------------------------------------------------------
208208
# Create parallel context
209209
# ------------------------------------------------------------------------------
210-
def createParallelContext():
210+
def _createParallelContext():
211211
"""
212-
Function for/to <short description of `netpyne.sim.setup.createParallelContext`>
212+
Function for/to <short description of `netpyne.sim.setup._createParallelContext`>
213213
214214
215215
"""
@@ -306,9 +306,9 @@ def readCmdLineArgs(simConfigDefault='cfg.py', netParamsDefault='netParams.py'):
306306
# ------------------------------------------------------------------------------
307307
# Setup LFP Recording
308308
# ------------------------------------------------------------------------------
309-
def setupRecordLFP():
309+
def _setupRecordLFP():
310310
"""
311-
Function for/to <short description of `netpyne.sim.setup.setupRecordLFP`>
311+
Function for/to <short description of `netpyne.sim.setup._setupRecordLFP`>
312312
313313
314314
"""
@@ -380,9 +380,9 @@ def setupRecordLFP():
380380
# ------------------------------------------------------------------------------
381381
# Setup Dipoles Recording (needed for EEG/MEG)
382382
# ------------------------------------------------------------------------------
383-
def setupRecordDipole():
383+
def _setupRecordDipole():
384384
"""
385-
Function for/to <short description of `netpyne.sim.setup.setupRecordDipole`>
385+
Function for/to <short description of `netpyne.sim.setup._setupRecordDipole`>
386386
387387
388388
"""
@@ -435,7 +435,7 @@ def setupRecordDipole():
435435
cdm = lfpykit.CurrentDipoleMoment(cell=lfpykitCell)
436436
cell.M = cdm.get_transformation_matrix()
437437

438-
# set up recording of membrane currents (duplicate with setupRecordLFP -- unifiy and avoid calling twice)
438+
# set up recording of membrane currents (duplicate with _setupRecordLFP -- unifiy and avoid calling twice)
439439
nseg = cell.getNumberOfSegments()
440440
cell.imembPtr = h.PtrVector(nseg) # pointer vector
441441
if neuron_version < '9.0.0':
@@ -559,11 +559,11 @@ def setupRecording():
559559

560560
# set LFP recording
561561
if sim.cfg.recordLFP or sim.cfg.saveIMembrane:
562-
setupRecordLFP()
562+
_setupRecordLFP()
563563

564564
# set dipole recording
565565
if sim.cfg.recordDipole:
566-
setupRecordDipole()
566+
_setupRecordDipole()
567567

568568
sim.timing('stop', 'setrecordTime')
569569

@@ -573,9 +573,9 @@ def setupRecording():
573573
# ------------------------------------------------------------------------------
574574
# Get cells list for recording based on set of conditions
575575
# ------------------------------------------------------------------------------
576-
def setGlobals():
576+
def _setGlobals():
577577
"""
578-
Function for/to <short description of `netpyne.sim.setup.setGlobals`>
578+
Function for/to <short description of `netpyne.sim.setup._setGlobals`>
579579
580580
581581
"""

netpyne/sim/wrappers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ def load(
428428
sim.cfg.createNEURONObj = createNEURONObj
429429
sim.loadAll(filename, instantiate=instantiate, createNEURONObj=createNEURONObj)
430430
if simConfig:
431-
sim.setSimCfg(simConfig) # set after to replace potentially loaded cfg
431+
sim._setSimCfg(simConfig) # set after to replace potentially loaded cfg
432432

433433
if len(sim.net.cells) == 0 and instantiate:
434434
pops = sim.net.createPops() # instantiate network populations

0 commit comments

Comments
 (0)