Active Topics

 


Reply
Thread Tools
Posts: 1,269 | Thanked: 3,961 times | Joined on May 2011 @ Brazil
#1
SciPy is a Python module for scientific calculations, using C/C++, Fortran, BLAS and LAPACK. SciPy supplements the popular NumPy module (python-numpy package), gathering a variety of high level science and engineering modules together as a single package.

SciPy is a set of open source scientific and numeric tools for Python. It currently supports special functions, integration, ordinary differential equation (ODE) solvers, gradient optimization, genetic algorithms, parallel programming tools, an expression-to-C++ compiler for fast execution, and others.

Version history :
- SciPy 0.14.0 (03/05/2014) ported to MeeGo 1.2 Harmattan in 28/09/2014.

SciPy 0.14.0 Harmattan is based on Ubuntu 14.10 version and SciPy 0.14.0 source code, but without Python 3 support, no documentation package, adapted dependencies to MeeGo Harmattan, etc.

Installing SciPy 0.14.0 on MeeGo Harmattan

SciPy has 2 repositories options, so it can be :
- easily installed by using Warehouse / OpenRepos.net. Install Warehouse (OpenRepos.net client) for MeeGo Harmattan, then open Warehouse, search for "SciPy", enable the repository and install;
- installed by using my Harmattan repository.

Warehouse showing SciPy 0.14.0 available to install :


SciPy 0.14.0 takes 45MB, but it also installs python-decorator, NumPy >= 1.9.0, libgfortran3, libblas3gf and liblapack3gf, total of approx. 70MB after installation.

Using SciPy on MeeGo Harmattan

It is strongly suggested to also install IPython for MeeGo Harmattan, so the interactive use of SciPy becomes a lot easier. With the new IPython 0.13.2 Harmattan, there are 3 interfaces : IPython terminal, IPython Notebook and IPython Qt console.

Time to load SciPy on Nokia N9 : 0.4-0.6 s (v0.14.0) by using 'from scipy import *' or 'import scipy'.

Documentation for SciPy

SciPy documentation is in the official SciPy site with SciPy Reference Guide, both online as well as in PDF and other formats. SciPy help in interactive mode is available by typing "help(scipy)" (after an "import scipy").

Python for MeeGo Harmattan

More Python packages are listed in the Python Harmattan Wiki. See also OpenRepos.net.
__________________
Python, C/C++, Qt and CAS developer. For Maemo/MeeGo/Sailfish :
Integral, Derivative, Limit - calculating mathematical integrals, derivatives and limits. SymPy - Computer Algebra System.
MatPlotLib - 2D & 3D plots in Python. IPython - Python interactive shell.
-- My blog about mobile & scientific computing ---
Sailfish : Sony Xperia X, Gemini, Jolla, Jolla C, Jolla Tablet, Nexus 4. Nokia N9, N900, N810.

Last edited by rcolistete; 2014-10-11 at 18:32. Reason: Added screenshot of SciPy 0.14.0 in Warehouse
 

The Following 4 Users Say Thank You to rcolistete For This Useful Post:
Posts: 1,269 | Thanked: 3,961 times | Joined on May 2011 @ Brazil
#2
SciPy 0.14.0 (03/05/2014) for MeeGo Harmattan :
- is the latest version, complete with C/C++, Fortran, BLAS and LAPACK speed;
- was compiled and packaged for MeeGo Harmattan in .deb using the Harmattan SDK on device (i.e., on Nokia N9, with chroot), it took 149min06s. Cython and SuiteSparse compilation dependencies took 36min08s and 64m49s to compile and package, respectively.
__________________
Python, C/C++, Qt and CAS developer. For Maemo/MeeGo/Sailfish :
Integral, Derivative, Limit - calculating mathematical integrals, derivatives and limits. SymPy - Computer Algebra System.
MatPlotLib - 2D & 3D plots in Python. IPython - Python interactive shell.
-- My blog about mobile & scientific computing ---
Sailfish : Sony Xperia X, Gemini, Jolla, Jolla C, Jolla Tablet, Nexus 4. Nokia N9, N900, N810.

Last edited by rcolistete; 2014-09-29 at 10:26.
 

