From 714ee0788c5f3916fb519fb16c689319eefa10ec Mon Sep 17 00:00:00 2001 From: Alexandru Fikl Date: Mon, 16 Mar 2026 13:30:41 +0200 Subject: [PATCH] fix: make TargetPointMultiplier a dataclass --- sumpy/kernel.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sumpy/kernel.py b/sumpy/kernel.py index 3861f650..df9c0468 100644 --- a/sumpy/kernel.py +++ b/sumpy/kernel.py @@ -1447,6 +1447,7 @@ def prepare_loopy_kernel(self, loopy_knl: lp.TranslationUnit) -> lp.TranslationU return lp.tag_array_axes(loopy_knl, self.dir_vec_name, "sep,C") +@dataclass(frozen=True) class TargetPointMultiplier(KernelWrapper): """Bases: :class:`Kernel` @@ -1463,8 +1464,8 @@ class TargetPointMultiplier(KernelWrapper): """Coordinate axis with which to multiply the kernel.""" def __init__(self, axis: int, inner_kernel: Kernel) -> None: - KernelWrapper.__init__(self, inner_kernel) - self.axis = axis + super().__init__(inner_kernel) + object.__setattr__(self, "axis", axis) @override def __str__(self) -> str: