Description: Cope with changes in min and max functions in NumPy 2
Author: Rafael Laboissière <rafael@debian.org>
Forwarded: no
Last-Update: 2025-02-01

--- plplot-5.15.0+dfsg2.orig/examples/python/x08.py
+++ plplot-5.15.0+dfsg2/examples/python/x08.py
@@ -103,14 +103,14 @@ def main(w):
     a = 0.9*x0
     y0 = 0.5*(YPTS - 1)
     b = 0.7*y0
-    for i in range(indexxmin, indexxmax):
-         square_root = sqrt(1. - min(1., ((double(i) - x0)/a)**2))
+    for i in range(int(indexxmin), int(indexxmax)):
+         square_root = sqrt(1. - minimum(1., ((double(i) - x0)/a)**2))
          # Add 0.5 to find nearest integer and therefore preserve symmetry
          # with regard to lower and upper bound of y range.
-         indexymin[i] = max(0, int(0.5 + y0 - b*square_root))
+         indexymin[i] = maximum(0, int(0.5 + y0 - b*square_root))
          # indexymax calculated with the convention that it is 1
          # greater than highest valid index.
-         indexymax[i] = min(YPTS, 1 + int(0.5 + y0 + b*square_root))
+         indexymax[i] = minimum(YPTS, 1 + int(0.5 + y0 + b*square_root))
          zlimited[i][indexymin[i]:indexymax[i]] = z[i][indexymin[i]:indexymax[i]]
 
     w.pllightsource(1., 1., 1.)
--- plplot-5.15.0+dfsg2.orig/examples/python/x21.py
+++ plplot-5.15.0+dfsg2/examples/python/x21.py
@@ -131,8 +131,8 @@ def main(w):
                         if isnan(zg[i][j]):
                             zg[i][j] = 0.0
                             dist = 0.0
-                            for ii in range(max(i-1,0),min(i+2,xp)):
-                                for jj in range(max(j-1,0),min(j+2,yp)):
+                            for ii in range(maximum(i-1,0),minimum(i+2,xp)):
+                                for jj in range(maximum(j-1,0),minimum(j+2,yp)):
                                     if (not isnan(zg[ii][jj])):
                                         d = abs(ii-i) + abs(jj-j)
                                         if (d != 1.0) :
@@ -148,8 +148,8 @@ def main(w):
             lzM = max(zg.flat)
             lzm = min(zg.flat)
 
-            lzm = min(lzm,zmin)
-            lzM = max(lzM,zmax)
+            lzm = minimum(lzm,zmin)
+            lzM = maximum(lzM,zmax)
 
             lzm = lzm - 0.01
             lzM = lzM + 0.01
--- plplot-5.15.0+dfsg2.orig/examples/python/x33.py
+++ plplot-5.15.0+dfsg2/examples/python/x33.py
@@ -435,7 +435,7 @@ def main(w):
             nlegend += 1
         else:
             nlegend -= 1
-        nlegend = max(1, nlegend)
+        nlegend = maximum(1, nlegend)
         opt_array = zeros(nlegend, "int")
         text_colors = zeros(nlegend, "int")
         text = zeros(nlegend, "S200")
@@ -469,7 +469,7 @@ def main(w):
         w.plsfont(w.PL_FCI_MONO, -1, -1)
         w.plscol0a( 15, 32, 32, 32, 0.70 )
 
-        nrow = min(3, nlegend)
+        nrow = int(minimum(3, nlegend))
         ncolumn = 0
 
         (legend_width, legend_height) = \
@@ -572,7 +572,7 @@ def main(w):
               box_colors, box_patterns, box_scales, box_line_widths,
               line_colors, line_styles, line_widths,
               symbol_colors, symbol_scales, symbol_numbers, symbols )
-    max_height = max(max_height, legend_height)
+    max_height = maximum(max_height, legend_height)
 
     # Set up symbol legend entries with various symbols.
     for i in range(nlegend):
@@ -595,7 +595,7 @@ def main(w):
               box_colors, box_patterns, box_scales, box_line_widths,
               line_colors, line_styles, line_widths,
               symbol_colors, symbol_scales, symbol_numbers, symbols )
-    max_height = max(max_height, legend_height)
+    max_height = maximum(max_height, legend_height)
 
     # Set up symbol legend entries with various numbers of symbols.
     for i in range(nlegend):
@@ -617,7 +617,7 @@ def main(w):
               box_colors, box_patterns, box_scales, box_line_widths,
               line_colors, line_styles, line_widths,
               symbol_colors, symbol_scales, symbol_numbers, symbols )
-    max_height = max(max_height, legend_height)
+    max_height = maximum(max_height, legend_height)
 
     # Set up box legend entries with various colours.
     for i in range(nlegend):
@@ -642,7 +642,7 @@ def main(w):
               box_colors, box_patterns, box_scales, box_line_widths,
               line_colors, line_styles, line_widths,
               symbol_colors, symbol_scales, symbol_numbers, symbols )
-    max_height = max(max_height, legend_height)
+    max_height = maximum(max_height, legend_height)
 
     # Set up box legend entries with various patterns.
     for i in range(nlegend):
@@ -664,7 +664,7 @@ def main(w):
               box_colors, box_patterns, box_scales, box_line_widths,
               line_colors, line_styles, line_widths,
               symbol_colors, symbol_scales, symbol_numbers, symbols )
-    max_height = max(max_height, legend_height)
+    max_height = maximum(max_height, legend_height)
 
     # Set up box legend entries with various box pattern line widths.
     for i in range(nlegend):
@@ -686,7 +686,7 @@ def main(w):
               box_colors, box_patterns, box_scales, box_line_widths,
               line_colors, line_styles, line_widths,
               symbol_colors, symbol_scales, symbol_numbers, symbols )
-    max_height = max(max_height, legend_height)
+    max_height = maximum(max_height, legend_height)
 
     # Set up line legend entries with various colours.
     for i in range(nlegend):
@@ -710,7 +710,7 @@ def main(w):
               box_colors, box_patterns, box_scales, box_line_widths,
               line_colors, line_styles, line_widths,
               symbol_colors, symbol_scales, symbol_numbers, symbols )
-    max_height = max(max_height, legend_height)
+    max_height = maximum(max_height, legend_height)
 
     # Set up line legend entries with various styles
     for i in range(nlegend):
@@ -731,7 +731,7 @@ def main(w):
               box_colors, box_patterns, box_scales, box_line_widths,
               line_colors, line_styles, line_widths,
               symbol_colors, symbol_scales, symbol_numbers, symbols )
-    max_height = max(max_height, legend_height)
+    max_height = maximum(max_height, legend_height)
 
     # Set up line legend entries with various widths.
     for i in range(nlegend):
@@ -752,7 +752,7 @@ def main(w):
               box_colors, box_patterns, box_scales, box_line_widths,
               line_colors, line_styles, line_widths,
               symbol_colors, symbol_scales, symbol_numbers, symbols )
-    max_height = max(max_height, legend_height)
+    max_height = maximum(max_height, legend_height)
 
     # Color bar examples
     values_small  = [ -1.0e-20, 1.0e-20 ]
