Skip to content

Commit 29e7a8c

Browse files
committed
Use numpy.linspace to generate grid
1 parent ba62453 commit 29e7a8c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/iris/coords.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2334,7 +2334,10 @@ def from_regular(
23342334
bounds values will be defined. Defaults to False.
23352335
23362336
"""
2337-
points = (zeroth + step) + step * np.arange(count, dtype=np.float32)
2337+
start = zeroth + step
2338+
end = zeroth + (count * step)
2339+
points = np.linspace(start, end, num=count, dtype=np.float32)
2340+
23382341
_, regular = iris.util.points_step(points)
23392342
if not regular:
23402343
points = (zeroth + step) + step * np.arange(

0 commit comments

Comments
 (0)