1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151
|
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 ]
|