Skip to content

Commit

Permalink
Fix syntax for Python<3.11
Browse files Browse the repository at this point in the history
  • Loading branch information
astrofrog committed Apr 9, 2024
1 parent ce96be6 commit 859ac5c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions glue/core/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -1852,9 +1852,9 @@ def compute_statistic(self, statistic, cid, subset_state=None, axis=None,
else:
if not hasattr(self, '_random_subset_indices') or self._random_subset_indices[0] != data.shape:
self._random_subset_indices = (data.shape, random_indices_for_array(data, random_subset))
data = data[*self._random_subset_indices[1]]
data = data[self._random_subset_indices[1]]
if mask is not None:
mask = mask[*self._random_subset_indices[1]]
mask = mask[self._random_subset_indices[1]]

result = compute_statistic(statistic, data, mask=mask, axis=axis, finite=finite,
positive=positive, percentile=percentile)
Expand Down Expand Up @@ -1974,11 +1974,11 @@ def compute_histogram(self, cids, weights=None, range=None, bins=None,
else:
if not hasattr(self, '_random_subset_histogram_indices') or self._random_subset_histogram_indices[0] != x.shape:
self._random_subset_histogram_indices = (x.shape, random_indices_for_array(x, random_subset))
x = x[*self._random_subset_histogram_indices[1]]
x = x[self._random_subset_histogram_indices[1]]
if ndim > 1:
y = y[*self._random_subset_histogram_indices[1]]
y = y[self._random_subset_histogram_indices[1]]
if w is not None:
w = w[*self._random_subset_histogram_indices[1]]
w = w[self._random_subset_histogram_indices[1]]

# Determine correction factor by which to scale the histogram so
# that it still has the right order of magnitude
Expand Down

0 comments on commit 859ac5c

Please sign in to comment.