From db8e7428d3710b1506acb7d34664971be8635395 Mon Sep 17 00:00:00 2001 From: Thomas Kluyver Date: Mon, 26 Jan 2015 09:57:28 -0800 Subject: [PATCH 1/2] Make Lorenz differential equations example compatible with Python 3 Thanks to @franktoffel for pointing this out in #7350 --- .../Lorenz Differential Equations.ipynb | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/examples/Interactive Widgets/Lorenz Differential Equations.ipynb b/examples/Interactive Widgets/Lorenz Differential Equations.ipynb index 4fdfac4b5..a179d3d9b 100644 --- a/examples/Interactive Widgets/Lorenz Differential Equations.ipynb +++ b/examples/Interactive Widgets/Lorenz Differential Equations.ipynb @@ -111,8 +111,9 @@ " ax.set_ylim((-35, 35))\n", " ax.set_zlim((5, 55))\n", " \n", - " def lorenz_deriv((x, y, z), t0, sigma=sigma, beta=beta, rho=rho):\n", + " def lorenz_deriv(x_y_z, t0, sigma=sigma, beta=beta, rho=rho):\n", " \"\"\"Compute the time-derivative of a Lorentz system.\"\"\"\n", + " x, y, z = x_y_z\n", " return [sigma * (y - x), x * (rho - z) - y, x * y - beta * z]\n", "\n", " # Choose random starting points, uniformly distributed from -15 to 15\n", @@ -13428,7 +13429,12 @@ ] } ], - "metadata": {}, + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "name": "python3" + } + }, "nbformat": 4, "nbformat_minor": 0 -} \ No newline at end of file +} From 46cb0233daf1985d03f32f72209ed2da8c3efd9a Mon Sep 17 00:00:00 2001 From: Thomas Kluyver Date: Mon, 26 Jan 2015 10:07:49 -0800 Subject: [PATCH 2/2] Fix typo Lorentz -> Lorenz --- .../Lorenz Differential Equations.ipynb | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/examples/Interactive Widgets/Lorenz Differential Equations.ipynb b/examples/Interactive Widgets/Lorenz Differential Equations.ipynb index a179d3d9b..1a3decaa1 100644 --- a/examples/Interactive Widgets/Lorenz Differential Equations.ipynb +++ b/examples/Interactive Widgets/Lorenz Differential Equations.ipynb @@ -112,7 +112,7 @@ " ax.set_zlim((5, 55))\n", " \n", " def lorenz_deriv(x_y_z, t0, sigma=sigma, beta=beta, rho=rho):\n", - " \"\"\"Compute the time-derivative of a Lorentz system.\"\"\"\n", + " \"\"\"Compute the time-derivative of a Lorenz system.\"\"\"\n", " x, y, z = x_y_z\n", " return [sigma * (y - x), x * (rho - z) - y, x * y - beta * z]\n", "\n", @@ -13433,6 +13433,18 @@ "kernelspec": { "display_name": "Python 3", "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.4.2" } }, "nbformat": 4,