Skip to content

Commit

Permalink
[L1-3] Rewrite note about *args; use len, not shape
Browse files Browse the repository at this point in the history
  • Loading branch information
mesnardo committed Aug 28, 2018
1 parent b885847 commit 64ee730
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lessons/01_phugoid/01_03_PhugoidFullModel.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"**Note**—We use the argument `*args` in the signature of the function `euler_step()` that is, then, passed to the function `f()`. `*args` is used to pass an arbitrary number of arguments to the function `f()`. Doing so, now, our function `euler_step()` can be used with any function `f()`, regardless the number of arguments this function takes. Sweet! (Read the Python documentation about [Arbitrary Argument Lists](https://docs.python.org/3/tutorial/controlflow.html#arbitrary-argument-lists) for more explanations.)"
"**Note**—We use an optional input to the function `euler_step()`, named `*args`. It passes to the function `f()` an arbitrary number of arguments. Doing so, `euler_step()` can take any function `f()`, regardless of the number of arguments this function needs. Sweet! (Read the Python documentation about [Arbitrary Argument Lists](https://docs.python.org/3/tutorial/controlflow.html#arbitrary-argument-lists) for more explanations.)"
]
},
{
Expand Down Expand Up @@ -546,8 +546,8 @@
" The difference between the two solutions in the L1-norm\n",
" scaled by the time-step size.\n",
" \"\"\"\n",
" N_coarse = u_coarse.shape[0]\n",
" N_fine = u_fine.shape[0]\n",
" N_coarse = len(u_coarse)\n",
" N_fine = len(u_fine)\n",
" ratio = math.ceil(N_fine / N_coarse)\n",
" diff = dt * numpy.sum(numpy.abs(u_coarse - u_fine[::ratio]))\n",
" return diff"
Expand Down

0 comments on commit 64ee730

Please sign in to comment.