28 """Wrap a method providing a helpful error message about image arithmetic
33 Class in which the method is to be defined.
42 existing = getattr(cls, attr,
None)
44 def notImplemented(self, other):
45 """Provide a helpful error message about image arithmetic
47 Unless we're operating on an ImageSlice, in which case it might be
52 self : subclass of `lsst.afw.image.ImageBase`
53 Image someone's attempting to do arithmetic with.
55 The operand of the arithmetic operation.
57 if existing
is not None and isinstance(other, (ImageSliceF, ImageSliceD)):
58 return existing(self, other)
59 raise NotImplementedError(
"This arithmetic operation is not implemented, in order to prevent the "
60 "accidental proliferation of temporaries. Please use the in-place "
61 "arithmetic operations (e.g., += instead of +) or operate on the "