kumquat-buildroot/support/testing/tests/package/sample_python_scipy.py
Guillaume W. Bres 08c78cf315 support/testing/tests/test_python_scipy: add scipy::io module testing
Test the scipy::io module, to demonstrate that runtime dependencies
are correct.

Signed-off-by: Guillaume W. Bres <guillaume.bressaix@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2022-08-03 18:35:54 +02:00

17 lines
370 B
Python

import numpy
import scipy.io
import scipy.special
import scipy.integrate
cb = scipy.special.cbrt([27, 64])
assert((cb == numpy.array([3., 4.])).all())
com = scipy.special.comb(5, 2, exact = False, repetition=True)
assert(com == 15.0)
t = scipy.integrate.trapezoid([5,8,10])
assert(t == 15.5)
mdic = {"t": t, "label": "example"}
scipy.io.savemat("example.mat", mdic)