mirror of
https://gitlab.com/buildroot.org/buildroot.git
synced 2026-09-28 21:11:41 -09:00
package/python-sympy: new package
SymPy is a Python library for symbolic mathematics. It aims to become a full-featured computer algebra system (CAS) while keeping the code as simple as possible in order to be comprehensible and easily extensible. SymPy is written entirely in Python. https://www.sympy.org/ Signed-off-by: Julien Olivain <ju.o@free.fr> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
This commit is contained in:
committed by
Thomas Petazzoni
parent
b9c09bd3c4
commit
d46b0936ce
15
support/testing/tests/package/sample_python_sympy.py
Normal file
15
support/testing/tests/package/sample_python_sympy.py
Normal file
@@ -0,0 +1,15 @@
|
||||
#! /usr/bin/env python3
|
||||
|
||||
from sympy import symbols, expand, factor
|
||||
|
||||
x, y = symbols('x y')
|
||||
|
||||
expr = x + 2*y
|
||||
|
||||
expanded_expr = expand(x*expr)
|
||||
print(expanded_expr)
|
||||
assert str(expanded_expr) == "x**2 + 2*x*y"
|
||||
|
||||
factored_expr = factor(expanded_expr)
|
||||
print(factored_expr)
|
||||
assert str(factored_expr) == "x*(x + 2*y)"
|
||||
Reference in New Issue
Block a user