From 78a11d4644f2b16ddb785a12d938201e70a4cd29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20Kl=C3=B6ckner?= Date: Sun, 3 Feb 2019 19:56:45 +0100 Subject: [PATCH 1/2] CI: Stop targeting specific Py3 versions --- .gitlab-ci.yml | 32 ++++++++------------------------ 1 file changed, 8 insertions(+), 24 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 59877cae..d44dd000 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -33,15 +33,15 @@ Python 2.7 POCL: reports: junit: test/pytest.xml -Python 3.6 POCL: +Python 3 POCL: script: - - export PY_EXE=python3.6 + - export PY_EXE=python3 - export PYOPENCL_TEST=portable - export EXTRA_INSTALL="pybind11 numpy mako" - curl -L -O -k https://gitlab.tiker.net/inducer/ci-support/raw/master/build-and-test-py-project.sh - ". ./build-and-test-py-project.sh" tags: - - python3.6 + - python3 - pocl except: - tags @@ -49,31 +49,15 @@ Python 3.6 POCL: reports: junit: test/pytest.xml -Python 3.7 POCL: +Python 3 Titan X: script: - - export PY_EXE=python3.7 - - export PYOPENCL_TEST=portable - - export EXTRA_INSTALL="pybind11 numpy mako" - - curl -L -O -k https://gitlab.tiker.net/inducer/ci-support/raw/master/build-and-test-py-project.sh - - ". ./build-and-test-py-project.sh" - tags: - - python3.7 - - pocl - except: - - tags - artifacts: - reports: - junit: test/pytest.xml - -Python 3.7 Titan X: - script: - - py_version=3.7 + - py_version=3 - export PYOPENCL_TEST=nvi:titan - EXTRA_INSTALL="pybind11 numpy mako" - curl -L -O -k https://gitlab.tiker.net/inducer/ci-support/raw/master/build-and-test-py-project.sh - ". ./build-and-test-py-project.sh" tags: - - python3.7 + - python3 - nvidia-titan-x except: - tags @@ -105,7 +89,7 @@ Documentation: - curl -L -O -k https://gitlab.tiker.net/inducer/ci-support/raw/master/build-docs.sh - ". ./build-docs.sh" tags: - - python3.5 + - python3 only: - master @@ -114,7 +98,7 @@ Flake8: - curl -L -O -k https://gitlab.tiker.net/inducer/ci-support/raw/master/prepare-and-run-flake8.sh - ". ./prepare-and-run-flake8.sh sumpy test" tags: - - python3.5 + - python3 except: - tags -- GitLab From 9ee2d7d2dfb9c348c4b22e3326856367fde71274 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20Kl=C3=B6ckner?= Date: Sun, 3 Feb 2019 20:08:55 +0100 Subject: [PATCH 2/2] Fix overindentation --- sumpy/visualization.py | 52 +++++++++++++++++++++--------------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/sumpy/visualization.py b/sumpy/visualization.py index 3a4dc8df..bf5f016b 100644 --- a/sumpy/visualization.py +++ b/sumpy/visualization.py @@ -64,35 +64,35 @@ def separate_by_real_and_imag(data, real_only): def make_field_plotter_from_bbox(bbox, h, extend_factor=0): - """ - :arg bbox: a tuple (low, high) of points represented as 1D numpy arrays - indicating the low and high ends of the extent of a bounding box. - :arg h: Either a number or a sequence of numbers indicating the desired - (approximate) grid spacing in all or each of the dimensions. If a - sequence, the length must match the number of dimensions. - :arg extend_factor: A floating point number indicating by what percentage - the plot area should be grown compared to *bbox*. - """ - low, high = bbox - - extent = (high-low) * (1 + extend_factor) - center = 0.5*(high+low) - - dimensions = len(center) - from numbers import Number - if isinstance(h, Number): - h = (h,)*dimensions - else: - if len(h) != dimensions: - raise ValueError("length of 'h' must match number of dimensions") + """ + :arg bbox: a tuple (low, high) of points represented as 1D numpy arrays + indicating the low and high ends of the extent of a bounding box. + :arg h: Either a number or a sequence of numbers indicating the desired + (approximate) grid spacing in all or each of the dimensions. If a + sequence, the length must match the number of dimensions. + :arg extend_factor: A floating point number indicating by what percentage + the plot area should be grown compared to *bbox*. + """ + low, high = bbox + + extent = (high-low) * (1 + extend_factor) + center = 0.5*(high+low) + + dimensions = len(center) + from numbers import Number + if isinstance(h, Number): + h = (h,)*dimensions + else: + if len(h) != dimensions: + raise ValueError("length of 'h' must match number of dimensions") - from math import ceil + from math import ceil - npoints = tuple( - int(ceil(extent[i] / h[i])) - for i in range(dimensions)) + npoints = tuple( + int(ceil(extent[i] / h[i])) + for i in range(dimensions)) - return FieldPlotter(center, extent, npoints) + return FieldPlotter(center, extent, npoints) class FieldPlotter(object): -- GitLab