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

Commitf7a8cab

Browse files
authored
Merge pull request#26414 from rcomer/flake8-fixes
Fixes for pycodestyle v2.11
2 parentsc36a03f +1774d8c commitf7a8cab

File tree

7 files changed

+13
-14
lines changed

7 files changed

+13
-14
lines changed

‎galleries/examples/misc/packed_bubbles.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,7 @@ def check_collisions(self, bubble, bubbles):
7676

7777
defcollides_with(self,bubble,bubbles):
7878
distance=self.outline_distance(bubble,bubbles)
79-
idx_min=np.argmin(distance)
80-
returnidx_miniftype(idx_min)==np.ndarrayelse [idx_min]
79+
returnnp.argmin(distance,keepdims=True)
8180

8281
defcollapse(self,n_iterations=50):
8382
"""

‎lib/matplotlib/dviread.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -622,7 +622,7 @@ def __init__(self, scale, tfm, texname, vf):
622622
forcharinrange(nchars)]
623623

624624
def__eq__(self,other):
625-
return (type(self)==type(other)
625+
return (type(self)istype(other)
626626
andself.texname==other.texnameandself.size==other.size)
627627

628628
def__ne__(self,other):

‎lib/matplotlib/font_manager.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -853,7 +853,7 @@ def set_fontconfig_pattern(self, pattern):
853853
pattern syntax for use here.
854854
"""
855855
forkey,valinparse_fontconfig_pattern(pattern).items():
856-
iftype(val)==list:
856+
iftype(val)islist:
857857
getattr(self,"set_"+key)(val[0])
858858
else:
859859
getattr(self,"set_"+key)(val)

‎lib/matplotlib/tests/test_axes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2949,12 +2949,12 @@ def _as_mpl_axes(self):
29492949

29502950
# testing axes creation with plt.axes
29512951
ax=plt.axes((0,0,1,1),projection=prj)
2952-
asserttype(ax)==PolarAxes
2952+
asserttype(ax)isPolarAxes
29532953
plt.close()
29542954

29552955
# testing axes creation with subplot
29562956
ax=plt.subplot(121,projection=prj)
2957-
asserttype(ax)==PolarAxes
2957+
asserttype(ax)isPolarAxes
29582958
plt.close()
29592959

29602960

‎lib/matplotlib/tests/test_cbook.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ def test_callback_complete(self, pickle):
226226

227227
# test that we can add a callback
228228
cid1=self.connect(self.signal,mini_me.dummy,pickle)
229-
asserttype(cid1)==int
229+
asserttype(cid1)isint
230230
self.is_not_empty()
231231

232232
# test that we don't add a second callback
@@ -251,7 +251,7 @@ def test_callback_disconnect(self, pickle):
251251

252252
# test that we can add a callback
253253
cid1=self.connect(self.signal,mini_me.dummy,pickle)
254-
asserttype(cid1)==int
254+
asserttype(cid1)isint
255255
self.is_not_empty()
256256

257257
self.disconnect(cid1)
@@ -269,7 +269,7 @@ def test_callback_wrong_disconnect(self, pickle):
269269

270270
# test that we can add a callback
271271
cid1=self.connect(self.signal,mini_me.dummy,pickle)
272-
asserttype(cid1)==int
272+
asserttype(cid1)isint
273273
self.is_not_empty()
274274

275275
self.disconnect("foo")

‎lib/matplotlib/tests/test_image.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1463,7 +1463,7 @@ def test_str_norms(fig_test, fig_ref):
14631463
axrs[3].imshow(t,norm=colors.SymLogNorm(linthresh=2,vmin=.3,vmax=.7))
14641464
axrs[4].imshow(t,norm="logit",clim=(.3,.7))
14651465

1466-
asserttype(axts[0].images[0].norm)==colors.LogNorm# Exactly that class
1466+
asserttype(axts[0].images[0].norm)iscolors.LogNorm# Exactly that class
14671467
withpytest.raises(ValueError):
14681468
axts[0].imshow(t,norm="foobar")
14691469

‎lib/matplotlib/tests/test_scale.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,22 +37,22 @@ def test_symlog_mask_nan():
3737
x=np.arange(-1.5,5,0.5)
3838
out=slti.transform_non_affine(slt.transform_non_affine(x))
3939
assert_allclose(out,x)
40-
asserttype(out)==type(x)
40+
asserttype(out)istype(x)
4141

4242
x[4]=np.nan
4343
out=slti.transform_non_affine(slt.transform_non_affine(x))
4444
assert_allclose(out,x)
45-
asserttype(out)==type(x)
45+
asserttype(out)istype(x)
4646

4747
x=np.ma.array(x)
4848
out=slti.transform_non_affine(slt.transform_non_affine(x))
4949
assert_allclose(out,x)
50-
asserttype(out)==type(x)
50+
asserttype(out)istype(x)
5151

5252
x[3]=np.ma.masked
5353
out=slti.transform_non_affine(slt.transform_non_affine(x))
5454
assert_allclose(out,x)
55-
asserttype(out)==type(x)
55+
asserttype(out)istype(x)
5656

5757

5858
@image_comparison(['logit_scales.png'],remove_text=True)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp