diff --git a/.ci/execute_travis_serial.py b/.ci/execute_travis_serial.py index 33e2b809..e0259c26 100755 --- a/.ci/execute_travis_serial.py +++ b/.ci/execute_travis_serial.py @@ -70,7 +70,7 @@ def print_results(): for k in result_: with open("%s.txt" % k, 'w') as f: for fl, r in result_[k]: - f.write('- %s\n' % fl) + f.write('- [ ] %s\n' % fl) f.write('```') try: r = r.decode('utf8') diff --git a/index.md b/index.md deleted file mode 100644 index 8838542e..00000000 --- a/index.md +++ /dev/null @@ -1,286 +0,0 @@ -[![Build Status](https://travis-ci.org/BhallaLab/moose-examples.svg?branch=master)](https://travis-ci.org/BhallaLab/moose-examples). - -Examples, tutorial and demo scripts. - -# Status of scripts tested by Travis. - -## Successful scripts - -These scripts ran successfully. - -- [ snippets/startstop.py ](https://github.com/BhallaLab/moose-examples/blob/master/snippets/startstop.py) -- [ snippets/interpol2d.py ](https://github.com/BhallaLab/moose-examples/blob/master/snippets/interpol2d.py) -- [ snippets/symcompartment.py ](https://github.com/BhallaLab/moose-examples/blob/master/snippets/symcompartment.py) -- [ snippets/lifcomp.py ](https://github.com/BhallaLab/moose-examples/blob/master/snippets/lifcomp.py) -- [ snippets/vectors.py ](https://github.com/BhallaLab/moose-examples/blob/master/snippets/vectors.py) -- [ snippets/loadKineticModel.py ](https://github.com/BhallaLab/moose-examples/blob/master/snippets/loadKineticModel.py) -- [ snippets/diffEqSolution.py ](https://github.com/BhallaLab/moose-examples/blob/master/snippets/diffEqSolution.py) -- [ snippets/HsolveInstability.py ](https://github.com/BhallaLab/moose-examples/blob/master/snippets/HsolveInstability.py) -- [ snippets/helloMoose.py ](https://github.com/BhallaLab/moose-examples/blob/master/snippets/helloMoose.py) -- [ snippets/convert_Genesis2Sbml.py ](https://github.com/BhallaLab/moose-examples/blob/master/snippets/convert_Genesis2Sbml.py) -- [ snippets/ionchannel.py ](https://github.com/BhallaLab/moose-examples/blob/master/snippets/ionchannel.py) -- [ snippets/showclocks.py ](https://github.com/BhallaLab/moose-examples/blob/master/snippets/showclocks.py) -- [ snippets/scriptKineticSolver.py ](https://github.com/BhallaLab/moose-examples/blob/master/snippets/scriptKineticSolver.py) -- [ snippets/scriptKineticModel.py ](https://github.com/BhallaLab/moose-examples/blob/master/snippets/scriptKineticModel.py) -- [ snippets/wildcard.py ](https://github.com/BhallaLab/moose-examples/blob/master/snippets/wildcard.py) -- [ snippets/tabledemo.py ](https://github.com/BhallaLab/moose-examples/blob/master/snippets/tabledemo.py) -- [ squid/squid.py ](https://github.com/BhallaLab/moose-examples/blob/master/squid/squid.py) -- [ squid/squid_setup.py ](https://github.com/BhallaLab/moose-examples/blob/master/squid/squid_setup.py) -- [ snippets/scriptGssaSolver.py ](https://github.com/BhallaLab/moose-examples/blob/master/snippets/scriptGssaSolver.py) -- [ tutorials/ChemicalBistables/strongBis.py ](https://github.com/BhallaLab/moose-examples/blob/master/tutorials/ChemicalBistables/strongBis.py) -- [ neuroml/lobster_pyloric/channels/ChannelTest.py ](https://github.com/BhallaLab/moose-examples/blob/master/neuroml/lobster_pyloric/channels/ChannelTest.py) -- [ neuroml/CA1PyramidalCell/CA1.py ](https://github.com/BhallaLab/moose-examples/blob/master/neuroml/CA1PyramidalCell/CA1.py) -- [ neuroml/CA1PyramidalCell/CA1_hsolve.py ](https://github.com/BhallaLab/moose-examples/blob/master/neuroml/CA1PyramidalCell/CA1_hsolve.py) -- [ neuroml/GranuleCell/Granule98_hsolve.py ](https://github.com/BhallaLab/moose-examples/blob/master/neuroml/GranuleCell/Granule98_hsolve.py) -- [ snippets/savemodel.py ](https://github.com/BhallaLab/moose-examples/blob/master/snippets/savemodel.py) -- [ snippets/pulsegen.py ](https://github.com/BhallaLab/moose-examples/blob/master/snippets/pulsegen.py) -- [ snippets/neuronFromDotp.py ](https://github.com/BhallaLab/moose-examples/blob/master/snippets/neuronFromDotp.py) -- [ symcomp/symcomp.py ](https://github.com/BhallaLab/moose-examples/blob/master/symcomp/symcomp.py) -- [ tutorials/ChemicalOscillators/repressillator.py ](https://github.com/BhallaLab/moose-examples/blob/master/tutorials/ChemicalOscillators/repressillator.py) -- [ cuda/testScript.py ](https://github.com/BhallaLab/moose-examples/blob/master/cuda/testScript.py) -- [ snippets/diffusion_using_Gillespie.py ](https://github.com/BhallaLab/moose-examples/blob/master/snippets/diffusion_using_Gillespie.py) -- [ snippets/singlemsgcross.py ](https://github.com/BhallaLab/moose-examples/blob/master/snippets/singlemsgcross.py) -- [ snippets/synapse.py ](https://github.com/BhallaLab/moose-examples/blob/master/snippets/synapse.py) -- [ snippets/gapjunction.py ](https://github.com/BhallaLab/moose-examples/blob/master/snippets/gapjunction.py) -- [ cuda/testHsolve.py ](https://github.com/BhallaLab/moose-examples/blob/master/cuda/testHsolve.py) -- [ snippets/stimtable.py ](https://github.com/BhallaLab/moose-examples/blob/master/snippets/stimtable.py) -- [ neuroml/GranuleCell/Granule98.py ](https://github.com/BhallaLab/moose-examples/blob/master/neuroml/GranuleCell/Granule98.py) -- [ snippets/loadCspaceModel.py ](https://github.com/BhallaLab/moose-examples/blob/master/snippets/loadCspaceModel.py) -- [ snippets/showmsg.py ](https://github.com/BhallaLab/moose-examples/blob/master/snippets/showmsg.py) -- [ rall_1964/rall64.py ](https://github.com/BhallaLab/moose-examples/blob/master/rall_1964/rall64.py) -- [ snippets/RandSpikeStats.py ](https://github.com/BhallaLab/moose-examples/blob/master/snippets/RandSpikeStats.py) -- [ snippets/tweakingParameters.py ](https://github.com/BhallaLab/moose-examples/blob/master/snippets/tweakingParameters.py) -- [ snippets/cylinderMotor.py ](https://github.com/BhallaLab/moose-examples/blob/master/snippets/cylinderMotor.py) -- [ tutorials/ChemicalOscillators/relaxationOsc.py ](https://github.com/BhallaLab/moose-examples/blob/master/tutorials/ChemicalOscillators/relaxationOsc.py) -- [ snippets/loadSbmlmodel.py ](https://github.com/BhallaLab/moose-examples/blob/master/snippets/loadSbmlmodel.py) -- [ symcomp/symcomp_readcell.py ](https://github.com/BhallaLab/moose-examples/blob/master/symcomp/symcomp_readcell.py) -- [ passive/passive_soma.py ](https://github.com/BhallaLab/moose-examples/blob/master/passive/passive_soma.py) -- [ snippets/multicomp_lif.py ](https://github.com/BhallaLab/moose-examples/blob/master/snippets/multicomp_lif.py) -- [ snippets/threading_demo.py ](https://github.com/BhallaLab/moose-examples/blob/master/snippets/threading_demo.py) - -## Failed scripts - -These scripts failed to execute successfully on Travis. -- [ snippets/startstop.py ](https://github.com/BhallaLab/moose-examples/blob/master/snippets/startstop.py) - -``` - Traceback (most recent call last): - File "/home/bhalla/dilawars/Work.SVN/GITHUB/BhallaLab/moose-examples/snippets/startstop.py", line 46, in - import moose - File "/home/bhalla/dilawars/Work/GITHUB/DILAWAR/moose-core/_build/python/moose/__init__.py", line 6, in - from moose.moose import * - File "/home/bhalla/dilawars/Work/GITHUB/DILAWAR/moose-core/_build/python/moose/moose.py", line 63, in - from moose._moose import * - ImportError: libhdf5.so.8: cannot open shared object file: No such file or directory -``` -- [ snippets/recurrentLIF.py ](https://github.com/BhallaLab/moose-examples/blob/master/snippets/recurrentLIF.py) - -``` - Traceback (most recent call last): - File "/home/bhalla/dilawars/Work.SVN/GITHUB/BhallaLab/moose-examples/snippets/recurrentLIF.py", line 23, in - import moose - File "/home/bhalla/dilawars/Work/GITHUB/DILAWAR/moose-core/_build/python/moose/__init__.py", line 6, in - from moose.moose import * - File "/home/bhalla/dilawars/Work/GITHUB/DILAWAR/moose-core/_build/python/moose/moose.py", line 63, in - from moose._moose import * - ImportError: libhdf5.so.8: cannot open shared object file: No such file or directory -``` -- [ snippets/interpol2d.py ](https://github.com/BhallaLab/moose-examples/blob/master/snippets/interpol2d.py) - -``` - Traceback (most recent call last): - File "/home/bhalla/dilawars/Work.SVN/GITHUB/BhallaLab/moose-examples/snippets/interpol2d.py", line 52, in - import moose - File "/home/bhalla/dilawars/Work/GITHUB/DILAWAR/moose-core/_build/python/moose/__init__.py", line 6, in - from moose.moose import * - File "/home/bhalla/dilawars/Work/GITHUB/DILAWAR/moose-core/_build/python/moose/moose.py", line 63, in - from moose._moose import * - ImportError: libhdf5.so.8: cannot open shared object file: No such file or directory -``` -- [ snippets/symcompartment.py ](https://github.com/BhallaLab/moose-examples/blob/master/snippets/symcompartment.py) - -``` - Traceback (most recent call last): - File "/home/bhalla/dilawars/Work.SVN/GITHUB/BhallaLab/moose-examples/snippets/symcompartment.py", line 51, in - import moose - File "/home/bhalla/dilawars/Work/GITHUB/DILAWAR/moose-core/_build/python/moose/__init__.py", line 6, in - from moose.moose import * - File "/home/bhalla/dilawars/Work/GITHUB/DILAWAR/moose-core/_build/python/moose/moose.py", line 63, in - from moose._moose import * - ImportError: libhdf5.so.8: cannot open shared object file: No such file or directory -``` -- [ snippets/crossComptOscillator.py ](https://github.com/BhallaLab/moose-examples/blob/master/snippets/crossComptOscillator.py) - -``` - timeout: the monitored command dumped core -``` -- [ snippets/findChemSteadyState.py ](https://github.com/BhallaLab/moose-examples/blob/master/snippets/findChemSteadyState.py) - -``` - - - timeout: the monitored command dumped core -``` -- [ izhikevich/demogui_qt.py ](https://github.com/BhallaLab/moose-examples/blob/master/izhikevich/demogui_qt.py) - -``` - Traceback (most recent call last): - File "/home/bhalla/dilawars/Work.SVN/GITHUB/BhallaLab/moose-examples/izhikevich/demogui_qt.py", line 48, in - from PyQt4 import QtGui, QtCore - ModuleNotFoundError: No module named 'PyQt4' -``` -- [ izhikevich/demogui_qt.py ](https://github.com/BhallaLab/moose-examples/blob/master/izhikevich/demogui_qt.py) - -``` - Traceback (most recent call last): - File "/home/bhalla/dilawars/Work.SVN/GITHUB/BhallaLab/moose-examples/izhikevich/demogui_qt.py", line 48, in - from PyQt4 import QtGui, QtCore - ModuleNotFoundError: No module named 'PyQt4' -``` -- [ snippets/crossComptOscillator.py ](https://github.com/BhallaLab/moose-examples/blob/master/snippets/crossComptOscillator.py) - -``` -``` -- [ snippets/findChemSteadyState.py ](https://github.com/BhallaLab/moose-examples/blob/master/snippets/findChemSteadyState.py) - -``` -``` -- [ tutorials/Electrophys/ephys2_Rall_law.py ](https://github.com/BhallaLab/moose-examples/blob/master/tutorials/Electrophys/ephys2_Rall_law.py) - -``` - Traceback (most recent call last): - File "/home/bhalla/dilawars/Work.SVN/GITHUB/BhallaLab/moose-examples/tutorials/Electrophys/ephys2_Rall_law.py", line 283, in - main() - File "/home/bhalla/dilawars/Work.SVN/GITHUB/BhallaLab/moose-examples/tutorials/Electrophys/ephys2_Rall_law.py", line 87, in main - makeDisplay() - File "/home/bhalla/dilawars/Work.SVN/GITHUB/BhallaLab/moose-examples/tutorials/Electrophys/ephys2_Rall_law.py", line 211, in makeDisplay - img = mpimg.imread( 'RallsLaw.png' ) - File "/home/bhalla/dilawars/Work/Py36/lib/python3.6/site-packages/matplotlib/image.py", line 1375, in imread - with open(fname, 'rb') as fd: - FileNotFoundError: [Errno 2] No such file or directory: 'RallsLaw.png' -``` -- [ tutorials/Electrophys/ephys1_cable.py ](https://github.com/BhallaLab/moose-examples/blob/master/tutorials/Electrophys/ephys1_cable.py) - -``` -``` -- [ parallelSolver/Fig2_v4.py ](https://github.com/BhallaLab/moose-examples/blob/master/parallelSolver/Fig2_v4.py) - -``` - x3*( 5.0*(x1 - 2.0 - (x1-2.0)^3/3 - (x2-0.8) + x0)) - x2*( (x0-2.0 + 0.7 - 0.8*(x1-0.8))/2.5) - x2 * exp( -((x0 - t)^2)/(2* 1.0) ) - x2 * exp( -((x0 - t)^2)/(2* 1.0) ) + x2 * (t > 71.0 ) * ( t < 171.0 ) - x3*( 0.1 + -5.0*x1 + 5.0*x1*x1 + -1.0*x1*x1*x1 + 10.0*x0*x1/(1+x1+10*x2) + -5.0*x1*x2) - x2*( 0.1*x0*x0 + -0.01*x1) - x2 * exp( -((x0 - t)^2)/(2* 25.0) ) - x2 * exp( -((x0 - t)^2)/(2* 25.0) ) + x2 * (t > 125.0 ) * ( t < 225.0 ) - x3*( -0.1*x1 + -0.2*x1*x2 + 10.0*x0) - x2*( 0.2*x0 + -0.1*x1) - x2 * exp( -((x0 - t)^2)/(2* 1.0) ) - x2 * exp( -((x0 - t)^2)/(2* 1.0) ) + x2 * (t > 71.0 ) * ( t < 171.0 ) - x3*( -0.1*x1 + -1.0*x1*x2 + 10.0*x0) - x2*( 2.0*x0 + -0.1*x1) - x2 * exp( -((x0 - t)^2)/(2* 1.0) ) - x2 * exp( -((x0 - t)^2)/(2* 1.0) ) + x2 * (t > 71.0 ) * ( t < 171.0 ) - renaming /library/cell to soma - - Rdesigneur: Elec model has 1 compartments and 0 spines on 1 compartments. - Chem part of model has the following compartments: - | In dend, 100 voxels X 7 pools - x3*( 5.0*(x1 - 2.0 - (x1-2.0)^3/3 - (x2-0.8) + x0)) - x2*( (x0-2.0 + 0.7 - 0.8*(x1-0.8))/2.5) - x2 * exp( -((x0 - t)^2)/(2* 1.0) ) - Traceback (most recent call last): - File "/home/bhalla/dilawars/Work.SVN/GITHUB/BhallaLab/moose-examples/parallelSolver/Fig2_v4.py", line 222, in - plotPanelCDEF( [0,1,2,3,4], 3 ) - File "/home/bhalla/dilawars/Work.SVN/GITHUB/BhallaLab/moose-examples/parallelSolver/Fig2_v4.py", line 171, in plotPanelCDEF - dt, tplot, avec = runPanelCDEF( 'fhn', 5.0, 0.5, 5, seq, 0.4 ) - File "/home/bhalla/dilawars/Work.SVN/GITHUB/BhallaLab/moose-examples/parallelSolver/Fig2_v4.py", line 130, in runPanelCDEF - Z[k].nInit = 1 - KeyError: 'moose_Id_subscript: invalid index.' -``` -- [ snippets/chemDoseResponse.py ](https://github.com/BhallaLab/moose-examples/blob/master/snippets/chemDoseResponse.py) - -``` -``` -- [ snippets/reacDiffConcGradient.py ](https://github.com/BhallaLab/moose-examples/blob/master/snippets/reacDiffConcGradient.py) - -``` -``` -- [ tutorials/ChemicalBistables/findSteadyState.py ](https://github.com/BhallaLab/moose-examples/blob/master/tutorials/ChemicalBistables/findSteadyState.py) - -``` -``` -- [ snippets/cspaceSteadyState.py ](https://github.com/BhallaLab/moose-examples/blob/master/snippets/cspaceSteadyState.py) - -``` - - - timeout: the monitored command dumped core - findfont: Matching :family=sans-serif:style=normal:variant=normal:weight=normal:stretch=normal:size=10.0 to DejaVu Sans ('/home/bhalla/dilawars/Work/Py36/lib/python3.6/site-packages/matplotlib/mpl-data/fonts/ttf/DejaVuSans.ttf') with score of 0.050000 -``` -- [ tutorials/ChemicalBistables/doseResponse.py ](https://github.com/BhallaLab/moose-examples/blob/master/tutorials/ChemicalBistables/doseResponse.py) - -``` - - - timeout: the monitored command dumped core -``` -- [ unsorted/ksolve_with_heavy_load.py ](https://github.com/BhallaLab/moose-examples/blob/master/unsorted/ksolve_with_heavy_load.py) - -``` - - - timeout: the monitored command dumped core -``` - -## Broken scripts - -These scripts are marked "BROKEN" by one or more developers. - -- -- [snippets/hdfdemo.py](https://github.com/BhallaLab/moose-examples/blob/master/snippets/hdfdemo.py)- -- [snippets/crossComptSimpleReacGSSA.py](https://github.com/BhallaLab/moose-examples/blob/master/snippets/crossComptSimpleReacGSSA.py)- -- [snippets/crossComptSimpleReac.py](https://github.com/BhallaLab/moose-examples/blob/master/snippets/crossComptSimpleReac.py)- -- [snippets/testWigglySpines.py](https://github.com/BhallaLab/moose-examples/blob/master/snippets/testWigglySpines.py)- -- [snippets/testRdesigneur.py](https://github.com/BhallaLab/moose-examples/blob/master/snippets/testRdesigneur.py) - -## Blacklisted scripts - -These scripts were not tested because they require human interaction :-(. - -- -- [traub_2005/py/test_tcr.py](https://github.com/BhallaLab/moose-examples/blob/master/traub_2005/py/test_tcr.py)- -- [traub_2005/py/test_cachans.py](https://github.com/BhallaLab/moose-examples/blob/master/traub_2005/py/test_cachans.py)- -- [traub_2005/py/test_deeplts.py](https://github.com/BhallaLab/moose-examples/blob/master/traub_2005/py/test_deeplts.py)- -- [traub_2005/py/test_deepbasket.py](https://github.com/BhallaLab/moose-examples/blob/master/traub_2005/py/test_deepbasket.py)- -- [traub_2005/py/test_hsolve_tcr.py](https://github.com/BhallaLab/moose-examples/blob/master/traub_2005/py/test_hsolve_tcr.py)- -- [traub_2005/py/test_suppyrrs.py](https://github.com/BhallaLab/moose-examples/blob/master/traub_2005/py/test_suppyrrs.py)- -- [traub_2005/py/test_suplts.py](https://github.com/BhallaLab/moose-examples/blob/master/traub_2005/py/test_suplts.py)- -- [traub_2005/py/test_capool.py](https://github.com/BhallaLab/moose-examples/blob/master/traub_2005/py/test_capool.py)- -- [traub_2005/py/gui.py](https://github.com/BhallaLab/moose-examples/blob/master/traub_2005/py/gui.py)- -- [traub_2005/py/fig_a3.py](https://github.com/BhallaLab/moose-examples/blob/master/traub_2005/py/fig_a3.py)- -- [traub_2005/py/test_deepaxoaxonic.py](https://github.com/BhallaLab/moose-examples/blob/master/traub_2005/py/test_deepaxoaxonic.py)- -- [traub_2005/py/test_nachans.py](https://github.com/BhallaLab/moose-examples/blob/master/traub_2005/py/test_nachans.py)- -- [traub_2005/py/dump_f_i_curves.py](https://github.com/BhallaLab/moose-examples/blob/master/traub_2005/py/dump_f_i_curves.py)- -- [traub_2005/py/test_supbasket.py](https://github.com/BhallaLab/moose-examples/blob/master/traub_2005/py/test_supbasket.py)- -- [traub_2005/py/test_tuftedrs.py](https://github.com/BhallaLab/moose-examples/blob/master/traub_2005/py/test_tuftedrs.py)- -- [traub_2005/py/test_spinystellate.py](https://github.com/BhallaLab/moose-examples/blob/master/traub_2005/py/test_spinystellate.py)- -- [traub_2005/py/fig_a2_fs.py](https://github.com/BhallaLab/moose-examples/blob/master/traub_2005/py/fig_a2_fs.py)- -- [traub_2005/py/test_tuftedib.py](https://github.com/BhallaLab/moose-examples/blob/master/traub_2005/py/test_tuftedib.py)- -- [traub_2005/py/vclamptest.py](https://github.com/BhallaLab/moose-examples/blob/master/traub_2005/py/vclamptest.py)- -- [traub_2005/py/test_singlecomp.py](https://github.com/BhallaLab/moose-examples/blob/master/traub_2005/py/test_singlecomp.py)- -- [traub_2005/py/test_supaxoaxonic.py](https://github.com/BhallaLab/moose-examples/blob/master/traub_2005/py/test_supaxoaxonic.py)- -- [traub_2005/py/test_nontuftedrs.py](https://github.com/BhallaLab/moose-examples/blob/master/traub_2005/py/test_nontuftedrs.py)- -- [traub_2005/py/test_suppyrfrb.py](https://github.com/BhallaLab/moose-examples/blob/master/traub_2005/py/test_suppyrfrb.py)- -- [traub_2005/py/test_nrt.py](https://github.com/BhallaLab/moose-examples/blob/master/traub_2005/py/test_nrt.py)- -- [traub_2005/py/test_archan.py](https://github.com/BhallaLab/moose-examples/blob/master/traub_2005/py/test_archan.py)- -- [traub_2005/py/display_morphology.py](https://github.com/BhallaLab/moose-examples/blob/master/traub_2005/py/display_morphology.py)- -- [paper-2015/Fig5_CellMultiscale/Fig5A.py](https://github.com/BhallaLab/moose-examples/blob/master/paper-2015/Fig5_CellMultiscale/Fig5A.py)- -- [paper-2015/Fig2_elecModels/Fig2D.py](https://github.com/BhallaLab/moose-examples/blob/master/paper-2015/Fig2_elecModels/Fig2D.py)- -- [paper-2015/Fig2_elecModels/Fig2E.py](https://github.com/BhallaLab/moose-examples/blob/master/paper-2015/Fig2_elecModels/Fig2E.py)- -- [util/moogli_viewer.py](https://github.com/BhallaLab/moose-examples/blob/master/util/moogli_viewer.py)- -- [snippets/loadMorphology.py](https://github.com/BhallaLab/moose-examples/blob/master/snippets/loadMorphology.py)- -- [snippets/insertSpinesWithoutRdesigneur.py](https://github.com/BhallaLab/moose-examples/blob/master/snippets/insertSpinesWithoutRdesigneur.py)- -- [snippets/insertSpines.py](https://github.com/BhallaLab/moose-examples/blob/master/snippets/insertSpines.py) - diff --git a/neuroml/lobster_pyloric/STG_net.py b/neuroml/lobster_pyloric/STG_net.py index ca4b5a9e..d8a22e5a 100644 --- a/neuroml/lobster_pyloric/STG_net.py +++ b/neuroml/lobster_pyloric/STG_net.py @@ -78,12 +78,13 @@ def loadRunSTGNeuroML_L123(filename): for child in soma2.children: print((child.className, child.path)) if graded_syn: - syn_path = soma2_path+'/DoubExpSyn_Ach__cells-0-_AB_PD_0-0-_Soma_0' + # syn_path = soma2_path+'/DoubExpSyn_Ach__cells-0-_AB_PD_0-0-_Soma_0' # # version < 3.2 + syn_path = soma2_path+'/DoubExpSyn_Ach__cells_AB_PD_0_Soma_0' # version 3.2 + syn = moose.element(syn_path) else: syn_path = soma2_path+'/DoubExpSyn_Ach' syn = moose.element(syn_path) - syn_Ik = setupTable('DoubExpSyn_Ach_Ik',syn,'Ik') + syn_Ik = setupTable('DoubExpSyn_Ach_Ik', syn, 'Ik') print("Reinit MOOSE ... ") resetSim(['/elec',cells_path], simdt, plotdt, simmethod='hsolve') diff --git a/neuroml2/run_hhcell.py b/neuroml2/run_hhcell.py index 8b9bfe4a..180060c2 100644 --- a/neuroml2/run_hhcell.py +++ b/neuroml2/run_hhcell.py @@ -47,18 +47,6 @@ import numpy as np import matplotlib.pyplot as plt - -# NOTE: This script does not work with python3 -# See https://github.com/NeuroML/NeuroML2/issues/116 . If this bug is fixed then -# remove this code block. -import neuroml as nml -a = nml.nml.nml.IonChannel() -try: - b = {a : 1 } -except TypeError as e: - print( 'Failed due to https://github.com/NeuroML/NeuroML2/issues/116' ) - quit( 0 ) - def test_channel_gates(): """Creates prototype channels under `/library` and plots the time constants (tau) and activation (minf, hinf, ninf) parameters for the diff --git a/snippets/convert_Genesis2Sbml.py b/snippets/convert_Genesis2Sbml.py index 73312993..46ec60d7 100644 --- a/snippets/convert_Genesis2Sbml.py +++ b/snippets/convert_Genesis2Sbml.py @@ -57,7 +57,7 @@ def main(): moose.loadModel('../genesis/Kholodenko.g','/Kholodenko') #Writes model to xml file - written = moose.mooseWriteSBML('/Kholodenko','../genesis/Kholodenko_tosbml.xml') + written = moose.writeSBML('/Kholodenko','../genesis/Kholodenko_tosbml.xml') print(written) if __name__ == '__main__': diff --git a/snippets/crossComptSimpleReac.py.BROKEN b/snippets/crossComptSimpleReac.py.BROKEN index 2d71cbf6..d3eb08fa 100644 --- a/snippets/crossComptSimpleReac.py.BROKEN +++ b/snippets/crossComptSimpleReac.py.BROKEN @@ -51,7 +51,7 @@ def makeModel(): compt0.y0 += side compt2.x1 += side compt2.x0 += side - print(('Volumes = ', compt0.volume, compt1.volume, compt2.volume)) + print('Volumes = ', compt0.volume, compt1.volume, compt2.volume) # create molecules and reactions a = moose.Pool( '/model/compt0/a' ) @@ -101,9 +101,9 @@ def makeModel(): stoich0.ksolve = ksolve0 stoich1.ksolve = ksolve1 stoich2.ksolve = ksolve2 - stoich0.path = '/model/compt0/#' - stoich1.path = '/model/compt1/#' - stoich2.path = '/model/compt2/#' + stoich0.reacSystemPath = '/model/compt0/#' + stoich1.reacSystemPath = '/model/compt1/#' + stoich2.reacSystemPath = '/model/compt2/#' stoich1.buildXreacs( stoich0 ) stoich1.buildXreacs( stoich2 ) stoich0.filterXreacs() diff --git a/snippets/funcInputToPools.py b/snippets/funcInputToPools.py index 0d25adcb..4a92032a 100644 --- a/snippets/funcInputToPools.py +++ b/snippets/funcInputToPools.py @@ -100,7 +100,7 @@ def main(): """ makeModel() - moose.seed() + moose.seed(10) moose.reinit() moose.start( 50.0 ) # Run the model for 100 seconds. diff --git a/snippets/loadSbmlmodel.py b/snippets/loadSbmlmodel.py index 892368ca..c44cf31f 100644 --- a/snippets/loadSbmlmodel.py +++ b/snippets/loadSbmlmodel.py @@ -5,8 +5,8 @@ # Maintainer: # Created: Fri Jan 29 11:43:15 2016 (+0530) # Version: -# Last-Updated: -# By: +# Last-Updated: Wed Sep 09 01:32:12 2020 (+0530) +# By: HarshaRani # Update #: 0 # URL: # Keywords: @@ -21,6 +21,7 @@ # # Change log: +# updated function calls # # # @@ -77,14 +78,14 @@ def main(): runtime = float(sys.argv[2]) sbmlId = moose.element('/') # Loading the sbml file into MOOSE, models are loaded in path/model - sbmlId = moose.mooseReadSBML(filepath,'/sbml') + sbmlId = moose.readSBML(filepath,'/sbml')[0] if isinstance(sbmlId, (list, tuple)): print(sbmlId) elif sbmlId.path != '/': - s1 = moose.element('/sbml/model/compartment/S1') - s2= moose.element('/sbml/model/compartment/S2') + s1 = moose.element('/sbml/compartment/S1') + s2 = moose.element('/sbml/compartment/S2') # Creating MOOSE Table, Table2 is for the chemical model graphs = moose.Neutral( '/sbml/graphs' ) @@ -96,7 +97,7 @@ def main(): moose.connect( outputs2,'requestOut', s2, 'getConc' ); # gsl solver is added, default is ee - moose.mooseAddChemSolver(sbmlId.path,"ee") + moose.addChemSolver(sbmlId.path,"ee") # Reset and Run moose.reinit() diff --git a/snippets/rxdReacDiffusion.py b/snippets/rxdReacDiffusion.py index fa15711b..84c3f8bf 100644 --- a/snippets/rxdReacDiffusion.py +++ b/snippets/rxdReacDiffusion.py @@ -17,8 +17,8 @@ def main(): # define the geometry compt = moose.CylMesh( '/cylinder' ) compt.r0 = compt.r1 = 1 - compt.x1 = 100 compt.diffLength = 0.2 + compt.x1 = 100 assert( compt.numDiffCompts == compt.x1/compt.diffLength ) #define the molecule. Its geometry is defined by its parent volume, cylinder diff --git a/snippets/scriptKineticSolver.py b/snippets/scriptKineticSolver.py index 9927b35e..8391c7b4 100644 --- a/snippets/scriptKineticSolver.py +++ b/snippets/scriptKineticSolver.py @@ -95,7 +95,7 @@ def main(): stoich = moose.Stoich( '/model/compartment/stoich' ) stoich.compartment = moose.element( '/model/compartment' ) stoich.ksolve = ksolve - stoich.path = "/model/compartment/##" + stoich.reacSystemPath = "/model/compartment/##" #solver.method = "rk5" #mesh = moose.element( "/model/compartment/mesh" ) #moose.connect( mesh, "remesh", solver, "remesh" ) diff --git a/snippets/showmsg.py b/snippets/showmsg.py index ea780e50..d8a8c5f6 100644 --- a/snippets/showmsg.py +++ b/snippets/showmsg.py @@ -13,6 +13,9 @@ def main(): synapse = syn.synapse.vec mid = moose.connect(net, 'spikeOut', synapse, 'addSpike', 'Sparse') # This creates a `Sparse` message from `spikeOut` source of net to `addSpike` destination on synapse. msg = moose.element(mid) + print(msg.setRandomConnectivity,'xx') + msg.setRandomConnectivity(connectionProbability, 5) + quit() msg.setRandomConnectivity(connectionProbability, 5) for n in net.vec: print(('Messages from %s.spikeOut' % (n.path))) diff --git a/squid/electronics.py b/squid/electronics.py index 2f356e39..8db78f81 100644 --- a/squid/electronics.py +++ b/squid/electronics.py @@ -1,38 +1,16 @@ -# electronics.py --- -# +# electronics.py --- +# # Filename: electronics.py -# Description: +# Description: # Author: Subhasis Ray -# Maintainer: -# Created: Wed Feb 22 00:53:38 2012 (+0530) -# Version: -# Last-Updated: Tue Jul 10 10:28:40 2012 (+0530) -# By: subha -# Update #: 221 -# URL: -# Keywords: -# Compatibility: -# -# +# Maintainer: Dilawar Singh -# Commentary: -# -# -# -# - -# Change log: -# -# 2012-02-22 23:22:30 (+0530) Subha - the circuitry put in a class. -# - -# Code: - -import numpy +import numpy as np import moose -class ClampCircuit(moose.Neutral): +class ClampCircuit(object): """Container for a Voltage-Clamp/Current clamp circuit.""" + defaults = { 'level1': 25.0, 'width1': 50.0, @@ -41,8 +19,9 @@ class ClampCircuit(moose.Neutral): 'trigMode': 0, 'delay3': 1e9 } - def __init__(self, path, compartment): - moose.Neutral.__init__(self, path) + def __init__(self, path, squid): + self.path = path + moose.Neutral(path) self.pulsegen = moose.PulseGen(path+"/pulse") # holding voltage/current generator self.pulsegen.count = 2 self.pulsegen.firstLevel = 25.0 @@ -50,39 +29,49 @@ def __init__(self, path, compartment): self.pulsegen.firstDelay = 2.0 self.pulsegen.secondDelay = 0.0 self.pulsegen.trigMode = 2 - self.gate = moose.PulseGen(path+"/gate") # holding voltage/current generator + self.gate = moose.PulseGen(path + "/gate") # holding voltage/current generator self.gate.level[0] = 1.0 self.gate.delay[0] = 0.0 self.gate.width[0] = 1e9 - moose.connect(self.gate, 'output', self.pulsegen, 'input') - self.lowpass = moose.RC(path+"/lowpass") # lowpass filter + moose.connect(self.gate, "output", self.pulsegen, "input") + self.lowpass = moose.RC(path + "/lowpass") # lowpass filter self.lowpass.R = 1.0 self.lowpass.C = 0.03 - self.vclamp = moose.DiffAmp(path+"/vclamp") + self.vclamp = moose.DiffAmp(path + "/vclamp") self.vclamp.gain = 0.0 self.vclamp.saturation = 1e10 - self.iclamp = moose.DiffAmp(path+"/iclamp") + self.iclamp = moose.DiffAmp(path + "/iclamp") self.iclamp.gain = 0.0 self.iclamp.saturation = 1e10 - self.pid = moose.PIDController(path+"/pid") + self.pid = moose.PIDController(path + "/pid") self.pid.gain = 0.5 self.pid.tauI = 0.02 self.pid.tauD = 0.005 self.pid.saturation = 1e10 # Connect current clamp circuitry moose.connect(self.pulsegen, "output", self.iclamp, "plusIn") - moose.connect(self.iclamp, "output", compartment, "injectMsg") + moose.connect(self.iclamp, "output", squid.C, "injectMsg") # Connect voltage clamp circuitry moose.connect(self.pulsegen, "output", self.lowpass, "injectIn") moose.connect(self.lowpass, "output", self.vclamp, "plusIn") moose.connect(self.vclamp, "output", self.pid, "commandIn") - moose.connect(compartment, "VmOut", self.pid, "sensedIn") - moose.connect(self.pid, "output", compartment, "injectMsg") + moose.connect(squid.C, "VmOut", self.pid, "sensedIn") + moose.connect(self.pid, "output", squid.C, "injectMsg") current_table = moose.Table("/data/Im") - moose.connect(current_table, "requestOut", compartment, "getIm") + moose.connect(current_table, "requestOut", squid.C, "getIm") - def configure_pulses(self, baseLevel=0.0, firstLevel=0.1, firstDelay=5.0, firstWidth=40.0, secondLevel=0.0, secondDelay=1e6, secondWidth=0.0, singlePulse=True): - """Set up the pulse generator.""" + def configure_pulses( + self, + baseLevel=0.0, + firstLevel=0.1, + firstDelay=5.0, + firstWidth=40.0, + secondLevel=0.0, + secondDelay=1e6, + secondWidth=0.0, + singlePulse=True, + ): + """Set up the pulse generator.""" self.pulsegen.baseLevel = baseLevel self.pulsegen.firstLevel = firstLevel self.pulsegen.firstWidth = firstWidth @@ -91,10 +80,10 @@ def configure_pulses(self, baseLevel=0.0, firstLevel=0.1, firstDelay=5.0, firstW self.pulsegen.secondDelay = secondDelay self.pulsegen.secondWidth = secondWidth if singlePulse: - self.pulsegen.trigMode = 1 + self.pulsegen.trigMode = 1 else: self.pulsegen.trigMode = 0 - + def do_voltage_clamp(self): """Switch to voltage clamp circuitry. After this the simdt may need to be changed for correct performance.""" @@ -103,14 +92,10 @@ def do_voltage_clamp(self): self.pid.gain = 0.5 self.pid.tauD = 0.005 self.pid.tauI = 0.02 - + def do_current_clamp(self): """Switch to current clamp circuitry. After this the simdt may need to be changed for correct performance.""" self.iclamp.gain = 1.0 self.vclamp.gain = 0.0 self.pid.gain = 0.0 - - -# -# electronics.py ends here diff --git a/squid/squid.py b/squid/squid.py index de3efc46..8ee493bd 100644 --- a/squid/squid.py +++ b/squid/squid.py @@ -1,44 +1,23 @@ -# squid.py --- -# # Filename: squid.py -# Description: +# Description: # Author: Subhasis Ray -# Maintainer: -# Created: Mon Feb 13 11:35:11 2012 (+0530) -# Version: -# Last-Updated: Thu Sep 20 14:05:27 2012 (+0530) -# By: subha -# Update #: 771 -# URL: -# Keywords: -# Compatibility: -# -# - -# Commentary: -# -# Rewrite of the squid demo for new moose. -# -# - -# Change log: -# -# -# - -# Code: -import sys -import numpy +# Maintainer: Dilawar Singh + +import numpy as np import moose GAS_CONSTANT = 8.314 FARADAY = 9.65e4 CELSIUS_TO_KELVIN = 273.15 -class IonChannel(moose.HHChannel): + +class IonChannel(object): """Enhanced version of HHChannel with setupAlpha that takes a dict of parameters.""" - def __init__(self, name, compartment, specific_gbar, e_rev, Xpower, Ypower=0.0, Zpower=0.0): + + def __init__( + self, name, compartment, specific_gbar, e_rev, Xpower, Ypower=0.0, Zpower=0.0 + ): """Instantuate an ion channel. name -- name of the channel. @@ -53,14 +32,15 @@ def __init__(self, name, compartment, specific_gbar, e_rev, Xpower, Ypower=0.0, Ypower -- exponent for the second gatinmg component. """ - moose.HHChannel.__init__(self, '%s/%s' % (compartment.path, name)) - self.Gbar = specific_gbar * compartment.area - self.Ek = e_rev - self.Xpower = Xpower - self.Ypower = Ypower - self.Zpower = Zpower - moose.connect(self, 'channel', compartment, 'channel') - + self.path = "%s/%s" % (compartment.path, name) + self.chan = moose.HHChannel(self.path) + self.chan.Gbar = specific_gbar * compartment.area + self.chan.Ek = e_rev + self.chan.Xpower = Xpower + self.chan.Ypower = Ypower + self.chan.Zpower = Zpower + moose.connect(self.chan, "channel", compartment.C, "channel") + def setupAlpha(self, gate, params, vdivs, vmin, vmax): """Setup alpha and beta parameters of specified gate. @@ -74,215 +54,243 @@ def setupAlpha(self, gate, params, vdivs, vmin, vmax): vmax -- maximum voltage value for the alpha/beta lookup tables. """ - if gate == 'X' and self.Xpower > 0: - gate = moose.HHGate(self.path + '/gateX') - elif gate == 'Y' and self.Ypower > 0: - gate = moose.HHGate(self.path + '/gateY') + if gate == "X" and self.chan.Xpower > 0: + gate = moose.HHGate(self.path + "/gateX") + elif gate == "Y" and self.chan.Ypower > 0: + gate = moose.HHGate(self.path + "/gateY") else: return False - gate.setupAlpha([params['A_A'], - params['A_B'], - params['A_C'], - params['A_D'], - params['A_F'], - params['B_A'], - params['B_B'], - params['B_C'], - params['B_D'], - params['B_F'], - vdivs, vmin, vmax]) + gate.setupAlpha( + [ + params["A_A"], + params["A_B"], + params["A_C"], + params["A_D"], + params["A_F"], + params["B_A"], + params["B_B"], + params["B_C"], + params["B_D"], + params["B_F"], + vdivs, + vmin, + vmax, + ] + ) return True - + @property def alpha_m(self): - if self.Xpower == 0: - return numpy.array([]) - return numpy.array(moose.element('%s/gateX' % (self.path)).tableA) + if self.chan.Xpower == 0: + return np.array([]) + return np.array(moose.element("%s/gateX" % (self.path)).tableA) + @property def beta_m(self): - if self.Xpower == 0: - return numpy.array([]) - return numpy.array(moose.element('%s/gateX' % (self.path)).tableB) - \ - numpy.array(moose.element('%s/gateX' % (self.path)).tableA) + if self.chan.Xpower == 0: + return np.array([]) + return np.array(moose.element("%s/gateX" % (self.path)).tableB) - np.array( + moose.element("%s/gateX" % (self.path)).tableA + ) + @property def alpha_h(self): - if self.Ypower == 0: - return numpy.array([]) - return numpy.array(moose.element('%s/gateY' % (self.path)).tableA) + if self.chan.Ypower == 0: + return np.array([]) + return np.array(moose.element("%s/gateY" % (self.path)).tableA) + @property def beta_h(self): - if self.Ypower == 0: - return numpy.array([]) - return numpy.array(moose.element('%s/gateY' % (self.path)).tableB) \ - - numpy.array(moose.element('%s/gateY' % (self.path)).tableA) + if self.chan.Ypower == 0: + return np.array([]) + return np.array(moose.element("%s/gateY" % (self.path)).tableB) - np.array( + moose.element("%s/gateY" % (self.path)).tableA + ) -class SquidAxon(moose.Compartment): - EREST_ACT = 0.0 # can be -70 mV if not following original HH convention + +class SquidAxon(object): + # can be -70 mV if not following original HH convention + EREST_ACT = 0.0 VMIN = -30.0 VMAX = 120.0 VDIVS = 150 defaults = { - 'temperature': CELSIUS_TO_KELVIN + 6.3, - 'K_out': 10.0, - 'Na_out': 460.0, - 'K_in': 301.4, - 'Na_in': 70.96, - 'Cl_out': 540.0, - 'Cl_in': 100.0, - 'length': 500, # um - 'diameter': 500, # um - 'Em': EREST_ACT + 10.613, - 'initVm': EREST_ACT, - 'specific_cm': 1.0, # uF/cm^2 - 'specific_gl': 0.3, # mmho/cm^2 - 'specific_ra': 0.030, # kohm-cm - 'specific_gNa': 120.0, # mmho/cm^2 - 'specific_gK': 36.0 # mmho/cm^2 + "temperature": CELSIUS_TO_KELVIN + 6.3, + "K_out": 10.0, + "Na_out": 460.0, + "K_in": 301.4, + "Na_in": 70.97, + "Cl_out": 540.0, + "Cl_in": 100.0, + "length": 500.0, # um + "diameter": 500.0, # um + "Em": EREST_ACT + 10.613, + "initVm": EREST_ACT, + "specific_cm": 1.0, # uF/cm^2 + "specific_gl": 0.3, # mmho/cm^2 + "specific_ra": 0.030, # kohm-cm + "specific_gNa": 120.0, # mmho/cm^2 + "specific_gK": 36.0, # mmho/cm^2 + } + + Na_m_params = { + "A_A": 0.1 * (25.0 + EREST_ACT), + "A_B": -0.1, + "A_C": -1.0, + "A_D": -25.0 - EREST_ACT, + "A_F": -10.0, + "B_A": 4.0, + "B_B": 0.0, + "B_C": 0.0, + "B_D": 0.0 - EREST_ACT, + "B_F": 18.0, + } + Na_h_params = { + "A_A": 0.07, + "A_B": 0.0, + "A_C": 0.0, + "A_D": 0.0 - EREST_ACT, + "A_F": 20.0, + "B_A": 1.0, + "B_B": 0.0, + "B_C": 1.0, + "B_D": -30.0 - EREST_ACT, + "B_F": -10.0, + } + K_n_params = { + "A_A": 0.01 * (10.0 + EREST_ACT), + "A_B": -0.01, + "A_C": -1.0, + "A_D": -10.0 - EREST_ACT, + "A_F": -10.0, + "B_A": 0.125, + "B_B": 0.0, + "B_C": 0.0, + "B_D": 0.0 - EREST_ACT, + "B_F": 80.0, } - - Na_m_params = {'A_A':0.1 * (25.0 + EREST_ACT), - 'A_B': -0.1, - 'A_C': -1.0, - 'A_D': -25.0 - EREST_ACT, - 'A_F':-10.0, - 'B_A': 4.0, - 'B_B': 0.0, - 'B_C': 0.0, - 'B_D': 0.0 - EREST_ACT, - 'B_F': 18.0} - Na_h_params = {'A_A': 0.07, - 'A_B': 0.0, - 'A_C': 0.0, - 'A_D': 0.0 - EREST_ACT, - 'A_F': 20.0, - 'B_A': 1.0, - 'B_B': 0.0, - 'B_C': 1.0, - 'B_D': -30.0 - EREST_ACT, - 'B_F': -10.0} - K_n_params = {'A_A': 0.01*(10.0 + EREST_ACT), - 'A_B': -0.01, - 'A_C': -1.0, - 'A_D': -10.0 - EREST_ACT, - 'A_F': -10.0, - 'B_A': 0.125, - 'B_B': 0.0, - 'B_C': 0.0, - 'B_D': 0.0 - EREST_ACT, - 'B_F': 80.0} """Compartment class enhanced with specific values of passive electrical properties set and calculated using dimensions.""" + def __init__(self, path): - moose.Compartment.__init__(self, path) - self.temperature = SquidAxon.defaults['temperature'] - self.K_out = SquidAxon.defaults['K_out'] - self.Na_out = SquidAxon.defaults['Na_out'] + # moose.Compartment.__init__(self, path) + self.path = path + self.C = moose.Compartment(self.path) + self.temperature = SquidAxon.defaults["temperature"] + self.K_out = SquidAxon.defaults["K_out"] + self.Na_out = SquidAxon.defaults["Na_out"] # Modified internal concentrations used to give HH values of # equilibrium constants from the Nernst equation at 6.3 deg C. - # HH 1952a, p. 455 - self.K_in = SquidAxon.defaults['K_in'] - self.Na_in = SquidAxon.defaults['Na_in'] - self.Cl_out = SquidAxon.defaults['Cl_out'] - self.Cl_in = SquidAxon.defaults['Cl_in'] - - self.length = SquidAxon.defaults['length'] - self.diameter = SquidAxon.defaults['diameter'] - self.Em = SquidAxon.defaults['Em'] - self.initVm = SquidAxon.defaults['initVm'] - self.specific_cm = SquidAxon.defaults['specific_cm'] - self.specific_gl = SquidAxon.defaults['specific_gl'] - self.specific_ra = SquidAxon.defaults['specific_ra'] - - self.Na_channel = IonChannel('Na', self, - 0.0, - self.VNa, - Xpower=3.0, - Ypower=1.0) - self.Na_channel.setupAlpha('X', SquidAxon.Na_m_params, - SquidAxon.VDIVS, - SquidAxon.VMIN, - SquidAxon.VMAX) - self.Na_channel.setupAlpha('Y', SquidAxon.Na_h_params, - SquidAxon.VDIVS, - SquidAxon.VMIN, - SquidAxon.VMAX) - self.K_channel = IonChannel('K', self, - 0.0, - self.VK, - Xpower=4.0) - self.K_channel.setupAlpha('X', SquidAxon.K_n_params, - SquidAxon.VDIVS, - SquidAxon.VMIN, - SquidAxon.VMAX) - self.specific_gNa = SquidAxon.defaults['specific_gNa'] - self.specific_gK = SquidAxon.defaults['specific_gK'] - + # HH 1952a, p. 455 + self.K_in = SquidAxon.defaults["K_in"] + self.Na_in = SquidAxon.defaults["Na_in"] + self.Cl_out = SquidAxon.defaults["Cl_out"] + self.Cl_in = SquidAxon.defaults["Cl_in"] + + self.C.length = SquidAxon.defaults["length"] + self.C.diameter = SquidAxon.defaults["diameter"] + self.C.Em = SquidAxon.defaults["Em"] + self.C.initVm = SquidAxon.defaults["initVm"] + + self.specific_cm = SquidAxon.defaults["specific_cm"] + self.specific_gl = SquidAxon.defaults["specific_gl"] + self.specific_ra = SquidAxon.defaults["specific_ra"] + + self.Na_channel = IonChannel( + "Na", self, 0.0, self.VNa, Xpower=3.0, Ypower=1.0 + ) + + self.Na_channel.setupAlpha( + "X", SquidAxon.Na_m_params, SquidAxon.VDIVS, SquidAxon.VMIN, SquidAxon.VMAX + ) + + self.Na_channel.setupAlpha( + "Y", SquidAxon.Na_h_params, SquidAxon.VDIVS, SquidAxon.VMIN, SquidAxon.VMAX + ) + + self.K_channel = IonChannel("K", self, 0.0, self.VK, Xpower=4.0) + + self.K_channel.setupAlpha( + "X", SquidAxon.K_n_params, SquidAxon.VDIVS, SquidAxon.VMIN, SquidAxon.VMAX + ) + + self.specific_gNa = SquidAxon.defaults["specific_gNa"] + self.specific_gK = SquidAxon.defaults["specific_gK"] + @classmethod def reversal_potential(cls, temp, c_out, c_in): """Compute the reversal potential based on Nernst equation.""" # NOTE the 70 mV added for compatibility with original HH - return (GAS_CONSTANT * temp / FARADAY) * 1000.0 * numpy.log(c_out/c_in) + 70.0 + cls.EREST_ACT + v = ( + (GAS_CONSTANT * temp / FARADAY) * 1000.0 * np.log(c_out / c_in) + + 70.0 + + cls.EREST_ACT + ) + return v - @property def xarea(self): """Area of cross section in cm^2 when length and diameter are in um""" - return 1e-8 * numpy.pi * self.diameter * self.diameter / 4.0 # cm^2 + return 1e-8 * np.pi * self.C.diameter * self.C.diameter / 4.0 # cm^2 @property def area(self): """Area in cm^2 when length and diameter are in um""" - return 1e-8 * self.length * numpy.pi * self.diameter # cm^2 - + return 1e-8 * self.C.length * np.pi * self.C.diameter # cm^2 + @property def specific_ra(self): - return self.Ra * self.xarea / self.length + return self.C.Ra * self.xarea / self.C.length + @specific_ra.setter def specific_ra(self, value): - self.Ra = value * self.length / self.xarea - + self.C.Ra = value * self.C.length / self.xarea + @property def specific_cm(self): - return self.Cm / self.area + return self.C.Cm / self.area + @specific_cm.setter def specific_cm(self, value): - self.Cm = value * self.area + self.C.Cm = value * self.area @property def specific_gl(self): - return 1.0/(self.Rm * self.area) + return 1.0 / (self.C.Rm * self.area) + @specific_gl.setter def specific_gl(self, value): - self.Rm = 1.0/(value * self.area) + self.C.Rm = 1.0 / (value * self.area) @property def specific_rm(self): - return self.Rm * self.area + return self.C.Rm * self.area + @specific_rm.setter def specific_rm(self, value): - self.Rm = value / self.area + self.C.Rm = value / self.area @property def specific_gNa(self): - return self.Na_channel.Gbar / self.area + return self.Na_channel.chan.Gbar / self.area @specific_gNa.setter def specific_gNa(self, value): - self.Na_channel.Gbar = value * self.area + self.Na_channel.chan.Gbar = value * self.area @property def specific_gK(self): - return self.K_channel.Gbar / self.area + return self.K_channel.chan.Gbar / self.area @specific_gK.setter def specific_gK(self, value): - self.K_channel.Gbar = value * self.area + self.K_channel.chan.Gbar = value * self.area @property def VK(self): """Reversal potential of K+ channels""" return SquidAxon.reversal_potential(self.temperature, self.K_out, self.K_in) - + @property def VNa(self): """Reversal potential of Na+ channels""" @@ -290,87 +298,79 @@ def VNa(self): def updateEk(self): """Update the channels' Ek""" - self.Na_channel.Ek = self.VNa - self.K_channel.Ek = self.VK - + self.Na_channel.chan.Ek = self.VNa + self.K_channel.chan.Ek = self.VK - @property - def celsius(self): + def get_celsius(self): return self.temperature - CELSIUS_TO_KELVIN - @celsius.setter - def celsius(self, celsius): + def set_celsius(self, celsius): self.temperature = celsius + CELSIUS_TO_KELVIN - def use_defaults(self): - for field, value in list(SquidAxon.defaults.items()): - setattr(self, field, value) + celsius = property(get_celsius, set_celsius) -class SquidModel(moose.Neutral): + +class SquidModel(object): """Container for squid demo.""" + def __init__(self, path): - moose.Neutral.__init__(self, path) - self.squid_axon = SquidAxon(path+'/squid_axon') - print((self.squid_axon.Na_channel.Gbar, self.squid_axon.K_channel.Gbar)) - self.current_clamp = moose.PulseGen(path+'/pulsegen') - self.current_clamp.firstDelay = 5.0 # ms - self.current_clamp.firstWidth = 40 # ms - self.current_clamp.firstLevel = 0.1 # uA + self.path = path + moose.Neutral(self.path) + self.axon = SquidAxon(path + "/axon") + # print((self.axon.Na_channel.chan.Gbar, self.axon.K_channel.chan.Gbar)) + self.current_clamp = moose.PulseGen(path + "/pulsegen") + self.current_clamp.firstDelay = 5.0 # ms + self.current_clamp.firstWidth = 40 # ms + self.current_clamp.firstLevel = 0.1 # uA self.current_clamp.secondDelay = 1e9 - print(('Current clamp connected:', moose.connect(self.current_clamp, 'output', self.squid_axon, 'injectMsg'))) - - self.Vm_table = moose.Table('%s/Vm' % (self.path)) - moose.connect(self.Vm_table, 'requestOut', self.squid_axon, 'getVm') - self.gK_table = moose.Table('%s/gK' % (self.path)) - moose.connect(self.gK_table, 'requestOut', self.squid_axon.K_channel, 'getGk') - self.gNa_table = moose.Table('%s/gNa' % (self.path)) - moose.connect(self.gNa_table, 'requestOut', self.squid_axon.Na_channel, 'getGk') + moose.connect(self.current_clamp, "output", self.axon.C, "injectMsg") + + self.Vm_table = moose.Table("%s/Vm" % (self.path)) + moose.connect(self.Vm_table, "requestOut", self.axon.C, "getVm") + self.gK_table = moose.Table("%s/gK" % (self.path)) + moose.connect(self.gK_table, "requestOut", self.axon.K_channel.chan, "getGk") + self.gNa_table = moose.Table("%s/gNa" % (self.path)) + moose.connect(self.gNa_table, "requestOut", self.axon.Na_channel.chan, "getGk") self.clocks_assigned = False - + def run(self, runtime, simdt=1e-6): - self.squid_axon.updateEk() - moose.setClock(0, simdt) - moose.setClock(1, simdt) - moose.setClock(2, simdt) - moose.setClock(3, simdt) - if not self.clocks_assigned: - moose.useClock(0, '%s/#[TYPE=Compartment]' % (self.path), 'init') - moose.useClock(0, '%s/#[TYPE=PulseGen]' % (self.path), 'process') - moose.useClock(1, '%s/#[TYPE=Compartment]' % (self.path), 'process') - moose.useClock(2, '%s/#[TYPE=HHChannel]' % (self.squid_axon.path), 'process') - moose.useClock(3, '%s/#[TYPE=Table]' % (self.path), 'process') - self.clocks_assigned = True + self.axon.updateEk() moose.reinit() moose.start(runtime) def save_data(self): - self.Vm_table.xplot('Vm.dat', 'Vm') - print('Vm saved to Vm.dat') - if hasattr(self, 'gK_table'): - self.gK_table.xplot('gK.dat', 'gK') - numpy.savetxt('K_alpha_n.dat', self.squid_axon.K_channel.alpha_m) - numpy.savetxt('K_beta_n.dat', self.squid_axon.K_channel.beta_m) - print('K conductance saved to gK.dat') - if hasattr(self, 'gNa_table'): - self.gNa_table.xplot('gNa.dat', 'gNa') - numpy.savetxt('Na_alpha_m.dat', self.squid_axon.Na_channel.alpha_m) - numpy.savetxt('Na_beta_m.dat', self.squid_axon.Na_channel.beta_m) - numpy.savetxt('Na_alpha_h.dat', self.squid_axon.Na_channel.alpha_h) - numpy.savetxt('Na_beta_h.dat', self.squid_axon.Na_channel.beta_h) - print('Na conductance saved to gNa.dat') - - - + self.Vm_table.xplot("Vm.dat", "Vm") + print("Vm saved to Vm.dat") + if hasattr(self, "gK_table"): + self.gK_table.xplot("gK.dat", "gK") + np.savetxt("K_alpha_n.dat", self.axon.K_channel.alpha_m) + np.savetxt("K_beta_n.dat", self.axon.K_channel.beta_m) + print("K conductance saved to gK.dat") + if hasattr(self, "gNa_table"): + self.gNa_table.xplot("gNa.dat", "gNa") + np.savetxt("Na_alpha_m.dat", self.axon.Na_channel.alpha_m) + np.savetxt("Na_beta_m.dat", self.axon.Na_channel.beta_m) + np.savetxt("Na_alpha_h.dat", self.axon.Na_channel.alpha_h) + np.savetxt("Na_beta_h.dat", self.axon.Na_channel.beta_h) + print("Na conductance saved to gNa.dat") + + def plot_data(self): + import matplotlib.pyplot as plt + + ax11 = plt.subplot(121) + ax12 = plt.subplot(122) + ax11.plot(self.Vm_table.vector) + ax12.plot(self.gNa_table.vector) + ax12.plot(self.gK_table.vector) + plt.show() + + def test(runtime=100.0, simdt=1e-2): - model = SquidModel('model') + model = SquidModel("/model") model.run(runtime, simdt) - model.save_data() + # model.save_data() + model.plot_data() + -if __name__ == '__main__': - # unittest.main() +if __name__ == "__main__": test() - - - -# -# squid.py ends here diff --git a/squid/squid_demo.py b/squid/squid_demo.py index 06359e94..9d9ed7d2 100644 --- a/squid/squid_demo.py +++ b/squid/squid_demo.py @@ -296,23 +296,23 @@ def _createChannelControl(self): self._kConductanceToggle = QCheckBox('Block K+ channel', self._channelCtrlBox) self._kConductanceToggle.setToolTip('%s' % (tooltip_KChan)) self._kOutLabel = QLabel('[K+]out (mM)', self._channelCtrlBox) - self._kOutEdit = QLineEdit('%g' % (self.squid_setup.squid_axon.K_out), + self._kOutEdit = QLineEdit('%g' % (self.squid_setup.axon.K_out), self._channelCtrlBox) self._kOutLabel.setToolTip('%s' % (tooltip_Nernst)) self._kOutEdit.setToolTip('%s' % (tooltip_Nernst)) set_default_line_edit_size(self._kOutEdit) self._naOutLabel = QLabel('[Na+]out (mM)', self._channelCtrlBox) - self._naOutEdit = QLineEdit('%g' % (self.squid_setup.squid_axon.Na_out), + self._naOutEdit = QLineEdit('%g' % (self.squid_setup.axon.Na_out), self._channelCtrlBox) self._naOutLabel.setToolTip('%s' % (tooltip_Nernst)) self._naOutEdit.setToolTip('%s' % (tooltip_Nernst)) set_default_line_edit_size(self._naOutEdit) self._kInLabel = QLabel('[K+]in (mM)', self._channelCtrlBox) - self._kInEdit = QLineEdit('%g' % (self.squid_setup.squid_axon.K_in), + self._kInEdit = QLineEdit('%g' % (self.squid_setup.axon.K_in), self._channelCtrlBox) self._kInEdit.setToolTip(tooltip_Nernst) self._naInLabel = QLabel('[Na+]in (mM)', self._channelCtrlBox) - self._naInEdit = QLineEdit('%g' % (self.squid_setup.squid_axon.Na_in), + self._naInEdit = QLineEdit('%g' % (self.squid_setup.axon.Na_in), self._channelCtrlBox) self._naInEdit.setToolTip('%s' % (tooltip_Nernst)) self._temperatureLabel = QLabel('Temperature (C)', self._channelCtrlBox) @@ -518,7 +518,12 @@ def _updatePlots(self): vm = numpy.asarray(self.squid_setup.vm_table.vector) cmd = numpy.asarray(self.squid_setup.cmd_table.vector) ik = numpy.asarray(self.squid_setup.ik_table.vector) + + # tab = self.squid_setup.ina_table + # print(moose.showmsg(tab)) + ina = numpy.asarray(self.squid_setup.ina_table.vector) + iclamp = numpy.asarray(self.squid_setup.iclamp_table.vector) vclamp = numpy.asarray(self.squid_setup.vclamp_table.vector) gk = numpy.asarray(self.squid_setup.gk_table.vector) @@ -636,19 +641,19 @@ def _runSlot(self): secondLevel=secondLevel, singlePulse=singlePulse) if self._kConductanceToggle.isChecked(): - self.squid_setup.squid_axon.specific_gK = 0.0 + self.squid_setup.axon.specific_gK = 0.0 else: - self.squid_setup.squid_axon.specific_gK = SquidAxon.defaults['specific_gK'] + self.squid_setup.axon.specific_gK = SquidAxon.defaults['specific_gK'] if self._naConductanceToggle.isChecked(): - self.squid_setup.squid_axon.specific_gNa = 0.0 + self.squid_setup.axon.specific_gNa = 0.0 else: - self.squid_setup.squid_axon.specific_gNa = SquidAxon.defaults['specific_gNa'] - self.squid_setup.squid_axon.celsius = self.getFloatInput(self._temperatureEdit, self._temperatureLabel.text()) - self.squid_setup.squid_axon.K_out = self.getFloatInput(self._kOutEdit, self._kOutLabel.text()) - self.squid_setup.squid_axon.Na_out = self.getFloatInput(self._naOutEdit, self._naOutLabel.text()) - self.squid_setup.squid_axon.K_in = self.getFloatInput(self._kInEdit, self._kInLabel.text()) - self.squid_setup.squid_axon.Na_in = self.getFloatInput(self._naInEdit, self._naInLabel.text()) - self.squid_setup.squid_axon.updateEk() + self.squid_setup.axon.specific_gNa = SquidAxon.defaults['specific_gNa'] + self.squid_setup.axon.celsius = self.getFloatInput(self._temperatureEdit, self._temperatureLabel.text()) + self.squid_setup.axon.K_out = self.getFloatInput(self._kOutEdit, self._kOutLabel.text()) + self.squid_setup.axon.Na_out = self.getFloatInput(self._naOutEdit, self._naOutLabel.text()) + self.squid_setup.axon.K_in = self.getFloatInput(self._kInEdit, self._kInLabel.text()) + self.squid_setup.axon.Na_in = self.getFloatInput(self._naInEdit, self._naInLabel.text()) + self.squid_setup.axon.updateEk() self.squid_setup.schedule(self._simdt, self._plotdt, clampMode) # The following line is for use with Qthread self.squid_setup.run(self._runtime) diff --git a/squid/squid_setup.py b/squid/squid_setup.py index 6f24e464..9c9b764d 100644 --- a/squid/squid_setup.py +++ b/squid/squid_setup.py @@ -38,8 +38,8 @@ def __init__(self): self.scheduled = False self.model_container = moose.Neutral('/model') self.data_container = moose.Neutral('/data') - self.squid_axon = SquidAxon('/model/squid_axon') - self.clamp_ckt = ClampCircuit('/model/electronics', self.squid_axon) + self.axon = SquidAxon('/model/axon') + self.clamp_ckt = ClampCircuit('/model/electronics', self.axon) self.simdt = 0.0 self.plotdt = 0.0 self.setup_recording() @@ -47,7 +47,7 @@ def __init__(self): def setup_recording(self): # Setup data collection self.vm_table = moose.Table('/data/Vm') - moose.connect(self.vm_table, 'requestOut', self.squid_axon, 'getVm') + moose.connect(self.vm_table, 'requestOut', self.axon.C, 'getVm') self.cmd_table = moose.Table('/data/command') moose.connect(self.cmd_table, 'requestOut', self.clamp_ckt.vclamp, 'getOutputValue') self.iclamp_table = moose.Table('/data/Iclamp') @@ -55,19 +55,19 @@ def setup_recording(self): self.vclamp_table = moose.Table('/data/Vclamp') moose.connect(self.vclamp_table, 'requestOut', self.clamp_ckt.pid, 'getOutputValue') self.m_table = moose.Table('/data/m') - moose.connect(self.m_table, 'requestOut', self.squid_axon.Na_channel, 'getX') + moose.connect(self.m_table, 'requestOut', self.axon.Na_channel.chan, 'getX') self.h_table = moose.Table('/data/h') - moose.connect(self.h_table, 'requestOut', self.squid_axon.Na_channel, 'getY') + moose.connect(self.h_table, 'requestOut', self.axon.Na_channel.chan, 'getY') self.n_table = moose.Table('/data/n') - moose.connect(self.n_table, 'requestOut', self.squid_axon.K_channel, 'getX') + moose.connect(self.n_table, 'requestOut', self.axon.K_channel.chan, 'getX') self.ina_table = moose.Table('/data/INa') - moose.connect(self.ina_table, 'requestOut', self.squid_axon.Na_channel, 'getIk') + moose.connect(self.ina_table, 'requestOut', self.axon.Na_channel.chan, 'getIk') self.ik_table = moose.Table('/data/IK') - moose.connect(self.ik_table, 'requestOut', self.squid_axon.K_channel, 'getIk') + moose.connect(self.ik_table, 'requestOut', self.axon.K_channel.chan, 'getIk') self.gna_table = moose.Table('/data/GNa') - moose.connect(self.gna_table, 'requestOut', self.squid_axon.Na_channel, 'getGk') + moose.connect(self.gna_table, 'requestOut', self.axon.Na_channel.chan, 'getGk') self.gk_table = moose.Table('/data/GK') - moose.connect(self.gk_table, 'requestOut', self.squid_axon.K_channel, 'getGk') + moose.connect(self.gk_table, 'requestOut', self.axon.K_channel.chan, 'getGk') def schedule(self, simdt, plotdt, clampmode): self.simdt = simdt @@ -85,7 +85,7 @@ def schedule(self, simdt, plotdt, clampmode): moose.useClock(0, '%s/#[TYPE=Compartment]' % (self.model_container.path), 'init') moose.useClock(0, '%s/##' % (self.clamp_ckt.path), 'process') moose.useClock(1, '%s/#[TYPE=Compartment]' % (self.model_container.path), 'process') - moose.useClock(2, '%s/#[TYPE=HHChannel]' % (self.squid_axon.path), 'process') + moose.useClock(2, '%s/#[TYPE=HHChannel]' % (self.axon.path), 'process') moose.useClock(3, '%s/#[TYPE=Table]' % (self.data_container.path), 'process') self.scheduled = True moose.reinit() @@ -95,7 +95,7 @@ def run(self, runtime): def save_data(self): for child in self.data_container.children: - tab = moose.Table(child) + tab = moose.element(child) tab.xplot('%s.dat' % (tab.name), tab.name) import sys diff --git a/traub_2005/py/cell_test_util.py b/traub_2005/py/cell_test_util.py index 3f38a1e0..1ae4b667 100644 --- a/traub_2005/py/cell_test_util.py +++ b/traub_2005/py/cell_test_util.py @@ -164,7 +164,7 @@ def runsim(self, simtime, stepsize=0.1, pulsearray=None): moose.reinit() config.logger.info('Finished reinit') ts = datetime.now() - mutils.stepRun(simtime, simtime/10.0, verbose=True, logger=config.logger) + mutils.stepRun(simtime, simtime/10.0, verbose=True) # The sleep is required to get all threads to end while moose.isRunning(): time.sleep(0.1) diff --git a/traub_2005/py/cells.py b/traub_2005/py/cells.py index e0ac7ea4..a7290a2f 100644 --- a/traub_2005/py/cells.py +++ b/traub_2005/py/cells.py @@ -176,7 +176,7 @@ def assign_depths(cell, depthdict, leveldict): comp.z = z -class CellMeta(type): +class CellMeta(moose.melement.__class__): def __new__(cls, name, bases, cdict): if name != 'CellBase': proto = read_prototype(name, cdict) @@ -198,15 +198,15 @@ def __new__(cls, name, bases, cdict): @metafix.with_metaclass(CellMeta) -class CellBase(moose.Neuron): - # __metaclass__ = CellMeta # This is incompatible with Python3 +class CellBase(object): annotation = {'cno': 'cno_0000020'} def __init__(self, path): - if not moose.exists(path): + self.path = path + if not moose.exists(self.path): path_tokens = path.rpartition('/') moose.copy(self.prototype, path_tokens[0], path_tokens[-1]) - moose.element( path ) + self.name = path.split('/')[-1] self.solver = moose.HSolve('{}/solver'.format(path)) self.solver.target = path self.solver.dt = config.simulationSettings.simulationDt diff --git a/traub_2005/py/channelbase.py b/traub_2005/py/channelbase.py index 76e98fee..725c3494 100644 --- a/traub_2005/py/channelbase.py +++ b/traub_2005/py/channelbase.py @@ -108,7 +108,7 @@ def get_class_field(name, cdict, bases, fieldname, default=None): return default -class ChannelMeta(type): +class ChannelMeta(moose.melement.__class__): def __new__(cls, name, bases, cdict): global prototypes # classes that set absract=True will be @@ -170,7 +170,3 @@ class ChannelBase(moose.HHChannel): abstract = True def __init__(self, path, xpower=1, ypower=0, Ek=0.0): moose.HHChannel.__init__(self, path) - - -# -# trbchan.py ends here diff --git a/traub_2005/py/fig_a2_fs.py b/traub_2005/py/fig_a2_fs.py index 69e411c3..24beeeb3 100644 --- a/traub_2005/py/fig_a2_fs.py +++ b/traub_2005/py/fig_a2_fs.py @@ -64,7 +64,7 @@ plotdt=1e-4 def setup_model(root='/', hsolve=True): - moose.ce(root) + moose.setCwe(root) model = moose.Neutral('model') data = moose.Neutral('data') cell = DeepBasket('%s/deepbasket' % (model.path)) @@ -99,6 +99,7 @@ def main(): model_dict = setup_model() do_sim(model_dict['stimulus'], amp) config.logger.info('##### %d' % (model_dict['tab_vm'].size)) + print(model_dict['tab_vm'].vector, '111') vm = model_dict['tab_vm'].vector * 1e3 inject = model_dict['tab_stim'].vector.copy() t = np.linspace(0, simtime, len(vm)) diff --git a/traub_2005/py/fig_a3.py b/traub_2005/py/fig_a3.py index 1e1b4a66..331d823f 100644 --- a/traub_2005/py/fig_a3.py +++ b/traub_2005/py/fig_a3.py @@ -60,7 +60,7 @@ plotdt=1e-4 def setup_model(root='/', hsolve=True): - moose.ce(root) + moose.setCwe(root) model = moose.Neutral('model') data = moose.Neutral('data') cell = SpinyStellate('%s/spinystellate' % (model.path)) diff --git a/traub_2005/py/vclamptest.py b/traub_2005/py/vclamptest.py index 69e4264e..90cb33a1 100644 --- a/traub_2005/py/vclamptest.py +++ b/traub_2005/py/vclamptest.py @@ -53,12 +53,12 @@ from moose import utils # import cells -def vclamptest(compartment, vclamp, duration=50e-3, delay=150e-3, solver='ee', vhold=None, mc=None, dc=None, simdt=1e-5, plotdt=0.25e-3): - """Do a series of voltage clamp experiemnts on compartment. +def vclamptest(axon, vclamp, duration=50e-3, delay=150e-3, solver='ee', vhold=None, mc=None, dc=None, simdt=1e-5, plotdt=0.25e-3): + """Do a series of voltage clamp experiemnts on axon. parameters: - compartment: Compartment object to be voltage clamped + axon: Compartment object to be voltage clamped vclamp: array of clamping voltage values. @@ -67,26 +67,26 @@ def vclamptest(compartment, vclamp, duration=50e-3, delay=150e-3, solver='ee', v delay: delay between successive application of clamping voltages vhold: holding voltage, If None, the Em of the - compartment is used. + axon is used. mc: model container, the vclamp object will be created inside - mc/electronics. If None, we use compartment.parent.parent + mc/electronics. If None, we use axon.parent.parent dc: data container, the data recording tables will be created - inside it. If None, we use compartment.parent.parent + inside it. If None, we use axon.parent.parent """ if vhold is None: - vhold = compartment.Em + vhold = axon.C.Em if mc is None: - mc = compartment.parent.parent + mc = axon.C.parent.parent if dc is None: - dc = compartment.parent.parent + dc = axon.C.parent.parent electronics = moose.Neutral('%s/electronics' % (mc.path)) command = moose.PulseGen('%s/command_source' % (electronics.path)) clamp = moose.VClamp('%s/vclamp' % (electronics.path)) moose.connect(command, 'output', clamp, 'commandIn') - moose.connect(compartment, 'VmOut', clamp, 'sensedIn') - moose.connect(clamp, 'currentOut', compartment, 'injectMsg') + moose.connect(axon.C, 'VmOut', clamp, 'sensedIn') + moose.connect(clamp, 'currentOut', axon.C, 'injectMsg') simtime = 0 command.count = len(vclamp) command.baseLevel = vhold @@ -100,7 +100,7 @@ def vclamptest(compartment, vclamp, duration=50e-3, delay=150e-3, solver='ee', v voltage = moose.Table('%s/Vcommand' % (dc.path)) moose.connect(voltage, 'requestOut', command, 'getOutputValue') vm = moose.Table('%s/Vm' % (dc.path)) - moose.connect(vm, 'requestOut', compartment, 'getVm') + moose.connect(vm, 'requestOut', axon.C, 'getVm') utils.resetSim([mc.path, dc.path], simdt, plotdt, simmethod=solver) moose.start(simtime) ivec = np.asarray(injected.vector)