Skip to content
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

Invalid cartopy method call in "draw_basemap" #184

Closed
irm-codebase opened this issue Jul 29, 2024 · 3 comments · Fixed by #185
Closed

Invalid cartopy method call in "draw_basemap" #184

irm-codebase opened this issue Jul 29, 2024 · 3 comments · Fixed by #185

Comments

@irm-codebase
Copy link

irm-codebase commented Jul 29, 2024

The issue

Calling ppm.plotpowerplant_map(some_ppm_df) will result in failure due to this line:

ax.outline_patch.set_visible(False)

This is most likely because the dependencies of this library are not pinned to "below" X version of geopandas and cartopy, resulting in unstable software.

The error shown is:

Traceback (most recent call last):
 Line 42, in <module>
    ppm.plot.powerplant_map(plants)
  Line 123, in powerplant_map
    draw_basemap(ax=ax, resolution=resolution, fillcontinents=fillcontinents)
  Line 390, in draw_basemap
    ax.outline_patch.set_visible(False)
    ^^^^^^^^^^^^^^^^
AttributeError: 'GeoAxes' object has no attribute 'outline_patch'

Solutions

v0.5.15 (the newest version at the moment) has several of these issues (e.g., using append instead of concat in other plotting functions).

Although modifying the line would fix this issue, using a lockfile is more robust long-term. There are some nice tools to do this (I like pixi).

@irm-codebase
Copy link
Author

Additionally, pinning cartopy to 0.17 (the version before outline_patch was depreciated) on the user side causes other headaches, since it's a fairly old version...

@lkstrp
Copy link
Member

lkstrp commented Jul 29, 2024

Thank you @irm-codebase !

The linked pr should fix that. Other pandas compatibility issues should also have been fixed in the master. If you encounter any other issues feel free to raise them. I'll make a release soon.

We are trying to improve the tests so that these things are caught earlier and no pins are needed.

@irm-codebase
Copy link
Author

Great, thank you for the help Lukas!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants