Skip to content

Commit 977d076

Browse files
committed
Merge branch 'test_travis' into development
2 parents 9eeeba8 + d66e1ba commit 977d076

8 files changed

Lines changed: 47 additions & 44 deletions

File tree

.github/workflows/non-omv.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: Non OMV tests
22

33
on:
44
push:
5-
branches: [ master, development, experimental ]
5+
branches: [ master, development, experimental, test* ]
66
pull_request:
7-
branches: [ master, development, experimental ]
7+
branches: [ master, development, experimental, test* ]
88

99
jobs:
1010
build:
@@ -16,14 +16,14 @@ jobs:
1616

1717
steps:
1818
- uses: actions/checkout@v2
19-
19+
2020
- name: Set up Python ${{ matrix.python-version }}
2121
uses: actions/setup-python@v2
2222
with:
2323
python-version: ${{ matrix.python-version }}
24-
24+
2525
- name: Test python HH
2626
run: |
2727
pip install scipy matplotlib
2828
cd Tutorial/Source
29-
python HodgkinHuxley.py
29+
python HodgkinHuxley.py

.github/workflows/omv-ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ name: Continuous build using OMV
33

44
on:
55
push:
6-
branches: [ master, development, experimental ]
6+
branches: [ master, development, experimental, test* ]
77
pull_request:
8-
branches: [ master, development, experimental ]
8+
branches: [ master, development, experimental, test* ]
99

1010
jobs:
1111
build:

Tutorial/Source/HodgkinHuxley.py

Lines changed: 2 additions & 7 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-
#advanced input (if checkbox selected)
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-
#basic input
128123
else:
129-
return 10*(t>100) - 10*(t>200) + 35*(t>300) - 35*(t>400)
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):
@@ -164,6 +159,7 @@ def Main(self):
164159
plt.rcParams['figure.figsize'] = [12, 8]
165160
plt.rcParams['font.size'] = 15
166161
plt.rcParams['legend.fontsize'] = 12
162+
plt.rcParams['legend.loc'] = "upper right"
167163

168164
fig=plt.figure()
169165

@@ -189,7 +185,6 @@ def Main(self):
189185
plt.legend()
190186

191187
plt.subplot(4,1,4, sharex = ax1)
192-
193188
plt.plot(self.t, V, 'k')
194189
plt.ylabel('V (mV)')
195190
plt.xlabel('t (ms)')

Tutorial/_media/figure_1.png

13.8 KB
Loading

Tutorial/_toc/Tutorial.rst

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ This variable from `HodgkinHuxley.py <Hodgkin%20Huxley.html>`_:
4848

4949
.. literalinclude:: ../Source/HodgkinHuxley.py
5050
:language: python
51-
:lines: 8-9
51+
:lines: 12-15
5252

5353
Is used in this line in `hhcell.cell.nml <hhcell.html>`_:
5454

@@ -65,11 +65,11 @@ These variables from `HodgkinHuxley.py <Hodgkin%20Huxley.html>`_:
6565

6666
.. literalinclude:: ../Source/HodgkinHuxley.py
6767
:language: python
68-
:lines: 11-12
68+
:lines: 12-13,17-18
6969

7070
.. literalinclude:: ../Source/HodgkinHuxley.py
7171
:language: python
72-
:lines: 20-21
72+
:lines: 26-27
7373

7474
Are used in this line in `hhcell.cell.nml <hhcell.html>`_:
7575

@@ -87,11 +87,11 @@ These variables from `HodgkinHuxley.py <Hodgkin%20Huxley.html>`_:
8787

8888
.. literalinclude:: ../Source/HodgkinHuxley.py
8989
:language: python
90-
:lines: 14-15
90+
:lines: 12-13,20-21
9191

9292
.. literalinclude:: ../Source/HodgkinHuxley.py
9393
:language: python
94-
:lines: 23-24
94+
:lines: 29-30
9595

9696
Are used in this line in `hhcell.cell.nml <hhcell.html>`_:
9797

@@ -108,11 +108,11 @@ These variables from `HodgkinHuxley.py <Hodgkin%20Huxley.html>`_:
108108

109109
.. literalinclude:: ../Source/HodgkinHuxley.py
110110
:language: python
111-
:lines: 17-18
111+
:lines: 12-13,23-24
112112

113113
.. literalinclude:: ../Source/HodgkinHuxley.py
114114
:language: python
115-
:lines: 26-27
115+
:lines: 32-33
116116

117117
Are used in this line in `hhcell.cell.nml <hhcell.html>`_:
118118

@@ -129,7 +129,7 @@ This variable from `HodgkinHuxley.py <Hodgkin%20Huxley.html>`_:
129129

130130
.. literalinclude:: ../Source/HodgkinHuxley.py
131131
:language: python
132-
:lines: 29-30
132+
:lines: 12-13,35-36
133133

134134
Is used in this line in `LEMS_HH_Simulation.xml <LEMS_HH_Simulation.html>`_:
135135

@@ -266,7 +266,7 @@ This line from `HodgkinHuxley.py <Hodgkin%20Huxley.html>`_:
266266

267267
.. literalinclude:: ../Source/HodgkinHuxley.py
268268
:language: python
269-
:lines: 124
269+
:lines: 153
270270

271271
Is used to define the initial values for the model in `hhcell.cell.nml <hhcell.html>`_:
272272

@@ -294,7 +294,7 @@ This line in `HodgkinHuxley.py <Hodgkin%20Huxley.html>`_:
294294