The Following 3 Users Say Thank You to rcolistete For This Useful Post:
Posts: 1,269 | Thanked: 3,961 times | Joined on May 2011 @ Brazil
#3
Benchmark of Python & SciPy on some mobile devices :
- XPS15 : Dell XPS 15 L502X, Core i7 2670QM 4 cores @ 2.2-3.1 GHz, 1+6 MB cache L2/L3, 8GB RAM DDR3 1,333 MHz, 1TB 5,400 RPM SATA hard drive. Ubuntu 12.04 64 bits, Python 2.7.3, NumPy 1.6.1, SciPy 0.9.0;
- A1215B : Asus 1215B, AMD C-50 2 cores @ 1.0GHz, 1 MB cache L2, 2GB RAM DDR3 1,066 MHz, 320 GB 5,400 RPM SATA hard drive. Ubuntu 14.04 64 bits, Python 2.7.6, NumPy 1.8.2, SciPy 0.13.3;
- A1005HA : Asus 1005HA, Atom N270 @ 1.6 GHz, 512 KB cache L2, 2GB RAM DDR2 667 MHz, 250 GB 5,400 RPM SATA hard drive. XUbuntu 14.04 32 bits, Python 2.7.6, NumPy 1.8.2, SciPy 0.13.3;
- N9 : Nokia N9, TI OMAP 3630 ARM Cortex A8 @ 1.0 GHz, 1GB RAM. MeeGo Harmattan, Python 2.6.6, Numpy 1.9.0, SciPy 0.14.0;
- N900 : Nokia N900, TI OMAP 3430 ARM Cortex A8 @ 600 MHz, 256 MB RAM. Maemo 5, Python 2.5.4, NumPy 1.4.0, SciPy 0.7.1. Easy Debian with Python 2.6.6, NumPy 1.4.1, SciPy 0.7.2;
- N810 : Nokia N810, TI OMAP 2420 ARM11 @ 400 MHz, 128 MB RAM. Maemo 4, Python 2.5.2. Easy Debian with Python 2.6.6, NumPy 1.4.1, SciPy 0.7.2.

1) SciPy FFT of a vector (10^6 elements) :
Code:
import time
t1=time.time()
import numpy as np
from scipy import fft
from scipy import fftpack
t2=time.time()
print "NumPy&SciPy import : %f s" % (t2-t1)
d = np.linspace(0, 1e3, 1e6)
t3=time.time()
print "NumPy linspace 10**6 : %f s" % (t3-t2)
fft(d)
t4=time.time();
print "SciPy FFT 10**6 : %f s" % (t4-t3)
fftpack.fft(d)
t5=time.time();
print "SciPy FFTPack 10**6 : %f s" % (t5-t4)
XPS15 : 0.106/0.0571 s
A1215B : 0.678/0.342 s
A1005HA : 1.03/0.499 s
N9 : 3.80/1.79 s
N900 : 6.83/3.63 s
N810 : 50.7/23.1 s (Easy Debian)

2) Triple numerical integral of (x*y*z)**(x+y+z) :
Code:
import time
t1=time.time()
from scipy.integrate import tplquad
t2=time.time()
print "SciPy tplquad import : %f s" % (t2-t1)
result = tplquad(lambda x, y, z: (x*y*z)**(x+y+z), 0, 1, lambda y: 0, lambda y: 1, lambda y, z: 0, lambda y, z: 1)
t3=time.time();
print "SciPy tplquad (x*y*z)**(x+y+z) : %f s" % (t3-t2)
print result
XPS15 : 5.32 s
A1215B : 28.6 s
A1005HA : 45.1 s
N9 : 119 s
N900 : convergence error with SciPy 0.7.1 on Maemo, 466s (Easy Debian)
N810 : 992 s (Easy Debian)
The same integral calculated by SymPy takes : 1212s on Nokia N810, 591s on Nokia N900, 121s on Nexus 4.

Conclusions from the above Python & NumPy calculations :
- N9 @ 1.0 GHz is 80%-3x% faster than N900 @ 600 MHz, greater than 66.67% expected by clock only;
- N9 is 7x-12x faster than N810;
- N900 is 1.1-6.4x faster than N810;
- Asus 1005HA (a netbook released in October 2008) with Atom N270 @ 1.6 GHz CPU is 1.6-2.7x faster than N9, 5.6-9.3x faster than N900, 21-48x faster than N810;
- Asus 1215B (a low-end notebook in 2012) with AMD C-50AMD C-50 CPU is 3.2-4.6x faster than N9, 9-15x faster than N900, 34-74x faster than N810;
- Dell XPS 15 L502X (a high-end notebook in 2012) with Core i7 2670QM CPU is 21-35x faster than N9, 63-87x faster than N900, 185-477x faster than N810.

See also benchmark of Python & NumPy on some mobile devices.
__________________
Python, C/C++, Qt and CAS developer. For Maemo/MeeGo/Sailfish :
Integral, Derivative, Limit - calculating mathematical integrals, derivatives and limits. SymPy - Computer Algebra System.
MatPlotLib - 2D & 3D plots in Python. IPython - Python interactive shell.
-- My blog about mobile & scientific computing ---
Sailfish : Sony Xperia X, Gemini, Jolla, Jolla C, Jolla Tablet, Nexus 4. Nokia N9, N900, N810.

Last edited by rcolistete; 2014-10-22 at 21:14. Reason: Added timings for Asus 1005HA
 

The Following 3 Users Say Thank You to rcolistete For This Useful Post:
Reply

Tags
calculations, python, scientific, scipy


 
Forum Jump


All times are GMT. The time now is 13:42.