Commit 0153b244 authored by Jan Hönig's avatar Jan Hönig
Browse files

Merge branch 'Update_pipeline' into 'master'

Update conftest and readme

See merge request pycodegen/lbmpy!38
parents 956c5c44 16250e9d
......@@ -21,7 +21,7 @@ tests-and-coverage:
- py.test -v -n $NUM_CORES --cov-report html --cov-report term --cov=. -m "not longrun"
tags:
- docker
- cuda
- cuda11
- AVX
artifacts:
when: always
......@@ -43,7 +43,7 @@ test-longrun:
- py.test -v -n $NUM_CORES --cov-report html --cov-report term --cov=.
tags:
- docker
- cuda
- cuda11
- AVX
artifacts:
paths:
......@@ -79,7 +79,7 @@ ubuntu:
- pytest-3 -v -m "not longrun"
tags:
- docker
- cuda
- cuda11
minimal-conda:
stage: test
......@@ -124,7 +124,7 @@ pycodegen-integration:
- make -j $NUM_CORES
tags:
- docker
- cuda
- cuda11
- AVX
# -------------------- Linter & Documentation --------------------------------------------------------------------------
......@@ -140,7 +140,7 @@ flake8-lint:
- flake8 lbmpy
tags:
- docker
- cuda
- cuda11
build-documentation:
......@@ -153,7 +153,7 @@ build-documentation:
- sphinx-build -W -b html doc html_doc
tags:
- docker
- cuda
- cuda11
artifacts:
paths:
- html_doc
......
......@@ -2,9 +2,9 @@ lbmpy
=====
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/mabau/lbmpy/master?filepath=doc%2Fnotebooks)
[![Docs](https://img.shields.io/badge/read-the_docs-brightgreen.svg)](http://pycodegen.pages.walberla.net/lbmpy)
[![Docs](https://img.shields.io/badge/read-the_docs-brightgreen.svg)](http://pycodegen.pages.i10git.cs.fau.de/lbmpy)
[![pipeline status](https://i10git.cs.fau.de/pycodegen/lbmpy/badges/master/pipeline.svg)](https://i10git.cs.fau.de/pycodegen/lbmpy/commits/master)
[![coverage report](https://i10git.cs.fau.de/pycodegen/lbmpy/badges/master/coverage.svg)](http://pycodegen.pages.walberla.net/lbmpy/coverage_report)
[![coverage report](https://i10git.cs.fau.de/pycodegen/lbmpy/badges/master/coverage.svg)](http://pycodegen.pages.i10git.cs.fau.de/lbmpy/coverage_report)
Run fast fluid simulations based on the lattice Boltzmann method in Python on CPUs and GPUs.
......@@ -39,7 +39,7 @@ pip install lbmpy[interactive]
Without `[interactive]` you get a minimal version with very little dependencies.
All options:
- `gpu`: use this if nVidia GPU is available and CUDA is installed
- `gpu`: use this if a NVIDIA GPU is available and CUDA is installed
- `opencl`: use this to enable the target `opencl` (execution using OpenCL)
- `alltrafos`: pulls in additional dependencies for loop simplification e.g. libisl
- `interactive`: installs dependencies to work in Jupyter including image I/O, plotting etc.
......@@ -53,5 +53,5 @@ pip install lbmpy[interactive,gpu,doc]
Documentation
-------------
Read the docs [here](http://pycodegen.pages.walberla.net/lbmpy) and
Read the docs [here](http://pycodegen.pages.i10git.cs.fau.de/lbmpy) and
check out the Jupyter notebooks in `doc/notebooks`.
......@@ -21,6 +21,12 @@ from lbmpy.phasefield.simplex_projection import simplex_projection_2d # NOQA
SCRIPT_FOLDER = os.path.dirname(os.path.realpath(__file__))
sys.path.insert(0, os.path.abspath('lbmpy'))
# 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):
......@@ -121,7 +127,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)
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
......@@ -130,4 +139,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)
if pytest_version >= 50403:
return IPyNbFile.from_parent(fspath=path, parent=parent)
else:
return IPyNbFile(path, parent)
......@@ -456,7 +456,7 @@ def extract_monomials(sequence_of_polynomials, dim=3):
>>> extract_monomials([x**2 + y**2 + y, y + y**2])
{(0, 2, 0), (0, 1, 0), (2, 0, 0)}
>>> extract_monomials([x**2 + y**2 + y, y + y**2], dim=2)
{(0, 1), (2, 0), (0, 2)}
{(0, 1), (0, 2), (2, 0)}
"""
monomials = set()
for polynomial in sequence_of_polynomials:
......@@ -479,8 +479,8 @@ def monomial_to_polynomial_transformation_matrix(monomials, polynomials):
>>> mons = list(extract_monomials(polys, dim=2))
>>> monomial_to_polynomial_transformation_matrix(mons, polys)
Matrix([
[7, 3, 2],
[9, -5, 0]])
[ 3, 2, 7],
[-5, 0, 9]])
"""
dim = len(monomials[0])
......
......@@ -38,7 +38,7 @@ def test_simplifications_srt_d2q9_incompressible():
def test_simplifications_srt_d2q9_compressible():
omega = sp.symbols('omega')
method = create_srt(get_stencil("D2Q9"), omega, compressible=True, equilibrium_order=2)
check_method(method, [53, 57, 1], [53, 41, 1])
check_method(method, [53, 58, 1], [53, 42, 1])
def test_simplifications_trt_d2q9_incompressible():
......@@ -50,7 +50,7 @@ def test_simplifications_trt_d2q9_incompressible():
def test_simplifications_trt_d2q9_compressible():
o1, o2 = sp.symbols("omega_1 omega_2")
method = create_trt(get_stencil("D2Q9"), o1, o2, compressible=True)
check_method(method, [77, 105, 1], [65, 55, 1])
check_method(method, [77, 106, 1], [65, 56, 1])
def test_simplifications_trt_d3q19_force_incompressible():
......@@ -64,4 +64,4 @@ def test_simplifications_trt_d3q19_force_compressible():
o1, o2 = sp.symbols("omega_1 omega_2")
force_model = Guo([sp.Rational(1, 3), sp.Rational(1, 2), sp.Rational(1, 5)])
method = create_trt_with_magic_number(get_stencil("D3Q19"), o1, compressible=False, force_model=force_model)
check_method(method, [270, 283, 1], [243, 177, 1])
check_method(method, [270, 284, 1], [243, 178, 1])
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