Skip to content

Commit

Permalink
Use np.ptp rather than ndarray method for compatibility with numpy 2.x.
Browse files Browse the repository at this point in the history
  • Loading branch information
Carifio24 committed Jun 24, 2024
1 parent 2cec104 commit a092281
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions glue_qt/plugins/dendro_viewer/data_viewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def _update_limits(self, layout=None):
x, y = self.state._layout.xy
x, y = x[::3], y[::3]
xlim = np.array([x.min(), x.max()])
xpad = .05 * xlim.ptp()
xpad = .05 * np.ptp(xlim)
xlim[0] -= xpad
xlim[1] += xpad

Expand All @@ -56,7 +56,7 @@ def _update_limits(self, layout=None):
ylim[0] /= pad
ylim[1] *= pad
else:
pad = .05 * ylim.ptp()
pad = .05 * np.ptp(ylim)
ylim[0] -= pad
ylim[1] += pad

Expand Down

0 comments on commit a092281

Please sign in to comment.