Skip to content

Commit 3c579a9

Browse files
Merge pull request #5273 from neutrinoceros/bug/numpy-2.4-minmax-out
2 parents 4849e84 + f5b925b commit 3c579a9

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

yt/fields/field_functions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def get_radius(data, field_prefix, ftype):
3030
np.abs(r, r)
3131
np.subtract(r, DW.d[i], rdw)
3232
np.abs(rdw, rdw)
33-
np.minimum(r, rdw, r)
33+
np.minimum(r, rdw, out=r)
3434
np.multiply(r, r, r)
3535
np.add(radius2.d, r, radius2.d)
3636
if data.ds.dimensionality < i + 1:

yt/frontends/tipsy/io.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ def _update_domain(self, data_file):
266266
pp["Coordinates"]["y"].min(),
267267
pp["Coordinates"]["z"].min(),
268268
],
269-
mi,
269+
out=mi,
270270
)
271271
np.maximum(
272272
ma,
@@ -275,7 +275,7 @@ def _update_domain(self, data_file):
275275
pp["Coordinates"]["y"].max(),
276276
pp["Coordinates"]["z"].max(),
277277
],
278-
ma,
278+
out=ma,
279279
)
280280
ind += c
281281
# We extend by 1%.

yt/utilities/amr_kdtree/amr_kdtools.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def receive_and_reduce(comm, incoming_rank, image, add_to_front, *, use_opacity=
2727
return image
2828

2929
ta = 1.0 - front[:, :, 3]
30-
np.maximum(ta, 0.0, ta)
30+
np.maximum(ta, 0.0, out=ta)
3131
# This now does the following calculation, but in a memory
3232
# conservative fashion
3333
# image[:,:,i ] = front[:,:,i] + ta*back[:,:,i]

yt/utilities/initial_conditions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def __call__(self, grid, sub_select=None):
3838
cr2 = self.core_radius**2
3939
for i, ax in enumerate("xyz"):
4040
np.add(r, (grid[ax] - self.center[i]) ** 2.0, r)
41-
np.maximum(r, cr2, r)
41+
np.maximum(r, cr2, out=r)
4242
ind = r <= r2
4343
if sub_select is not None:
4444
ind &= sub_select

yt/visualization/volume_rendering/old_camera.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2173,8 +2173,8 @@ def _render(self, double_check, num_threads, image, sampler):
21732173
+ width / 2.0 * off2 * east_vector
21742174
+ width / 2.0 * off3 * normal_vector
21752175
)
2176-
np.minimum(mi, this_point, mi)
2177-
np.maximum(ma, this_point, ma)
2176+
np.minimum(mi, this_point, out=mi)
2177+
np.maximum(ma, this_point, out=ma)
21782178
# Now we have a bounding box.
21792179
data_source = ds.region(self.center, mi, ma)
21802180

0 commit comments

Comments
 (0)