Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc8b9eb4

Browse files
authored
Merge pull request#24302 from oscargus/intround
MNT: Remove redundant int after round
2 parents54360f3 +751e13d commitc8b9eb4

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

‎examples/statistics/time_series_histogram.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
# Generate unbiased Gaussian random walks
4242
Y=np.cumsum(np.random.randn(num_series,num_points),axis=-1)
4343
# Generate sinusoidal signals
44-
num_signal=int(round(SNR*num_series))
44+
num_signal=round(SNR*num_series)
4545
phi= (np.pi/8)*np.random.randn(num_signal,1)# small random offset
4646
Y[-num_signal:]= (
4747
np.sqrt(np.arange(num_points))[None, :]# random walk RMS scaling factor

‎lib/matplotlib/colors.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,7 @@ def to_hex(c, keep_alpha=False):
515515
c=to_rgba(c)
516516
ifnotkeep_alpha:
517517
c=c[:3]
518-
return"#"+"".join(format(int(round(val*255)),"02x")forvalinc)
518+
return"#"+"".join(format(round(val*255),"02x")forvalinc)
519519

520520

521521
### Backwards-compatible color-conversion API

‎lib/matplotlib/image.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1244,8 +1244,8 @@ def make_image(self, renderer, magnification=1.0, unsampled=False):
12441244
l,b,r,t=self.axes.bbox.extents
12451245
width= (round(r)+0.5)- (round(l)-0.5)
12461246
height= (round(t)+0.5)- (round(b)-0.5)
1247-
width=int(round(width*magnification))
1248-
height=int(round(height*magnification))
1247+
width=round(width*magnification)
1248+
height=round(height*magnification)
12491249
vl=self.axes.viewLim
12501250

12511251
x_pix=np.linspace(vl.x0,vl.x1,width)

‎lib/matplotlib/patches.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2568,9 +2568,9 @@ def _get_sawtooth_vertices(self, x0, y0, width, height, mutation_size):
25682568

25692569
# the sizes of the vertical and horizontal sawtooth are
25702570
# separately adjusted to fit the given box size.
2571-
dsx_n=int(round((width-tooth_size)/ (tooth_size*2)))*2
2571+
dsx_n=round((width-tooth_size)/ (tooth_size*2))*2
25722572
dsx= (width-tooth_size)/dsx_n
2573-
dsy_n=int(round((height-tooth_size)/ (tooth_size*2)))*2
2573+
dsy_n=round((height-tooth_size)/ (tooth_size*2))*2
25742574
dsy= (height-tooth_size)/dsy_n
25752575

25762576
x0,y0=x0-pad+tooth_size2,y0-pad+tooth_size2

‎lib/mpl_toolkits/mplot3d/axes3d.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2021,9 +2021,9 @@ def _3d_extend_contour(self, cset, stride=5):
20212021
continue
20222022

20232023
stepsize= (len(topverts[0])-1)/ (nsteps-1)
2024-
foriinrange(int(round(nsteps))-1):
2025-
i1=int(round(i*stepsize))
2026-
i2=int(round((i+1)*stepsize))
2024+
foriinrange(round(nsteps)-1):
2025+
i1=round(i*stepsize)
2026+
i2=round((i+1)*stepsize)
20272027
polyverts.append([topverts[0][i1],
20282028
topverts[0][i2],
20292029
botverts[0][i2],

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp