Skip to content

Commit

Permalink
Merge pull request #660 from suny-downstate-medical-center/development
Browse files Browse the repository at this point in the history
PR from development to master - VERSION 1.0.1
  • Loading branch information
joewgraham authored Feb 18, 2022
2 parents 4060887 + d8b7e94 commit bfd631d
Show file tree
Hide file tree
Showing 287 changed files with 45,597 additions and 3,982 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
name: Tests
on: [push]
on: [push, pull_request]
jobs:
Run-Tests:
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ubuntu-latest]
python-version: [2.7, 3.7]
#python-version: [2.7, 3.7]
python-version: [3.7]

steps:
- name: Check out repository code
Expand Down
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,7 @@ venv/
/examples/M1/*.png
/examples/M1/*.pov
/examples/HHTut/temp.json
.vscode
.vscode
/examples/HHTut/HHTut_plot_2Dnet.png
/examples/HHTut/HHTut_regen.py
/examples/HHTut/HHTut_traces.png
69 changes: 69 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,70 @@
# Version 1.0.1

**New features**

- Added new plotting module with custom plotters

- Separated analysis.plotSpikeRaster into analysis.prepareRaster and plotting.plotRaster

- Separated analysis.plotSpikeHist into analysis.prepareSpikeData, analysis.prepareSpikeHist, plotting.plotSpikeHist and plotting.plotSpikeFreq

- Separated analysis.plotLFP into analysis.prepareLFP, analysis.preparePSD, analysis.prepareSpectrogram, plotting.plotLFPTimeSeries, plotting.plotLFPPSD, plotting.plotLFPSpectrogram, and plotting.plotLFPLocations

- Mapped old analysis.plots onto new ones

- Interfaced with LFPkit to enable recording/plotting of dipole current moments and EEG signals

- Added Current Source Density (CSD) analysis and plots

- Enabled selecting a subset of cells to save individual LFP signal from via cfg.saveLFPCells = [...]

- Added cfg.saveLFPPops to store LFP generated individually by each population

- Function to return batch parameter combinations (used for GUI)

- Added jupyter nb tutorials

- Added hippocampus CA3 model example

- Updated SONATA importing

- Improved distributed saving and interval saving (more robust)

- Added mapping of netParams values within cfg (used for batch sims in GUI)

- Extended Action tests to pull requests (not just push)


**Bug fixes**

- Fixed setting cfgMapping nested params when not string

- Fixed defineCellShapes when sec['hObj'] is not a h.Section()

- Fixed bug when using lognormal in string functions

- Added rxdmath to avoid RxD error

- Fixed bug in Tutorial 8 (batch)

- When saving to JSON wait until file exists before returning (to avoid exiting before saving finished)


# Version 1.0.0.2

**New features**

- Added function to get list of batch grid search parameter combinations

- Save output of mpi_bulletin batches to .run and .err files

- Fixed bug in loading exotic stim param values

- Fixed bug in loading where sim was required to have rank attribute

- Added quotes in batch.py to avoid path white spaces issue


# Version 1.0.0.2

- Release for use with GUI
Expand Down Expand Up @@ -1472,3 +1539,5 @@ First version that was uploaded to pypi. Includes following features:
- Parameters/specifications
- Instantiated networks
- Simulation results

- Distance-based redistribution of synapses (subConn)
2 changes: 1 addition & 1 deletion doc/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
shutil.rmtree('build', ignore_errors=True)

# All .rst files but those listed here will be deleted during this process
keep = ['about.rst', 'advanced.rst', 'index.rst', 'install.rst', 'reference.rst', 'tutorial.rst']
keep = ['about.rst', 'advanced.rst', 'index.rst', 'install.rst', 'reference.rst', 'tutorial.rst', 'contrib.rst']

print('Deleting old .rst files.')
for file in os.listdir('source'):
Expand Down
76 changes: 51 additions & 25 deletions doc/source/about.rst

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions doc/source/code/HHCellFile.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,21 +55,21 @@ def createSections(self):

def defineGeometry(self):
"""Set the 3D geometry of the cell."""
self.soma.L = 18.8
self.soma.diam = 18.8
self.soma.Ra = 123.0
self.soma.L = 18.8 # length of the soma section in microns
self.soma.diam = 18.8 # diameter of the soma section in microns
self.soma.Ra = 123.0 # axial resistivity of the soma section in ohm-cm

self.dend.L = 200.0
self.dend.diam = 1.0
self.dend.Ra = 100.0
self.dend.L = 200.0 # length of the dend section in microns
self.dend.diam = 1.0 # diameter of the dend section in microns
self.dend.Ra = 100.0 # axial resistivity of the dend section in ohm-cm

def defineBiophysics(self):
"""Assign the membrane properties across the cell."""
# Insert active Hodgkin-Huxley current in the soma
self.soma.insert('hh')
self.soma.gnabar_hh = 0.12 # Sodium conductance in S/cm2
self.soma.gkbar_hh = 0.036 # Potassium conductance in S/cm2
self.soma.gl_hh = 0.003 # Leak conductance in S/cm2
self.soma.gl_hh = 0.003 # Leak conductance in S/cm2
self.soma.el_hh = -70 # Reversal potential in mV

self.dend.insert('pas')
Expand Down
2 changes: 1 addition & 1 deletion doc/source/code/tut2.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,5 @@

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

# check model output
# Check the model output: sim.checkOutput is used for testing purposes. Please comment out the following line if you are exploring the tutorial.
sim.checkOutput('tut2')
2 changes: 1 addition & 1 deletion doc/source/code/tut3.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,5 +64,5 @@

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

# check model output
# Check the model output: sim.checkOutput is used for testing purposes. Please comment out the following line if you are exploring the tutorial.
sim.checkOutput('tut3')
2 changes: 1 addition & 1 deletion doc/source/code/tut4.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,5 +77,5 @@

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

# check model output
# Check the model output: sim.checkOutput is used for testing purposes. Please comment out the following line if you are exploring the tutorial.
sim.checkOutput('tut4')
2 changes: 1 addition & 1 deletion doc/source/code/tut5.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,5 +80,5 @@

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

# check model output
# Check the model output: sim.checkOutput is used for testing purposes. Please comment out the following line if you are exploring the tutorial.
sim.checkOutput('tut5')
2 changes: 1 addition & 1 deletion doc/source/code/tut6.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,5 @@

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

# check model output
# Check the model output: sim.checkOutput is used for testing purposes. Please comment out the following line if you are exploring the tutorial.
sim.checkOutput('tut6')
2 changes: 1 addition & 1 deletion doc/source/code/tut7.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,5 +100,5 @@
sim.analysis.plotRaster(syncLines=True)
sim.analysis.plotTraces(include = [1])

# check model output
# Check the model output: sim.checkOutput is used for testing purposes. Please comment out the following line if you are exploring the tutorial.
sim.checkOutput('tut7')
2 changes: 1 addition & 1 deletion doc/source/code/tut8_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ def plot2DRate(dataFolder, batchLabel, params, data, par1, par2, val, valLabel,
# Function to read batch data and plot figure
#--------------------------------------------------------------------
def readPlot():
dataFolder = 'tauWeight_data/'
dataFolder = 'tut8_data/'
batchLabel = 'tauWeight'

params, data = readBatchData(dataFolder, batchLabel, loadAll=0, saveAll=1, vars=None, maxCombs=None)
Expand Down
101 changes: 71 additions & 30 deletions doc/source/code/tut_artif.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,59 +14,100 @@
###############################################################################
# NETWORK PARAMETERS
###############################################################################

# Population parameters
netParams.popParams['PYR1'] = {'cellType': 'PYR', 'numCells': 100} # pop of HH cells
netParams.popParams['artif1'] = {'cellType': 'artif_NetStim', 'numCells': 100} # pop of NetStims
netParams.popParams['artif2'] = {'cellType': 'artif_IntFire2', 'numCells': 100} # pop of IntFire2
netParams.popParams['artif3'] = {'cellType': 'artif_IntFire4', 'numCells': 100} # pop of IntFire4
netParams.popParams['artif4'] = {'cellType': 'artif_VecStim', 'numCells': 100} # pop of Vecstims with 2 pulses

# Cell parameters
## PYR cell properties
cellParams = Dict()
cellParams.secs.soma.geom = {'diam': 18.8, 'L': 18.8, 'Ra': 123.0}
cellParams.secs.soma.mechs.hh = {'gnabar': 0.12, 'gkbar': 0.036, 'gl': 0.003, 'el': -70}
netParams.cellParams['PYR'] = cellParams

netParams.cellParams['artif_NetStim'] = {'cellModel': 'NetStim', 'rate': 50, 'noise': 0.8, 'start': 1, 'seed': 2} # pop of NetStims
netParams.cellParams['artif_IntFire2'] = {'cellModel': 'IntFire2', 'ib': 0.0} # pop of IntFire2
netParams.cellParams['artif3_IntFire4'] = {'cellModel': 'IntFire4', 'taue': 1.0} # pop of IntFire4
netParams.cellParams['artif4_Vecstim'] = {'cellModel': 'VecStim', 'rate': 5, 'noise': 0.5, 'start': 50,
'pulses': [{'start': 200, 'end': 300, 'rate': 60, 'noise':0.2}, {'start': 500, 'end': 800, 'rate': 30, 'noise': 0.5}]} # pop of Vecstims with 2 pulses
## IntFire2 artificial cell
netParams.cellParams['artif_IntFire2'] = {
'cellModel': 'IntFire2',
'ib': 0.0}

## IntFire4 artificial cell
netParams.cellParams['artif_IntFire4'] = {
'cellModel': 'IntFire4',
'taue': 1.0}

## NetStim artificial spike generator
netParams.cellParams['artif_NetStim'] = {
'cellModel': 'NetStim'}

## VecStim artificial spike generator
netParams.cellParams['artif_VecStim'] = {
'cellModel': 'VecStim'} # pop of Vecstims with 2 pulses


# Population parameters
netParams.popParams['PYR1'] = {
'cellType': 'PYR',
'numCells': 100} # pop of HH cells

netParams.popParams['pop_IntFire2'] = {
'cellType': 'artif_IntFire2',
'numCells': 100} # pop of IntFire2

netParams.popParams['pop_IntFire4'] = {
'cellType': 'artif_IntFire4',
'numCells': 100} # pop of IntFire4

netParams.popParams['pop_NetStim'] = {
'cellType': 'artif_NetStim',
'numCells': 100,
'rate': 10,
'noise': 0.8,
'start': 1,
'seed': 2} # pop of NEtSims

netParams.popParams['pop_VecStim'] = {
'cellType': 'artif_VecStim',
'numCells': 100,
'rate': 5,
'noise': 0.5,
'start': 50,
'pulses': [{'start': 200, 'end': 300, 'rate': 60, 'noise':0.2},
{'start': 500, 'end': 800, 'rate': 30, 'noise': 0.5}]} # pop of Vecstims with 2 pulses


# Synaptic mechanism parameters
netParams.synMechParams['AMPA'] = {'mod': 'Exp2Syn', 'tau1': 0.1, 'tau2': 1.0, 'e': 0}


# Stimulation parameters
netParams.stimSourceParams['background'] = {'type': 'NetStim', 'interval': 100, 'number': 1e5, 'start': 500, 'noise': 0.5} # stim using NetStims after 500ms
netParams.stimTargetParams['bkg->PYR1'] = {'source': 'background', 'conds': {'pop': 'PYR1'}, 'sec':'soma', 'loc': 0.5, 'weight': 0.5, 'delay': 1}
# Connections
netParams.connParams['NetStim->PYR1'] = {
'preConds': {'pop': 'pop_NetStim'},
'postConds': {'pop': 'PYR1'},
'convergence': 3,
'weight': 0.002,
'synMech': 'AMPA',
'delay': 'uniform(1,5)'}


# Connections
netParams.connParams['artif1->PYR1'] = {
'preConds': {'pop': 'artif1'},
netParams.connParams['VecStim->PYR1'] = {
'preConds': {'pop': 'pop_VecStim'},
'postConds': {'pop': 'PYR1'},
'convergence': 8,
'probability': 0.4,
'weight': 0.005,
'synMech': 'AMPA',
'delay': 'uniform(1,5)'}

netParams.connParams['PYR1->artif2'] = {
netParams.connParams['PYR1->IntFire2'] = {
'preConds': {'pop': 'PYR1'},
'postConds': {'pop': 'artif2'},
'postConds': {'pop': 'pop_IntFire2'},
'probability': 0.2,
'weight': 0.2,
'weight': 0.1,
'synMech': 'AMPA',
'delay': 'uniform(1,5)'}

netParams.addConnParams('artif2->artif3',
{'preConds': {'pop': 'artif2'},
'postConds': {'pop': 'artif3'},
'divergence': 20,
'weight': 0.05,
'delay': 3})

netParams.connParams['IntFire2->IntFire4'] = {
'preConds': {'pop': 'pop_IntFire2'},
'postConds': {'pop': 'pop_IntFire4'},
'probability': 0.1,
'weight': 0.2,
'delay': 'uniform(1,5)'}


###############################################################################
Expand All @@ -84,7 +125,7 @@
simConfig.recordTraces = {'Vsoma':{'sec':'soma','loc':0.5,'var':'v'}}

# # Analysis and plotting
simConfig.analysis['plotRaster'] = True
simConfig.analysis['plotRaster'] = {'orderInverse': True}


###############################################################################
Expand Down
2 changes: 1 addition & 1 deletion doc/source/code/tut_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,5 +182,5 @@

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

# check model output
# Check the model output: sim.checkOutput is used for testing purposes. Please comment out the following line if you are exploring the tutorial.
sim.checkOutput('tut_import')
9 changes: 7 additions & 2 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@
'autodocsumm',
]


# Add custom sections to Napoleon
napoleon_custom_sections = [('NetPyNE Options', 'params_style'), ('Plot Options', 'params_style')]


# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

Expand All @@ -60,9 +65,9 @@
# built documents.
#
# The short X.Y version.
version = '1.0.0.2'
version = '1.0.1'
# The full version, including alpha/beta/rc tags.
release = '1.0.0.2'
release = '1.0.1'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
16 changes: 16 additions & 0 deletions doc/source/contrib.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Contribute ancillary code
=======================================

Ancillary code contributions will most typically be additional analysis and/or plotting code to be used with NetPyNE output files. This is separate from
NetPyNE source code. Contribution to source code is also encouraged and is desribed `here <https://github.com/Neurosim-lab/netpyne/blob/development/CONTRIBUTING.md>`_.
Sometimes new analysis Python code may also require adding new output formats to NetPyNE so that both contributions may be made together.

Other ancillary contributions might include new Tutorials for specific purposes or NEURON procedural code for augmenting the declarative code in a
netParams file for complex parameter settings.

Code should be hosted by the user on a publicly-accessible github page with complete documentation (and strong code commenting). Submissions should then be made in the `NetPyNE forum
<https://groups.google.com/forum/#!forum/netpyne-forum>`_ with a brief description of the package for listing here.

Contributed code list
---------------------

4 changes: 3 additions & 1 deletion doc/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Welcome to the NetPyNE homepage!

NetPyNE is an open-source Python package to facilitate the development, parallel simulation, analysis, and optimization of biological neuronal networks using the NEURON simulator. See our recent `publication in eLife <https://elifesciences.org/articles/44494>`_ for more details.

To make NetPyNE more accessible, we have released a (beta version) graphical user interface (GUI). The GUI is freely available at `www.netpyne.org/gui <http://www.netpyne.org/gui>`_ with documentation `here <https://github.com/Neurosim-lab/NetPyNE-UI/wiki>`_.
To make NetPyNE more accessible, we have released a (beta version) graphical user interface (GUI). The GUI is freely available at `gui.netpyne.org <http://gui.netpyne.org>`_ with documentation `here <https://github.com/Neurosim-lab/NetPyNE-UI/wiki>`_.

For a detailed overview of NetPyNE, including an interactive tutorial utilizing the GUI, please see our `CNS*2020 <https://www.cnsorg.org/cns-2020>`_
tutorial: **Building mechanistic multiscale models: from molecules to networks using NEURON and NetPyNE**. The complete video is available `here <https://yale.zoom.us/rec/play/tMAkcrr8-jo3HNCU4wSDUaR8W427LaKs1HAW_aUPzkmzUSJRO1WnY7cXZep77NjtCLWqwFVD6Ya8aNTL?continueMode=true&_x_zm_rtaid=J63YcHJGT9CUEjhkklHizQ.1598553844678.e87215956b2d8a50ef33ec4d6479b3b2&_x_zm_rhtaid=388>`_ and slides are available `here <http://bit.ly/cns20-netpyne>`_.
Expand All @@ -17,6 +17,8 @@ Check out our latest tutorial: **Virtual Environments, Jupyter Notebooks, and Ne

Join our `NetPyNE mailing list <https://groups.google.com/forum/#!forum/netpyne-mailing>`_ to receive updates on version releases and other major announcements. Get your questions answered and participate in the NetPyNE community at the `NetPyNE forum <https://groups.google.com/forum/#!forum/netpyne-forum>`_ or the `NetPyNE section of the NEURON forum <https://www.neuron.yale.edu/phpBB/viewforum.php?f=45>`_.

NetPyNE is available as a resource through `Neuroscience Gateway Portal (NSG) <https://www.nsgportal.org/>`_; `Open Source Brain (OSB) <https://www.opensourcebrain.org/>`_ ; `Human Brain Project (HBP) EBRAINS <https://www.humanbrainproject.eu/en/hbp-platforms/ebrains/>`_; `NIH SPARC initiative <https://commonfund.nih.gov/Sparc/>`_.

The NetPyNE source code is available on `GitHub <https://github.com/Neurosim-lab/netpyne>`_.


Expand Down
Loading

0 comments on commit bfd631d

Please sign in to comment.