From c52f78609953c213e68f21ba9c9ebfc2b1e552b6 Mon Sep 17 00:00:00 2001 From: Alexandru Fikl Date: Fri, 24 Apr 2026 21:04:59 +0300 Subject: [PATCH 1/2] chore: remove some old mypy stuff --- grudge/array_context.py | 1 - grudge/models/euler.py | 2 +- pyproject.toml | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/grudge/array_context.py b/grudge/array_context.py index e2ad0087..3ca0b9f2 100644 --- a/grudge/array_context.py +++ b/grudge/array_context.py @@ -262,7 +262,6 @@ def _dag_to_compiled_func(self, dict_of_named_arrays: DictOfNamedArrays, from pytato import number_distributed_tags prev_mpi_base_tag = self.actx.mpi_base_tag - # type-ignore-reason: 'PytatoPyOpenCLArrayContext' has no 'mpi_communicator' # pylint: disable=no-member distributed_partition, new_mpi_base_tag = number_distributed_tags( self.actx.mpi_communicator, diff --git a/grudge/models/euler.py b/grudge/models/euler.py index 2f67a760..23bfc4b3 100644 --- a/grudge/models/euler.py +++ b/grudge/models/euler.py @@ -372,7 +372,7 @@ def interp_to_quad(u): return op.inverse_mass( dcoll, - volume_fluxes - op.face_mass(dcoll, df, interface_fluxes) # type: ignore[operator] + volume_fluxes - op.face_mass(dcoll, df, interface_fluxes) ) # }}} diff --git a/pyproject.toml b/pyproject.toml index c4ed31dc..5610745a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -52,7 +52,7 @@ doc = [ "sphinx>=4", ] test = [ - "mypy", + "basedpyright", "pytest", "ruff" ] From d7abe02c67398213838c4bf183f7c56332d5e4c0 Mon Sep 17 00:00:00 2001 From: Alexandru Fikl Date: Fri, 24 Apr 2026 21:06:21 +0300 Subject: [PATCH 2/2] chore: remove some old pylint stuff --- examples/wave/wave-op-var-velocity.py | 1 - grudge/array_context.py | 13 +++---------- test/mesh_data.py | 2 +- test/test_grudge.py | 4 ++-- 4 files changed, 6 insertions(+), 14 deletions(-) diff --git a/examples/wave/wave-op-var-velocity.py b/examples/wave/wave-op-var-velocity.py index 47c763f2..43cb2bbd 100644 --- a/examples/wave/wave-op-var-velocity.py +++ b/examples/wave/wave-op-var-velocity.py @@ -98,7 +98,6 @@ def wave_operator(actx, dcoll, c, w): obj_array.flat( -op.weak_local_div(dcoll, dd_quad, c_quad*v_quad), -op.weak_local_grad(dcoll, dd_quad, c_quad*u_quad) - # pylint: disable=invalid-unary-operand-type ) + op.face_mass( dcoll, dd_allfaces_quad, diff --git a/grudge/array_context.py b/grudge/array_context.py index 3ca0b9f2..50407881 100644 --- a/grudge/array_context.py +++ b/grudge/array_context.py @@ -238,17 +238,11 @@ def _dag_to_compiled_func(self, dict_of_named_arrays: DictOfNamedArrays, dict_of_named_arrays) distributed_partition = pt.find_distributed_partition( - # pylint-ignore-reason: - # '_BasePytatoArrayContext' has no - # 'mpi_communicator' member - # pylint: disable=no-member self.actx.mpi_communicator, dict_of_named_arrays) if __debug__: - # pylint-ignore-reason: - # '_BasePytatoArrayContext' has no 'mpi_communicator' member pt.verify_distributed_partition( - self.actx.mpi_communicator, # pylint: disable=no-member + self.actx.mpi_communicator, distributed_partition) self.actx._compile_trace_callback(self.f, "post_find_distributed_partition", @@ -262,7 +256,6 @@ def _dag_to_compiled_func(self, dict_of_named_arrays: DictOfNamedArrays, from pytato import number_distributed_tags prev_mpi_base_tag = self.actx.mpi_base_tag - # pylint: disable=no-member distributed_partition, new_mpi_base_tag = number_distributed_tags( self.actx.mpi_communicator, distributed_partition, @@ -371,8 +364,8 @@ def __call__(self, arg_id_to_arg) -> ArrayContainer: assert isinstance(self.actx, PytatoPyOpenCLArrayContext | PyOpenCLArrayContext) out_dict = execute_distributed_partition( self.distributed_partition, self.part_id_to_prg, - self.actx.queue, self.actx.mpi_communicator, # pylint: disable=no-member - allocator=self.actx.allocator, # pylint: disable=no-member + self.actx.queue, self.actx.mpi_communicator, + allocator=self.actx.allocator, input_args=input_args_for_prg) def to_output_template(keys, _): diff --git a/test/mesh_data.py b/test/mesh_data.py index 5063fa07..0476caf2 100644 --- a/test/mesh_data.py +++ b/test/mesh_data.py @@ -59,7 +59,7 @@ def get_mesh(self, resolution, mesh_order=None): if mesh_order is None: mesh_order = 4 return mgen.make_curve_mesh( - self.curve_fn, # pylint: disable=no-member + self.curve_fn, np.linspace(0.0, 1.0, resolution + 1), mesh_order) diff --git a/test/test_grudge.py b/test/test_grudge.py index 0993a6c3..5d40fce2 100644 --- a/test/test_grudge.py +++ b/test/test_grudge.py @@ -137,7 +137,7 @@ def _ellipse_surface_area(radius, aspect_ratio): # NOTE: hardcoded value so we don't need scipy for the test ellip_e = 1.2110560275684594 else: - from scipy.special import ellipe # pylint: disable=no-name-in-module + from scipy.special import ellipe ellip_e = ellipe(eccentricity) @@ -1093,7 +1093,7 @@ def test_bessel(actx_factory: ArrayContextFactory): # FIXME: Bessel functions need to brought out of the symbolic # layer. Related issue: https://github.com/inducer/grudge/issues/93 def bessel_j(actx, n, r): - from grudge import bind, sym # pylint: disable=no-name-in-module + from grudge import bind, sym return bind(dcoll, sym.bessel_j(n, sym.var("r")))(actx, r=r) # https://dlmf.nist.gov/10.6.1