-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix typing errors using mypy 1.2 #7752
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
Changes from 14 commits
f38cba5
701dd11
7f7893c
629f6de
e5a4987
403adfd
4a880c5
13b356e
d37fe53
7180019
0c2c0b7
e342f78
ecba29d
3434780
61c23ac
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2042,7 +2042,7 @@ def test_seaborn_palette_as_cmap(self) -> None: | |
def test_convenient_facetgrid(self) -> None: | ||
a = easy_array((10, 15, 4)) | ||
d = DataArray(a, dims=["y", "x", "z"]) | ||
g = self.plotfunc(d, x="x", y="y", col="z", col_wrap=2) | ||
g = self.plotfunc(d, x="x", y="y", col="z", col_wrap=2) # type: ignore[arg-type] # https://github.com/python/mypy/issues/15015 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This errors with
self.plotfunc is a staticmethod and it seems that mypy only chooses one of the overloads for that plotfunc. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Well, nothing we can do about it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Refactoring the tests without the staticmethod trick was an idea I had, but I'm not in the mood for such a large rewrite. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Haha yes, I also thought about this several times already. Just too large of a refactor with almost no gains... |
||
|
||
assert_array_equal(g.axs.shape, [2, 2]) | ||
for (y, x), ax in np.ndenumerate(g.axs): | ||
|
@@ -2051,7 +2051,7 @@ def test_convenient_facetgrid(self) -> None: | |
assert "x" == ax.get_xlabel() | ||
|
||
# Inferring labels | ||
g = self.plotfunc(d, col="z", col_wrap=2) | ||
g = self.plotfunc(d, col="z", col_wrap=2) # type: ignore[arg-type] # https://github.com/python/mypy/issues/15015 | ||
assert_array_equal(g.axs.shape, [2, 2]) | ||
for (y, x), ax in np.ndenumerate(g.axs): | ||
assert ax.has_data() | ||
|
Uh oh!
There was an error while loading. Please reload this page.