Coverage for python/lsst/afw/image/disableArithmetic.py : 76%
Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
|
"""Wrap a method providing a helpful error message about image arithmetic
Parameters ---------- cls : `type` Class in which the method is to be defined. attr : `str` Name of the method.
Returns ------- method : callable Wrapped method. """
"""Provide a helpful error message about image arithmetic
Unless we're operating on an ImageSlice, in which case it might be defined.
Parameters ---------- self : subclass of `lsst.afw.image.ImageBase` Image someone's attempting to do arithmetic with. other : anything The operand of the arithmetic operation. """ if existing is not None and isinstance(other, (ImageSliceF, ImageSliceD)): return existing(self, other) raise NotImplementedError("This arithmetic operation is not implemented, in order to prevent the " "accidental proliferation of temporaries. Please use the in-place " "arithmetic operations (e.g., += instead of +) or operate on the " "underlying arrays.")
"""Add helpful error messages about image arithmetic""" "__radd__", "__rsub__", "__rmul__", "__rtruediv__"):
"""Add helpful error messages about mask arithmetic""" "__ror__", "__rand__", "__rxor__"): |