Skip to content

Commit 8d70a27

Browse files
committed
update for loop doc and api
1 parent b51f5e8 commit 8d70a27

File tree

3 files changed

+147
-142
lines changed

3 files changed

+147
-142
lines changed

brainpy/math/controls.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -785,6 +785,10 @@ def _body_fun(op):
785785
if not isinstance(static_vals, (tuple, list)):
786786
static_vals = (static_vals, )
787787
new_vals = body_fun(*static_vals)
788+
if new_vals is None:
789+
new_vals = tuple()
790+
if not isinstance(new_vals, tuple):
791+
new_vals = (new_vals, )
788792
return [v.value for v in dyn_vars], new_vals
789793

790794
def _cond_fun(op):

docs/tutorial_building/build_conductance_neurons.ipynb

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,7 @@
3636
]
3737
},
3838
{
39-
"cell_type": "code",
40-
"execution_count": null,
41-
"outputs": [],
39+
"cell_type": "markdown",
4240
"source": [
4341
"On the other hand, simplified models do not care about the physiological features of neurons but mainly focus on how to reproduce the exact spike timing. Therefore, they are more simplified and maybe not biologically explicable.\n",
4442
"\n",
@@ -47,21 +45,19 @@
4745
"metadata": {
4846
"collapsed": false,
4947
"pycharm": {
50-
"name": "#%%\n"
48+
"name": "#%% md\n"
5149
}
5250
}
5351
},
5452
{
55-
"cell_type": "code",
56-
"execution_count": null,
57-
"outputs": [],
53+
"cell_type": "markdown",
5854
"source": [
5955
"## Building an ion channel"
6056
],
6157
"metadata": {
6258
"collapsed": false,
6359
"pycharm": {
64-
"name": "#%%\n"
60+
"name": "#%% md\n"
6561
}
6662
}
6763
},
@@ -436,17 +432,6 @@
436432
"source": [
437433
"By combining different ion channels, we can get different types of conductance-based neuron models easily and straightforwardly. To see all predifined channel models in BrainPy, please click [here](../apis/dyn.rst)."
438434
]
439-
},
440-
{
441-
"cell_type": "code",
442-
"execution_count": null,
443-
"metadata": {
444-
"pycharm": {
445-
"name": "#%%\n"
446-
}
447-
},
448-
"outputs": [],
449-
"source": []
450435
}
451436
],
452437
"metadata": {

0 commit comments

Comments
 (0)