Skip to content

Commit 05802d0

Browse files
authored
Merge pull request #27 from irahulsonkar/master
Updated default injection current
2 parents 2e2f3da + c9c922c commit 05802d0

3 files changed

Lines changed: 15 additions & 18 deletions

File tree

Tutorial/Source/HodgkinHuxley.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -120,13 +120,8 @@ def I_inj(self, t):
120120
return 10*(t>100) - 10*(t>200) + 35*(t>300) - 35*(t>400)
121121

122122
#""" running jupyterLab notebook """
123-
#injection current is defined
124-
elif self.I_inj_width>0:
125-
return self.I_inj_max*(t>self.I_inj_trans) - self.I_inj_max*(t>self.I_inj_trans+self.I_inj_width)
126-
127-
#default injection current
128123
else:
129-
return 10*(t>150) - 10*(t>300)
124+
return self.I_inj_max*(t>self.I_inj_trans) - self.I_inj_max*(t>self.I_inj_trans+self.I_inj_width)
130125

131126
@staticmethod
132127
def dALLdt(X, t, self):

notebook/notebook.ipynb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,13 @@
4848
},
4949
{
5050
"cell_type": "code",
51-
"execution_count": 2,
51+
"execution_count": 1,
5252
"metadata": {},
5353
"outputs": [
5454
{
5555
"data": {
5656
"application/vnd.jupyter.widget-view+json": {
57-
"model_id": "5642c47f493c4f08bcd11f959297b0c6",
57+
"model_id": "1d3c73d3138d47af8f717354d52f302c",
5858
"version_major": 2,
5959
"version_minor": 0
6060
},
@@ -68,7 +68,7 @@
6868
{
6969
"data": {
7070
"application/vnd.jupyter.widget-view+json": {
71-
"model_id": "6521d11af86947c8b2c9fef49c7d6201",
71+
"model_id": "814554308e89435dac419867021cf088",
7272
"version_major": 2,
7373
"version_minor": 0
7474
},

notebook/ui_widget.py

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@
1212
default_pot_K = -77
1313
default_pot_L = -54.387
1414
default_t0 = 0
15-
default_tn = 450
15+
default_tn = 150
1616
default_deltat = 0.01
17-
default_amplitude = 50
18-
default_width = 0
19-
default_translation = 50
17+
default_amplitude = 10
18+
default_width = 100
19+
default_translation = 25
2020

2121
#function to reset input values to default on button click
2222
def resetTodefault(_):
@@ -42,13 +42,14 @@ def showDefault(response):
4242

4343
#function to change slider handle colour when move from default
4444
def highlight_slider():
45-
inputList = [slider_capacitance, slider_cond_Na, slider_cond_K, slider_cond_L, slider_pot_Na, slider_pot_K, slider_pot_L]
46-
inputDefault = [default_capacitance, default_cond_Na, default_cond_K, default_cond_L, default_pot_Na, default_pot_K, default_pot_L]
45+
inputList = [slider_capacitance, slider_cond_Na, slider_cond_K, slider_cond_L, slider_pot_Na, slider_pot_K, slider_pot_L, slider_amplitude, slider_width, slider_translation]
46+
inputDefault = [default_capacitance, default_cond_Na, default_cond_K, default_cond_L, default_pot_Na, default_pot_K, default_pot_L, default_amplitude, default_width, default_translation]
4747
for l, d in zip(inputList,inputDefault):
4848
if l.value == d:
4949
l.style.handle_color = 'white'
5050
else:
5151
l.style.handle_color = 'orange'
52+
"""
5253
if slider_width.value == default_width:
5354
slider_amplitude.style.handle_color = 'white'
5455
slider_width.style.handle_color = 'white'
@@ -57,6 +58,7 @@ def highlight_slider():
5758
slider_amplitude.style.handle_color = 'orange'
5859
slider_width.style.handle_color = 'orange'
5960
slider_translation.style.handle_color = 'orange'
61+
"""
6062

6163
#defining the widgets
6264
#Header or texts as HTMLMath to include symbols
@@ -80,9 +82,9 @@ def highlight_slider():
8082
slider_translation = ipywidgets.FloatSlider(value=default_translation,min=0,max=250,step=0.1,description='Time Delay',readout=False,continuous_update=False)
8183

8284
#text box widgets
83-
time_start = ipywidgets.FloatText(value=0,description='Start Time',disabled=True)
84-
time_end = ipywidgets.FloatText(value=450,description='Total Time',disabled=False)
85-
time_step = ipywidgets.FloatText(value=0.01,description='Time Step',disabled=False)
85+
time_start = ipywidgets.FloatText(value=default_t0,description='Start Time',disabled=True)
86+
time_end = ipywidgets.FloatText(value=default_tn,description='Total Time',disabled=False)
87+
time_step = ipywidgets.FloatText(value=default_deltat,description='Time Step',disabled=False)
8688

8789
#text box widgets to link with sliders (included to type in values for slider inputs also)
8890
textBox_capacitance = ipywidgets.FloatText(value=default_capacitance,step=0.1,layout=ipywidgets.Layout(width='5%'))

0 commit comments

Comments
 (0)