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

Appearance settings

Backport PR #26414: Fixes for pycodestyle v2.11 #26426

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions 3 examples/misc/packed_bubbles.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,7 @@ def check_collisions(self, bubble, bubbles):

def collides_with(self, bubble, bubbles):
distance = self.outline_distance(bubble, bubbles)
idx_min = np.argmin(distance)
return idx_min if type(idx_min) == np.ndarray else [idx_min]
return np.argmin(distance, keepdims=True)

def collapse(self, n_iterations=50):
"""
Expand Down
2 changes: 1 addition & 1 deletion 2 lib/matplotlib/dviread.py
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,7 @@ def __init__(self, scale, tfm, texname, vf):
for char in range(nchars)]

def __eq__(self, other):
return (type(self) == type(other)
return (type(self) is type(other)
and self.texname == other.texname and self.size == other.size)

def __ne__(self, other):
Expand Down
2 changes: 1 addition & 1 deletion 2 lib/matplotlib/font_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -851,7 +851,7 @@ def set_fontconfig_pattern(self, pattern):
pattern syntax for use here.
"""
for key, val in parse_fontconfig_pattern(pattern).items():
if type(val) == list:
if type(val) is list:
getattr(self, "set_" + key)(val[0])
else:
getattr(self, "set_" + key)(val)
Expand Down
4 changes: 2 additions & 2 deletions 4 lib/matplotlib/tests/test_axes.py
Original file line number Diff line number Diff line change
Expand Up @@ -2834,12 +2834,12 @@ def _as_mpl_axes(self):

# testing axes creation with plt.axes
ax = plt.axes([0, 0, 1, 1], projection=prj)
assert type(ax) == PolarAxes
assert type(ax) is PolarAxes
plt.close()

# testing axes creation with subplot
ax = plt.subplot(121, projection=prj)
assert type(ax) == PolarAxes
assert type(ax) is PolarAxes
plt.close()


Expand Down
6 changes: 3 additions & 3 deletions 6 lib/matplotlib/tests/test_cbook.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ def test_callback_complete(self, pickle):

# test that we can add a callback
cid1 = self.connect(self.signal, mini_me.dummy, pickle)
assert type(cid1) == int
assert type(cid1) is int
self.is_not_empty()

# test that we don't add a second callback
Expand All @@ -249,7 +249,7 @@ def test_callback_disconnect(self, pickle):

# test that we can add a callback
cid1 = self.connect(self.signal, mini_me.dummy, pickle)
assert type(cid1) == int
assert type(cid1) is int
self.is_not_empty()

self.disconnect(cid1)
Expand All @@ -267,7 +267,7 @@ def test_callback_wrong_disconnect(self, pickle):

# test that we can add a callback
cid1 = self.connect(self.signal, mini_me.dummy, pickle)
assert type(cid1) == int
assert type(cid1) is int
self.is_not_empty()

self.disconnect("foo")
Expand Down
2 changes: 1 addition & 1 deletion 2 lib/matplotlib/tests/test_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -1461,6 +1461,6 @@ def test_str_norms(fig_test, fig_ref):
axrs[3].imshow(t, norm=colors.SymLogNorm(linthresh=2, vmin=.3, vmax=.7))
axrs[4].imshow(t, norm="logit", clim=(.3, .7))

assert type(axts[0].images[0].norm) == colors.LogNorm # Exactly that class
assert type(axts[0].images[0].norm) is colors.LogNorm # Exactly that class
with pytest.raises(ValueError):
axts[0].imshow(t, norm="foobar")
8 changes: 4 additions & 4 deletions 8 lib/matplotlib/tests/test_scale.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,22 +37,22 @@ def test_symlog_mask_nan():
x = np.arange(-1.5, 5, 0.5)
out = slti.transform_non_affine(slt.transform_non_affine(x))
assert_allclose(out, x)
assert type(out) == type(x)
assert type(out) is type(x)

x[4] = np.nan
out = slti.transform_non_affine(slt.transform_non_affine(x))
assert_allclose(out, x)
assert type(out) == type(x)
assert type(out) is type(x)

x = np.ma.array(x)
out = slti.transform_non_affine(slt.transform_non_affine(x))
assert_allclose(out, x)
assert type(out) == type(x)
assert type(out) is type(x)

x[3] = np.ma.masked
out = slti.transform_non_affine(slt.transform_non_affine(x))
assert_allclose(out, x)
assert type(out) == type(x)
assert type(out) is type(x)


@image_comparison(['logit_scales.png'], remove_text=True)
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.