From f865e59b693cf1a7b70cad9e15dee5351fd8f36b Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner Date: Fri, 20 Apr 2018 15:55:35 -0500 Subject: [PATCH] Switch some functionality to new pytools logging infrastructure --- meshmode/discretization/connection/refinement.py | 7 +++---- meshmode/mesh/generation.py | 6 ++---- setup.py | 2 +- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/meshmode/discretization/connection/refinement.py b/meshmode/discretization/connection/refinement.py index 2cf13580..fb06dc5d 100644 --- a/meshmode/discretization/connection/refinement.py +++ b/meshmode/discretization/connection/refinement.py @@ -30,6 +30,8 @@ import pyopencl.array # noqa import logging logger = logging.getLogger(__name__) +from pytools import log_process + # {{{ Build interpolation batches for group @@ -110,6 +112,7 @@ def _build_interpolation_batches_for_group( # }}} +@log_process(logger) def make_refinement_connection(refiner, coarse_discr, group_factory): """Return a :class:`meshmode.discretization.connection.DiscretizationConnection` @@ -144,8 +147,6 @@ def make_refinement_connection(refiner, coarse_discr, group_factory): group_factory, real_dtype=coarse_discr.real_dtype) - logger.info("building refinement connection: start") - groups = [] with cl.CommandQueue(fine_discr.cl_context) as queue: for group_idx, (coarse_discr_group, fine_discr_group, record) in \ @@ -157,8 +158,6 @@ def make_refinement_connection(refiner, coarse_discr, group_factory): queue, group_idx, coarse_discr_group, fine_discr_group, record)))) - logger.info("building refinement connection: done") - return DirectDiscretizationConnection( from_discr=coarse_discr, to_discr=fine_discr, diff --git a/meshmode/mesh/generation.py b/meshmode/mesh/generation.py index ac4928b7..03b89ba5 100644 --- a/meshmode/mesh/generation.py +++ b/meshmode/mesh/generation.py @@ -31,6 +31,7 @@ import modepy as mp import logging logger = logging.getLogger(__name__) +from pytools import log_process __doc__ = """ @@ -785,6 +786,7 @@ def generate_warped_rect_mesh(dim, order, n): # {{{ warp_and_refine_until_resolved +@log_process(logger) def warp_and_refine_until_resolved( unwarped_mesh_or_refiner, warp_callable, est_rel_interp_tolerance): """Given an original ("un-warped") :class:`meshmode.mesh.Mesh` and a @@ -803,8 +805,6 @@ def warp_and_refine_until_resolved( from modepy.modal_decay import simplex_interp_error_coefficient_estimator_matrix from meshmode.mesh.refinement import Refiner, RefinerWithoutAdjacency - logger.info("warp_and_refine_until_resolved: start") - if isinstance(unwarped_mesh_or_refiner, (Refiner, RefinerWithoutAdjacency)): refiner = unwarped_mesh_or_refiner unwarped_mesh = refiner.get_current_mesh() @@ -855,8 +855,6 @@ def warp_and_refine_until_resolved( unwarped_mesh = refiner.refine(refine_flags) iteration += 1 - logger.info("warp_and_refine_until_resolved: done") - return unwarped_mesh # }}} diff --git a/setup.py b/setup.py index f9778b8c..688e9f92 100644 --- a/setup.py +++ b/setup.py @@ -45,7 +45,7 @@ def main(): "modepy", "gmsh_interop", "six", - "pytools>=2013.1", + "pytools>=2018.4", "pytest>=2.3", "loo.py>=2014.1", ], -- GitLab