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

Add caching to arcgisimage #562

Merged
merged 2 commits into from
Oct 30, 2022
Merged

Add caching to arcgisimage #562

merged 2 commits into from
Oct 30, 2022

Conversation

JoepdeJong
Copy link
Contributor

@JoepdeJong JoepdeJong commented Oct 30, 2022

arcgisimage is slow due to network communication, especially when you are working with high-resolution plots of the same region. This commit adds a cachedir to the arcgisimage function, to prevent downloading the same image multiple times.

molinav and others added 2 commits October 25, 2022 09:46
arcgisimageis slow due to network communication, especially when you are working with high-resolution plots of the same region. This commit adds a cachedir to the arcgisimage function, to prevent downloading the same image multiple times.
@molinav molinav changed the base branch from master to develop October 30, 2022 16:30
@molinav
Copy link
Member

molinav commented Oct 30, 2022

Thanks for the contribution, @JoepdeJong! Since this pull request adds a new feature, I moved the target branch from master to develop, so that this new argument in Basemap.arcgisimage will appear in the next minor release of basemap (1.4.0).

Currently, I am putting most of my effort in the basemap 1.3.x series, with patches that were required since long time ago to make basemap a bit more stable, so I still do not have a planned date to prepare the release 1.4.0. In the meantime, you can install basemap directly from the develop branch with:

python -m pip install git+https://github.com/matplotlib/basemap#subdirectory=packages/basemap

Note that in this case you will need to have a C compiler for the _geoslib module build, and define GEOS_DIR in case that you do not have GEOS in some of the common installation paths.

@molinav molinav merged commit d669ff0 into matplotlib:develop Oct 30, 2022
@guidocioni
Copy link

guidocioni commented Aug 19, 2023

Hey @molinav, as I see this PR is already closed, I have few questions and comments:

  • I think in line 4322 should be return self.imshow(img, ax=ax, origin='upper') and not return basemap.imshow(img, ax=ax, origin='upper').
  • I think the print statement in line 4320 can be removed or maybe replaced with something more robust for logging?
    Thanks for the great work

@molinav
Copy link
Member

molinav commented Aug 19, 2023

Hi @guidocioni!

This PR was merged into the develop branch, so it is targeting the next minor release (1.4.0). I wanted to finalise 1.4.0 long ago but I just did not find enough spare time.

The patch releases (like 1.3.8) are branched directly from master (the latest stable tag) to correct things that are not working as supposed. When the fixes are done, I merge back to master to create a new tag and the corrections are also merged to develop so that they are also included in the next minor release.

If you see that something like you said is not working, feel always free to create a new PR into develop. One of my goals for 1.4.0 was to start having a basic test suite running, to have reports on the code coverage and prevent easy-to-detect bugs as you found.

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 this pull request may close these issues.

3 participants