Commit 4f41d979 authored by Jan Hönig's avatar Jan Hönig
Browse files

Merge branch 'develop' into 'master'

Update conftest and readme

See merge request pycodegen/pystencils!167
parents 2d758462 458bff59
......@@ -22,7 +22,7 @@ tests-and-coverage:
- py.test -v -n $NUM_CORES --cov-report html --cov-report term --cov=. -m "not longrun" --html test-report/index.html
tags:
- docker
- cuda
- cuda11
- AVX
artifacts:
when: always
......@@ -44,7 +44,7 @@ test-longrun:
- py.test -v -n $NUM_CORES --cov-report html --cov-report term --cov=. --html test-report/index.html
tags:
- docker
- cuda
- cuda11
- AVX
artifacts:
paths:
......@@ -80,7 +80,7 @@ ubuntu:
- pytest-3 -v -m "not longrun"
tags:
- docker
- cuda
- cuda11
- AVX
minimal-conda:
......@@ -146,7 +146,7 @@ pycodegen-integration:
- make -j $NUM_CORES
tags:
- docker
- cuda
- cuda11
- AVX
# -------------------- Linter & Documentation --------------------------------------------------------------------------
......
......@@ -2,16 +2,16 @@ pystencils
==========
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/mabau/pystencils/master?filepath=doc%2Fnotebooks)
[![Docs](https://img.shields.io/badge/read-the_docs-brightgreen.svg)](http://pycodegen.pages.walberla.net/pystencils)
[![Docs](https://img.shields.io/badge/read-the_docs-brightgreen.svg)](https://pycodegen.pages.i10git.cs.fau.de/pystencils)
[![pypi-package](https://badge.fury.io/py/pystencils.svg)](https://badge.fury.io/py/pystencils)
[![pipeline status](https://i10git.cs.fau.de/pycodegen/pystencils/badges/master/pipeline.svg)](https://i10git.cs.fau.de/pycodegen/pystencils/commits/master)
[![coverage report](https://i10git.cs.fau.de/pycodegen/pystencils/badges/master/coverage.svg)](http://pycodegen.pages.walberla.net/pystencils/coverage_report)
[![coverage report](https://i10git.cs.fau.de/pycodegen/pystencils/badges/master/coverage.svg)](http://pycodegen.pages.i10git.cs.fau.de/pystencils/coverage_report)
Run blazingly fast stencil codes on numpy arrays.
*pystencils* uses sympy to define stencil operations, that can be executed on numpy arrays.
Exploiting the stencil structure makes *pystencils* run faster than normal numpy code and even as Cython and numba,
[as demonstrated in this notebook](http://pycodegen.pages.walberla.net/pystencils/notebooks/demo_benchmark.html).
[as demonstrated in this notebook](https://pycodegen.pages.i10git.cs.fau.de/pystencils/notebooks/demo_benchmark.html).
Here is a code snippet that computes the average of neighboring cells:
......@@ -21,7 +21,7 @@ import numpy as np
f, g = ps.fields("f, g : [2D]")
stencil = ps.Assignment(g[0, 0],
(f[1, 0] + f[-1, 0] + f[0, 1] + f[0, -1]) / 4)
(f[1, 0] + f[-1, 0] + f[0, 1] + f[0, -1]) / 4)
kernel = ps.create_kernel(stencil).compile()
f_arr = np.random.rand(1000, 1000)
......@@ -39,9 +39,6 @@ discretize = ps.fd.Discretization2ndOrder(dx=1, dt=0.01)
discretization = discretize(adv_diff_pde)
```
Look at the [documentation](http://pycodegen.pages.walberla.net/pystencils) to learn more.
Installation
------------
......@@ -69,5 +66,5 @@ pip install pystencils[interactive,gpu,doc]
Documentation
-------------
Read the docs [here](http://pycodegen.pages.walberla.net/pystencils) and
Read the docs [here](https://pycodegen.pages.i10git.cs.fau.de/pystencils) and
check out the Jupyter notebooks in `doc/notebooks`.
......@@ -25,6 +25,12 @@ except ImportError:
SCRIPT_FOLDER = os.path.dirname(os.path.realpath(__file__))
sys.path.insert(0, os.path.abspath('pystencils'))
# the Ubuntu pipeline uses an older version of pytest which uses deprecated functionality.
# This leads to many warinings in the test and coverage pipeline.
pytest_numeric_version = [int(x, 10) for x in pytest.__version__.split('.')]
pytest_numeric_version.reverse()
pytest_version = sum(x * (100 ** i) for i, x in enumerate(pytest_numeric_version))
def add_path_to_ignore(path):
if not os.path.exists(path):
......@@ -152,8 +158,10 @@ class IPyNbFile(pytest.File):
warnings.filterwarnings("ignore", "IPython.core.inputsplitter is deprecated")
notebook = nbformat.read(notebook_contents, 4)
code, _ = exporter.from_notebook_node(notebook)
yield IPyNbTest(self.name, self, code)
# pytest v 2.4>: yield IPyNbTest.from_parent(name=self.name, parent=self, code=code)
if pytest_version >= 50403:
yield IPyNbTest.from_parent(name=self.name, parent=self, code=code)
else:
yield IPyNbTest(self.name, self, code)
def teardown(self):
pass
......@@ -162,5 +170,7 @@ class IPyNbFile(pytest.File):
def pytest_collect_file(path, parent):
glob_exprs = ["*demo*.ipynb", "*tutorial*.ipynb", "test_*.ipynb"]
if any(path.fnmatch(g) for g in glob_exprs):
return IPyNbFile(path, parent)
# pytest v 2.4 >: return IPyNbFile.from_parent(fspath=path, parent=parent)
if pytest_version >= 50403:
return IPyNbFile.from_parent(fspath=path, parent=parent)
else:
return IPyNbFile(path, parent)
Markdown is supported
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