From a6d0c9b8b2252e402c98233cda22b107c844e43a Mon Sep 17 00:00:00 2001 From: Matt Wala Date: Tue, 19 Mar 2019 16:38:36 -0500 Subject: [PATCH 01/13] Temporarily disable slow tests --- .gitlab-ci.yml | 208 ++++++++++++++++++++++++------------------------- 1 file changed, 104 insertions(+), 104 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1b302bbb..9f6e1182 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,107 +1,107 @@ -Python 2.7 POCL: - script: - - export PY_EXE=python2.7 - - export PYOPENCL_TEST=portable - - export EXTRA_INSTALL="pybind11 scipy 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: - - python2.7 - - pocl - - large-node - except: - - tags - artifacts: - reports: - junit: test/pytest.xml - -Python 3 POCL: - script: - - export PY_EXE=python3 - - export PYOPENCL_TEST=portable - - export EXTRA_INSTALL="pybind11 numpy scipy 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 - - pocl - - large-node - except: - - tags - artifacts: - reports: - junit: test/pytest.xml - -Python 3 POCL Examples: - script: - - test -n "$SKIP_EXAMPLES" && exit - - export PY_EXE=python3 - - export PYOPENCL_TEST=portable - - export EXTRA_INSTALL="pybind11 numpy mako pyvisfile matplotlib" - - curl -L -O -k https://gitlab.tiker.net/inducer/ci-support/raw/master/build-py-project-and-run-examples.sh - - ". ./build-py-project-and-run-examples.sh" - tags: - - python3 - - pocl - - large-node - except: - - tags - artifacts: - reports: - junit: test/pytest.xml - -Python 3 Conda: - script: - - export SUMPY_FORCE_SYMBOLIC_BACKEND=symengine - - CONDA_ENVIRONMENT=.test-conda-env-py3.yml - - REQUIREMENTS_TXT=.test-conda-env-py3-requirements.txt - - curl -L -O -k https://gitlab.tiker.net/inducer/ci-support/raw/master/build-and-test-py-project-within-miniconda.sh - - ". ./build-and-test-py-project-within-miniconda.sh" - tags: - - linux - - large-node - except: - - tags - - artifacts: - reports: - junit: test/pytest.xml - -Python 3 Conda Apple: - script: - - export LC_ALL=en_US.UTF-8 - - export LANG=en_US.UTF-8 - - export PYTEST_ADDOPTS=-k-slowtest - - CONDA_ENVIRONMENT=.test-conda-env-py3-macos.yml - - REQUIREMENTS_TXT=.test-conda-env-py3-requirements.txt - - curl -L -O -k https://gitlab.tiker.net/inducer/ci-support/raw/master/build-and-test-py-project-within-miniconda.sh - - ". ./build-and-test-py-project-within-miniconda.sh" - - # https://gitlab.tiker.net/inducer/pytential/issues/112 - allow_failure: true - - tags: - - apple - except: - - tags - retry: 2 - - # https://gitlab.tiker.net/inducer/pytential/issues/112 - allow_failure: true - - artifacts: - reports: - junit: test/pytest.xml - -Documentation: - script: - - EXTRA_INSTALL="pybind11 numpy mako" - - curl -L -O -k https://gitlab.tiker.net/inducer/ci-support/raw/master/build-docs.sh - - ". ./build-docs.sh" - tags: - - python3 - only: - - master +# Python 2.7 POCL: +# script: +# - export PY_EXE=python2.7 +# - export PYOPENCL_TEST=portable +# - export EXTRA_INSTALL="pybind11 scipy 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: +# - python2.7 +# - pocl +# - large-node +# except: +# - tags +# artifacts: +# reports: +# junit: test/pytest.xml +# +# Python 3 POCL: +# script: +# - export PY_EXE=python3 +# - export PYOPENCL_TEST=portable +# - export EXTRA_INSTALL="pybind11 numpy scipy 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 +# - pocl +# - large-node +# except: +# - tags +# artifacts: +# reports: +# junit: test/pytest.xml +# +# Python 3 POCL Examples: +# script: +# - test -n "$SKIP_EXAMPLES" && exit +# - export PY_EXE=python3 +# - export PYOPENCL_TEST=portable +# - export EXTRA_INSTALL="pybind11 numpy mako pyvisfile matplotlib" +# - curl -L -O -k https://gitlab.tiker.net/inducer/ci-support/raw/master/build-py-project-and-run-examples.sh +# - ". ./build-py-project-and-run-examples.sh" +# tags: +# - python3 +# - pocl +# - large-node +# except: +# - tags +# artifacts: +# reports: +# junit: test/pytest.xml +# +# Python 3 Conda: +# script: +# - export SUMPY_FORCE_SYMBOLIC_BACKEND=symengine +# - CONDA_ENVIRONMENT=.test-conda-env-py3.yml +# - REQUIREMENTS_TXT=.test-conda-env-py3-requirements.txt +# - curl -L -O -k https://gitlab.tiker.net/inducer/ci-support/raw/master/build-and-test-py-project-within-miniconda.sh +# - ". ./build-and-test-py-project-within-miniconda.sh" +# tags: +# - linux +# - large-node +# except: +# - tags +# +# artifacts: +# reports: +# junit: test/pytest.xml +# +# Python 3 Conda Apple: +# script: +# - export LC_ALL=en_US.UTF-8 +# - export LANG=en_US.UTF-8 +# - export PYTEST_ADDOPTS=-k-slowtest +# - CONDA_ENVIRONMENT=.test-conda-env-py3-macos.yml +# - REQUIREMENTS_TXT=.test-conda-env-py3-requirements.txt +# - curl -L -O -k https://gitlab.tiker.net/inducer/ci-support/raw/master/build-and-test-py-project-within-miniconda.sh +# - ". ./build-and-test-py-project-within-miniconda.sh" +# +# # https://gitlab.tiker.net/inducer/pytential/issues/112 +# allow_failure: true +# +# tags: +# - apple +# except: +# - tags +# retry: 2 +# +# # https://gitlab.tiker.net/inducer/pytential/issues/112 +# allow_failure: true +# +# artifacts: +# reports: +# junit: test/pytest.xml +# +# Documentation: +# script: +# - EXTRA_INSTALL="pybind11 numpy mako" +# - curl -L -O -k https://gitlab.tiker.net/inducer/ci-support/raw/master/build-docs.sh +# - ". ./build-docs.sh" +# tags: +# - python3 +# only: +# - master Flake8: script: -- GitLab From aad7b8ae0acc0cef6674f53faae448091e51490a Mon Sep 17 00:00:00 2001 From: Matt Wala Date: Tue, 19 Mar 2019 16:40:27 -0500 Subject: [PATCH 02/13] Add Pylint job --- .gitlab-ci.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9f6e1182..fc9a64a3 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -103,6 +103,17 @@ # only: # - master +Pylint: + script: + - export PY_EXE=python3 + - EXTRA_INSTALL="pybind11 numpy mako" + - curl -L -O -k https://gitlab.tiker.net/inducer/ci-support/raw/master/prepare-and-run-pylint.sh + - ". ./prepare-and-run-pylint.sh loopy test/test_*.py" + tags: + - python3 + except: + - tags + Flake8: script: - curl -L -O -k https://gitlab.tiker.net/inducer/ci-support/raw/master/prepare-and-run-flake8.sh -- GitLab From 810234bb5b03944330caaa02ff4fa2b27379859a Mon Sep 17 00:00:00 2001 From: Matt Wala Date: Tue, 19 Mar 2019 16:43:31 -0500 Subject: [PATCH 03/13] s/loopy/pytential/ --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index fc9a64a3..362b69ee 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -108,7 +108,7 @@ Pylint: - export PY_EXE=python3 - EXTRA_INSTALL="pybind11 numpy mako" - curl -L -O -k https://gitlab.tiker.net/inducer/ci-support/raw/master/prepare-and-run-pylint.sh - - ". ./prepare-and-run-pylint.sh loopy test/test_*.py" + - ". ./prepare-and-run-pylint.sh pytential test/test_*.py" tags: - python3 except: -- GitLab From 7419414af0a26a2e6488b02efed1669d61d5fc18 Mon Sep 17 00:00:00 2001 From: Matt Wala Date: Tue, 19 Mar 2019 23:03:57 +0100 Subject: [PATCH 04/13] Add matplotlib to EXTRA_INSTALL --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 362b69ee..f591a4ea 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -106,7 +106,7 @@ Pylint: script: - export PY_EXE=python3 - - EXTRA_INSTALL="pybind11 numpy mako" + - EXTRA_INSTALL="pybind11 numpy mako matplotlib" - curl -L -O -k https://gitlab.tiker.net/inducer/ci-support/raw/master/prepare-and-run-pylint.sh - ". ./prepare-and-run-pylint.sh pytential test/test_*.py" tags: -- GitLab From d4f3f85a81f464a32ffc62dcf7dc1b15f7e09744 Mon Sep 17 00:00:00 2001 From: Matt Wala Date: Tue, 19 Mar 2019 17:05:44 -0500 Subject: [PATCH 05/13] Run in editable mode --- .gitlab-ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f591a4ea..1f0f1b35 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -105,6 +105,8 @@ Pylint: script: + # Needed to avoid name shadowing issues when running from source directory. + - PROJECT_INSTALL_FLAGS="--editable" - export PY_EXE=python3 - EXTRA_INSTALL="pybind11 numpy mako matplotlib" - curl -L -O -k https://gitlab.tiker.net/inducer/ci-support/raw/master/prepare-and-run-pylint.sh -- GitLab From bc5cf7951b3332a90ed651f5da48a6b5dff4b3f1 Mon Sep 17 00:00:00 2001 From: Matt Wala Date: Sat, 30 Mar 2019 15:53:50 -0500 Subject: [PATCH 06/13] Some fixes --- .pylintrc-local.yml | 3 +++ pytential/solve.py | 2 +- pytential/source.py | 4 ++++ pytential/symbolic/compiler.py | 2 +- pytential/symbolic/execution.py | 6 ++++-- pytential/unregularized.py | 2 +- 6 files changed, 14 insertions(+), 5 deletions(-) create mode 100644 .pylintrc-local.yml diff --git a/.pylintrc-local.yml b/.pylintrc-local.yml new file mode 100644 index 00000000..58ef538e --- /dev/null +++ b/.pylintrc-local.yml @@ -0,0 +1,3 @@ +- arg: ignore +- val: + - old_diffop_primitives diff --git a/pytential/solve.py b/pytential/solve.py index dce9d8a3..82d6f68f 100644 --- a/pytential/solve.py +++ b/pytential/solve.py @@ -211,7 +211,7 @@ def _gmres(A, b, restart=None, tol=None, x0=None, dot=None, # noqa if (stall_iterations and len(residual_norms) > stall_iterations and norm_r > ( - residual_norms[-stall_iterations] + residual_norms[-stall_iterations] # noqa pylint:disable=invalid-unary-operand-type / no_progress_factor)): state = "stalled" diff --git a/pytential/source.py b/pytential/source.py index 9334dff7..dab44fe3 100644 --- a/pytential/source.py +++ b/pytential/source.py @@ -191,6 +191,10 @@ class LayerPotentialSourceBase(PotentialSource): .. method:: exec_compute_potential_insn """ + @property + def density_discr(self): + raise NotImplementedError + @property def ambient_dim(self): return self.density_discr.ambient_dim diff --git a/pytential/symbolic/compiler.py b/pytential/symbolic/compiler.py index 456044e7..cb9a9c1d 100644 --- a/pytential/symbolic/compiler.py +++ b/pytential/symbolic/compiler.py @@ -304,7 +304,7 @@ class Code(object): def dump_dataflow_graph(self): from pytools.debug import open_unique_debug_file - open_unique_debug_file("dataflow", ".dot")\ + open_unique_debug_file("dataflow", ".dot")[0]\ .write(dot_dataflow_graph(self, max_node_label_length=None)) def __str__(self): diff --git a/pytential/symbolic/execution.py b/pytential/symbolic/execution.py index 976e352f..165ab796 100644 --- a/pytential/symbolic/execution.py +++ b/pytential/symbolic/execution.py @@ -168,7 +168,7 @@ class EvaluationMapper(EvaluationMapperBase): from pytential.solve import gmres rhs = self.rec(expr.rhs) - result = gmres(scipy_op, rhs, debug=False) + result = gmres(scipy_op, rhs) return result def map_quad_kernel_op(self, expr): @@ -452,7 +452,9 @@ class GeometryCollection(object): return where in self.places def copy(self): - return GeometryCollection(self.places, auto_where=self.where) + return GeometryCollection( + self.places, + auto_where=self._default_place_ids) def get_cache(self, name): return self.caches.setdefault(name, {}) diff --git a/pytential/unregularized.py b/pytential/unregularized.py index e7fe1b3e..60ba7e02 100644 --- a/pytential/unregularized.py +++ b/pytential/unregularized.py @@ -74,7 +74,7 @@ class UnregularizedLayerPotentialSource(LayerPotentialSourceBase): if fmm_level_to_order is None: if fmm_order is not False: - def fmm_level_to_order(kernel, kernel_args, tree, level): + def fmm_level_to_order(kernel, kernel_args, tree, level): # noqa pylint:disable=function-redefined return fmm_order else: fmm_level_to_order = False -- GitLab From 37c4f232fa1ff22d158a47d1cdc63ff7a5ce5d80 Mon Sep 17 00:00:00 2001 From: Matt Wala Date: Sat, 30 Mar 2019 15:58:13 -0500 Subject: [PATCH 07/13] Fix syntax --- .pylintrc-local.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pylintrc-local.yml b/.pylintrc-local.yml index 58ef538e..5e246cf6 100644 --- a/.pylintrc-local.yml +++ b/.pylintrc-local.yml @@ -1,3 +1,3 @@ - arg: ignore -- val: - - old_diffop_primitives + val: + - old_diffop_primitives -- GitLab From d3387180bbe443539c0c0d1f979d8785d70d23e0 Mon Sep 17 00:00:00 2001 From: Matt Wala Date: Sun, 31 Mar 2019 01:46:47 -0500 Subject: [PATCH 08/13] Fix ignore list --- .pylintrc-local.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.pylintrc-local.yml b/.pylintrc-local.yml index 5e246cf6..9c0810b8 100644 --- a/.pylintrc-local.yml +++ b/.pylintrc-local.yml @@ -1,3 +1,4 @@ - arg: ignore val: - - old_diffop_primitives + - old_diffop_primitives.py + - generalized_debye.py -- GitLab From 73d01fa9032de2c73d46bfc62519d3c1aa2f6736 Mon Sep 17 00:00:00 2001 From: Matt Wala Date: Sun, 31 Mar 2019 18:22:08 -0500 Subject: [PATCH 09/13] Some more fixes --- .pylintrc-local.yml | 1 + pytential/qbx/__init__.py | 2 +- pytential/qbx/fmm.py | 2 +- pytential/qbx/utils.py | 40 +++++----------------- pytential/symbolic/pde/maxwell/__init__.py | 4 +-- test/test_scalar_int_eq.py | 24 ++++++++++++- 6 files changed, 36 insertions(+), 37 deletions(-) diff --git a/.pylintrc-local.yml b/.pylintrc-local.yml index 9c0810b8..fbd7df48 100644 --- a/.pylintrc-local.yml +++ b/.pylintrc-local.yml @@ -2,3 +2,4 @@ val: - old_diffop_primitives.py - generalized_debye.py + - waveguide.py # See issue #116 on gitlab diff --git a/pytential/qbx/__init__.py b/pytential/qbx/__init__.py index 832ddcbc..2be29cd8 100644 --- a/pytential/qbx/__init__.py +++ b/pytential/qbx/__init__.py @@ -147,7 +147,7 @@ class QBXLayerPotentialSource(LayerPotentialSourceBase): if fmm_order is False: fmm_level_to_order = False else: - def fmm_level_to_order(kernel, kernel_args, tree, level): + def fmm_level_to_order(kernel, kernel_args, tree, level): # noqa pylint:disable=function-redefined return fmm_order if _max_leaf_refine_weight is None: diff --git a/pytential/qbx/fmm.py b/pytential/qbx/fmm.py index badf6300..39189147 100644 --- a/pytential/qbx/fmm.py +++ b/pytential/qbx/fmm.py @@ -598,7 +598,7 @@ def assemble_performance_data(geo_data, uses_pde_expansions, # FIXME: This should suport target filtering. if summarize_parallel is None: - def summarize_parallel(parallel_array, sym_multipliers): + def summarize_parallel(parallel_array, sym_multipliers): # noqa pylint:disable=function-redefined return np.sum(parallel_array) * sym_multipliers from collections import OrderedDict diff --git a/pytential/qbx/utils.py b/pytential/qbx/utils.py index b0ffc066..0e711322 100644 --- a/pytential/qbx/utils.py +++ b/pytential/qbx/utils.py @@ -189,6 +189,14 @@ class TreeCodeContainerMixin(object): class TreeWranglerBase(object): + @property + def code_container(self): + raise NotImplementedError + + @property + def queue(self): + raise NotImplementedError + def build_tree(self, lpot_source, targets_list=(), use_stage2_discr=False): tb = self.code_container.build_tree() @@ -327,38 +335,6 @@ def el_view(discr, group_nr, global_array): # }}} -# {{{ discr plotter - -def plot_discr(lpot_source, outfilename="discr.pdf"): - with cl.CommandQueue(lpot_source.cl_context) as queue: - from boxtree.tree_builder import TreeBuilder - tree_builder = TreeBuilder(lpot_source.cl_context) - tree = tree_builder(queue, lpot_source).get(queue=queue) - from boxtree.visualization import TreePlotter - - import matplotlib - matplotlib.use('Agg') - import matplotlib.pyplot as plt - tp = TreePlotter(tree) - tp.draw_tree() - sources = (tree.sources[0], tree.sources[1]) - sti = tree.sorted_target_ids - plt.plot(sources[0][sti[tree.qbx_user_source_slice]], - sources[1][sti[tree.qbx_user_source_slice]], - lw=0, marker=".", markersize=1, label="sources") - plt.plot(sources[0][sti[tree.qbx_user_center_slice]], - sources[1][sti[tree.qbx_user_center_slice]], - lw=0, marker=".", markersize=1, label="centers") - plt.plot(sources[0][sti[tree.qbx_user_target_slice]], - sources[1][sti[tree.qbx_user_target_slice]], - lw=0, marker=".", markersize=1, label="targets") - plt.axis("equal") - plt.legend() - plt.savefig(outfilename) - -# }}} - - # {{{ tree-with-metadata: data structure class TreeWithQBXMetadata(Tree): diff --git a/pytential/symbolic/pde/maxwell/__init__.py b/pytential/symbolic/pde/maxwell/__init__.py index 8bdab9df..04ba7c40 100644 --- a/pytential/symbolic/pde/maxwell/__init__.py +++ b/pytential/symbolic/pde/maxwell/__init__.py @@ -225,8 +225,8 @@ class MuellerAugmentedMFIEOperator(object): S = partial(sym.S, self.kernel, qbx_forced_limit="avg") - def curl_S(dens): - return sym.curl(sym.S(self.kernel, dens, qbx_forced_limit="avg")) + def curl_S(dens, k): + return sym.curl(sym.S(self.kernel, dens, qbx_forced_limit="avg", k=k)) grad = partial(sym.grad, 3) diff --git a/test/test_scalar_int_eq.py b/test/test_scalar_int_eq.py index 72d08fcf..1e048b7f 100644 --- a/test/test_scalar_int_eq.py +++ b/test/test_scalar_int_eq.py @@ -64,6 +64,23 @@ def make_circular_point_group(ambient_dim, npoints, radius, # {{{ test cases class IntEqTestCase: + + @property + def default_helmholtz_k(self): + raise NotImplementedError + + @property + def name(self): + raise NotImplementedError + + @property + def qbx_order(self): + raise NotImplementedError + + @property + def target_order(self): + raise NotImplementedError + def __init__(self, helmholtz_k, bc_type, prob_side): """ :arg prob_side: may be -1, +1, or ``'scat'`` for a scattering problem @@ -93,6 +110,9 @@ class IntEqTestCase: class CurveIntEqTestCase(IntEqTestCase): resolutions = [40, 50, 60] + def curve_func(self, *args, **kwargs): + raise NotImplementedError + def get_mesh(self, resolution, target_order): return make_curve_mesh( self.curve_func, @@ -639,7 +659,9 @@ def run_int_eq_test(cl_ctx, queue, case, resolution, visualize): if 0: from sumpy.tools import build_matrix - mat = build_matrix(bound_op.scipy_op("u", dtype=dtype, k=case.k)) + mat = build_matrix( + bound_op.scipy_op( + queue, arg_name="u", dtype=dtype, k=case.k)) w, v = la.eig(mat) if 0: pt.imshow(np.log10(1e-20+np.abs(mat))) -- GitLab From cc49fa0ed6677dad491c51d3796c4e8c85f403f8 Mon Sep 17 00:00:00 2001 From: Matt Wala Date: Wed, 3 Apr 2019 20:16:20 -0500 Subject: [PATCH 10/13] Silence some errors --- pytential/symbolic/pde/maxwell/__init__.py | 2 +- pytential/symbolic/pde/scalar.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pytential/symbolic/pde/maxwell/__init__.py b/pytential/symbolic/pde/maxwell/__init__.py index 04ba7c40..1431f75b 100644 --- a/pytential/symbolic/pde/maxwell/__init__.py +++ b/pytential/symbolic/pde/maxwell/__init__.py @@ -244,7 +244,7 @@ class MuellerAugmentedMFIEOperator(object): F3 = (xyz_to_tangential(sym.n_cross(E1-E0) + 0.5*(mu0+mu1)*Mxyz)) # sign flip included - F4 = -sym.n_dot(mu1*H1-mu0*H0) + 0.5*(mu1+mu0)*u.rho_m + F4 = -sym.n_dot(mu1*H1-mu0*H0) + 0.5*(mu1+mu0)*u.rho_m # noqa pylint:disable=invalid-unary-operand-type return sym.join_fields(F1, F2, F3, F4) diff --git a/pytential/symbolic/pde/scalar.py b/pytential/symbolic/pde/scalar.py index 4d211916..840d8044 100644 --- a/pytential/symbolic/pde/scalar.py +++ b/pytential/symbolic/pde/scalar.py @@ -124,7 +124,7 @@ class DirichletOperator(L2WeightedPDEOperator): inv_sqrt_w_u = cse(u/sqrt_w) if map_potentials is None: - def map_potentials(x): + def map_potentials(x): # pylint:disable=function-redefined return x def S(density): # noqa @@ -236,7 +236,7 @@ class NeumannOperator(L2WeightedPDEOperator): inv_sqrt_w_u = cse(u/sqrt_w) if map_potentials is None: - def map_potentials(x): + def map_potentials(x): # pylint:disable=function-redefined return x kwargs["qbx_forced_limit"] = qbx_forced_limit -- GitLab From 46cf0b35a3cdce691ebd646e8490555bba198bdb Mon Sep 17 00:00:00 2001 From: Matt Wala Date: Wed, 3 Apr 2019 20:20:40 -0500 Subject: [PATCH 11/13] Revert "Temporarily disable slow tests" This reverts commit a6d0c9b8b2252e402c98233cda22b107c844e43a. --- .gitlab-ci.yml | 208 ++++++++++++++++++++++++------------------------- 1 file changed, 104 insertions(+), 104 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1f0f1b35..87c06040 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,107 +1,107 @@ -# Python 2.7 POCL: -# script: -# - export PY_EXE=python2.7 -# - export PYOPENCL_TEST=portable -# - export EXTRA_INSTALL="pybind11 scipy 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: -# - python2.7 -# - pocl -# - large-node -# except: -# - tags -# artifacts: -# reports: -# junit: test/pytest.xml -# -# Python 3 POCL: -# script: -# - export PY_EXE=python3 -# - export PYOPENCL_TEST=portable -# - export EXTRA_INSTALL="pybind11 numpy scipy 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 -# - pocl -# - large-node -# except: -# - tags -# artifacts: -# reports: -# junit: test/pytest.xml -# -# Python 3 POCL Examples: -# script: -# - test -n "$SKIP_EXAMPLES" && exit -# - export PY_EXE=python3 -# - export PYOPENCL_TEST=portable -# - export EXTRA_INSTALL="pybind11 numpy mako pyvisfile matplotlib" -# - curl -L -O -k https://gitlab.tiker.net/inducer/ci-support/raw/master/build-py-project-and-run-examples.sh -# - ". ./build-py-project-and-run-examples.sh" -# tags: -# - python3 -# - pocl -# - large-node -# except: -# - tags -# artifacts: -# reports: -# junit: test/pytest.xml -# -# Python 3 Conda: -# script: -# - export SUMPY_FORCE_SYMBOLIC_BACKEND=symengine -# - CONDA_ENVIRONMENT=.test-conda-env-py3.yml -# - REQUIREMENTS_TXT=.test-conda-env-py3-requirements.txt -# - curl -L -O -k https://gitlab.tiker.net/inducer/ci-support/raw/master/build-and-test-py-project-within-miniconda.sh -# - ". ./build-and-test-py-project-within-miniconda.sh" -# tags: -# - linux -# - large-node -# except: -# - tags -# -# artifacts: -# reports: -# junit: test/pytest.xml -# -# Python 3 Conda Apple: -# script: -# - export LC_ALL=en_US.UTF-8 -# - export LANG=en_US.UTF-8 -# - export PYTEST_ADDOPTS=-k-slowtest -# - CONDA_ENVIRONMENT=.test-conda-env-py3-macos.yml -# - REQUIREMENTS_TXT=.test-conda-env-py3-requirements.txt -# - curl -L -O -k https://gitlab.tiker.net/inducer/ci-support/raw/master/build-and-test-py-project-within-miniconda.sh -# - ". ./build-and-test-py-project-within-miniconda.sh" -# -# # https://gitlab.tiker.net/inducer/pytential/issues/112 -# allow_failure: true -# -# tags: -# - apple -# except: -# - tags -# retry: 2 -# -# # https://gitlab.tiker.net/inducer/pytential/issues/112 -# allow_failure: true -# -# artifacts: -# reports: -# junit: test/pytest.xml -# -# Documentation: -# script: -# - EXTRA_INSTALL="pybind11 numpy mako" -# - curl -L -O -k https://gitlab.tiker.net/inducer/ci-support/raw/master/build-docs.sh -# - ". ./build-docs.sh" -# tags: -# - python3 -# only: -# - master +Python 2.7 POCL: + script: + - export PY_EXE=python2.7 + - export PYOPENCL_TEST=portable + - export EXTRA_INSTALL="pybind11 scipy 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: + - python2.7 + - pocl + - large-node + except: + - tags + artifacts: + reports: + junit: test/pytest.xml + +Python 3 POCL: + script: + - export PY_EXE=python3 + - export PYOPENCL_TEST=portable + - export EXTRA_INSTALL="pybind11 numpy scipy 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 + - pocl + - large-node + except: + - tags + artifacts: + reports: + junit: test/pytest.xml + +Python 3 POCL Examples: + script: + - test -n "$SKIP_EXAMPLES" && exit + - export PY_EXE=python3 + - export PYOPENCL_TEST=portable + - export EXTRA_INSTALL="pybind11 numpy mako pyvisfile matplotlib" + - curl -L -O -k https://gitlab.tiker.net/inducer/ci-support/raw/master/build-py-project-and-run-examples.sh + - ". ./build-py-project-and-run-examples.sh" + tags: + - python3 + - pocl + - large-node + except: + - tags + artifacts: + reports: + junit: test/pytest.xml + +Python 3 Conda: + script: + - export SUMPY_FORCE_SYMBOLIC_BACKEND=symengine + - CONDA_ENVIRONMENT=.test-conda-env-py3.yml + - REQUIREMENTS_TXT=.test-conda-env-py3-requirements.txt + - curl -L -O -k https://gitlab.tiker.net/inducer/ci-support/raw/master/build-and-test-py-project-within-miniconda.sh + - ". ./build-and-test-py-project-within-miniconda.sh" + tags: + - linux + - large-node + except: + - tags + + artifacts: + reports: + junit: test/pytest.xml + +Python 3 Conda Apple: + script: + - export LC_ALL=en_US.UTF-8 + - export LANG=en_US.UTF-8 + - export PYTEST_ADDOPTS=-k-slowtest + - CONDA_ENVIRONMENT=.test-conda-env-py3-macos.yml + - REQUIREMENTS_TXT=.test-conda-env-py3-requirements.txt + - curl -L -O -k https://gitlab.tiker.net/inducer/ci-support/raw/master/build-and-test-py-project-within-miniconda.sh + - ". ./build-and-test-py-project-within-miniconda.sh" + + # https://gitlab.tiker.net/inducer/pytential/issues/112 + allow_failure: true + + tags: + - apple + except: + - tags + retry: 2 + + # https://gitlab.tiker.net/inducer/pytential/issues/112 + allow_failure: true + + artifacts: + reports: + junit: test/pytest.xml + +Documentation: + script: + - EXTRA_INSTALL="pybind11 numpy mako" + - curl -L -O -k https://gitlab.tiker.net/inducer/ci-support/raw/master/build-docs.sh + - ". ./build-docs.sh" + tags: + - python3 + only: + - master Pylint: script: -- GitLab From 4020017204705aba6685e23d88f82a021f7fb73f Mon Sep 17 00:00:00 2001 From: Matt Wala Date: Wed, 3 Apr 2019 20:45:48 -0500 Subject: [PATCH 12/13] Fix usage of property as abstract member - this isn't really allowed. --- pytential/qbx/__init__.py | 3 ++- pytential/qbx/refinement.py | 5 ----- pytential/qbx/target_assoc.py | 4 ---- pytential/qbx/utils.py | 10 +++------- pytential/source.py | 13 ++++++++++++- pytential/unregularized.py | 2 +- 6 files changed, 18 insertions(+), 19 deletions(-) diff --git a/pytential/qbx/__init__.py b/pytential/qbx/__init__.py index 2be29cd8..8961659e 100644 --- a/pytential/qbx/__init__.py +++ b/pytential/qbx/__init__.py @@ -172,9 +172,10 @@ class QBXLayerPotentialSource(LayerPotentialSourceBase): # }}} + LayerPotentialSourceBase.__init__(self, density_discr) + self.fine_order = fine_order self.qbx_order = qbx_order - self.density_discr = density_discr self.fmm_level_to_order = fmm_level_to_order assert target_association_tolerance is not None diff --git a/pytential/qbx/refinement.py b/pytential/qbx/refinement.py index 1911a48d..a80a8098 100644 --- a/pytential/qbx/refinement.py +++ b/pytential/qbx/refinement.py @@ -276,11 +276,6 @@ class RefinerCodeContainer(TreeCodeContainerMixin): # {{{ wrangler class RefinerWrangler(TreeWranglerBase): - - def __init__(self, code_container, queue): - self.code_container = code_container - self.queue = queue - # {{{ check subroutines for conditions 1-3 @log_process(logger) diff --git a/pytential/qbx/target_assoc.py b/pytential/qbx/target_assoc.py index 11b70c4b..25170c5f 100644 --- a/pytential/qbx/target_assoc.py +++ b/pytential/qbx/target_assoc.py @@ -433,10 +433,6 @@ class TargetAssociationCodeContainer(TreeCodeContainerMixin): class TargetAssociationWrangler(TreeWranglerBase): - def __init__(self, code_container, queue): - self.code_container = code_container - self.queue = queue - @log_process(logger) def mark_targets(self, tree, peer_lists, lpot_source, target_status, debug, wait_for=None): diff --git a/pytential/qbx/utils.py b/pytential/qbx/utils.py index 0e711322..49d9ea16 100644 --- a/pytential/qbx/utils.py +++ b/pytential/qbx/utils.py @@ -189,13 +189,9 @@ class TreeCodeContainerMixin(object): class TreeWranglerBase(object): - @property - def code_container(self): - raise NotImplementedError - - @property - def queue(self): - raise NotImplementedError + def __init__(self, queue, code_container): + self.queue = queue + self.code_container = code_container def build_tree(self, lpot_source, targets_list=(), use_stage2_discr=False): diff --git a/pytential/source.py b/pytential/source.py index dab44fe3..e628fe21 100644 --- a/pytential/source.py +++ b/pytential/source.py @@ -191,8 +191,19 @@ class LayerPotentialSourceBase(PotentialSource): .. method:: exec_compute_potential_insn """ + def __init__(self, density_discr): + self.density_discr = density_discr + + @property + def stage2_density_discr(self): + raise NotImplementedError + + @property + def quad_stage2_density_discr(self): + raise NotImplementedError + @property - def density_discr(self): + def resampler(self): raise NotImplementedError @property diff --git a/pytential/unregularized.py b/pytential/unregularized.py index 60ba7e02..4bd67ae9 100644 --- a/pytential/unregularized.py +++ b/pytential/unregularized.py @@ -66,7 +66,7 @@ class UnregularizedLayerPotentialSource(LayerPotentialSourceBase): """ :arg fmm_order: `False` for direct calculation. """ - self.density_discr = density_discr + LayerPotentialSourceBase.__init__(self, density_discr) self.debug = debug if fmm_order is not False and fmm_level_to_order is not None: -- GitLab From ff9f40eb5f17745019a14c04c468a3847e790665 Mon Sep 17 00:00:00 2001 From: Matt Wala Date: Wed, 3 Apr 2019 20:56:05 -0500 Subject: [PATCH 13/13] Flip ctor args in TreeWranglerBase --- pytential/qbx/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pytential/qbx/utils.py b/pytential/qbx/utils.py index 49d9ea16..c7d06247 100644 --- a/pytential/qbx/utils.py +++ b/pytential/qbx/utils.py @@ -189,9 +189,9 @@ class TreeCodeContainerMixin(object): class TreeWranglerBase(object): - def __init__(self, queue, code_container): - self.queue = queue + def __init__(self, code_container, queue): self.code_container = code_container + self.queue = queue def build_tree(self, lpot_source, targets_list=(), use_stage2_discr=False): -- GitLab