Skip to content

Commit

Permalink
update for loop doc and api
Browse files Browse the repository at this point in the history
  • Loading branch information
chaoming0625 committed Sep 14, 2022
1 parent b51f5e8 commit 8d70a27
Show file tree
Hide file tree
Showing 3 changed files with 147 additions and 142 deletions.
4 changes: 4 additions & 0 deletions brainpy/math/controls.py
Original file line number Diff line number Diff line change
Expand Up @@ -785,6 +785,10 @@ def _body_fun(op):
if not isinstance(static_vals, (tuple, list)):
static_vals = (static_vals, )
new_vals = body_fun(*static_vals)
if new_vals is None:
new_vals = tuple()
if not isinstance(new_vals, tuple):
new_vals = (new_vals, )
return [v.value for v in dyn_vars], new_vals

def _cond_fun(op):
Expand Down
23 changes: 4 additions & 19 deletions docs/tutorial_building/build_conductance_neurons.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,7 @@
]
},
{
"cell_type": "code",
"execution_count": null,
"outputs": [],
"cell_type": "markdown",
"source": [
"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",
"\n",
Expand All @@ -47,21 +45,19 @@
"metadata": {
"collapsed": false,
"pycharm": {
"name": "#%%\n"
"name": "#%% md\n"
}
}
},
{
"cell_type": "code",
"execution_count": null,
"outputs": [],
"cell_type": "markdown",
"source": [
"## Building an ion channel"
],
"metadata": {
"collapsed": false,
"pycharm": {
"name": "#%%\n"
"name": "#%% md\n"
}
}
},
Expand Down Expand Up @@ -436,17 +432,6 @@
"source": [
"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)."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"pycharm": {
"name": "#%%\n"
}
},
"outputs": [],
"source": []
}
],
"metadata": {
Expand Down
Loading

0 comments on commit 8d70a27

Please sign in to comment.