Skip to content

Commit a969c89

Browse files
alexfiklinducer
authored andcommitted
fix: make TargetPointMultiplier a dataclass
1 parent 21c6735 commit a969c89

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

sumpy/kernel.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1447,6 +1447,7 @@ def prepare_loopy_kernel(self, loopy_knl: lp.TranslationUnit) -> lp.TranslationU
14471447
return lp.tag_array_axes(loopy_knl, self.dir_vec_name, "sep,C")
14481448

14491449

1450+
@dataclass(frozen=True)
14501451
class TargetPointMultiplier(KernelWrapper):
14511452
"""Bases: :class:`Kernel`
14521453
@@ -1463,8 +1464,8 @@ class TargetPointMultiplier(KernelWrapper):
14631464
"""Coordinate axis with which to multiply the kernel."""
14641465

14651466
def __init__(self, axis: int, inner_kernel: Kernel) -> None:
1466-
KernelWrapper.__init__(self, inner_kernel)
1467-
self.axis = axis
1467+
super().__init__(inner_kernel)
1468+
object.__setattr__(self, "axis", axis)
14681469

14691470
@override
14701471
def __str__(self) -> str:

0 commit comments

Comments
 (0)