{ "metadata": { "name": "", "signature": "sha256:f210f09ecd181dffaa696ef401f8613f70d69991ee9360b45edcfd7a6f62b7b6" }, "nbformat": 3, "nbformat_minor": 0, "worksheets": [ { "cells": [ { "cell_type": "heading", "level": 1, "metadata": {}, "source": [ "Custom Display Logic" ] }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Overview" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "As described in the [Rich Output](Rich Output.ipynb) tutorial, the IPython display system can display rich representations of objects in the following formats:\n", "\n", "* JavaScript\n", "* HTML\n", "* PNG\n", "* JPEG\n", "* SVG\n", "* LaTeX\n", "* PDF\n", "\n", "This Notebook shows how you can add custom display logic to your own classes, so that they can be displayed using these rich representations. There are two ways of accomplishing this:\n", "\n", "1. Implementing special display methods such as `_repr_html_` when you define your class.\n", "2. Registering a display function for a particular existing class.\n", "\n", "This Notebook describes and illustrates both approaches." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Import the IPython display functions." ] }, { "cell_type": "code", "collapsed": false, "input": [ "from IPython.display import (\n", " display, display_html, display_png, display_svg\n", ")" ], "language": "python", "metadata": {}, "outputs": [], "prompt_number": 7 }, { "cell_type": "markdown", "metadata": {}, "source": [ "Parts of this notebook need the matplotlib inline backend:" ] }, { "cell_type": "code", "collapsed": false, "input": [ "%matplotlib inline\n", "import numpy as np\n", "import matplotlib.pyplot as plt" ], "language": "python", "metadata": {}, "outputs": [], "prompt_number": 1 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Special display methods" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The main idea of the first approach is that you have to implement special display methods when you define your class, one for each representation you want to use. Here is a list of the names of the special methods and the values they must return:\n", "\n", "* `_repr_html_`: return raw HTML as a string\n", "* `_repr_json_`: return raw JSON as a string\n", "* `_repr_jpeg_`: return raw JPEG data\n", "* `_repr_png_`: return raw PNG data\n", "* `_repr_svg_`: return raw SVG data as a string\n", "* `_repr_latex_`: return LaTeX commands in a string surrounded by \"$\"." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "As an illustration, we build a class that holds data generated by sampling a Gaussian distribution with given mean and standard deviation. Here is the definition of the `Gaussian` class, which has a custom PNG and LaTeX representation." ] }, { "cell_type": "code", "collapsed": false, "input": [ "from IPython.core.pylabtools import print_figure\n", "from IPython.display import Image, SVG, Math\n", "\n", "class Gaussian(object):\n", " \"\"\"A simple object holding data sampled from a Gaussian distribution.\n", " \"\"\"\n", " def __init__(self, mean=0.0, std=1, size=1000):\n", " self.data = np.random.normal(mean, std, size)\n", " self.mean = mean\n", " self.std = std\n", " self.size = size\n", " # For caching plots that may be expensive to compute\n", " self._png_data = None\n", " \n", " def _figure_data(self, format):\n", " fig, ax = plt.subplots()\n", " ax.hist(self.data, bins=50)\n", " ax.set_title(self._repr_latex_())\n", " ax.set_xlim(-10.0,10.0)\n", " data = print_figure(fig, format)\n", " # We MUST close the figure, otherwise IPython's display machinery\n", " # will pick it up and send it as output, resulting in a double display\n", " plt.close(fig)\n", " return data\n", " \n", " def _repr_png_(self):\n", " if self._png_data is None:\n", " self._png_data = self._figure_data('png')\n", " return self._png_data\n", " \n", " def _repr_latex_(self):\n", " return r'$\\mathcal{N}(\\mu=%.2g, \\sigma=%.2g),\\ N=%d$' % (self.mean,\n", " self.std, self.size)" ], "language": "python", "metadata": {}, "outputs": [], "prompt_number": 37 }, { "cell_type": "markdown", "metadata": {}, "source": [ "Create an instance of the Gaussian distribution and return it to display the default representation:" ] }, { "cell_type": "code", "collapsed": false, "input": [ "x = Gaussian(2.0, 1.0)\n", "x" ], "language": "python", "metadata": {}, "outputs": [ { "latex": [ "$\\mathcal{N}(\\mu=2, \\sigma=1),\\ N=1000$" ], "metadata": {}, "output_type": "pyout", "png": "iVBORw0KGgoAAAANSUhEUgAAAXIAAAENCAYAAAASUO4dAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAGolJREFUeJzt3XtwlNUdxvFnMUGhkgkpuKHANJoQIreQGE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XfJZdcogULFnR6/uTkZI0ZM0aS9Pe//10FBQUaP378Wfetrq7WY489poMHD+rdd9+Vy+XSTTfd\npNmzZ4d1zlPa/kxtDRw4UNXV1SEdY/v27SooKNCYMWP08MMPa/v27crPzz/j2F2traGhQRdccEHw\nft++fXX06FE5HI6wtiPx0LUCHT16VOeff76Ki4u1du1a/fe//1VlZaUmTJgQ3Ke1tbXdc9566y19\n+9vflnSy5fjWW29F3Io+paGhQX/4wx+0fPnysz5eV1en2bNn649//KM2btyooqIiLV++PBjikeio\nRd6vXz81NzeHdIz33ntP48aNU58+fXTffffp+eef10cffaSRI0dGXNfZahswYEC7bcePH1daWlrY\n25F4aJH3ckeOHFH//v0lnQyK66+/XosXL9Y3v/lN3X///cH9kpLav1XWrFmj6667TpK0Y8cOjR07\n9oxjh9OVYIyRx+PRiy++qAsvvFCffvpp8A/FKb/+9a91//33B1uZX375ZbD2SM4pddwiP3LkSMih\nd+LEieDtWbNmKSsrS6NGjdIDDzwQ1doyMzP17rvvBu8fPnxY+fn5Sk1NDWn7oUOHlJ+fH9LPBMvE\n61NWxFdjY6PZuXOn+e1vf9tuJMO2bdtMSkqKmTdvXrv977jjDtPY2Bi8X1BQYN5//31jjDG//OUv\nze9+9zvz2muvRVzPokWLzLvvvmv8fr955513jM/nM8YYU11dbVpbW40xxsyZM8fs2rXLGHNyRM0j\njzwS8flOWbZs2VlHrTz//PNm/fr1wftt62irubnZeL3edtvuuecec8MNN0S9tqNHj5oxY8YE748b\nN84EAoGwtyPxnFdeXl4e7z8m6H4+n08TJ07UuHHjNGXKlOD2IUOG6IMPPlB+fn671lt9fb2OHTum\niy++WAcPHtSCBQs0cOBANTY26siRI/r888918cUX65JLLgm7li1btmjatGl64YUX9Oyzz2rp0qV6\n4oknlJKSomuuuUYjRoxQVlaWsrKytHr1ah04cEA7d+7U/Pnz1adP5L2Dixcv1vLly/Xee+/pyJEj\nys/PD364+8ILL2j27NnB/4m0reOUrVu36oEHHtC+ffs0YcIEpaSkS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KykiDvAqfT\nqdraWqWnp8vv9+uiiy7q9Dkx7Vpp229WXFysl19+Wc3NzaqpqdGePXv4hDtMfr8/ePvVV19t90k3\nQlNQUKA9e/bok08+UXNzs/785z+ruLg43mVZq6mpSY2NjZKkY8eOae3atbwvu6i4uFher1eS5PV6\nVVJS0vmTov0p7F//+lczbNgwc8EFFxin02muv/764GNPPvmkyczMNCNHjjRr1qyJ9qkT3owZM8zY\nsWPNuHHjzC233GJqa2vjXZKVVq9ebbKzs01mZqZ56qmn4l2O1fbu3Wtyc3NNbm6uGT16NK9nmKZN\nm2aGDBlikpOTzbBhw8zvf/97c/jwYVNUVGRGjBhh3G63qa+v7/Q4TAgCAMuxdBwAWI4gBwDLEeQA\nYDmCHAAsR5ADgOUIcgCwHEEOAJYjyAHAcv8DUrLE4leGVckAAAAASUVORK5CYII=\n", "prompt_number": 43, "text": [ "<__main__.Gaussian at 0x108a39bd0>" ] } ], "prompt_number": 43 }, { "cell_type": "markdown", "metadata": {}, "source": [ "You can also pass the object to the `display` function to display the default representation:" ] }, { "cell_type": "code", "collapsed": false, "input": [ "display(x)" ], "language": "python", "metadata": {}, "outputs": [ { "latex": [ "$\\mathcal{N}(\\mu=2, \\sigma=1),\\ N=1000$" ], "metadata": {}, "output_type": "display_data", "png": "iVBORw0KGgoAAAANSUhEUgAAAXIAAAENCAYAAAASUO4dAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAGolJREFUeJzt3XtwlNUdxvFnMUGhkgkpuKHANJoQIreQGEWttBvD4pWY\nWAdhOpgqOKJ26m2wQG0b6yhL1T9Q2k5FSrcyxeK0RmqRAQoLxVGDXOoFYqhEQbrZAkkwEDQmnP6B\nbBMgZHezm83ZfD8zmey+++77/rJsnhzOnnNehzHGCABgrT7xLgAA0DUEOQBYjiAHAMsR5ABgOYIc\nACxHkAOA5QhyALAcQQ4AliPIEZaampp4lxBTfr9fTU1N8S4DCAtBjnPaunWrcnNzde+996qmpkZv\n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X/4wx+0fPnysz5eV1en2bNn649//KM2btyooqIiLV++PBjikeio\nRd6vXz81NzeHdIz33ntP48aNU58+fXTffffp+eef10cffaSRI0dGXNfZahswYEC7bcePH1daWlrY\n25F4aJH3ckeOHFH//v0lnQyK66+/XosXL9Y3v/lN3X///cH9kpLav1XWrFmj6667TpK0Y8cOjR07\n9oxjh9OVYIyRx+PRiy++qAsvvFCffvpp8A/FKb/+9a91//33B1uZX375ZbD2SM4pddwiP3LkSMih\nd+LEieDtWbNmKSsrS6NGjdIDDzwQ1doyMzP17rvvBu8fPnxY+fn5Sk1NDWn7oUOHlJ+fH9LPBMvE\n61NWxFdjY6PZuXOn+e1vf9tuJMO2bdtMSkqKmTdvXrv977jjDtPY2Bi8X1BQYN5//31jjDG//OUv\nze9+9zvz2muvRVzPokWLzLvvvmv8fr955513jM/nM8YYU11dbVpbW40xxsyZM8fs2rXLGHNyRM0j\njzwS8flOWbZs2VlHrTz//PNm/fr1wftt62irubnZeL3edtvuuecec8MNN0S9tqNHj5oxY8YE748b\nN84EAoGwtyPxnFdeXl4e7z8m6H4+n08TJ07UuHHjNGXKlOD2IUOG6IMPPlB+fn671lt9fb2OHTum\niy++WAcPHtSCBQs0cOBANTY26siRI/r888918cUX65JLLgm7li1btmjatGl64YUX9Oyzz2rp0qV6\n4oknlJKSomuuuUYjRoxQVlaWsrKytHr1ah04cEA7d+7U/Pnz1adP5L2Dixcv1vLly/Xee+/pyJEj\nys/PD364+8ILL2j27NnB/4m0reOUrVu36oEHHtC+ffs0YcIEpaSkSDrZF378+HFNnDgxqrUNGDBA\nAwYM0N/+9jf5fD5NmTJFV111lfr27RvWdiSgzpK+qqrKjB8/PviVkpJiFi1aZA4fPmwmTZpkRowY\nYdxut6mvr++OPzyIotra2pD3ra+vNz/96U+NMca89NJLZv78+bEqq50vv/zSbN68uVvOdcrx48fN\nQw89FPc6gFB12pwZOXKkduzYoR07dmjbtm3q37+/SktL5fF45Ha7VV1draKiInk8nu74u4Mocjqd\nI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233GJqa2vjXZKVVq9ebbKzs01mZqZ56qmn4l2O1fbu3Wtyc3NNbm6uGT16NK9nmKZN\nm2aGDBlikpOTzbBhw8zvf/97c/jwYVNUVGRGjBhh3G63qa+v7/Q4TAgCAMuxdBwAWI4gBwDLEeQA\nYDmCHAAsR5ADgOUIcgCwHEEOAJYjyAHAcv8DUrLE4leGVckAAAAASUVORK5CYII=\n", "text": [ "<__main__.Gaussian at 0x108a39bd0>" ] } ], "prompt_number": 44 }, { "cell_type": "markdown", "metadata": {}, "source": [ "Use `display_png` to view the PNG representation:" ] }, { "cell_type": "code", "collapsed": false, "input": [ "display_png(x)" ], "language": "python", "metadata": {}, "outputs": [ { "metadata": {}, "output_type": "display_data", "png": "iVBORw0KGgoAAAANSUhEUgAAAXIAAAENCAYAAAASUO4dAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAGolJREFUeJzt3XtwlNUdxvFnMUGhkgkpuKHANJoQIreQGEWttBvD4pWY\nWAdhOpgqOKJ26m2wQG0b6yhL1T9Q2k5FSrcyxeK0RmqRAQoLxVGDXOoFYqhEQbrZAkkwEDQmnP6B\nbBMgZHezm83ZfD8zmey+++77/rJsnhzOnnNehzHGCABgrT7xLgAA0DUEOQBYjiAHAMsR5ABgOYIc\nACxHkAOA5QhyALAcQQ4AliPIEZaampp4lxBTfr9fTU1N8S4DCAtBjnPaunWrcnNzde+996qmpkZv\nv/12vEuKqcGDB+tXv/pVvMsAwuJgij4kafbs2frOd76jGTNmtNt+77336tZbb9Xll1+uBQsWaOHC\nhTE5/5/+9Cf5/X5VVlaqtLRU06ZNi8l5Trdz504tX75czzzzTHDb1q1btXv3bt1xxx3dUkNHzlZb\nRUWFdu3apT59+mjo0KHBf69wtyPBGMAYc+WVV5rbbrut3bYPPvjArF692hhjzM6dO81zzz0Xk3Pv\n2bMneOyDBw+a1NRUs3fv3picq61nn33WlJaWmh/+8IdnPDZjxoyQj/P222+bkpISM3ToUPPVV18Z\nY4ypra01t99+u7npppvMm2++GZXaGhoaTH5+fvD+lVdeaQ4dOhTW9oMHD4ZdC3o+ulag1tZWTZo0\nSRs2bNAXX3wR3O7z+XTttddKkl5//fXg7Wj78MMPg90ZgwYNUlZWlrZt2xaTc7X18MMP65Zbbjnr\nY4MHD9a///3vkI4zYcIEXX/99crOztZf/vIXSZLT6dTNN9+sV155RVdffXVUatu8ebNGjRoVvJ+b\nm6sNGzaEtX3jxo1h14KeLyneBSD+PvzwQxUVFWnnzp164403VFpaKkk6fvy4zj//fEknuxvmz58f\n1nH37t2rJUuWdPj4lVdeqVtuuUU33nij3njjDUmSMUZ+v19ZWVkR/SyhnvMU00HPYm5urrZt2xZS\nHSdOnFBycrJ+/OMf6+mnn9btt98uSTp27Jj69esXtdo+++wzpaamBu+npqZqz549SktLC2s7Eg9B\nDlVWVmrGjBmaNm2aVqxYodLSUn355Zfq27dvcJ+mpiY5HI7g/dbWVn3ve9/Tli1bJEkzZ87UvHnz\n2gXfJZdcogULFnR6/uTkZI0ZM0aS9Pe//10FBQUaP378Wfetrq7WY489poMHD+rdd9+Vy+XSTTfd\npNmzZ4d1zlPa/kxtDRw4UNXV1SEdY/v27SooKNCYMWP08MMPa/v27crPzz/j2F2traGhQRdccEHw\nft++fXX06FE5HI6wtiPx0LUCHT16VOeff76Ki4u1du1a/fe//1VlZaUmTJgQ3Ke1tbXdc9566y19\n+9vflnSy5fjWW29F3Io+paGhQX/4wx+0fPnysz5eV1en2bNn649//KM2btyooqIiLV++PBjikeio\nRd6vXz81NzeHdIz33ntP48aNU58+fXTffffp+eef10cffaSRI0dGXNfZahswYEC7bcePH1daWlrY\n25F4aJH3ckeOHFH//v0lnQyK66+/XosXL9Y3v/lN3X///cH9kpLav1XWrFmj6667TpK0Y8cOjR07\n9oxjh9OVYIyRx+PRiy++qAsvvFCffvpp8A/FKb/+9a91//33B1uZX375ZbD2SM4pddwiP3LkSMih\nd+LEieDtWbNmKSsrS6NGjdIDDzwQ1doyMzP17rvvBu8fPnxY+fn5Sk1NDWn7oUOHlJ+fH9LPBMvE\n61NWxFdjY6PZuXOn+e1vf9tuJMO2bdtMSkqKmTdvXrv977jjDtPY2Bi8X1BQYN5//31jjDG//OUv\nze9+9zvz2muvRVzPokWLzLvvvmv8fr955513jM/nM8YYU11dbVpbW40xxsyZM8fs2rXLGHNyRM0j\njzwS8flOWbZs2VlHrTz//PNm/fr1wftt62irubnZeL3edtvuuecec8MNN0S9tqNHj5oxY8YE748b\nN84EAoGwtyPxnFdeXl4e7z8m6H4+n08TJ07UuHHjNGXKlOD2IUOG6IMPPlB+fn671lt9fb2OHTum\niy++WAcPHtSCBQs0cOBANTY26siRI/r888918cUX65JLLgm7li1btmjatGl64YUX9Oyzz2rp0qV6\n4oknlJKSomuuuUYjRoxQVlaWsrKytHr1ah04cEA7d+7U/Pnz1adP5L2Dixcv1vLly/Xee+/pyJEj\nys/PD364+8ILL2j27NnB/4m0reOUrVu36oEHHtC+ffs0YcIEpaSkSDrZF378+HFNnDgxqrUNGDBA\nAwYM0N/+9jf5fD5NmTJFV111lfr27RvWdiSgzpK+qqrKjB8/PviVkpJiFi1aZA4fPmwmTZpkRowY\nYdxut6mvr++OPzyIotra2pD3ra+vNz/96U+NMca89NJLZv78+bEqq50vv/zSbN68uVvOdcrx48fN\nQw89FPc6gFB12pwZOXKkduzYoR07dmjbtm3q37+/SktL5fF45Ha7VV1draKiInk8nu74u4Mocjqd\nIe+bmpqqQYMG6dChQ6qsrNStt94aw8r+79VXX41oHHZXvPzyy7rnnnviXgcQqrCm6K9du1ZPPPGE\n/vnPfyonJ0ebNm2S0+lUbW2tXC6XqqqqYlkr4swYoxdffFF33313vEuJmf3792v79u0dThQCeqKw\ngvyuu+5SQUGB7rvvPg0cOFD19fWSTv6Cp6WlBe8DALpPyEHe3NysoUOHateuXRo8eHC7IJektLQ0\n1dXVxaxQAMDZhTyO/I033tBll12mwYMHS1KwSyU9PV1+v18XXXTRGc/JysrSxx9/HL1qAaAXyMzM\nDH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H374ocnNzTXN\nzc2mpqbGZGZmmtbW1mifPqGVl5ebZ599Nt5lWK2lpcVkZmaampoa09zcbHJzc82uXbviXZbVMjIy\nzOHDh+NdhpU2b95stm/fbsaMGRPcNmfOHLNw4UJjjDEej8f85Cc/6fQ4UW+R5+TkKDs7+4ztr732\nmqZPn67k5GRlZGQoKytLlZWV0T59wjP0hHUJE9lig/dlZCZOnKiBAwe227Zq1SqVlZVJksrKylRR\nUdHpcbptEO5//vOfdsMTmUAUmeeff165ubmaOXNmaP/lQjtMZIs+h8OhSZMmqaCgQEuWLIl3OdYL\nBAJyOp2SJKfTqUAg0OlzIhq14na7VVtbe8b2p556SlOmTAn5OIw7PVNHr+2TTz6pe++9Vz//+c8l\nST/72c/0yCOPaOnSpd1dotV4z0Xfm2++qSFDhujgwYNyu93KycnRxIkT411WQji5LELn79mIgnzd\nunVhP+f0CUSfffaZhg4dGsnpE1qor+2sWbPC+qOJk0KZyIbwDBkyRJI0ePBglZaWqrKykiDvAqfT\nqdraWqWnp8vv9+uiiy7q9Dkx7Vpp229WXFysl19+Wc3NzaqpqdGePXv4hDtMfr8/ePvVV19t90k3\nQlNQUKA9e/bok08+UXNzs/785z+ruLg43mVZq6mpSY2NjZKkY8eOae3atbwvu6i4uFher1eS5PV6\nVVJS0vmTov0p7F//+lczbNgwc8EFFxin02muv/764GNPPvmkyczMNCNHjjRr1qyJ9qkT3owZM8zY\nsWPNuHHjzC233GJqa2vjXZKVVq9ebbKzs01mZqZ56qmn4l2O1fbu3Wtyc3NNbm6uGT16NK9nmKZN\nm2aGDBlikpOTzbBhw8zvf/97c/jwYVNUVGRGjBhh3G63qa+v7/Q4TAgCAMuxdBwAWI4gBwDLEeQA\nYDmCHAAsR5ADgOUIcgCwHEEOAJYjyAHAcv8DUrLE4leGVckAAAAASUVORK5CYII=\n" } ], "prompt_number": 45 }, { "cell_type": "markdown", "metadata": {}, "source": [ "
display
and display_png
. The former computes all representations of the object, and lets the notebook UI decide which to display. The later only computes the PNG representation.\n",
"