{ "cells": [ { "cell_type": "markdown", "metadata": { "toc": "true" }, "source": [ "# Table of Contents\n", "
" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Test for Binder v2" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Sys & OS modules" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Path (sys.path):\n", "\n", "/usr/lib/python36.zip\n", "/usr/lib/python3.6\n", "/usr/lib/python3.6/lib-dynload\n", "/home/lilian/.local/lib/python3.6/site-packages\n", "/usr/local/lib/python3.6/dist-packages\n", "/usr/local/lib/python3.6/dist-packages/dot2tex-2.11.dev0-py3.6.egg\n", "/usr/local/lib/python3.6/dist-packages/autorun-0.1.dev20171103-py3.6.egg\n", "/usr/local/lib/python3.6/dist-packages/sphinxcontrib_cheeseshop-0.2.dev20171103-py3.6.egg\n", "/usr/local/lib/python3.6/dist-packages/sphinxcontrib_youtube-1.0.dev20171103-py3.6.egg\n", "/usr/local/lib/python3.6/dist-packages/sphinxcontrib_bitbucket-1.0-py3.6.egg\n", "/usr/local/lib/python3.6/dist-packages/sphinxcontrib_googleanalytics-0.1.dev20180228-py3.6.egg\n", "/usr/local/lib/python3.6/dist-packages/sphinxcontrib_gnuplot-0.1.dev20180308-py3.6.egg\n", "/usr/lib/python3/dist-packages\n", "/usr/local/lib/python3.6/dist-packages/IPython/extensions\n", "/home/lilian/.ipython\n" ] } ], "source": [ "import sys\n", "\n", "print(\"Path (sys.path):\")\n", "for f in sys.path:\n", " print(f)" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [], "source": [ "import os" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Current directory:\n", "/home/lilian/publis/notebooks\n" ] } ], "source": [ "print(\"Current directory:\")\n", "print(os.getcwd())" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Importing a file\n", "\n", "I will import [this file](https://github.com/Naereen/notebooks/blob/master/agreg/memoisation.py) from the [agreg/](https://github.com/Naereen/notebooks/tree/master/agreg/) sub-folder." ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "3 secondes...\n", "13\n", "4 secondes...\n", "100\n", "3 secondes...\n", "13\n", "0 secondes !\n", "13\n", "3 secondes...\n", "13\n", "3 secondes...\n", "13\n", "4 secondes...\n", "100\n", "0 secondes !\n", "100\n", "Test de fibo() non mémoisée :\n", "F_0 = 1\n", "F_1 = 1\n", "F_2 = 2\n", "F_3 = 3\n", "F_4 = 5\n", "F_5 = 8\n", "F_6 = 13\n", "F_7 = 21\n", "F_8 = 34\n", "F_9 = 55\n", "Test de fibo() mémoisée (plus rapide) :\n", "F_0 = 1\n", "F_1 = 1\n", "F_2 = 2\n", "F_3 = 3\n", "F_4 = 5\n", "F_5 = 8\n", "F_6 = 13\n", "F_7 = 21\n", "F_8 = 34\n", "F_9 = 55\n", "Test de factorielle() mémoisée :\n", "0! = 0\n", "1! = 1\n", "2! = 2\n", "3! = 6\n", "4! = 24\n", "5! = 120\n", "6! = 720\n", "7! = 5040\n", "8! = 40320\n", "9! = 362880\n" ] } ], "source": [ "import agreg.memoisation" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Conclusion" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "It seems to work as wanted." ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "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.6.5" }, "toc": { "colors": { "hover_highlight": "#DAA520", "running_highlight": "#FF0000", "selected_highlight": "#FFD700" }, "moveMenuLeft": true, "nav_menu": { "height": "84px", "width": "252px" }, "navigate_menu": true, "number_sections": true, "sideBar": false, "threshold": 4, "toc_cell": true, "toc_section_display": "block", "toc_window_display": true }, "varInspector": { "cols": { "lenName": 16, "lenType": 16, "lenVar": 40 }, "kernels_config": { "python": { "delete_cmd_postfix": "", "delete_cmd_prefix": "del ", "library": "var_list.py", "varRefreshCmd": "print(var_dic_list())" }, "r": { "delete_cmd_postfix": ") ", "delete_cmd_prefix": "rm(", "library": "var_list.r", "varRefreshCmd": "cat(var_dic_list()) " } }, "types_to_exclude": [ "module", "function", "builtin_function_or_method", "instance", "_Feature" ], "window_display": false } }, "nbformat": 4, "nbformat_minor": 2 }