Skip to content

Commit

Permalink
Remove deprecated getArrays()
Browse files Browse the repository at this point in the history
  • Loading branch information
parejkoj committed Apr 12, 2024
1 parent 8cdfe0a commit 96e2711
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 27 deletions.
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

0 comments on commit 96e2711

Please sign in to comment.