Skip to content
Snippets Groups Projects
Commit 9c408566 authored by Dilawar Singh's avatar Dilawar Singh
Browse files

Added assert to diffshells.

parent e23bd61c
No related branches found
No related tags found
No related merge requests found
...@@ -145,14 +145,9 @@ if __name__ == '__main__': ...@@ -145,14 +145,9 @@ if __name__ == '__main__':
pulse.delay[1] = 1e9 pulse.delay[1] = 1e9
chan = chan_proto.chan_proto('/library/CaL12',param_chan.Cal) chan = chan_proto.chan_proto('/library/CaL12',param_chan.Cal)
m = moose.connect(pulse, 'output', dend, 'injectMsg') m = moose.connect(pulse, 'output', dend, 'injectMsg')
moose.connect(vmtab, 'requestOut', dend, 'getVm') moose.connect(vmtab, 'requestOut', dend, 'getVm')
chan = addOneChan('CaL12', gbar, dend) chan = addOneChan('CaL12', gbar, dend)
moose.connect(gktab, 'requestOut', chan, 'getGk') moose.connect(gktab, 'requestOut', chan, 'getGk')
moose.connect(iktab, 'requestOut', chan, 'getIk') moose.connect(iktab, 'requestOut', chan, 'getIk')
diftab = [] diftab = []
...@@ -190,11 +185,9 @@ if __name__ == '__main__': ...@@ -190,11 +185,9 @@ if __name__ == '__main__':
dbuf.bFree = dbuf.bTot dbuf.bFree = dbuf.bTot
moose.start(t_stop) moose.start(t_stop)
t = np.linspace(0, t_stop, len(vmtab.vector)) t = np.linspace(0, t_stop, len(vmtab.vector))
fname = 'moose_results_difshell_no_' + str(difshell_no) + '_difbuffer_no_' + str( fname = 'moose_results_difshell_no_' + str(difshell_no) + '_difbuffer_no_' + str(
difbuff_no) + '_pump_' + str(pumps) + '_gbar_' + str(gbar) + '.txt' difbuff_no) + '_pump_' + str(pumps) + '_gbar_' + str(gbar) + '.txt'
print( fname )
header = 'time Vm Ik Gk' header = 'time Vm Ik Gk'
number = 4 + difshell_no * (difbuff_no + 1) number = 4 + difshell_no * (difbuff_no + 1)
res = np.zeros((len(t), number)) res = np.zeros((len(t), number))
...@@ -210,5 +203,6 @@ if __name__ == '__main__': ...@@ -210,5 +203,6 @@ if __name__ == '__main__':
for j, buf in enumerate(buftab[i]): for j, buf in enumerate(buftab[i]):
res[:, 4 + i * (difbuff_no + 1) + j + 1] = buf.vector res[:, 4 + i * (difbuff_no + 1) + j + 1] = buf.vector
header += ' difshell_' + str(i) + '_difbuff_' + str(j) header += ' difshell_' + str(i) + '_difbuff_' + str(j)
np.savetxt(fname, res, header=header, comments='') assert( res.mean() == 0.6059903892218336 )
assert( np.std(res) == 1.9505369046640817 ), np.std( res )
print( 'All done' )
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment