From ef9206a8e1933b6691c9b89c524b1537789aa871 Mon Sep 17 00:00:00 2001 From: Hao Gao Date: Sat, 8 Sep 2018 23:27:21 -0500 Subject: [PATCH 1/2] Replace inner kernel for AxisTargetDerivative --- sumpy/kernel.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sumpy/kernel.py b/sumpy/kernel.py index 768ad1a3..1ee007ad 100644 --- a/sumpy/kernel.py +++ b/sumpy/kernel.py @@ -797,6 +797,10 @@ class AxisTargetDerivative(DerivativeBase): expr = self.inner_kernel.postprocess_at_target(expr, bvec) return expr.diff(bvec[self.axis]) + def replace_inner_kernel(self, new_inner_kernel): + self.inner_kernel = new_inner_kernel + return self + mapper_method = "map_axis_target_derivative" -- GitLab From 6e01d2d0d1b3b29b932ea8c6613b36283c748c9b Mon Sep 17 00:00:00 2001 From: Hao Gao Date: Mon, 10 Sep 2018 08:16:54 -0500 Subject: [PATCH 2/2] Return a new object in replace_inner_kernel --- sumpy/kernel.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sumpy/kernel.py b/sumpy/kernel.py index 1ee007ad..3ce0bb8d 100644 --- a/sumpy/kernel.py +++ b/sumpy/kernel.py @@ -798,8 +798,7 @@ class AxisTargetDerivative(DerivativeBase): return expr.diff(bvec[self.axis]) def replace_inner_kernel(self, new_inner_kernel): - self.inner_kernel = new_inner_kernel - return self + return type(self)(self.axis, new_inner_kernel) mapper_method = "map_axis_target_derivative" -- GitLab