Skip to content

New function signatures in pyplot break Cartopy #12288

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

Closed
QuLogic opened this issue Sep 25, 2018 · 1 comment
Closed

New function signatures in pyplot break Cartopy #12288

QuLogic opened this issue Sep 25, 2018 · 1 comment
Labels
Release critical For bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions. topic: pyplot API
Milestone

Comments

@QuLogic
Copy link
Member

QuLogic commented Sep 25, 2018

This is just copied from #10918 (comment) to make it easier to follow. xref SciTools/cartopy#1126

Bug report

@QuLogic:

It turns out that passing named arguments for everything broke Cartopy a bit because the first parameter of imshow there is img, not X.
It's also started explicitly passing data=None to all wrapped Axes methods that accept labelled data, which is slightly problematic since _preprocess_data is not public.

@anntzer:

Sorry about that. It doesn't look too hard to make pyplot pass defaultless arguments positionally instead of as keywords if you'd like.
I guess you prefer not passing data through when it's None? (There's a plan to make _preprocess_data public too but that's a side point.) Although they were already passing it before (at least in some cases, didn't check carefully) so I'm not sure what changed?

@QuLogic

We probably want to keep compatibility with old Cartopy, so we should change the positional arguments at least.

As to data, it was never explicit before, but caught by **kwargs. If never passed, it would not appear at all in the final call. Now it's there explicitly (even if None). I'm not sure if it should or should not be explicit in the signature, but it would be best if it's not passed when None at the very least.

Code for reproduction

import cartopy.crs as ccrs
import matplotlib.pyplot as plt
import numpy as np

# First problem
ax = plt.axes(projection=crs.PlateCarree())
plt.imshow(np.zeros((100, 100)))

# Second problem
plt.pcolormesh(np.zeros((100, 100)))

Matplotlib version

  • Operating system: Fedora 28
  • Matplotlib version: 3.0.0
  • Python version: 3.6.5
  • Other libraries: Cartopy 0.16
@QuLogic QuLogic added Release critical For bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions. topic: pyplot API labels Sep 25, 2018
@QuLogic QuLogic added this to the v3.0.x milestone Sep 25, 2018
@anntzer
Copy link
Contributor

anntzer commented Oct 10, 2018

Closed by #12293, I think?

@anntzer anntzer closed this as completed Oct 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Release critical For bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions. topic: pyplot API
Projects
None yet
Development

No branches or pull requests

2 participants