From a8636b7f00f7f5b6c7c137e032d07112c5bea8dd Mon Sep 17 00:00:00 2001 From: Michael Kuron <mkuron@icp.uni-stuttgart.de> Date: Wed, 22 Jan 2020 17:57:33 +0100 Subject: [PATCH] Fix more tests on Ubuntu --- .../00_tutorial_lbmpy_walberla_overview.ipynb | 10 ++++++++++ doc/notebooks/01_tutorial_predefinedScenarios.ipynb | 10 ++++++++++ ..._moments_cumulants_and_maxwellian_equilibrium.ipynb | 10 ++++++++++ lbmpy_tests/test_boundary_handling.py | 9 +++++++-- 4 files changed, 37 insertions(+), 2 deletions(-) diff --git a/doc/notebooks/00_tutorial_lbmpy_walberla_overview.ipynb b/doc/notebooks/00_tutorial_lbmpy_walberla_overview.ipynb index c9ade949..3046074f 100644 --- a/doc/notebooks/00_tutorial_lbmpy_walberla_overview.ipynb +++ b/doc/notebooks/00_tutorial_lbmpy_walberla_overview.ipynb @@ -1,5 +1,15 @@ { "cells": [ + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "import pytest\n", + "pytest.importorskip('pycuda')" + ] + }, { "cell_type": "code", "execution_count": 2, diff --git a/doc/notebooks/01_tutorial_predefinedScenarios.ipynb b/doc/notebooks/01_tutorial_predefinedScenarios.ipynb index f7bd479c..ec02bff6 100644 --- a/doc/notebooks/01_tutorial_predefinedScenarios.ipynb +++ b/doc/notebooks/01_tutorial_predefinedScenarios.ipynb @@ -1,5 +1,15 @@ { "cells": [ + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "import pytest\n", + "pytest.importorskip('pycuda')" + ] + }, { "cell_type": "code", "execution_count": 1, diff --git a/doc/notebooks/demo_moments_cumulants_and_maxwellian_equilibrium.ipynb b/doc/notebooks/demo_moments_cumulants_and_maxwellian_equilibrium.ipynb index 2a3f401a..3b147a96 100644 --- a/doc/notebooks/demo_moments_cumulants_and_maxwellian_equilibrium.ipynb +++ b/doc/notebooks/demo_moments_cumulants_and_maxwellian_equilibrium.ipynb @@ -695,6 +695,16 @@ "This method for deriving a discrete equilibrium works well for \"full stencils\" i.e. with $3^d$ directions, where $d$ is the dimension." ] }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "import pytest\n", + "pytest.importorskip('ipy_table')" + ] + }, { "cell_type": "code", "execution_count": 19, diff --git a/lbmpy_tests/test_boundary_handling.py b/lbmpy_tests/test_boundary_handling.py index 25589c2c..cc88ffa6 100644 --- a/lbmpy_tests/test_boundary_handling.py +++ b/lbmpy_tests/test_boundary_handling.py @@ -1,5 +1,7 @@ import numpy as np +import pytest + from lbmpy.boundaries import UBB, NeumannByCopy, NoSlip, StreamInConstant from lbmpy.boundaries.boundaryhandling import LatticeBoltzmannBoundaryHandling from lbmpy.creationfunctions import create_lb_function @@ -8,9 +10,12 @@ from lbmpy.lbstep import LatticeBoltzmannStep from pystencils import create_data_handling, make_slice -def test_simple(): +@pytest.mark.parametrize("gpu", [True, False]) +def test_simple(gpu): + import pytest + pytest.importorskip('pycuda') dh = create_data_handling((10, 5), parallel=False) - dh.add_array('pdfs', values_per_cell=9, cpu=True, gpu=True) + dh.add_array('pdfs', values_per_cell=9, cpu=True, gpu=gpu) lb_func = create_lb_function(stencil='D2Q9', compressible=False, relaxation_rate=1.8) bh = LatticeBoltzmannBoundaryHandling(lb_func.method, dh, 'pdfs') -- GitLab