Skip to content

Commit

Permalink
Make the Coord.cell method lazy
Browse files Browse the repository at this point in the history
  • Loading branch information
bouweandela committed Jan 11, 2024
1 parent b11af45 commit 23c6df2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/iris/coords.py
Original file line number Diff line number Diff line change
Expand Up @@ -2092,7 +2092,7 @@ def cell(self, index):
"""
index = iris.util._build_full_slice_given_keys(index, self.ndim)

point = tuple(np.array(self.points[index], ndmin=1).flatten())
point = tuple(np.array(self.core_points()[index], ndmin=1).flatten())
if len(point) != 1:
raise IndexError(
"The index %s did not uniquely identify a single "
Expand All @@ -2101,7 +2101,7 @@ def cell(self, index):

bound = None
if self.has_bounds():
bound = tuple(np.array(self.bounds[index], ndmin=1).flatten())
bound = tuple(np.array(self.core_bounds()[index], ndmin=1).flatten())

if self.units.is_time_reference():
point = self.units.num2date(point)
Expand Down

0 comments on commit 23c6df2

Please sign in to comment.