Skip to content

Commit 262e8e7

Browse files
committed
Update
1 parent a526db2 commit 262e8e7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+13066
-46
lines changed

book/anatomy.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Anatomy of an array
33

44
.. contents:: **Contents**
55
:local:
6-
6+
77
Data type
88
---------
99

book/book.css

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,11 @@ h2 a:hover, h3 a:hover {
9898
border-bottom: 1px solid black;
9999
}
100100

101+
/* --- Images -------------------------------------------------------------- */
102+
.bordered {
103+
border: 1px solid black;
104+
}
105+
101106
/* --- Table of contents --------------------------------------------------- */
102107
.main-content {
103108
padding-top: 1em;
@@ -165,7 +170,11 @@ h2.subtitle {
165170
margin-right: auto;
166171
margin-bottom: 64px;
167172
}
173+
.title-logos p {
174+
text-align: center;
175+
}
168176

177+
169178
/* --- Math ---------------------------------------------------------------- */
170179
span.formula {
171180
color: #955;

book/book.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,14 @@
2525
.. image:: ../data/nc.large.png
2626
:width: 40px
2727

28+
(J. Kerouac style)
29+
30+
31+
.. ----------------------------------------------------------------------------
32+
.. container:: title-logos
33+
34+
.. image:: ../data/cubes.png
35+
:width: 100%
2836

2937
.. ----------------------------------------------------------------------------
3038
@@ -37,6 +45,7 @@ techniques that you don't find in books and such techniques are mostly learned
3745
through experience. The goal of this book is to explain some of them and to
3846
make you acquire experience in the process.
3947

48+
4049
.. ----------------------------------------------------------------------------
4150
.. contents:: **Table of Contents**
4251
:class: main-content

book/code-vectorization.rst

Lines changed: 43 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,16 @@ an array of cells that are connected together with the notion of neighbour and
7979
their vectorization is straightforward. Let me first define the game and we'll
8080
see how to vectorize it.
8181

82+
.. admonition:: **Figure**
83+
:class: legend
84+
85+
Conus textile snail exhibits a cellular automaton pattern on its shell.
86+
Image by `Richard Ling <https://commons.wikimedia.org/wiki/File:Textile_cone.JPG>`_, 2005.
87+
88+
.. image:: ../data/Textile-Cone-cropped.jpg
89+
:width: 100%
90+
:class: bordered
91+
8292

8393
The Game of Life
8494
++++++++++++++++
@@ -397,7 +407,6 @@ References
397407
Temporal vectorization
398408
----------------------
399409

400-
401410
The Mandelbrot set is the set of complex numbers `c` for which the function
402411
:math:`f_c(z) = z^2+ c` does not diverge when iterated from :math:`z=0`, i.e.,
403412
for which the sequence :math:`f_c(0), f_c(f_c(0))`, etc., remains bounded in
@@ -407,6 +416,17 @@ done by iterating the computation up to a maximum number of iterations, after
407416
which, if the number is still within some bounds, it is considerered non
408417
divergent. Of course, the more iteration you do, the more precision you get.
409418

419+
420+
.. admonition:: **Figure**
421+
:class: legend
422+
423+
Romanesco broccoli, showing self-similar form approximating a natural fractal.
424+
Image by `Jon Sullivan <https://commons.wikimedia.org/wiki/File:Fractal_Broccoli.jpg>`_, 2004.
425+
426+
.. image:: ../data/Fractal-Broccoli-cropped.jpg
427+
:width: 100%
428+
:class: bordered
429+
410430
Python implementation
411431
+++++++++++++++++++++
412432

@@ -602,17 +622,15 @@ update at each iteration. This the case for example in particle systems where
602622
particles interact mostly with local neighbours. This is also the case for
603623
boids that simulate flocking behaviors.
604624

605-
.. admonition:: **Figure 6**
625+
.. admonition:: **Figure**
606626
:class: legend
607627

608-
Boids is an artificial life program, developed by Craig Reynolds in 1986,
609-
which simulates the flocking behaviour of birds.
610-
611-
.. raw:: html
628+
Flocking birds are an example of self-organization in biology.
629+
Image by `Christoffer A Rasmussen <https://commons.wikimedia.org/wiki/File:Fugle,_ørnsø_073.jpg>`_, 2012.
612630

613-
<video width="100%" controls>
614-
<source src="../data/boids.mp4" type="video/mp4">
615-
Your browser does not support the video tag. </video>
631+
.. image:: ../data/Fugle-cropped.jpg
632+
:width: 100%
633+
:class: bordered
616634

617635
Boids
618636
+++++
@@ -853,6 +871,22 @@ velocity and position:
853871
position += velocity
854872
855873
874+
We finally visualize the result using a custom oriented scatter plot.
875+
876+
.. admonition:: **Figure 6**
877+
:class: legend
878+
879+
Boids is an artificial life program, developed by Craig Reynolds in 1986,
880+
which simulates the flocking behaviour of birds.
881+
882+
.. raw:: html
883+
884+
<video width="100%" class="bordered" controls>
885+
<source src="../data/boids.mp4" type="video/mp4">
886+
Your browser does not support the video tag. </video>
887+
888+
889+
856890
Exercise
857891
++++++++
858892

book/preface.rst

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,12 +88,26 @@ Matplotlib 1.5.3
8888
How to contribute
8989
+++++++++++++++++
9090

91-
If you want to contribute to this book, you can do it by:
91+
If you want to contribute to this book, you can:
9292

93-
* Reviewing chapters (please contact me)
94-
* Reporting issues (https://github.com/rougier/numpy-book/issues)
95-
* Suggesting improvements (https://github.com/rougier/numpy-book/pulls)
96-
* Designing a better and responsive template for the book website
93+
* Review chapters (please contact me)
94+
* Report issues (https://github.com/rougier/numpy-book/issues)
95+
* Suggest improvements (https://github.com/rougier/numpy-book/pulls)
96+
* Correct English (https://github.com/rougier/numpy-book/issues)
97+
* Design a better and more responsive html template for the book.
98+
99+
100+
Publishing
101+
----------
102+
103+
If you're an editor interested in publishing this book, you can contact me if
104+
you agree to have this open access version online, you know how to deal with
105+
`restructured text <http://docutils.sourceforge.net/rst.html>`_ (Word is not an
106+
option), you provide a real added-value as well as supporting services, and
107+
more importantly, you have a truly amazing latex book template (and be warned
108+
that I'm a bit picky about typography & design: E.Tufte is my hero).
109+
110+
Still here?
97111

98112

99113
License

0 commit comments

Comments
 (0)