@@ -122,7 +122,7 @@ by looking at the type of the returned object:
122122
123123 The `solution_3_bis() ` returns a generator that can be used to generate the
124124full list or to iterate over all the different elements. In any case, the huge
125- speedup comes from the non-instantiation of the full list and it is this
125+ speedup comes from the non-instantiation of the full list and it is thus
126126important to wonder if you need an actual instance of your result or if a
127127simple generator might do the job.
128128
@@ -265,8 +265,7 @@ CUDA parallel computation API from Python.
265265 b = np.random.uniform(0 , 1 , 1000 ).astype(np.float32)
266266 c = np.zeros_like(a)
267267
268- evaluate(drv.Out(c), drv.In(a), drv.In(b),
269- block = (400 ,1 ,1 ), grid = (1 ,1 ))
268+ evaluate(drv.Out(c), drv.In(a), drv.In(b), block = (400 ,1 ,1 ), grid = (1 ,1 ))
270269
271270
272271 PyOpenCL
@@ -292,13 +291,12 @@ and other massively parallel compute devices from Python.
292291 gpu_b = cl.Buffer(ctx, mf.READ_ONLY | mf.COPY_HOST_PTR , hostbuf = b)
293292
294293 evaluate = cl.Program(ctx, """
295- __kernel void evaluate(
296- __global const float *gpu_a;
297- __global const float *gpu_b;
298- __global float *gpu_c)
294+ __kernel void evaluate(__global const float *gpu_a;
295+ __global const float *gpu_b;
296+ __global float *gpu_c)
299297 {
300- int gid = get_global_id(0);
301- gpu_c[gid] = 2*gpu_a[gid] + 3*gpu_b[gid];
298+ int gid = get_global_id(0);
299+ gpu_c[gid] = 2*gpu_a[gid] + 3*gpu_b[gid];
302300 }
303301 """ ).build()
304302
@@ -308,45 +306,72 @@ and other massively parallel compute devices from Python.
308306
309307
310308
311- Scipy & friends
312- ---------------
313-
314- Here is a very short list of packages that are well-maintained, well tested and
315- may simplify your scientific life (depending on your domain). There are of
316- course many more and depending on your specific needs, chances are you do not
317- have to program everything by yourself. But it is a good exercise if you have
318- some spare time. For an extensive list, have a look at the `Awesome python list
319- <https://awesome-python.com> `_.
320-
321- * `scikit-image <http://scikit-image.org >`_ is a Python package dedicated to
322- image processing, and using natively NumPy arrays as image objects. This
323- chapter describes how to use scikit-image on various image processing tasks,
324- and insists on the link with other scientific Python modules such as NumPy
325- and SciPy.
326-
327- * `scikit-learn <http://scikit-learn.org/stable/ >`_ is a free software machine
328- learning library for the Python programming language. It features various
329- classification, regression and clustering algorithms including support vector
330- machines, random forests, gradient boosting, k-means and DBSCAN, and is
331- designed to interoperate with the Python numerical and scientific libraries
332- NumPy and SciPy.
333-
334- * The `Astropy <http://www.astropy.org >`_ project is a community effort to
335- develop a single core package for astronomy in Python and foster
336- interoperability between Python astronomy packages.
337-
338- * `Cartopy <http://scitools.org.uk/cartopy/ >`_ is a Python package designed to
339- make drawing maps for data analysis and visualisation as easy as
340- possible. Cartopy makes use of the powerful PROJ.4, numpy and shapely
341- libraries and has a simple and intuitive drawing interface to matplotlib for
342- creating publication quality maps.
343-
344- * `Brian <http://www.briansimulator.org >`_ is a free, open source simulator for
345- spiking neural networks. It is written in the Python programming language and
346- is available on almost all platforms. We believe that a simulator should not
347- only save the time of processors, but also the time of scientists. Brian is
348- therefore designed to be easy to learn and use, highly flexible and easily
349- extensible.
309+ ..
310+ Friends of Scipy
311+ ----------------
312+
313+ Here is a very short list of packages that are well-maintained, well tested and
314+ may simplify your scientific life (depending on your domain). There are of
315+ course many more and depending on your specific needs, chances are you do not
316+ have to program everything by yourself. But it is a good exercise if you have
317+ some spare time. For an extensive list, have a look at the `Awesome python list
318+ <https://awesome-python.com> `_.
319+
320+ scikit-learn
321+ ++++++++++++
322+
323+ `scikit-learn <http://scikit-learn.org/stable/ >`_ is a free software machine
324+ learning library for the Python programming language. It features various
325+ classification, regression and clustering algorithms including support vector
326+ machines, random forests, gradient boosting, k-means and DBSCAN, and is
327+ designed to interoperate with the Python numerical and scientific libraries
328+ NumPy and SciPy.
329+
330+
331+ scikit-image
332+ ++++++++++++
333+
334+ `scikit-image <http://scikit-image.org >`_ is a Python package dedicated to
335+ image processing, and using natively NumPy arrays as image objects. This
336+ chapter describes how to use scikit-image on various image processing tasks,
337+ and insists on the link with other scientific Python modules such as NumPy and
338+ SciPy.
339+
340+ SympPy
341+ ++++++
342+
343+ `SymPy <http://www.sympy.org/en/index.html >`_ is a Python library for symbolic
344+ mathematics. It aims to become a full-featured computer algebra system (CAS)
345+ while keeping the code as simple as possible in order to be comprehensible and
346+ easily extensible. SymPy is written entirely in Python.
347+
348+ Astropy
349+ +++++++
350+
351+ The `Astropy <http://www.astropy.org >`_ project is a community effort to
352+ develop a single core package for astronomy in Python and foster
353+ interoperability between Python astronomy packages.
354+
355+
356+ Cartopy
357+ +++++++
358+
359+ `Cartopy <http://scitools.org.uk/cartopy/ >`_ is a Python package designed to
360+ make drawing maps for data analysis and visualisation as easy as
361+ possible. Cartopy makes use of the powerful PROJ.4, numpy and shapely libraries
362+ and has a simple and intuitive drawing interface to matplotlib for creating
363+ publication quality maps.
364+
365+
366+ Brian
367+ +++++
368+
369+ `Brian <http://www.briansimulator.org >`_ is a free, open source simulator for
370+ spiking neural networks. It is written in the Python programming language and
371+ is available on almost all platforms. We believe that a simulator should not
372+ only save the time of processors, but also the time of scientists. Brian is
373+ therefore designed to be easy to learn and use, highly flexible and easily
374+ extensible.
350375
351376
352377Conclusion
@@ -356,7 +381,7 @@ Numpy is a very versatile library but still, it does not mean you have to use
356381it in every situation. In this chapter, we've seen some alternatives (including
357382Python itself) that are worth a look. As always, the choice belongs to you. You
358383have to consider what is the best solution for you in term of development time,
359- computation time and effort in maintenance. In onen hand, if you design your
384+ computation time and effort in maintenance. In one hand, if you design your
360385own solution, you'll have to test it and to maintain it, but in exchange,
361386you'll be free to design it the way you want. On the other hand, if you decide
362387to rely on a third-party package, you'll save time in development and benefit
0 commit comments