diff --git a/grudge/models/second_order.py b/grudge/models/second_order.py index 24260c0f7012ab7bbd6f7adc0fc23a0248bbee32..61aa72a097d914c2213c095d0556bf2738454ffb 100644 --- a/grudge/models/second_order.py +++ b/grudge/models/second_order.py @@ -156,8 +156,8 @@ class NeumannBCGenerator(mappers.IdentityMapper): "operator encountered by stab term generator") from grudge.symbolic import BoundaryNormalComponent - return (self.bc * factor * - BoundaryNormalComponent(self.tag, expr.op.xyz_axis)) + return (self.bc * factor + * BoundaryNormalComponent(self.tag, expr.op.xyz_axis)) elif isinstance(expr.op, sym.FluxOperatorBase): return 0 diff --git a/grudge/models/wave.py b/grudge/models/wave.py index 19229abe81cb3ed567cb4346174f3f2eff8e577c..40710eb2363b7e475f1be299f1b69540343309be 100644 --- a/grudge/models/wave.py +++ b/grudge/models/wave.py @@ -36,8 +36,8 @@ from pytools.obj_array import join_fields # {{{ constant-velocity class StrongWaveOperator(HyperbolicOperator): - """This operator discretizes the wave equation - :math:`\\partial_t^2 u = c^2 \\Delta u`. + r"""This operator discretizes the wave equation + :math:`\partial_t^2 u = c^2 \Delta u`. To be precise, we discretize the hyperbolic system @@ -156,7 +156,7 @@ class StrongWaveOperator(HyperbolicOperator): -self.c*np.dot(nabla, v), -self.c*(nabla*u) ) - + + + # noqa: W504 sym.InverseMassOperator()( sym.FaceMassOperator()( flux(sym.int_tpair(w)) @@ -181,8 +181,8 @@ class StrongWaveOperator(HyperbolicOperator): class WeakWaveOperator(HyperbolicOperator): - """This operator discretizes the wave equation - :math:`\\partial_t^2 u = c^2 \\Delta u`. + r"""This operator discretizes the wave equation + :math:`\partial_t^2 u = c^2 \Delta u`. To be precise, we discretize the hyperbolic system @@ -321,8 +321,8 @@ class WeakWaveOperator(HyperbolicOperator): # {{{ variable-velocity class VariableCoefficientWeakWaveOperator(HyperbolicOperator): - """This operator discretizes the wave equation - :math:`\\partial_t^2 u = c^2 \\Delta u`. + r"""This operator discretizes the wave equation + :math:`\partial_t^2 u = c^2 \Delta u`. To be precise, we discretize the hyperbolic system diff --git a/grudge/symbolic/compiler.py b/grudge/symbolic/compiler.py index 976beed9b8cc6ec20d6420203509f0ba954372ff..4a58961b66966485294092ba9baa60476b209afd 100644 --- a/grudge/symbolic/compiler.py +++ b/grudge/symbolic/compiler.py @@ -592,6 +592,8 @@ class Code(object): # }}} +# }}} + # {{{ assignment aggregration pass @@ -721,8 +723,8 @@ def aggregate_assignments(inf_mapper, instructions, result, other_indirect_origins = get_complete_origins_set( other_assign, skip_levels=1) - if (my_assign not in other_indirect_origins and - other_assign not in my_indirect_origins): + if (my_assign not in other_indirect_origins + and other_assign not in my_indirect_origins): did_work = True # aggregate the two assignments diff --git a/grudge/symbolic/mappers/__init__.py b/grudge/symbolic/mappers/__init__.py index 5304d647f542400f12b67fecc34dd0f377b23375..2b0b2242de11e6180d7889a2ec87a3b9e18a08f7 100644 --- a/grudge/symbolic/mappers/__init__.py +++ b/grudge/symbolic/mappers/__init__.py @@ -658,8 +658,8 @@ class GlobalToReferenceMapper(CSECachingMapperMixin, IdentityMapper): return sum( sym.inverse_metric_derivative( rst_axis, expr.op.xyz_axis, - ambient_dim=self.ambient_dim, dim=self.dim) * - ref_class(rst_axis, dd_in=dd_in)(rec_field) + ambient_dim=self.ambient_dim, dim=self.dim) + * ref_class(rst_axis, dd_in=dd_in)(rec_field) for rst_axis in range(self.dim)) if isinstance(expr.op, op.MassOperator): @@ -677,8 +677,9 @@ class GlobalToReferenceMapper(CSECachingMapperMixin, IdentityMapper): jac_in_surf * self.rec(expr.field)) elif isinstance(expr.op, op.StiffnessOperator): - return op.RefMassOperator()(jac_noquad * - self.rec( + return op.RefMassOperator()( + jac_noquad + * self.rec( op.DiffOperator(expr.op.xyz_axis)(expr.field))) elif isinstance(expr.op, op.DiffOperator): @@ -1048,7 +1049,7 @@ class _InnerDerivativeJoiner(pymbolic.mapper.RecursiveMapper): class DerivativeJoiner(CSECachingMapperMixin, IdentityMapper): - """Joins derivatives: + r"""Joins derivatives: .. math:: diff --git a/grudge/symbolic/primitives.py b/grudge/symbolic/primitives.py index 7c92087da0cff9e2e1ad62f4fc62a63c4e89baf2..2afb3d21bdd6639480691c3e904386f809641d00 100644 --- a/grudge/symbolic/primitives.py +++ b/grudge/symbolic/primitives.py @@ -613,7 +613,7 @@ def mv_normal(dd, ambient_dim, dim=None): pder = ( pseudoscalar(ambient_dim, dim, dd=dd) - / + / # noqa: W504 area_element(ambient_dim, dim, dd=dd)) return cse( # Dorst Section 3.7.2 diff --git a/test/test_grudge.py b/test/test_grudge.py index 9537a31d6f0eb658d6b131407c57fc5cd6711f2d..cf820f4c89f259a03e74b1ef37436f4c45833afc 100644 --- a/test/test_grudge.py +++ b/test/test_grudge.py @@ -193,7 +193,7 @@ def test_2d_gauss_theorem(ctx_factory): sym.integral(( sym.nabla(2) * f(sym.nodes(2)) ).sum()) - - + - # noqa: W504 sym.integral( sym.interp("vol", sym.BTAG_ALL)(f(sym.nodes(2))) .dot(sym.normal(sym.BTAG_ALL, 2)),