Skip to content
Snippets Groups Projects
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 !167
parents 2d758462 458bff59
Branches
Tags
No related merge requests found
...@@ -22,7 +22,7 @@ tests-and-coverage: ...@@ -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 - py.test -v -n $NUM_CORES --cov-report html --cov-report term --cov=. -m "not longrun" --html test-report/index.html
tags: tags:
- docker - docker
- cuda - cuda11
- AVX - AVX
artifacts: artifacts:
when: always when: always
...@@ -44,7 +44,7 @@ test-longrun: ...@@ -44,7 +44,7 @@ test-longrun:
- py.test -v -n $NUM_CORES --cov-report html --cov-report term --cov=. --html test-report/index.html - py.test -v -n $NUM_CORES --cov-report html --cov-report term --cov=. --html test-report/index.html
tags: tags:
- docker - docker
- cuda - cuda11
- AVX - AVX
artifacts: artifacts:
paths: paths:
...@@ -80,7 +80,7 @@ ubuntu: ...@@ -80,7 +80,7 @@ ubuntu:
- pytest-3 -v -m "not longrun" - pytest-3 -v -m "not longrun"
tags: tags:
- docker - docker
- cuda - cuda11
- AVX - AVX
minimal-conda: minimal-conda:
...@@ -146,7 +146,7 @@ pycodegen-integration: ...@@ -146,7 +146,7 @@ pycodegen-integration:
- make -j $NUM_CORES - make -j $NUM_CORES
tags: tags:
- docker - docker
- cuda - cuda11
- AVX - AVX
# -------------------- Linter & Documentation -------------------------------------------------------------------------- # -------------------- Linter & Documentation --------------------------------------------------------------------------
......
...@@ -2,16 +2,16 @@ pystencils ...@@ -2,16 +2,16 @@ pystencils
========== ==========
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/mabau/pystencils/master?filepath=doc%2Fnotebooks) [![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) [![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) [![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. Run blazingly fast stencil codes on numpy arrays.
*pystencils* uses sympy to define stencil operations, that can be executed 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, 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: Here is a code snippet that computes the average of neighboring cells:
...@@ -21,7 +21,7 @@ import numpy as np ...@@ -21,7 +21,7 @@ import numpy as np
f, g = ps.fields("f, g : [2D]") f, g = ps.fields("f, g : [2D]")
stencil = ps.Assignment(g[0, 0], 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() kernel = ps.create_kernel(stencil).compile()
f_arr = np.random.rand(1000, 1000) f_arr = np.random.rand(1000, 1000)
...@@ -39,9 +39,6 @@ discretize = ps.fd.Discretization2ndOrder(dx=1, dt=0.01) ...@@ -39,9 +39,6 @@ discretize = ps.fd.Discretization2ndOrder(dx=1, dt=0.01)
discretization = discretize(adv_diff_pde) discretization = discretize(adv_diff_pde)
``` ```
Look at the [documentation](http://pycodegen.pages.walberla.net/pystencils) to learn more.
Installation Installation
------------ ------------
...@@ -69,5 +66,5 @@ pip install pystencils[interactive,gpu,doc] ...@@ -69,5 +66,5 @@ pip install pystencils[interactive,gpu,doc]
Documentation 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`. check out the Jupyter notebooks in `doc/notebooks`.
...@@ -25,6 +25,12 @@ except ImportError: ...@@ -25,6 +25,12 @@ except ImportError:
SCRIPT_FOLDER = os.path.dirname(os.path.realpath(__file__)) SCRIPT_FOLDER = os.path.dirname(os.path.realpath(__file__))
sys.path.insert(0, os.path.abspath('pystencils')) 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): def add_path_to_ignore(path):
if not os.path.exists(path): if not os.path.exists(path):
...@@ -152,8 +158,10 @@ class IPyNbFile(pytest.File): ...@@ -152,8 +158,10 @@ class IPyNbFile(pytest.File):
warnings.filterwarnings("ignore", "IPython.core.inputsplitter is deprecated") warnings.filterwarnings("ignore", "IPython.core.inputsplitter is deprecated")
notebook = nbformat.read(notebook_contents, 4) notebook = nbformat.read(notebook_contents, 4)
code, _ = exporter.from_notebook_node(notebook) code, _ = exporter.from_notebook_node(notebook)
yield IPyNbTest(self.name, self, code) if pytest_version >= 50403:
# pytest v 2.4>: yield IPyNbTest.from_parent(name=self.name, parent=self, code=code) yield IPyNbTest.from_parent(name=self.name, parent=self, code=code)
else:
yield IPyNbTest(self.name, self, code)
def teardown(self): def teardown(self):
pass pass
...@@ -162,5 +170,7 @@ class IPyNbFile(pytest.File): ...@@ -162,5 +170,7 @@ class IPyNbFile(pytest.File):
def pytest_collect_file(path, parent): def pytest_collect_file(path, parent):
glob_exprs = ["*demo*.ipynb", "*tutorial*.ipynb", "test_*.ipynb"] glob_exprs = ["*demo*.ipynb", "*tutorial*.ipynb", "test_*.ipynb"]
if any(path.fnmatch(g) for g in glob_exprs): if any(path.fnmatch(g) for g in glob_exprs):
return IPyNbFile(path, parent) if pytest_version >= 50403:
# pytest v 2.4 >: return IPyNbFile.from_parent(fspath=path, parent=parent) return IPyNbFile.from_parent(fspath=path, parent=parent)
else:
return IPyNbFile(path, parent)
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