# start_slideshow_at: selected # theme: sky # transition: cube # version: '1.0' # --- # %% [markdown] slideshow={"slide_type": "slide"} # <div class="licence"> # <span>Licence CC BY-NC-ND</span> # <span>Thierry Parmentelat</span> # </div> # %% slideshow={"slide_type": "slide"} from plan import plan_extras plan_extras("packaging") # %% [markdown] slideshow={"slide_type": "slide"} # ### *packaging* (software distribution) # %% [markdown] # ### portée # on regroupe ici les outils pour # # * **packager** un composant logiciel # * **exposer** différentes versions à une infrastructure # * **installer** à partir de l'infrastructure # * **installer** un module localement à partir des sources # * **gérer** les dépendances entre composants # * **maintenir** plusieurs combinaisons de composants
# slideNumber: c/t # start_slideshow_at: selected # theme: sky # transition: cube # version: '1.0' # --- # %% [markdown] slideshow={"slide_type": "slide"} # <div class="licence"> # <span>Licence CC BY-NC-ND</span> # <span>Thierry Parmentelat</span> # </div> # %% slideshow={"slide_type": "-"} from plan import plan_extras plan_extras("pandas") # %% [markdown] slideshow={"slide_type": "slide"} # # pandas # %% [markdown] # from `Python for data analysis`, Wes McKinney # %% [markdown] # # objectives # # * data structures with labeled axes # * automatic or explicit data alignment # * integrated time series functionality # * same data structure for time series or non-time series # * arithemtic operations and reductions (on a whole column)
# slideNumber: c/t # start_slideshow_at: selected # theme: sky # transition: cube # version: '1.0' # --- # %% [markdown] slideshow={"slide_type": ""} # <div class="licence"> # <span>Licence CC BY-NC-ND</span> # <span>Thierry Parmentelat</span> # </div> # %% slideshow={"slide_type": "slide"} from plan import plan_extras plan_extras("notebooks") # %% [markdown] slideshow={"slide_type": "slide"} # # introduction aux notebooks # %% [markdown] # ## c'est quoi un notebook ? # %% [markdown] # un document hybride qui mélange: # # * du texte formatté, # * des équations et illustrations, # * avec des fragments de code exécutable, # * possiblement interactifs.
# jupyter: # jupytext: # cell_metadata_filter: all,-hidden,-heading_collapsed,-run_control,-trusted # notebook_metadata_filter: all,-language_info,-toc,-jupytext.text_representation.jupytext_version,-jupytext.text_representation.format_version # text_representation: # extension: .py # format_name: percent # kernelspec: # display_name: Python 3 # language: python # name: python3 # notebookname: plan extras # rise: # autolaunch: true # slideNumber: c/t # start_slideshow_at: selected # theme: sky # transition: cube # version: '1.0' # --- # %% [markdown] # <div class="licence"> # <span>Licence CC BY-NC-ND</span> # <span>Thierry Parmentelat</span> # </div> # %% from plan import plan_extras plan_extras()
# autolaunch: true # slideNumber: c/t # start_slideshow_at: selected # theme: sky # transition: cube # version: '1.0' # --- # %% [markdown] slideshow={"slide_type": "slide"} # <div class="licence"> # <span>Licence CC BY-NC-ND</span> # <span>Thierry Parmentelat</span> # </div> # %% slideshow={"slide_type": "-"} from plan import plan_extras; plan_extras("numpy", "dimension 1") # %% [markdown] slideshow={"slide_type": "slide"} # # intro à numpy # %% [markdown] # ## pourquoi `numpy` # %% [markdown] # la librairie numpy est **très** utilisée pour les traitements gourmands en calculs, car # # * elle est **beaucoup plus efficace** que Python "*de base* " pour cet usage, # * même si elle est un tout petit peu moins générale # %% [markdown] slideshow={"slide_type": "slide"} # la limitation concerne le fait que **les tableaux sont homogènes**
# slideNumber: c/t # start_slideshow_at: selected # theme: sky # transition: cube # version: '1.0' # --- # %% [markdown] slideshow={"slide_type": "slide"} # <div class="licence"> # <span>Licence CC BY-NC-ND</span> # <span>Thierry Parmentelat</span> # </div> # %% slideshow={"slide_type": "slide"} from plan import plan_extras plan_extras("numpy", "linéaire") # %% [markdown] slideshow={"slide_type": "slide"} # # algèbre linéaire # %% import numpy as np import matplotlib.pyplot as plt # %matplotlib inline plt.ion() # %% [markdown] # * Un aspect important de l'utilisation de numpy # * consiste à manipuler des matrices et vecteurs # * [voir doc complète](https://docs.scipy.org/doc/numpy/reference/routines.linalg.html)
# slideNumber: c/t # start_slideshow_at: selected # theme: sky # transition: cube # version: '1.0' # --- # %% [markdown] slideshow={"slide_type": "slide"} # <div class="licence"> # <span>Licence CC BY-NC-ND</span> # <span>Thierry Parmentelat</span> # </div> # %% slideshow={"slide_type": "slide"} from plan import plan_extras plan_extras("doc", "readthedocs") # %% [markdown] slideshow={"slide_type": "slide"} # # `readthedocs.io` # %% [markdown] # * système communautaire # * pour héberger la documentation # * mode 'on installe et on oublie' # * connecté aux *webhooks* de gitlab/github # * i.e. regénère la documentation à chaque commit # * possiblement pour plusieurs branches / tags # %% [markdown] slideshow={"slide_type": "slide"} # ## exemple # ![](media/readthedocs-example-01.png)
# slideNumber: c/t # start_slideshow_at: selected # theme: sky # transition: cube # version: '1.0' # --- # %% [markdown] slideshow={"slide_type": "slide"} # <div class="licence"> # <span>Licence CC BY-NC-ND</span> # <span>Thierry Parmentelat</span> # </div> # %% from plan import plan_extras plan_extras("doc", "outils") # %% [markdown] slideshow={"slide_type": "slide"} # # génération de documentation # %% [markdown] slideshow={"slide_type": "-"} # * PEPs # * outils de génération de documents # * [doxygen](http://www.stack.nl/~dimitri/doxygen/) (non détaillé) # * [sphinx](http://www.sphinx-doc.org/en/stable/) # * [mkdocs](http://www.mkdocs.org/): plus orienté markdown (non détaillé) # * langages de markup : reST, markdown et doctest # * styles de docstrings : reST, google et numpy # * readthedocs.io (infra / présentation séparée) # %% [markdown] slideshow={"slide_type": "slide"}
# slideNumber: c/t # start_slideshow_at: selected # theme: sky # transition: cube # version: '1.0' # --- # %% [markdown] slideshow={"slide_type": "slide"} # <div class="licence"> # <span>Licence CC BY-NC-ND</span> # <span>Thierry Parmentelat</span> # </div> # %% slideshow={"slide_type": "slide"} from plan import plan_extras plan_extras("numpy", "supérieures") # %% [markdown] slideshow={"slide_type": "slide"} # # numpy - dimensions > 1 # %% slideshow={"slide_type": "-"} import numpy as np import matplotlib.pyplot as plt # %matplotlib inline plt.ion() # %% [markdown] # # conventions sur les indices des dimension # %% [markdown] # ## dimension 2: **lignes** x **colonnes**
# slideNumber: c/t # start_slideshow_at: selected # theme: sky # transition: cube # version: '1.0' # --- # %% [markdown] slideshow={"slide_type": "slide"} # <div class="licence"> # <span>Licence CC BY-NC-ND</span> # <span>Thierry Parmentelat</span> # </div> # %% slideshow={"slide_type": "slide"} from plan import plan_extras plan_extras("numpy", "struct") # %% [markdown] slideshow={"slide_type": "slide"} # # structured arrays # %% import numpy as np import matplotlib.pyplot as plt # %matplotlib inline plt.ion() # %% [markdown] # * jusqu'ici on a vu des tableaux *homogènes* # * tous les éléments ont le même type # * on peut aussi se définir des types structurés # * comme un 'struct' en c - ou encore un 'record'