Skip to content
Snippets Groups Projects
Commit 2f2fce8a authored by Michael Kuron's avatar Michael Kuron :mortar_board:
Browse files

Merge branch 'Sympy_minimal' into 'master'

Bump minimum SymPy version and add Python 3.9 to CI

See merge request !208
parents b2312d53 70b77136
No related merge requests found
......@@ -34,6 +34,29 @@ tests-and-coverage:
cobertura: coverage.xml
junit: report.xml
# pipeline with latest python version
latest-python:
stage: test
except:
variables:
- $ENABLE_NIGHTLY_BUILDS
image: i10git.cs.fau.de:5005/pycodegen/pycodegen/latest_python
script:
- env
- pip list
- export NUM_CORES=$(nproc --all)
- mkdir -p ~/.config/matplotlib
- echo "backend:template" > ~/.config/matplotlib/matplotlibrc
- mkdir public
- py.test -v -n $NUM_CORES -m "not longrun" --junitxml=report.xml
tags:
- docker
- AVX
artifacts:
when: always
reports:
junit: report.xml
# Nightly test - runs "long run" jobs only
test-longrun:
stage: test
......@@ -80,11 +103,18 @@ ubuntu:
variables:
- $ENABLE_NIGHTLY_BUILDS
image: i10git.cs.fau.de:5005/pycodegen/pycodegen/ubuntu
before_script:
- apt-get -y remove python3-sympy
- ln -s /usr/include/locale.h /usr/include/xlocale.h
- pip3 install `grep -Eo 'sympy[>=]+[0-9\.]+' setup.py | sed 's/>/=/g'`
script:
- export NUM_CORES=$(nproc --all)
- mkdir -p ~/.config/matplotlib
- echo "backend:template" > ~/.config/matplotlib/matplotlibrc
- sed -i 's/--doctest-modules //g' pytest.ini
- pytest-3 -v -m "not longrun" --junitxml=report.xml
- env
- pip3 list
- pytest-3 -v -n $NUM_CORES -m "not longrun" --junitxml=report.xml
tags:
- docker
- cuda11
......
......@@ -3,10 +3,8 @@ from subprocess import CalledProcessError
import pytest
import sympy
import pycuda.driver
import pystencils
import pystencils.cpu.cpujit
import pystencils.gpucuda.cudajit
from pystencils.backends.cbackend import CBackend
from pystencils.backends.cuda_backend import CudaBackend
......@@ -40,6 +38,7 @@ def test_custom_backends_cpu():
def test_custom_backends_gpu():
pytest.importorskip('pycuda')
import pycuda.driver
import pystencils.gpucuda.cudajit
z, x, y = pystencils.fields("z, y, x: [2d]")
......
......@@ -365,6 +365,7 @@ def test_load_data():
def test_array_handler(target):
size = (2, 2)
if target == 'gpu':
pytest.importorskip('pycuda')
array_handler = PyCudaArrayHandler()
if target == 'opencl':
pytest.importorskip('pyopencl')
......
import pytest
import sympy as sp
import pystencils as ps
......@@ -6,6 +7,7 @@ from pystencils.fast_approximation import (
def test_fast_sqrt():
pytest.importorskip('pycuda')
f, g = ps.fields("f, g: double[2D]")
expr = sp.sqrt(f[0, 0] + f[1, 0])
......@@ -28,6 +30,7 @@ def test_fast_sqrt():
def test_fast_divisions():
pytest.importorskip('pycuda')
f, g = ps.fields("f, g: double[2D]")
expr = f[0, 0] / f[1, 0]
assert len(insert_fast_divisions(expr).atoms(fast_division)) == 1
......
......@@ -2,6 +2,7 @@ import pystencils as ps
import sympy as sp
from pystencils.stencil import coefficient_list, plot_expression
import pystencils.plot as plt
def test_coefficient_list():
......@@ -9,7 +10,8 @@ def test_coefficient_list():
expr = 2 * f[1] + 3 * f[-1]
coff = coefficient_list(expr)
assert coff == [3, 0, 2]
plot_expression(expr, matrix_form=True)
figure = plt.figure()
plot_expression(expr, matrix_form=True, figure=figure)
f = ps.fields("f: double[3D]")
expr = 2 * f[1, 0, 0] + 3 * f[0, -1, 0]
......@@ -22,9 +24,11 @@ def test_coefficient_list():
# in 3D plot only works if there are entries on every of the three 2D planes. In the above examples z-1 was empty
expr = 2 * f[1, 0, 0] + 1 * f[0, -1, 0] + 1 * f[0, 0, 1] + f[0, 0, -1]
plot_expression(expr)
figure = plt.figure()
plot_expression(expr, figure=figure)
def test_plot_expression():
f = ps.fields("f: double[2D]")
plot_expression(2 * f[1, 0] + 3 * f[0, -1], matrix_form=True)
figure = plt.figure()
plot_expression(2 * f[1, 0] + 3 * f[0, -1], matrix_form=True, figure=figure)
......@@ -85,7 +85,7 @@ setuptools.setup(name='pystencils',
author_email='martin.bauer@fau.de',
url='https://i10git.cs.fau.de/pycodegen/pystencils/',
packages=['pystencils'] + ['pystencils.' + s for s in setuptools.find_packages('pystencils')],
install_requires=['sympy>=1.1', 'numpy', 'appdirs', 'joblib'],
install_requires=['sympy>=1.2', 'numpy>=1.8.0', 'appdirs', 'joblib'],
package_data={'pystencils': ['include/*.h',
'backends/cuda_known_functions.txt',
'backends/opencl1.1_known_functions.txt',
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment