Having the versions of packages used for the book in a requirements.txt
would be helpful for others reproducing things a year or so down the line.
Looking through the repo for something such as numpy
doesn't bring up anything wrt the version used, just that it's imported in several locations.
As this book was only recently finished, perhaps there's an environment on the authors computer which has all the correct package versions within it? And a file could be generated from that.
Example search for numpy with rg numpy
:
README.md:* [From Python to Numpy](https://www.labri.fr/perso/nrougier/from-python-to-numpy/) (Scientific Python Volume I)
README.md:* [100 Numpy exercices](https://github.com/rougier/numpy-100)
rst/threed.rst:specify the color of each of the triangle using a numpy array, so let's just do
rst/anatomy.rst: import numpy as np
rst/anatomy.rst: import numpy as np
rst/00-preface.rst: import numpy as np
rst/00-preface.rst: >>> import numpy; print(numpy.__version__)
code/showcases/escher-movie.py:import numpy as np
code/showcases/domain-coloring.py:import numpy as np
code/showcases/mandelbrot.py:import numpy as np
code/showcases/text-shadow.py:import numpy as np
code/showcases/windmap.py:import numpy as np
code/showcases/mosaic.py:import numpy as np
code/showcases/mosaic.py: from numpy.random.mtrand import RandomState
code/showcases/contour-dropshadow.py:import numpy as np
code/showcases/escher.py:import numpy as np
code/showcases/text-spiral.py:import numpy as np
code/showcases/recursive-voronoi.py:import numpy as np
code/showcases/recursive-voronoi.py: from numpy.random.mtrand import RandomState
code/showcases/waterfall-3d.py:import numpy as np
rst/defaults.rst: import numpy as np
code/beyond/stamp.py:import numpy as np
code/beyond/dyson-hatching.py:import numpy as np
code/beyond/tikz-dashes.py:import numpy as np
rst/coordinates.rst: import numpy as np
rst/animation.rst: import numpy as np
rst/animation.rst: import numpy as np
rst/animation.rst: import numpy as np
code/beyond/tinybot.py:import numpy as np
code/beyond/dungeon.py:import numpy as np
cover/cover-pattern.py:import numpy as np
code/beyond/interactive-loupe.py:import numpy as np
code/beyond/bluenoise.py:import numpy as np
code/beyond/bluenoise.py: from numpy.random.mtrand import RandomState
code/beyond/polygon-clipping.py:import numpy as np
code/beyond/radial-maze.py:import numpy as np
code/reference/hatch.py:import numpy as np
code/reference/colormap-sequential-1.py:import numpy as np
code/reference/colormap-uniform.py:import numpy as np
code/reference/marker.py:import numpy as np
code/reference/line.py:import numpy as np
code/ornaments/annotation-zoom.py:import numpy as np
code/scales-projections/text-polar.py:import numpy as np
code/ornaments/legend-regular.py:import numpy as np
code/ornaments/elegant-scatter.py:import numpy as np
code/reference/axes-adjustment.py:import numpy as np
code/ornaments/legend-alternatives.py:import numpy as np
code/reference/colorspec.py:import numpy as np
code/typography/typography-matters.py:import numpy as np
code/colors/color-gradients.py:import numpy as np
code/threed/bunny-6.py:import numpy as np
code/scales-projections/projection-polar-config.py:import numpy as np
code/colors/color-wheel.py:import numpy as np
code/colors/mona-lisa.py:import numpy as np
code/threed/bunny-4.py:import numpy as np
code/ornaments/title-regular.py:import numpy as np
code/typography/text-outline.py:import numpy as np
code/ornaments/bessel-functions.py:import numpy as np
code/scales-projections/projection-polar-histogram.py:import numpy as np
code/rules/rule-6.py:import numpy as np
code/colors/open-colors.py:import numpy as np
code/colors/material-colors.py:import numpy as np
code/colors/flower-polar.py:import numpy as np
code/typography/typography-legibility.py:import numpy as np
code/colors/colored-plot.py:import numpy as np
code/rules/rule-7.py:import numpy as np
code/colors/colored-hist.py:import numpy as np
code/rules/rule-3.py:import numpy as np
code/colors/alpha-vs-color.py:import numpy as np
code/colors/stacked-plots.py:import numpy as np
code/ornaments/label-alternatives.py:import numpy as np
code/typography/tick-labels-variation.py:import numpy as np
code/rules/projections.py:import numpy as np
code/typography/typography-math-stacks.py:import numpy as np
code/rules/rule-2.py:import numpy as np
code/colors/alpha-scatter.py:import numpy as np
code/typography/typography-text-path.py:import numpy as np
code/scales-projections/polar-patterns.py:import numpy as np
code/scales-projections/scales-custom.py:import numpy as np
code/rules/parameters.py:import numpy as np
code/threed/bunny-1.py:import numpy as np
code/scales-projections/geo-projections.py:import numpy as np
code/rules/rule-8.py:import numpy as np
code/threed/bunny-5.py:import numpy as np
code/ornaments/latex-text-box.py:import numpy as np
code/ornaments/annotation-direct.py:import numpy as np
code/typography/projection-3d-gaussian.py:import numpy as np
code/threed/bunny-7.py:import numpy as np
code/rules/helper.py:import numpy as np
code/rules/helper.py: """ Generate a numpy array containing a disc. """
code/typography/typography-font-stacks.py:import numpy as np
code/scales-projections/scales-log-log.py:import numpy as np
code/scales-projections/projection-3d-frame.py:import numpy as np
code/threed/bunnies.py:import numpy as np
code/threed/bunny.py:import numpy as np
code/threed/bunny-3.py:import numpy as np
code/rules/rule-9.py:import numpy as np
code/ornaments/annotate-regular.py:import numpy as np
code/threed/bunny-2.py:import numpy as np
code/reference/tick-locator.py:import numpy as np
code/threed/bunny-8.py:import numpy as np
code/reference/colormap-diverging.py:import numpy as np
code/scales-projections/scales-comparison.py:import numpy as np
code/reference/text-alignment.py:import numpy as np
code/scales-projections/scales-check.py:import numpy as np
code/reference/scale.py:import numpy as np
code/reference/colormap-qualitative.py:import numpy as np
code/reference/tick-formatter.py:import numpy as np
code/rules/graphics.py:import numpy as np
code/rules/rule-1.py:import numpy as np
code/reference/collection.py:import numpy as np
code/ornaments/annotation-side.py:import numpy as np
code/reference/colormap-sequential-2.py:import numpy as np
code/defaults/defaults-exercice-1.py:import numpy as np
code/animation/platecarree.py:import numpy as np
code/defaults/defaults-step-4.py:import numpy as np
code/layout/standard-layout-2.py:import numpy as np
code/coordinates/transforms-blend.py:import numpy as np
code/unsorted/layout-weird.py:import numpy as np
code/unsorted/advanced-linestyles.py:import numpy as np
code/coordinates/transforms-exercise-1.py:import numpy as np
code/animation/fluid-animation.py:import numpy as np
code/unsorted/alpha-gradient.py:import numpy as np
code/animation/sine-cosine.py:import numpy as np
code/optimization/line-benchmark.py:import numpy as np
code/animation/fluid.py:import numpy as np
code/optimization/transparency.py:import numpy as np
code/animation/rain.py:import numpy as np
code/optimization/scatter-benchmark.py:import numpy as np
code/optimization/self-cover.py:import numpy as np
code/animation/imgcat.py:import numpy as np
code/unsorted/hatched-bars.py:import numpy as np
code/optimization/multithread.py:import numpy as np
code/animation/earthquakes.py:import numpy as np
code/unsorted/poster-layout.py:import numpy as np
code/coordinates/transforms-letter.py:import numpy as np
code/optimization/scatters.py:import numpy as np
code/animation/sine-cosine-mp4.py:import numpy as np
code/optimization/multisample.py:import numpy as np
code/unsorted/make-hatch-linewidth.py:import numpy as np
code/animation/lissajous.py:import numpy as np
code/coordinates/transforms-polar.py:import numpy as np
code/unsorted/earthquakes.py:import numpy as np
code/unsorted/git-commits.py:import numpy as np
code/unsorted/github-activity.py:import numpy as np
code/coordinates/collage.py:import numpy as np
code/introduction/matplotlib-timeline.py:import numpy as np
code/coordinates/transforms-floating-axis.py:import numpy as np
code/coordinates/transforms-hist.py:import numpy as np
code/layout/complex-layout-bare.py:import numpy as np
code/animation/less-is-more.py:import numpy as np
code/coordinates/transforms.py:import numpy as np
code/unsorted/alpha-compositing.py:import numpy as np
code/layout/standard-layout-1.py:import numpy as np
code/layout/layout-classical.py:import numpy as np
code/unsorted/stacked-bars.py:import numpy as np
code/layout/complex-layout.py:import numpy as np
code/layout/layout-aspect.py:import numpy as np
code/unsorted/metropolis.py:import numpy as np
code/unsorted/scale-logit.py:import numpy as np
code/unsorted/dyson-hatching.py:import numpy as np
code/unsorted/dyson-hatching.py: from numpy.random.mtrand import RandomState
code/layout/layout-gridspec.py:import numpy as np
code/defaults/defaults-step-1.py:import numpy as np
code/defaults/defaults-step-2.py:import numpy as np
code/defaults/defaults-step-5.py:import numpy as np
code/defaults/defaults-step-3.py:import numpy as np
code/anatomy/bold-ticklabel.py:import numpy as np
code/unsorted/3d/contour.py:import numpy as np
code/unsorted/3d/sphere.py:import numpy as np
code/unsorted/3d/platonic-solids.py:import numpy as np
code/unsorted/3d/surf.py:import numpy as np
code/unsorted/3d/bar.py:import numpy as np
tex/cover-pattern.py:import numpy as np
code/unsorted/3d/scatter.py:import numpy as np
tex/book.bib: url = {https://www.labri.fr/perso/nrougier/from-python-to-numpy/},
code/anatomy/pixel-font.py:import numpy as np
code/anatomy/raster-vector.py:import numpy as np
code/anatomy/zorder-plots.py:import numpy as np
code/anatomy/ruler.py:import numpy as np
code/anatomy/anatomy.py:import numpy as np
code/anatomy/zorder.py:import numpy as np
code/unsorted/3d/bunny.py:import numpy as np
code/unsorted/3d/bunnies.py:import numpy as np
code/unsorted/3d/plot.py:import numpy as np
code/unsorted/3d/plot.py: camera : 4x4 numpy array
code/unsorted/3d/glm.py:import numpy as np
These seem to be the imports used in the text:
'from __future__ import absolute_import',
'from __future__ import division',
'from __future__ import print_function',
'from __future__ import unicode_literals',
'from datetime import date, datetime',
'from datetime import datetime',
'from dateutil.relativedelta import relativedelta',
'from docutils import nodes',
'from docutils.core import publish_cmdline',
'from docutils.parsers.rst import directives, Directive',
'from fluid import Fluid, inflow',
'from functools import reduce',
'from graphics import *',
'from helper import *',
'from itertools import cycle',
'from math import cos, sin, floor, sqrt, pi, ceil',
'from math import factorial',
'from math import sqrt, ceil, floor, pi, cos, sin',
'from matplotlib import colors',
'from matplotlib import ticker',
'from matplotlib.animation import FuncAnimation, writers',
'from matplotlib.artist import Artist',
'from matplotlib.backend_bases import GraphicsContextBase, RendererBase',
'from matplotlib.backends.backend_agg import FigureCanvas',
'from matplotlib.backends.backend_agg import FigureCanvasAgg',
'from matplotlib.collections import AsteriskPolygonCollection',
'from matplotlib.collections import CircleCollection',
'from matplotlib.collections import EllipseCollection',
'from matplotlib.collections import LineCollection',
'from matplotlib.collections import PatchCollection',
'from matplotlib.collections import PathCollection',
'from matplotlib.collections import PolyCollection',
'from matplotlib.collections import PolyCollection',
'from matplotlib.collections import QuadMesh',
'from matplotlib.collections import RegularPolyCollection',
'from matplotlib.collections import StarPolygonCollection',
'from matplotlib.colors import LightSource',
'from matplotlib.figure import Figure',
'from matplotlib.font_manager import FontProperties',
'from matplotlib.font_manager import findfont, FontProperties',
'from matplotlib.gridspec import GridSpec',
'from matplotlib.gridspec import GridSpec',
'from matplotlib.patches import Circle',
'from matplotlib.patches import Circle',
'from matplotlib.patches import Circle, Rectangle',
'from matplotlib.patches import ConnectionPatch',
'from matplotlib.patches import Ellipse',
'from matplotlib.patches import Ellipse',
'from matplotlib.patches import FancyBboxPatch',
'from matplotlib.patches import PathPatch',
'from matplotlib.patches import Polygon',
'from matplotlib.patches import Polygon',
'from matplotlib.patches import Polygon, Ellipse',
'from matplotlib.patches import Rectangle',
'from matplotlib.patches import Rectangle, PathPatch',
'from matplotlib.path import Path',
'from matplotlib.patheffects import Stroke, Normal',
'from matplotlib.patheffects import withStroke',
'from matplotlib.text import TextPath',
'from matplotlib.textpath import TextPath',
'from matplotlib.ticker import AutoMinorLocator, MultipleLocator, FuncFormatter',
'from matplotlib.ticker import MultipleLocator',
'from matplotlib.ticker import NullFormatter',
'from matplotlib.ticker import NullFormatter, MultipleLocator',
'from matplotlib.ticker import NullFormatter, SymmetricalLogLocator',
'from matplotlib.transforms import Affine2D',
'from matplotlib.transforms import ScaledTranslation',
'from matplotlib.transforms import blended_transform_factory, ScaledTranslation',
'from mpl_toolkits.axes_grid1 import ImageGrid',
'from mpl_toolkits.axes_grid1 import ImageGrid',
'from mpl_toolkits.axes_grid1 import make_axes_locatable',
'from mpl_toolkits.axes_grid1.inset_locator import inset_axes',
'from mpl_toolkits.axes_grid1.inset_locator import mark_inset',
'from mpl_toolkits.axes_grid1.inset_locator import mark_inset',
'from mpl_toolkits.axes_grid1.inset_locator import zoomed_inset_axes',
'from mpl_toolkits.axes_grid1.inset_locator import zoomed_inset_axes',
'from mpl_toolkits.mplot3d import Axes3D, art3d',
'from mpl_toolkits.mplot3d import Axes3D, proj3d, art3d',
'from multiprocessing import Pool',
'from numpy.random.mtrand import RandomState',
'from parameters import *',
'from pathlib import Path',
'from projections import *',
'from pylab import *',
'from scipy.ndimage import gaussian_filter',
'from scipy.ndimage import gaussian_filter1d',
'from scipy.ndimage import map_coordinates, spline_filter',
'from scipy.sparse.linalg import factorized',
'from scipy.spatial import Voronoi',
'from scipy.special import erf',
'from scipy.special import jn, jn_zeros',
'from shapely.geometry import Polygon',
'from shapely.geometry import box, Polygon',
'from skimage.color import rgb2lab, lab2rgb, rgb2xyz, xyz2rgb',
'from timeit import default_timer as timer',
'from tqdm.autonotebook import tqdm',
'import bluenoise',
'import cartopy',
'import cartopy.crs',
'import cartopy.crs as ccrs',
'import colorsys',
'import dateutil.parser',
'import git',
'import glm',
'import html.parser',
'import imageio',
'import locale',
'import math',
'import matplotlib',
'import matplotlib as mpl',
'import matplotlib.animation as animation',
'import matplotlib.animation as animation',
'import matplotlib.colors as colors',
'import matplotlib.colors as mc',
'import matplotlib.colors as mcolors',
'import matplotlib.gridspec as gridspec',
'import matplotlib.image as mpimg',
'import matplotlib.patches as mpatch',
'import matplotlib.patches as mpatches',
'import matplotlib.patches as patches',
'import matplotlib.path as mpath',
'import matplotlib.path as path',
'import matplotlib.patheffects as PathEffects',
'import matplotlib.patheffects as path_effects',
'import matplotlib.pylab as plt',
'import matplotlib.pyplot as plt',
'import matplotlib.pyplot as plt',
'import matplotlib.ticker as ticker',
'import matplotlib.transforms as transforms',
'import mpl_toolkits.axisartist.floating_axes as floating_axes',
'import mpl_toolkits.mplot3d.art3d as art3d',
'import mpmath',
'import noise',
'import numpy as np',
'import os',
'import plot',
'import re',
'import scipy',
'import scipy.sparse as sp',
'import scipy.spatial',
'import shapely.geometry',
'import sys',
'import tqdm',
'import tqdm',
'import types',
'import urllib',
'import urllib.request'