| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
There was a problem hiding this comment.
The fact that all this didn't trip any test changes means to me that we aren't testing the signatures completely, and that is making breaking changes opaque to us, but a problem for downstream packages. If we decide to change the signatures, that should fail some tests, which can then consciously be removed if need be, and accompanied by the appropriate API change notes. (i.e. the changes made in #10918 shoudl have failed some tests so we knew we were causing problems, so this is the time to add those tests)
Sorry, something went wrong.
|
It's going to be pretty tricky to test this unless we make a copy of all pyplot signatures somewhere else to compare against, which sounds not so nice. |
Sorry, something went wrong.
|
I don’t think they all have to be tested just a smattering to make sure the boilerplate is doing the right thing. I do t understand what you mean by copying all the pyot signatures but maybe I’m misunderstanding what is going on here |
Sorry, something went wrong.
|
It's not clear to me what test you exactly want to add either... |
Sorry, something went wrong.
|
Ideally there would be some tests that would have failed #10918, which presumably means duplicating whatever signature cartopy was trying to use. But again if there is a more informed critical mass of devs who don't think this is possible they should feel free to dismiss my review. I'm not claiming deep understanding |
Sorry, something went wrong.
|
I have not gone through the changes, but this is sufficient to get Cartopy tests working again. Keep in mind that Cartopy does not of course exercise the entirety of the pyplot API, just the following: $ rg --no-filename -o 'plt\.[A-Za-z0-9_]+' | sort -u plt.autoscale plt.axes plt.clf plt.close plt.contour plt.contourf plt.draw plt.figure plt.gca plt.gcf plt.get_backend plt.imread plt.imshow plt.pcolor plt.pcolormesh plt.plot plt.savefig plt.scatter plt.show plt.subplot plt.subplots_adjust plt.switch_backend plt.xlim plt.ylim |
Sorry, something went wrong.
|
TBH I am not particularly interested in figuring out how to do implement a test (especially wrt what guarantees we want to make regarding the subclassability of Axes). |
Sorry, something went wrong.
I think all I'm asking for are tests that test the allowed signatures, which I think is where the downstream subclasses are tripping up. But again, anyone who understands this better can dismiss my review if I'm off base about the testability of this. |
Sorry, something went wrong.
|
Can you open the request for tests as a separate issue instead? |
Sorry, something went wrong.
I still think we should test these code paths so we don't break things like this in the future.
Don't force them to reproduce the names of "intended-as-positional" arguments; don't force them to support the data kwarg. This is also necessary for methods that take `*args`, as otherwise we generate a call of the form `foo=foo, *args` which is incorrectly understood as `*args, foo=foo`.
|
Clarified in the commit message why this also closes #12405. |
Sorry, something went wrong.
|
Can you push it? |
Sorry, something went wrong.
|
Done! |
Sorry, something went wrong.
There was a problem hiding this comment.
Works for Cartopy.
Sorry, something went wrong.
|
pyplot signatures need more tests |
Sorry, something went wrong.
…293-on-v3.0.x Backport PR #12293 on branch v3.0.x (Make pyplot more tolerant wrt. 3rd-party subclasses.)
| Back | FazBrowse Home | New Git URL |
Don't force them to reproduce the names of "intended-as-positional"
arguments; don't force them to support the data kwarg.
xref #12288
attn @QuLogic can you pick it up from there if more changes are needed?
PR Summary
PR Checklist