295295
.. literalinclude:: ../Source/HodgkinHuxley.py
296296
:language: python
297-
:lines: 135-138
297+
:lines: 191-194
298298

299299
Is used in these lines in `LEMS_HH_Simulation.xml <LEMS_HH_Simulation.html>`_:
300300

@@ -306,7 +306,7 @@ This line in `HodgkinHuxley.py <Hodgkin%20Huxley.html>`_:
306306

307307
.. literalinclude:: ../Source/HodgkinHuxley.py
308308
:language: python
309-
:lines: 140-145
309+
:lines: 177-182
310310

311311
Is used in these lines in `LEMS_HH_Simulation.xml <LEMS_HH_Simulation.html>`_:
312312

@@ -318,7 +318,7 @@ This line in `HodgkinHuxley.py <Hodgkin%20Huxley.html>`_:
318318

319319
.. literalinclude:: ../Source/HodgkinHuxley.py
320320
:language: python
321-
:lines: 147-152
321+
:lines: 184-189
322322

323323
Is used in these lines in `LEMS_HH_Simulation.xml <LEMS_HH_Simulation.html>`_:
324324

@@ -330,7 +330,7 @@ This line in `HodgkinHuxley.py <Hodgkin%20Huxley.html>`_:
330330

331331
.. literalinclude:: ../Source/HodgkinHuxley.py
332332
:language: python
333-
:lines: 154-158
333+
:lines: 170-175
334334

335335
Is used in these lines in `LEMS_HH_Simulation.xml <LEMS_HH_Simulation.html>`_:
336336

Tutorial/conf.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,4 +270,3 @@
270270
import sphinx_rtd_theme
271271
html_theme = 'sphinx_rtd_theme'
272272
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
273-

notebook/notebook.ipynb

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,13 @@
4848
},
4949
{
5050
"cell_type": "code",
51-
"execution_count": 8,
51+
"execution_count": 1,
5252
"metadata": {},
5353
"outputs": [
5454
{
5555
"data": {
5656
"application/vnd.jupyter.widget-view+json": {
57-
"model_id": "a4fcb2202ee348999f01df623a6598e9",
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": "af43f6c641d140c0a0a4459b17e39637",
71+
"model_id": "814554308e89435dac419867021cf088",
7272
"version_major": 2,
7373
"version_minor": 0
7474
},
@@ -121,8 +121,15 @@
121121
"1) Starting from the bottom, the first (bottom-most) plot shows neural membrane voltage activity. The spikes here are called \"action potentials\" and correspond directly to the current/time plot. Outflux of *Na* directly followed by influx of *K* causes the spiking activity observed in the plot.\n",
122122
"2) The second plot from the bottom shows the activation/inactivation parameters of the ion channels in the neuron. \n",
123123
"3) Third plot from the bottom (the current/time plot) makes this more concrete, showing the influx (negative y-axis) and outflux (positive y-axis) of ions passing through each type of ion channel being modeled.\n",
124-
"4) The top-most plot, shows two currents injected into the cell membrane at times 100ms and 300ms for default values. If injection current is changed from above slider then it will be a single rectangular pulse based on user input."
124+
"4) The top-most plot, shows current injected into the cell membrane at times 150ms for default values. The injection current can be changed from above slider for amplitude, duration and delay."
125125
]
126+
},
127+
{
128+
"cell_type": "code",
129+
"execution_count": null,
130+
"metadata": {},
131+
"outputs": [],
132+
"source": []
126133
}
127134
],
128135
"metadata": {

notebook/ui_widget.py

Lines changed: 14 additions & 12 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
@@ -65,7 +67,7 @@ def highlight_slider():
6567
header_potential = ipywidgets.HTMLMath(value=r"<b> Nernst Reverasal Potentials, \(mV\)</b>")
6668
header_simTime = ipywidgets.HTMLMath(value=r"<b> Simulation Time, \(ms\)</b>")
6769
header_injCurrent = ipywidgets.HTMLMath(value=r"<b> Injection Current, \(\mu{A}/cm^2\)</b>")
68-
injCurrent_note = ipywidgets.HTML(value=f"<i>*For injection current width = 0, the model uses default two pulse signal from tutorial</i>")
70+
injCurrent_note = ipywidgets.HTML(value=f"<i>*For injection current duration = 0, the model uses default pulse signal from tutorial</i>")
6971

7072
#slider widgets
7173
slider_capacitance = ipywidgets.FloatSlider(value=default_capacitance,min=0,max=3,step=0.1,description='Capacitance',readout=False,continuous_update=False)
@@ -76,13 +78,13 @@ def highlight_slider():
7678
slider_pot_K = ipywidgets.FloatSlider(value=default_pot_K,min=-100,max=100,step=0.1,description='Potassium',readout=False,continuous_update=False)
7779
slider_pot_L = ipywidgets.FloatSlider(value=default_pot_L,min=-100,max=100,step=0.1,description='Leak',readout=False,continuous_update=False)
7880
slider_amplitude = ipywidgets.FloatSlider(value=default_amplitude,min=-20,max=200,step=0.1,description='Amplitude',readout=False,continuous_update=False)
79-
slider_width = ipywidgets.FloatSlider(value=default_width,min=0,max=500,step=0.1,description='Width',readout=False,continuous_update=False)
80-
slider_translation = ipywidgets.FloatSlider(value=default_translation,min=0,max=250,step=0.1,description='Start at',readout=False,continuous_update=False)
81+
slider_width = ipywidgets.FloatSlider(value=default_width,min=0,max=500,step=0.1,description='Duration',readout=False,continuous_update=False)
82+
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)