Skip to content

Commit 8afed74

Browse files
authored
remove unused "type: ignore" comments in test_plot.py (fixed in matplotlib 3.10.0) (#9904)
1 parent 7612078 commit 8afed74

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

xarray/tests/test_plot.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,27 +90,27 @@ def text_in_fig() -> set[str]:
9090
"""
9191
Return the set of all text in the figure
9292
"""
93-
return {t.get_text() for t in plt.gcf().findobj(mpl.text.Text)} # type: ignore[attr-defined] # mpl error?
93+
return {t.get_text() for t in plt.gcf().findobj(mpl.text.Text)}
9494

9595

9696
def find_possible_colorbars() -> list[mpl.collections.QuadMesh]:
9797
# nb. this function also matches meshes from pcolormesh
98-
return plt.gcf().findobj(mpl.collections.QuadMesh) # type: ignore[return-value] # mpl error?
98+
return plt.gcf().findobj(mpl.collections.QuadMesh)
9999

100100

101101
def substring_in_axes(substring: str, ax: mpl.axes.Axes) -> bool:
102102
"""
103103
Return True if a substring is found anywhere in an axes
104104
"""
105-
alltxt: set[str] = {t.get_text() for t in ax.findobj(mpl.text.Text)} # type: ignore[attr-defined] # mpl error?
105+
alltxt: set[str] = {t.get_text() for t in ax.findobj(mpl.text.Text)}
106106
return any(substring in txt for txt in alltxt)
107107

108108

109109
def substring_not_in_axes(substring: str, ax: mpl.axes.Axes) -> bool:
110110
"""
111111
Return True if a substring is not found anywhere in an axes
112112
"""
113-
alltxt: set[str] = {t.get_text() for t in ax.findobj(mpl.text.Text)} # type: ignore[attr-defined] # mpl error?
113+
alltxt: set[str] = {t.get_text() for t in ax.findobj(mpl.text.Text)}
114114
check = [(substring not in txt) for txt in alltxt]
115115
return all(check)
116116

@@ -122,7 +122,7 @@ def property_in_axes_text(
122122
Return True if the specified text in an axes
123123
has the property assigned to property_str
124124
"""
125-
alltxt: list[mpl.text.Text] = ax.findobj(mpl.text.Text) # type: ignore[assignment]
125+
alltxt: list[mpl.text.Text] = ax.findobj(mpl.text.Text)
126126
return all(
127127
plt.getp(t, property) == property_str
128128
for t in alltxt

0 commit comments

Comments
 (0)