From 8416da7fdcab388a43dd3fa2e23fd349627ff699 Mon Sep 17 00:00:00 2001 From: Roger Labbe Date: Tue, 27 Jan 2015 09:51:52 -0800 Subject: [PATCH] Moved Chapter 2 as part of reorg --- 02_Discrete_Bayes/README.md | 2 -- ...crete_bayes.ipynb => 02_discrete_bayes.ipynb | 14 +++++++------- .../no_info.gif => animations/02_no_info.gif | Bin .../simulate.gif => animations/02_simulate.gif | Bin .../discrete_bayes_animations.ipynb | 16 ++++++++-------- code/book_format.py | 8 ++++---- 6 files changed, 19 insertions(+), 21 deletions(-) delete mode 100644 02_Discrete_Bayes/README.md rename 02_Discrete_Bayes/discrete_bayes.ipynb => 02_discrete_bayes.ipynb (99%) rename 02_Discrete_Bayes/no_info.gif => animations/02_no_info.gif (100%) rename 02_Discrete_Bayes/simulate.gif => animations/02_simulate.gif (100%) rename {02_Discrete_Bayes => animations}/discrete_bayes_animations.ipynb (98%) diff --git a/02_Discrete_Bayes/README.md b/02_Discrete_Bayes/README.md deleted file mode 100644 index d041551..0000000 --- a/02_Discrete_Bayes/README.md +++ /dev/null @@ -1,2 +0,0 @@ -You may read this book online via nbviewer by using this link: -[*Read Online Now*](http://nbviewer.ipython.org/github/rlabbe/Kalman-and-Bayesian-Filters-in-Python/blob/master/table_of_contents.ipynb) diff --git a/02_Discrete_Bayes/discrete_bayes.ipynb b/02_discrete_bayes.ipynb similarity index 99% rename from 02_Discrete_Bayes/discrete_bayes.ipynb rename to 02_discrete_bayes.ipynb index 0820667..24198bc 100644 --- a/02_Discrete_Bayes/discrete_bayes.ipynb +++ b/02_discrete_bayes.ipynb @@ -1,7 +1,7 @@ { "metadata": { "name": "", - "signature": "sha256:ddf0e480bb79058d902cbf898ce123b461e76d9f9ed6f40d87c00a2d973cb721" + "signature": "sha256:91108c3755b10babb902a5c6bcf9bba324a0fda3d1f3e5fb51cf65f3665c51e1" }, "nbformat": 3, "nbformat_minor": 0, @@ -32,7 +32,7 @@ "from __future__ import division, print_function\n", "import matplotlib.pyplot as plt\n", "import sys\n", - "sys.path.insert(0, '../code') # allow us to format the book\n", + "sys.path.insert(0, './code') # allow us to format the book\n", "import book_format\n", "book_format.load_style()" ], @@ -259,13 +259,13 @@ ], "metadata": {}, "output_type": "pyout", - "prompt_number": 1, + "prompt_number": 2, "text": [ - "" + "" ] } ], - "prompt_number": 1 + "prompt_number": 2 }, { "cell_type": "markdown", @@ -825,7 +825,7 @@ "metadata": {}, "source": [ "And, if you are viewing this on the web or in IPython Notebook, here is an animation of that output.\n", - " " + "" ] }, { @@ -1005,7 +1005,7 @@ "metadata": {}, "source": [ "Finally, for those viewing this in a Notebook or on the web, here is an animation of that algorithm.\n", - " " + "" ] }, { diff --git a/02_Discrete_Bayes/no_info.gif b/animations/02_no_info.gif similarity index 100% rename from 02_Discrete_Bayes/no_info.gif rename to animations/02_no_info.gif diff --git a/02_Discrete_Bayes/simulate.gif b/animations/02_simulate.gif similarity index 100% rename from 02_Discrete_Bayes/simulate.gif rename to animations/02_simulate.gif diff --git a/02_Discrete_Bayes/discrete_bayes_animations.ipynb b/animations/discrete_bayes_animations.ipynb similarity index 98% rename from 02_Discrete_Bayes/discrete_bayes_animations.ipynb rename to animations/discrete_bayes_animations.ipynb index c204107..34d885a 100644 --- a/02_Discrete_Bayes/discrete_bayes_animations.ipynb +++ b/animations/discrete_bayes_animations.ipynb @@ -1,7 +1,7 @@ { "metadata": { "name": "", - "signature": "sha256:f7617d896ab55b01e8388aebbb8383939bbad41d33a202d0a073d2fca46d8ec8" + "signature": "sha256:8ca39e02795ea489851809c56e3e92eaf9d7fe6e5fb1b83cde4ac7605fcdccb0" }, "nbformat": 3, "nbformat_minor": 0, @@ -25,7 +25,7 @@ "import sys\n", "sys.path.insert(0,'../code') # allow us to format the book\n", "import book_format\n", - "book_format.load_style()" + "book_format.load_style(directory='..')" ], "language": "python", "metadata": {}, @@ -252,7 +252,7 @@ "output_type": "pyout", "prompt_number": 1, "text": [ - "" + "" ] } ], @@ -343,7 +343,7 @@ "fig = plt.figure(figsize=(6.5, 2.5))\n", "anim = animation.FuncAnimation(fig, bar_animate,\n", " frames=100, interval=75)\n", - "anim.save('no_info.gif', writer='imagemagick')" + "anim.save('02_no_info.gif', writer='imagemagick')" ], "language": "python", "metadata": {}, @@ -353,7 +353,7 @@ "output_type": "display_data", "png": "iVBORw0KGgoAAAANSUhEUgAAAbgAAACsCAYAAAAJ+rmKAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAADWBJREFUeJzt3X3MnXddx/H3Zy0TCuNMWBzS3aQolW1RZDyUBeRBrdJN\n3ZQYZwWNaGBGixijDvgD/zCR8AeRkOEy5rYMhdUwQEscHcFNBMFJYQ+MtaYdNLYFJk87hIeZ1n39\n41xrDnfb+5z77rl7nf58v5Km18Mv5/rk7n3O5/yu6zqnqSokSWrNGX0HkCRpNVhwkqQmWXCSpCZZ\ncJKkJllwkqQmWXCSpCZNLLgkNyR5MMnnlhjzjiR7k9yT5KLZRpQkafmmmcHdCGw50c4klwLPqKqN\nwGuBa2aUTZKkFZtYcFX1ceCbSwy5DLipG3sncHaSc2cTT5KklVk7g8dYDxwYWz8InAc8+OiG4XDo\n16VIklbNYDDI4m2zuslk8QNbaJKkXs2i4A4BC2Pr53XbJEnqzSxOUe4AtgHbk1wMPFRVD55o8GAw\nmMEhJUn/3w2HwyX3Tyy4JDcDLwXOSXIA+HPgMQBVdW1V3Zrk0iT7gO8Arz7p1JIknaSciv8uZ/wm\nE2dwkqRZGJ/BreZNJpIkzRULTpLUJAtOktQkC06S1CQLTpLUJAtOktQkC06S1CQLTpLUJAtOktQk\nC06S1CQLTpLUJAtOktQkC06S1CQLTpLUJAtOktQkC06S1CQLTpLUJAtOktQkC06S1KSJBZdkS5I9\nSfYmueo4+89JsjPJ3UnuS/Lbq5JUkqRlWLLgkqwBrga2ABcCW5NcsGjYNuCuqno28DLgbUnWrkJW\nSZKmNmkGtwnYV1X7q+owsB24fNGYLwNP7JafCHy9qo7MNqYkSc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SUUl+EfjvqrqLOZ4hAS+qqouAS4A/6E6fz5O1wHOA\nv66q5zC68/oN/UY6viRnAr8EvK/vLOOS/CjwR8AGRmdinpDklb2GWqSq9gBvBT4CfBi4ix7eGJ4O\nBTfNh801QZLHAO8H/q6q/qHvPEvpTln9E/C8vrOMeSFwWXeN62bgZ5K8u+dMx6iqL3d/fxX4IKNT\n/PPkIHCwqj7drd/CqPDm0SXAZ7qf5Tx5HvDJqvp6VR0BPsDo93OuVNUNVfW8qnop8BCjeylOqdOh\n4I5+2Lx7R3UFow+Xa0pJAlwP3F9Vb+87z/EkOSfJ2d3y44CfY/Suby5U1ZuqaqGqns7otNXtVfVb\nfecal2RdkrO65ccDPw/M1Z29VfUV4ECSH+s2bQY+32OkpWxl9GZm3uwBLk7yuO65vRmYt9P5JPmh\n7u+nAb9CD6d6J32TSe9O9GHznmN9nyQ3Ay8FnpzkAPDmqrqx51jjXgS8Crg3yaOl8caq2tljpsV+\nGLipu2vtDOBvq+qfe860lHk8dX4u8MHRax5rgfdU1Uf6jXRcrwPe071hfYA5/HKI7g3CZmDurmNW\n1T3d2YNdjE77fRZ4V7+pjuuWJE9mdEPM71fVt051gLn/mIAkSStxOpyilCRp2Sw4SVKTLDhJUpMs\nOElSkyw4SVKTLDhJUpMsOElSk/4Po5u82b9IDysAAAAASUVORK5CYII=\n", "text": [ - "" + "" ] } ], @@ -363,7 +363,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - " " + "" ] }, { @@ -390,7 +390,7 @@ "fig = plt.figure(figsize=(6.5, 2.5))\n", "anim = animation.FuncAnimation(fig, bar_animate,\n", " frames=60, interval=75)\n", - "anim.save('simulate.gif', writer='imagemagick')" + "anim.save('02_simulate.gif', writer='imagemagick')" ], "language": "python", "metadata": {}, @@ -400,7 +400,7 @@ "output_type": "display_data", "png": "iVBORw0KGgoAAAANSUhEUgAAAbgAAACsCAYAAAAJ+rmKAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t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7Gfz/\nnChVdWNVPb+qXgo8xOBailPqdCi44zebd6+ormBwc7mWKEmAG4D7q+ptfedZSJJzk5zTPX488LMM\nXvVNhKp6Y1VNV9UzGCxbfaSqfrPvXMOSrEtydvf4CcDPARN1ZW9VfRk4lOTHul1bgM/1GGkx2xm8\nmJk0M8AlSR7ffW9vASZtOZ8kP9T9/XTgl+lhqXfif6P3iW427znW90lyC/BS4ClJDgFvqqqbeo41\n7EXAlcC9SR4pjTdU1d4eM833w8DN3VVrZwB/W1X/3HOmxUzi0vl5wAcGP/NYC7y7qj7Ub6QFvRZ4\nd/eC9QEm8M0huhcIW4CJO49ZVfd0qwf7GCz7fQZ4Z7+pFnRrkqcwuCDm96vqm6c6wMTfJiBJ0kqc\nDkuUkiQtmwUnSWqSBSdJapIFJ0lqkgUnSWqSBSdJapIFJ0lq0v8ByVyjNXG2/lYAAAAASUVORK5C\nYII=\n", "text": [ - "" + "" ] } ], diff --git a/code/book_format.py b/code/book_format.py index 98fdd86..d49aef1 100644 --- a/code/book_format.py +++ b/code/book_format.py @@ -64,14 +64,14 @@ def _decode_dict(data): return rv -def load_style(name='./styles/custom2.css'): +def load_style(directory = '.', name='/styles/custom2.css'): if sys.version_info[0] >= 3: - s = json.load( open("./code/538.json")) + s = json.load(open(directory + "/code/538.json")) else: - s = json.load( open("./code/538.json"), object_hook=_decode_dict) + s = json.load(open(directory + "/code/538.json"), object_hook=_decode_dict) plt.rcParams.update(s) reset_axis () np.set_printoptions(suppress=True) - styles = open(name, 'r').read() + styles = open(directory + name, 'r').read() return HTML(styles)