Skip to content

Commit a5f2566

Browse files
author
Dilawar Singh
committed
Merge branch 'pybind11' into squid_no_subclass
2 parents d45fc5f + ea2d2c0 commit a5f2566

10 files changed

+151
-184
lines changed

.ci/execute_travis_serial.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def print_results():
7070
for k in result_:
7171
with open("%s.txt" % k, 'w') as f:
7272
for fl, r in result_[k]:
73-
f.write('- %s\n' % fl)
73+
f.write('- [ ] %s\n' % fl)
7474
f.write('```')
7575
try:
7676
r = r.decode('utf8')

snippets/funcInputToPools.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ def main():
100100
"""
101101

102102
makeModel()
103-
moose.seed()
103+
moose.seed(10)
104104

105105
moose.reinit()
106106
moose.start( 50.0 ) # Run the model for 100 seconds.

snippets/rxdReacDiffusion.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ def main():
1717
# define the geometry
1818
compt = moose.CylMesh( '/cylinder' )
1919
compt.r0 = compt.r1 = 1
20-
compt.x1 = 100
2120
compt.diffLength = 0.2
21+
compt.x1 = 100
2222
assert( compt.numDiffCompts == compt.x1/compt.diffLength )
2323

2424
#define the molecule. Its geometry is defined by its parent volume, cylinder

snippets/showmsg.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ def main():
1313
synapse = syn.synapse.vec
1414
mid = moose.connect(net, 'spikeOut', synapse, 'addSpike', 'Sparse') # This creates a `Sparse` message from `spikeOut` source of net to `addSpike` destination on synapse.
1515
msg = moose.element(mid)
16+
print(msg.setRandomConnectivity,'xx')
17+
msg.setRandomConnectivity(connectionProbability, 5)
18+
quit()
1619
msg.setRandomConnectivity(connectionProbability, 5)
1720
for n in net.vec:
1821
print(('Messages from %s.spikeOut' % (n.path)))

squid/electronics.py

Lines changed: 27 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,16 @@
1-
# electronics.py ---
2-
#
1+
# electronics.py ---
2+
#
33
# Filename: electronics.py
4-
# Description:
4+
# Description:
55
# Author: Subhasis Ray
6-
# Maintainer:
7-
# Created: Wed Feb 22 00:53:38 2012 (+0530)
8-
# Version:
9-
# Last-Updated: Tue Jul 10 10:28:40 2012 (+0530)
10-
# By: subha
11-
# Update #: 221
12-
# URL:
13-
# Keywords:
14-
# Compatibility:
15-
#
16-
#
6+
# Maintainer: Dilawar Singh
177

18-
# Commentary:
19-
#
20-
#
21-
#
22-
#
23-
24-
# Change log:
25-
#
26-
# 2012-02-22 23:22:30 (+0530) Subha - the circuitry put in a class.
27-
#
28-
29-
# Code:
30-
31-
import numpy
8+
import numpy as np
329
import moose
3310

3411
class ClampCircuit(object):
3512
"""Container for a Voltage-Clamp/Current clamp circuit."""
13+
3614
defaults = {
3715
'level1': 25.0,
3816
'width1': 50.0,
@@ -51,21 +29,21 @@ def __init__(self, path, squid):
5129
self.pulsegen.firstDelay = 2.0
5230
self.pulsegen.secondDelay = 0.0
5331
self.pulsegen.trigMode = 2
54-
self.gate = moose.PulseGen(path+"/gate") # holding voltage/current generator
32+
self.gate = moose.PulseGen(path + "/gate") # holding voltage/current generator
5533
self.gate.level[0] = 1.0
5634
self.gate.delay[0] = 0.0
5735
self.gate.width[0] = 1e9
58-
moose.connect(self.gate, 'output', self.pulsegen, 'input')
59-
self.lowpass = moose.RC(path+"/lowpass") # lowpass filter
36+
moose.connect(self.gate, "output", self.pulsegen, "input")
37+
self.lowpass = moose.RC(path + "/lowpass") # lowpass filter
6038
self.lowpass.R = 1.0
6139
self.lowpass.C = 0.03
62-
self.vclamp = moose.DiffAmp(path+"/vclamp")
40+
self.vclamp = moose.DiffAmp(path + "/vclamp")
6341
self.vclamp.gain = 0.0
6442
self.vclamp.saturation = 1e10
65-
self.iclamp = moose.DiffAmp(path+"/iclamp")
43+
self.iclamp = moose.DiffAmp(path + "/iclamp")
6644
self.iclamp.gain = 0.0
6745
self.iclamp.saturation = 1e10
68-
self.pid = moose.PIDController(path+"/pid")
46+
self.pid = moose.PIDController(path + "/pid")
6947
self.pid.gain = 0.5
7048
self.pid.tauI = 0.02
7149
self.pid.tauD = 0.005
@@ -82,8 +60,18 @@ def __init__(self, path, squid):
8260
current_table = moose.Table("/data/Im")
8361
moose.connect(current_table, "requestOut", squid.C, "getIm")
8462

85-
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):
86-
"""Set up the pulse generator."""
63+
def configure_pulses(
64+
self,
65+
baseLevel=0.0,
66+
firstLevel=0.1,
67+
firstDelay=5.0,
68+
firstWidth=40.0,
69+
secondLevel=0.0,
70+
secondDelay=1e6,
71+
secondWidth=0.0,
72+
singlePulse=True,
73+
):
74+
"""Set up the pulse generator."""
8775
self.pulsegen.baseLevel = baseLevel
8876
self.pulsegen.firstLevel = firstLevel
8977
self.pulsegen.firstWidth = firstWidth
@@ -92,10 +80,10 @@ def configure_pulses(self, baseLevel=0.0, firstLevel=0.1, firstDelay=5.0, firstW
9280
self.pulsegen.secondDelay = secondDelay
9381
self.pulsegen.secondWidth = secondWidth
9482
if singlePulse:
95-
self.pulsegen.trigMode = 1
83+
self.pulsegen.trigMode = 1
9684
else:
9785
self.pulsegen.trigMode = 0
98-
86+
9987
def do_voltage_clamp(self):
10088
"""Switch to voltage clamp circuitry. After this the simdt may
10189
need to be changed for correct performance."""
@@ -104,14 +92,10 @@ def do_voltage_clamp(self):
10492
self.pid.gain = 0.5
10593
self.pid.tauD = 0.005
10694
self.pid.tauI = 0.02
107-
95+
10896
def do_current_clamp(self):
10997
"""Switch to current clamp circuitry. After this the simdt may
11098
need to be changed for correct performance."""
11199
self.iclamp.gain = 1.0
112100
self.vclamp.gain = 0.0
113101
self.pid.gain = 0.0
114-
115-
116-
#
117-
# electronics.py ends here

0 commit comments

Comments
 (0)