Skip to content

Commit 0eaf4db

Browse files
authored
Merge pull request #2147 from larrybradley/fix-np-deprecation
Use reshape instead of directly setting a shape due to numpy deprecation
2 parents 2c2e65b + 52693bf commit 0eaf4db

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

photutils/psf/model_plotting.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,9 @@ def _reshape_grid(self, data):
9999
nypsfs = self.model._ygrid.shape[0]
100100
nxpsfs = self.model._xgrid.shape[0]
101101
ny, nx = self.model.data.shape[1:]
102-
data.shape = (nypsfs, nxpsfs, ny, nx)
103-
104-
return data.transpose([0, 2, 1, 3]).reshape(nypsfs * ny, nxpsfs * nx)
102+
return (data.reshape(nypsfs, nxpsfs, ny, nx)
103+
.transpose([0, 2, 1, 3])
104+
.reshape(nypsfs * ny, nxpsfs * nx))
105105

106106
@_plot_grid_docstring
107107
def plot_grid(self, *, ax=None, vmax_scale=None, peak_norm=False,

0 commit comments

Comments
 (0)