-
Notifications
You must be signed in to change notification settings - Fork 366
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
Replace _autoscaleX_on with get_autoscalex_on() in GeoAxes #2054
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes look good! Test failures seem unrelated since I see the same in #2056.
@holzschu , it looks like you still need to sign the CLA:
Blocked: CLA needed
|
Thanks for the explanation. I have signed the CLA. |
Unfortunate this wasn't backported to 0.20.3 |
We could cut a 0.21.0 release from main... It looks like it has been about a year since 0.20.0 was released. |
I don't have a preference, but we need to release something before Matplotlib releases 3.6 with both this and #2071. |
since matplotlib is updated to 3.6 I get the following error AttributeError: 'GeoAxesSubplot' object has no attribute '_autoscaleXon' packages
code Traceback ~/miniconda3/lib/python3.9/site-packages/cartopy/mpl/geoaxes.py in stock_img(self, name) ~/miniconda3/lib/python3.9/site-packages/cartopy/mpl/geoaxes.py in wrapper(self, *args, **kwargs) ~/miniconda3/lib/python3.9/site-packages/cartopy/mpl/geoaxes.py in imshow(self, img, *args, **kwargs) ~/miniconda3/lib/python3.9/site-packages/cartopy/mpl/geoaxes.py in get_extent(self, crs) ~/miniconda3/lib/python3.9/site-packages/cartopy/mpl/geoaxes.py in _get_extent_geom(self, crs) ~/miniconda3/lib/python3.9/contextlib.py in enter(self) ~/miniconda3/lib/python3.9/site-packages/cartopy/mpl/geoaxes.py in hold_limits(self, hold) AttributeError: 'GeoAxesSubplot' object has no attribute '_autoscaleXon' |
@ElmWer, you'll have to upgrade to Cartopy v0.21 to work with Matplotlib 3.6. |
SciTools/cartopy#2054 CI failed for commit 50cd733 because the env got mpl 3.6.1 but cartopy 0.20.2
Rationale
Modern implementations of matplotlib have removed the variables
_autoscaleXon
and_autoscaleYon
.mpl/geoaxes.py
references these variables, resulting in an error when running cartopy:This PR replaces the deprecated variables with the functions
get_autoscalex_on()
(andset_autoscalex_on()
), that are present in matplotlib.Implications
As far as I can tell, the change was introduced with matplotlib version 3.5.2, released May 3rd, 2022.
Based on what I can see from the matplotlib github site, the change should be compatible with previous versions of matplotlib.