8000 add info about jupyter book built · lhoupert/from-python-to-numpy@6a09c51 · GitHub
[go: up one dir, main page]

Skip to content

Commit 6a09c51

Browse files
committed
add info about jupyter book built
1 parent bd6797a commit 6a09c51

File tree

4 files changed

+293
-3
lines changed

4 files changed

+293
-3
lines changed

01-preface-with-jupyter-book.rst

Lines changed: 190 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,190 @@
1+
Preface
2+
===============================================================================
3+
4+
.. contents:: **Contents**
5+
:local:
6+
7+
8+
About the author
9+
----------------
10+
11+
`Nicolas P. Rougier`_ is a full-time research scientist at Inria_ which is the
12+
French national institute for research in computer science and control. This is
13+
a public scientific and technological establishment (EPST) under the double
14+
supervision of the Research & Education Ministry, and the Ministry of Economy
15+
Finance and Industry. Nicolas P. Rougier is working within the Mnemosyne_
16+
project which lies at the frontier between integrative and computational
17+
neuroscience in association with the `Institute of Neurodegenerative
18+
Diseases`_, the Bordeaux laboratory for research in computer science
19+
(LaBRI_), the `University of Bordeaux`_ and the national center for scientific
20+
research (CNRS_).
21+
22+
He has been using Python for more than 15 years and NumPy for more than 10
23+
years for modeling in neuroscience, machine learning and for advanced
24+
visualization (OpenGL). Nicolas P. Rougier is the author of several online
25+
resources and tutorials (Matplotlib, NumPy, OpenGL) and he's teaching Python,
26+
NumPy and scientific visualization at the University of Bordeaux and in various
27+
conferences and schools worldwide (SciPy, EuroScipy, etc). He's also the author
28+
of the popular article `Ten Simple Rules for Better Figures`_ and a popular
29+
`matplotlib tutorial
30+
<http://www.labri.fr/perso/nrougier/teaching/matplotlib/matplotlib.html>`_.
31+
32+
33+
About this book
34+
---------------
35+
36+
This book has been written in |ReST|_ format and generated using the
37+
`rst2html.py` command line available from the docutils_ python package.
38+
39+
If you want to rebuild the html output, from the top directory, type:
40+
41+
.. code-block::
42+
43+
$ rst2html.py --link-stylesheet --cloak-email-addresses \
44+
--toc-top-backlinks --stylesheet=book.css \
45+
--stylesheet-dirs=. book.rst book.html
46+
47+
The sources are available from https://github.com/rougier/from-python-to-numpy.
48+
49+
.. |ReST| replace:: restructured text
50+
.. _ReST: http://docutils.sourceforge.net/rst.html
51+
.. _docutils: http://docutils.sourceforge.net/
52+
53+
54+
About the Jupyter Book
55+
++++++++++++++++++++++
56+
57+
**html version**
58+
59+
To generate the `Jupyter Book`_ from the top directory:
60+
61+
1. Install the most up to date version of jupyter-book:
62+
63+
.. code-block::
64+
65+
$ pip install -U jupyter-book
66+
67+
2. Go to the root directory of the repository and run:
68+
69+
.. code-block::
70+
71+
$ jupyter-book build . --path-output jupyter-book/.
72+
73+
3. Copy the data folder into the html directory:
74+
75+
.. code-block::
76+
77+
$ cp -r data jupyter-book/_build/html/.
78+
79+
4. Open Jupyter-book at: `jupyter-book/_build/html/index.html`
80+
81+
82+
**pdf version**
83+
84+
To generate a pdf versio 67F4 n of the book, you will need pyppeteer_ installed,
85+
then in the top directory, run:
86+
87+
.. code-block::
88+
89+
$ jupyter-book build . --builder pdfhtml --path-output jupyter-book/.
90+
91+
The pdf version of the book is available at `jupyter-book/_build/pdf/book.pdf`
92+
93+
.. _Jupyter Book: https://jupyterbook.org
94+
.. _pyppeteer: https://pypi.org/project/pyppeteer/
95+
96+
97+
Prerequisites
98+
+++++++++++++
99+
100+
This is not a Python beginner guide and you should have an intermediate level in
101+
Python and ideally a beginner level in NumPy. If this is not the case, have
102+
a look at the bibliography_ for a curated list of resources.
103+
104+
105+
Conventions
106+
+++++++++++
107+
108+
We will use usual naming conventions. If not stated explicitly, each script
109+
should import NumPy, scipy and matplotlib as:
110+
111+
.. code-block:: python
112+
113+
import numpy as np
114+
import scipy as sp
115+
import matplotlib.pyplot as plt
116+
117+
118+
We'll use up-to-date versions (at the date of writing, i.e. January, 2017) of the
119+
different packages:
120+
121+
=========== =========
122+
Packages Version
123+
=========== =========
124+
Python 3.6.0
125+
----------- ---------
126+
NumPy 1.12.0
127+
----------- ---------
128+
Scipy 0.18.1
129+
----------- ---------
130+
Matplotlib 2.0.0
131+
=========== =========
132+
133+
How to contribute
134+
+++++++++++++++++
135+
136+
If you want to contribute to this book, you can:
137+
138+
* Review chapters (please contact me)
139+
* Report issues (https://github.com/rougier/from-python-to-numpy/issues)
140+
* Suggest improvements (https://github.com/rougier/from-python-to-numpy/pulls)
141+
* Correct English (https://github.com/rougier/from-python-to-numpy/issues)
142+
* Design a better and more responsive html template for the book.
143+
* Star the project (https://github.com/rougier/from-python-to-numpy)
144+
145+
Publishing
146+
++++++++++
147+
148+
If you're an editor interested in publishing this book, you can `contact me
149+
<mailto:Nicolas.Rougier@inria.fr>`_ if you agree to have this version and all
150+
subsequent versions open access (i.e. online at `this address
151+
<http://www.labri.fr/perso/nrougier/from-python-to-numpy>`_), you know how to
152+
deal with `restructured text <http://docutils.sourceforge.net/rst.html>`_ (Word
153+
is not an option), you provide a real added-value as well as supporting
154+
services, and more importantly, you have a truly amazing latex book template
155+
(and be warned that I'm a bit picky about typography & design: `Edward Tufte
156+
<https://www.edwardtufte.com/tufte/>`_ is my hero). Still here?
157+
158+
159+
License
160+
--------
161+
162+
**Book**
163+
164+
This work is licensed under a `Creative Commons Attribution-Non Commercial-Share
165+
Alike 4.0 International License <https://creativecommons.org/licenses/by-nc-sa/4.0/>`_. You are free to:
166+
167+
* **Share** — copy and redistribute the material in any medium or format
168+
* **Adapt** — remix, transform, and build upon the material
169+
170+
The licensor cannot revoke these freedoms as long as you follow the license terms.
171+
172+
**Code**
173+
174+
The code is licensed under the `OSI-approved BSD 2-Clause License
175+
<LICENSE-code.txt>`_.
176+
177+
178+
.. --- Links ------------------------------------------------------------------
179+
.. _Nicolas P. Rougier: http://www.labri.fr/perso/nrougier/
180+
.. _Inria: http://www.inria.fr/en
181+
.. _Mnemosyne: http://www.inria.fr/en/teams/mnemosyne
182+
.. _LaBRI: https://www.labri.fr/
183+
.. _CNRS: http://www.cnrs.fr/index.php
184+
.. _University of Bordeaux: http://www.u-bordeaux.com/
185+
.. _Institute of Neurodegenerative Diseases:
186+
http://www.imn-bordeaux.org/en/
187+
.. _Ten Simple Rules for Better Figures:
188+
http://dx.doi.org/10.1371/journal.pcbi.1003833
189+
.. ----------------------------------------------------------------------------
190+

_config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Book settings
22
title: From Python to Numpy
3-
author: Nicolas P. Rougier
3+
author: Nicolas P. Rougier; Loïc Houpert
44
logo: data/cubes.png
55

66

_toc.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
format: jb-article
2-
root: book
2+
root: book-jupyterbook
33
title: From Python to Numpy
44
sections:
5-
- file: 01-preface
5+
- file: 01-preface-with-jupyter-book
66
- file: 02-introduction
77
- file: 03-anatomy
88
- file: 04-code-vectorization

book-jupyterbook.rst

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
.. ----------------------------------------------------------------------------
2+
.. Title: From Python to Numpy
3+
.. Author: Nicolas P. Rougier
4+
.. Date: January 2017
5+
.. License: Creative Commons Share-Alike Non-Commercial International 4.0
6+
.. ----------------------------------------------------------------------------
7+
8+
.. meta::
9+
:description: An open-source book about numpy vectorization techniques, based on experience, practice and descriptive examples
10+
:viewport: width=device-width, initial-scale=1, maximum-scale=1
11+
12+
.. |date| date:: %B %Y
13+
14+
===============================================================================
15+
From Python to Numpy
16+
===============================================================================
17+
18+
Copyright (c) 2021 - Nicolas P. Rougier <Nicolas.Rougier@inria.fr> & Loïc Houpert <loic@lhoupert.fr>
19+
20+
.. default-role:: code
21+
22+
.. container:: title-logos
23+
24+
.. image:: data/cc.large.png
25+
:width: 40px
26+
.. image:: data/by.large.png
27+
:width: 40px
28+
.. image:: data/sa.large.png
29+
:width: 40px
30+
.. image:: data/nc.large.png
31+
:width: 40px
32+
33+
|
34+
| Latest version - |date|
35+
| DOI: `10.5281/zenodo.225783 <http://doi.org/10.5281/zenodo.225783>`_
36+
37+
.. ----------------------------------------------------------------------------
38+
.. container:: title-logos
39+
40+
.. image:: data/cubes.png
41+
:width: 100%
42+
43+
.. ----------------------------------------------------------------------------
44+
45+
There are already a fair number of books about Numpy (see Bibliography_) and a
46+
legitimate question is to wonder if another book is really necessary. As you
47+
may have guessed by reading these lines, my personal answer is yes, mostly
48+
because I think there is room for a different approach concentrating on the
49+
migration from Python to Numpy through vectorization. There are a lot of
50+
techniques that you don't find in books and such techniques are mostly learned
51+
through experience. The goal of this book is to explain some of these
52+
techniques and to provide an opportunity for making this experience in the
53+
process.
54+
55+
**Website:** http://www.labri.fr/perso/nrougier/from-python-to-numpy
56+
57+
58+
.. ----------------------------------------------------------------------------
59+
.. contents:: **Table of Contents**
60+
:class: main-content
61+
:depth: 2
62+
63+
|
64+
|
65+
66+
**Disclaimer:** All external pictures should have associated credits. If there
67+
are missing credits, please tell me, I will correct it. Similarly, all excerpts
68+
should be sourced (wikipedia mostly). If not, this is an error and I will
69+
correct it as soon as you tell me.
70+
71+
72+
The book is open-access (you're reading it) but **if you insist on buying it**,
73+
my advice would be to read it first and then decide if you still want to buy it
74+
(!?). If this is the case, you can do it via `Paypal
75+
<https://www.paypal.me/NicolasPRougier/>`_, price is free (`5 euros
76+
<https://www.paypal.me/NicolasPRougier/5>`_, `10 euros
77+
<https://www.paypal.me/NicolasPRougier/10>`_, `25 euros
78+
<https://www.paypal.me/NicolasPRougier/25>`_). You won't get anything extra but
79+
it might help me with the writing of the upcoming **Python and OpenGL for
80+
Scientific Visualization** (May 2018).
81+
82+
83+
.. ----------------------------------------------------------------------------
84+
.. |WIP| image:: https://img.shields.io/badge/status-WIP-orange.svg?style=flat-square
85+
86+
.. ----------------------------------------------------------------------------
87+
.. include< 7CBC /span>:: 01-preface-with-jupyter-book.rst
88+
.. include:: 02-introduction.rst
89+
.. include:: 03-anatomy.rst
90+
.. include:: 04-code-vectorization.rst
91+
.. include:: 05-problem-vectorization.rst
92+
.. include:: 06-custom-vectorization.rst
93+
.. include:: 07-beyond-numpy.rst
94+
.. include:: 08-conclusion.rst
95+
.. include:: 09-quick-reference.rst
96+
.. include:: 10-bibliography.rst
97+
98+
99+
.. --- Compilation ------------------------------------------------------------
100+
.. rst2html.py --link-stylesheet --stylesheet=markdown.css book.rst book.html

0 commit comments

Comments
 (0)
0