Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DM-39935: Remove MaskedImage.getArrays() #731

Merged
merged 1 commit into from
Apr 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions python/lsst/afw/image/_maskedImage/_maskedImageContinued.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.

from deprecated.sphinx import deprecated

import numpy as np

from lsst.utils import TemplateMeta
Expand Down Expand Up @@ -84,15 +82,6 @@ def _get(self, index, origin):
self.mask[index, origin],
self.variance[index, origin])

@deprecated(reason=("This method is being removed in favor of the individual properties."
" It will be removed after v26."),
version="v26.0", category=FutureWarning)
def getArrays(self):
"""Return a tuple (value, mask, variance) numpy arrays."""
return (self.image.array if self.image else None,
self.mask.array if self.mask else None,
self.variance.array if self.variance else None)

def convertF(self):
return MaskedImageF(self, True)

Expand Down
13 changes: 0 additions & 13 deletions tests/test_maskedImage.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,19 +113,6 @@ def tearDown(self):
del self.mimage2
del self.function

# TODO DM-39935: remove this test when you remove getArrays()
def testArrays(self):
"""
This method is testing that ``lsst.afw.image.MaskedImageF.getArrays()``
returns the proper image, mask, and variance.
"""
image, mask, variance = self.mimage.getArrays()
self.assertFloatsEqual(self.mimage.image.getArray(), image)
self.assertFloatsEqual(self.mimage.mask.getArray(), mask)
self.assertFloatsEqual(self.mimage.variance.getArray(), variance)
mimage2 = afwImage.makeMaskedImageFromArrays(image, mask, variance)
self.assertEqual(type(mimage2), type(self.mimage))

def testProperties(self):
self.assertImagesEqual(self.mimage.image, self.mimage.image)
self.assertMasksEqual(self.mimage.mask, self.mimage.mask)
Expand Down
5 changes: 2 additions & 3 deletions tests/test_stacker.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,10 +334,9 @@ def testRejectedMaskPropagation(self):
finalImage = np.array([12.0, 12.0, 12.0, 12.0], dtype=np.float32)
for i in range(4):
mi = afwImage.MaskedImageF(4, 1)
imArr, maskArr, varArr = mi.getArrays()
imArr[:, :] = np.ones((1, 4), dtype=np.float32)
mi.image.array[:, :] = np.ones((1, 4), dtype=np.float32)
maskedImageList.append(mi)
partialSum += imArr
partialSum += mi.image.array
# add one more image with all permutations of the first two bits set in
# different pixels
mi = afwImage.MaskedImageF(4, 1)
Expand Down
Loading