Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a test suite for numpy / scipy?

I'm about to reinstall numpy and scipy on my Ubuntu Lucid. As these things carry quite a few dependencies, I'm wondering if there is a comprehensive test suite to check if the new install really works.

Of course, I can just take a bunch of my scripts and run them one by one to see if they keep working, but that won't guard against a situation where at some point in the future I'll try to use something I didn't use before and it'll break (or, worse, silently produce nonsence).

like image 363
ev-br Avatar asked Feb 08 '12 20:02

ev-br


People also ask

Which testing framework is used in NumPy?

Until the 1.15 release, NumPy used the nose testing framework, it now uses the pytest framework.

Which is better NumPy or SciPy?

NumPy is written in C and so has a faster computational speed. SciPy is written in Python and so has a slower execution speed but vast functionality.

Does NumPy have SciPy?

SciPy builds on NumPy. All the numerical code resides in SciPy. The SciPy module consists of all the NumPy functions. It is however better to use the fast processing NumPy.

Is SciPy built on top of NumPy?

What is SciPy? SciPy is an open-source Python library which is used to solve scientific and mathematical problems. It is built on the NumPy extension and allows the user to manipulate and visualize data with a wide range of high-level commands.


2 Answers

Yes. Both packages have a test method for this.

import numpy numpy.test('full')  import scipy scipy.test('full') 

You will need to have pytest and hypothesis installed to run numpy.test.

like image 101
David Alber Avatar answered Oct 05 '22 21:10

David Alber


Note that binary packages for the mathematical libraries Scipy and Numpy depend on, shipped by Linux distributions, have in some cases showed to be subtly broken. Running Numpy and Scipy test suites with numpy.test() and scipy.test() is recommended, as a first step to confirm that your installation functions properly. If it doesn't, you may want to try another set of binaries if available, or buy some above-mentioned commercial packages.

from http://www.scipy.org/Download

like image 29
msw Avatar answered Oct 05 '22 21:10

msw