From 82e3231ad5f4e1a3286ce274999604b2b810c460 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Tue, 9 Jan 2024 14:12:07 +0100 Subject: [PATCH 01/23] Start next development cycle 1.5.0-dev --- CHANGELOG.md | 2 ++ packages/basemap/src/_geoslib.pyx | 2 +- packages/basemap/src/mpl_toolkits/basemap/__init__.py | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bf6bec7e2..7fc3aeb71 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,8 @@ https://keepachangelog.com/en/1.0.0/ https://semver.org/spec/v2.0.0.html +## [Unreleased] + ## [1.4.0] - 2024-01-09 ### Added diff --git a/packages/basemap/src/_geoslib.pyx b/packages/basemap/src/_geoslib.pyx index f91dd333b..676ac4d4b 100644 --- a/packages/basemap/src/_geoslib.pyx +++ b/packages/basemap/src/_geoslib.pyx @@ -2,7 +2,7 @@ import sys import numpy cimport numpy as cnp -__version__ = "1.4.0" +__version__ = "1.5.0-dev" # Need some Python C-API functions for strings. diff --git a/packages/basemap/src/mpl_toolkits/basemap/__init__.py b/packages/basemap/src/mpl_toolkits/basemap/__init__.py index e1ce7afc6..75bcecf9e 100644 --- a/packages/basemap/src/mpl_toolkits/basemap/__init__.py +++ b/packages/basemap/src/mpl_toolkits/basemap/__init__.py @@ -48,7 +48,7 @@ from . proj import Proj -__version__ = "1.4.0" +__version__ = "1.5.0-dev" # basemap data files now installed in lib/matplotlib/toolkits/basemap/data # check to see if environment variable BASEMAPDATA set to a directory, From f331bf9d023fee48a8832b4ddf4a66ccf3e5f9de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Wed, 10 Jan 2024 14:21:46 +0100 Subject: [PATCH 02/23] Add two closed issues to 1.4.0 CHANGELOG --- CHANGELOG.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7fc3aeb71..bb8dc0e40 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,7 +22,8 @@ https://semver.org/spec/v2.0.0.html [#447] and [#574]). - Renewed documentation, with fixes for the broken links and examples, an improved section on the installation process, and without the - deprecation/sunsetting section (solves issues [#527] and [#568]). + deprecation/sunsetting section (solves issues [#438], [#471], [#527] + and [#568]). - Optional argument `encoding_errors` for `Basemap.readshapefile` method (PR [#554] by @guziy, implements request [#552]). - Optional argument `cachedir` for `Basemap.arcgisimage` method to allow @@ -1196,6 +1197,8 @@ https://github.com/matplotlib/basemap/issues/487 https://github.com/matplotlib/basemap/issues/481 [#476]: https://github.com/matplotlib/basemap/pull/476 +[#471]: +https://github.com/matplotlib/basemap/issues/471 [#463]: https://github.com/matplotlib/basemap/issues/463 [#461]: @@ -1210,6 +1213,8 @@ https://github.com/matplotlib/basemap/issues/445 https://github.com/matplotlib/basemap/issues/444 [#443]: https://github.com/matplotlib/basemap/issues/443 +[#438]: +https://github.com/matplotlib/basemap/issues/438 [#437]: https://github.com/matplotlib/basemap/issues/437 [#436]: From fdd8647b092571c31b29ddad46f7235b679e3519 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Thu, 11 Jan 2024 13:58:42 +0100 Subject: [PATCH 03/23] Update README with latest wheels available in PyPI --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 0f6c19781..21b98ad39 100644 --- a/README.md +++ b/README.md @@ -31,8 +31,9 @@ python -m pip install basemap-data python -m pip install basemap-data-hires ``` -Precompiled `basemap` binary wheels for Windows and GNU/Linux are also -available in PyPI (architectures x86 and x64, Python 2.7 and 3.5+): +Precompiled `basemap` binary wheels for Windows and GNU/Linux +(architectures x86 and x64, Python 2.7 and 3.5+) as well as for MacOS +(architectures x64 and arm64, Python 3.9+) are also available in PyPI: ```sh python -m pip install basemap ``` From a3112f147b57206b8e10ee8b9abebde040fee0b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Thu, 11 Jan 2024 14:00:26 +0100 Subject: [PATCH 04/23] Exclude .DS_Store folders from distributables --- CHANGELOG.md | 3 +++ packages/basemap/MANIFEST.in | 1 + 2 files changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index bb8dc0e40..4aa0075f2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,9 @@ https://semver.org/spec/v2.0.0.html ## [Unreleased] +### Fixed +- Set recursive exclusion for `.DS_Store` folders in `MANIFEST.in`. + ## [1.4.0] - 2024-01-09 ### Added diff --git a/packages/basemap/MANIFEST.in b/packages/basemap/MANIFEST.in index 0ea74f384..93b419369 100644 --- a/packages/basemap/MANIFEST.in +++ b/packages/basemap/MANIFEST.in @@ -4,5 +4,6 @@ recursive-exclude doc/build * recursive-include test * recursive-include utils *.py recursive-exclude **/__pycache__ * +recursive-exclude **/.DS_Store * exclude **/*.pyc exclude **/.gitkeep From dc87639b3f6c082a4f9fb035318abffeffa42922 Mon Sep 17 00:00:00 2001 From: nitram96 Date: Thu, 8 Feb 2024 14:51:12 +0000 Subject: [PATCH 05/23] fixed bugs with using cachedir in arcgisimage. cachedir is no longer ignored if verbose is false, if a cached image is found now correctly shows it using self.imshow(), now uses os.path.join to join cachedir and filename, so a backslash is no longer required at the end of cachedir --- packages/basemap/src/mpl_toolkits/basemap/__init__.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/basemap/src/mpl_toolkits/basemap/__init__.py b/packages/basemap/src/mpl_toolkits/basemap/__init__.py index 75bcecf9e..88963acff 100644 --- a/packages/basemap/src/mpl_toolkits/basemap/__init__.py +++ b/packages/basemap/src/mpl_toolkits/basemap/__init__.py @@ -4351,12 +4351,13 @@ def arcgisimage(self,server='http://server.arcgisonline.com/ArcGIS',\ os.makedirs(cachedir) # Check if the image is already in the cachedir folder. - cache_path = cachedir + filename + cache_path = os.path.join(cachedir, filename) - if os.path.isfile(cache_path) and verbose: - print('Image already in cache') + if os.path.isfile(cache_path): + if verbose: + print('Image already in cache') img = Image.open(cache_path) - return basemap.imshow(img, ax=ax, origin='upper') + return self.imshow(img, ax=ax, origin='upper') # Retrieve image from remote server. import contextlib From d5ba71fd38f5bcb2551c7dab09a55f6f417ac763 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Wed, 14 Feb 2024 10:56:53 +0100 Subject: [PATCH 06/23] Apply basic PyLint corrections to Basemap.arcgisimage method --- .../src/mpl_toolkits/basemap/__init__.py | 61 ++++++++++--------- 1 file changed, 33 insertions(+), 28 deletions(-) diff --git a/packages/basemap/src/mpl_toolkits/basemap/__init__.py b/packages/basemap/src/mpl_toolkits/basemap/__init__.py index 88963acff..e13cbc37f 100644 --- a/packages/basemap/src/mpl_toolkits/basemap/__init__.py +++ b/packages/basemap/src/mpl_toolkits/basemap/__init__.py @@ -4257,9 +4257,9 @@ def pil_to_array(*args, **kwargs): im,c = self._cliplimb(ax,im) return im - def arcgisimage(self,server='http://server.arcgisonline.com/ArcGIS',\ - service='World_Imagery',xpixels=400,ypixels=None,\ - dpi=96,cachedir=None,verbose=False,**kwargs): + def arcgisimage(self, server="http://server.arcgisonline.com/ArcGIS", + service="World_Imagery", xpixels=400, ypixels=None, + dpi=96, cachedir=None, verbose=False, **kwargs): """ Retrieve an image using the ArcGIS Server REST API and display it on the map. In order to use this method, the Basemap instance must be @@ -4285,7 +4285,8 @@ def arcgisimage(self,server='http://server.arcgisonline.com/ArcGIS',\ map projection region. dpi The device resolution of the exported image (dots per inch, default 96). - cachedir An optional directory to use as cache folder for the retrieved images. + cachedir An optional directory to use as cache folder for the + retrieved images. verbose if True, print URL used to retrieve image (default False). ============== ==================================================== @@ -4295,7 +4296,7 @@ def arcgisimage(self,server='http://server.arcgisonline.com/ArcGIS',\ returns a matplotlib.image.AxesImage instance. """ - # fix PIL import on some versions of OSX and scipy + # Fix PIL import on some versions of OSX and scipy. try: from PIL import Image except ImportError: @@ -4305,28 +4306,30 @@ def arcgisimage(self,server='http://server.arcgisonline.com/ArcGIS',\ raise ImportError("arcgisimage method requires PIL " "(http://pillow.readthedocs.io)") - if not hasattr(self,'epsg'): + if not hasattr(self, "epsg"): raise ValueError("the Basemap instance must be created using " "an EPSG code (http://spatialreference.org) " "in order to use the wmsmap method") - ax = kwargs.pop('ax', None) or self._check_ax() - # find the x,y values at the corner points. + + ax = kwargs.pop("ax", None) or self._check_ax() + + # Find the (x, y) values at the corner points. with warnings.catch_warnings(): warnings.simplefilter("ignore", category=FutureWarning) p = pyproj.Proj(init="epsg:%s" % self.epsg, preserve_units=True) - xmin,ymin = p(self.llcrnrlon,self.llcrnrlat) - xmax,ymax = p(self.urcrnrlon,self.urcrnrlat) + xmin, ymin = p(self.llcrnrlon, self.llcrnrlat) + xmax, ymax = p(self.urcrnrlon, self.urcrnrlat) if self.projection in _cylproj: - Dateline =\ - _geoslib.Point(self(180.,0.5*(self.llcrnrlat+self.urcrnrlat))) - hasDateline = Dateline.within(self._boundarypolyxy) - if hasDateline: + dateline = _geoslib.Point(self(180., 0.5 * (self.llcrnrlat + self.urcrnrlat))) + if dateline.within(self._boundarypolyxy): raise ValueError("arcgisimage cannot handle images that cross " "the dateline for cylindrical projections") - # ypixels not given, find by scaling xpixels by the map aspect ratio. + + # If ypixels is not given, compute it with xpixels and aspect ratio. if ypixels is None: - ypixels = int(self.aspect*xpixels) - # construct a URL using the ArcGIS Server REST API. + ypixels = int(self.aspect * xpixels) + + # Construct a URL using the ArcGIS Server REST API. basemap_url = \ "%s/rest/services/%s/MapServer/export?\ bbox=%s,%s,%s,%s&\ @@ -4337,27 +4340,29 @@ def arcgisimage(self,server='http://server.arcgisonline.com/ArcGIS',\ format=png32&\ transparent=true&\ f=image" %\ -(server,service,xmin,ymin,xmax,ymax,self.epsg,self.epsg,xpixels,ypixels,dpi) - # print URL? - if verbose: print(basemap_url) +(server, service, xmin, ymin, xmax, ymax, self.epsg, self.epsg, xpixels, ypixels, dpi) + + # Print URL in verbose mode. + if verbose: + print(basemap_url) + + if cachedir is not None: - if cachedir != None: # Generate a filename for the cached file. filename = "%s-bbox-%s-%s-%s-%s-bboxsr%s-imagesr%s-size-%s-%s-dpi%s.png" %\ - (service,xmin,ymin,xmax,ymax,self.epsg,self.epsg,xpixels,ypixels,dpi) + (service, xmin, ymin, xmax, ymax, self.epsg, self.epsg, xpixels, ypixels, dpi) - # Check if the cache directory exists, if not create it. + # Check if the cache directory exists, if not create it. if not os.path.exists(cachedir): os.makedirs(cachedir) # Check if the image is already in the cachedir folder. cache_path = os.path.join(cachedir, filename) - if os.path.isfile(cache_path): if verbose: - print('Image already in cache') + print("Image already in cache") img = Image.open(cache_path) - return self.imshow(img, ax=ax, origin='upper') + return self.imshow(img, ax=ax, origin="upper") # Retrieve image from remote server. import contextlib @@ -4365,11 +4370,11 @@ def arcgisimage(self,server='http://server.arcgisonline.com/ArcGIS',\ with contextlib.closing(conn): img = Image.open(conn) # Save to cache if requested. - if cachedir != None: + if cachedir is not None: img.save(cache_path) # Return AxesImage instance. - return self.imshow(img, ax=ax, origin='upper') + return self.imshow(img, ax=ax, origin="upper") def wmsimage(self,server,\ xpixels=400,ypixels=None,\ From d4eae27751352f260f9d5c9d271a5ecd592c92cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Wed, 14 Feb 2024 11:19:38 +0100 Subject: [PATCH 07/23] Apply basic Flake8 corrections to Basemap.arcgisimage method --- .../src/mpl_toolkits/basemap/__init__.py | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/packages/basemap/src/mpl_toolkits/basemap/__init__.py b/packages/basemap/src/mpl_toolkits/basemap/__init__.py index e13cbc37f..7562500cd 100644 --- a/packages/basemap/src/mpl_toolkits/basemap/__init__.py +++ b/packages/basemap/src/mpl_toolkits/basemap/__init__.py @@ -4330,17 +4330,17 @@ def arcgisimage(self, server="http://server.arcgisonline.com/ArcGIS", ypixels = int(self.aspect * xpixels) # Construct a URL using the ArcGIS Server REST API. - basemap_url = \ -"%s/rest/services/%s/MapServer/export?\ -bbox=%s,%s,%s,%s&\ -bboxSR=%s&\ -imageSR=%s&\ -size=%s,%s&\ -dpi=%s&\ -format=png32&\ -transparent=true&\ -f=image" %\ -(server, service, xmin, ymin, xmax, ymax, self.epsg, self.epsg, xpixels, ypixels, dpi) + basemap_url = "".join([ + "%s/rest/services/%s/MapServer/export?", + "bbox=%s,%s,%s,%s&", + "bboxSR=%s&", + "imageSR=%s&", + "size=%s,%s&", + "dpi=%s&", + "format=png32&", + "transparent=true&", + "f=image", + ]) % (server, service, xmin, ymin, xmax, ymax, self.epsg, self.epsg, xpixels, ypixels, dpi) # Print URL in verbose mode. if verbose: @@ -4349,8 +4349,8 @@ def arcgisimage(self, server="http://server.arcgisonline.com/ArcGIS", if cachedir is not None: # Generate a filename for the cached file. - filename = "%s-bbox-%s-%s-%s-%s-bboxsr%s-imagesr%s-size-%s-%s-dpi%s.png" %\ - (service, xmin, ymin, xmax, ymax, self.epsg, self.epsg, xpixels, ypixels, dpi) + filename = "%s-bbox-%s-%s-%s-%s-bboxsr%s-imagesr%s-size-%s-%s-dpi%s.png" % \ + (service, xmin, ymin, xmax, ymax, self.epsg, self.epsg, xpixels, ypixels, dpi) # Check if the cache directory exists, if not create it. if not os.path.exists(cachedir): From 27ffdb875bb5196758ffc98546242162aa33e5f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Wed, 14 Feb 2024 11:53:50 +0100 Subject: [PATCH 08/23] Clean Basemap.arcgisimage docstring and comments --- .../src/mpl_toolkits/basemap/__init__.py | 82 ++++++++++--------- 1 file changed, 44 insertions(+), 38 deletions(-) diff --git a/packages/basemap/src/mpl_toolkits/basemap/__init__.py b/packages/basemap/src/mpl_toolkits/basemap/__init__.py index 7562500cd..bec68ab2e 100644 --- a/packages/basemap/src/mpl_toolkits/basemap/__init__.py +++ b/packages/basemap/src/mpl_toolkits/basemap/__init__.py @@ -4260,40 +4260,50 @@ def pil_to_array(*args, **kwargs): def arcgisimage(self, server="http://server.arcgisonline.com/ArcGIS", service="World_Imagery", xpixels=400, ypixels=None, dpi=96, cachedir=None, verbose=False, **kwargs): - """ - Retrieve an image using the ArcGIS Server REST API and display it on - the map. In order to use this method, the Basemap instance must be - created using the ``epsg`` keyword to define the map projection, unless - the ``cyl`` projection is used (in which case the epsg code 4326 is - assumed). + r"""Display background image using ArcGIS Server REST API. - .. tabularcolumns:: |l|L| + In order to use this method, the :class:`Basemap` instance + must be created using the ``epsg`` keyword to define the + map projection, unless the "cyl" projection is used (in + which case the EPSG code 4326 is assumed). - ============== ==================================================== - Keywords Description - ============== ==================================================== - server web map server URL (default - http://server.arcgisonline.com/ArcGIS). - service service (image type) hosted on server (default - 'World_Imagery', which is NASA 'Blue Marble' - image). - xpixels requested number of image pixels in x-direction - (default 400). - ypixels requested number of image pixels in y-direction. - Default (None) is to infer the number from - from xpixels and the aspect ratio of the - map projection region. - dpi The device resolution of the exported image (dots per - inch, default 96). - cachedir An optional directory to use as cache folder for the - retrieved images. - verbose if True, print URL used to retrieve image (default - False). - ============== ==================================================== + Parameters + ---------- - Extra keyword ``ax`` can be used to override the default axis instance. + server : str, optional + base URL of the web map server - returns a matplotlib.image.AxesImage instance. + service : str, optional + service (image type) hosted by the server + + xpixels : int, optional + requested number of image pixels in the `x`-direction + + ypixels : int, optional + requested number of image pixels in the `y`-direction; + if not given, it is inferred from ``xpixels`` and the + aspect ratio of the map projection region + + dpi : int, optional + device resolution of the exported image + + cachedir : str, optional + if given, directory to use as cache folder for the images + retrieved from the server + + verbose : bool, optional + if True, print debugging information + + \**kwargs : dict, optional + keyword-only arguments; currently, only ``ax`` is supported + to override the default :class:`matplotlib.axes.Axes` + instance + + Returns + ------- + + aximg : matplotlib.image.AxesImage + image axes instance """ # Fix PIL import on some versions of OSX and scipy. @@ -4313,7 +4323,7 @@ def arcgisimage(self, server="http://server.arcgisonline.com/ArcGIS", ax = kwargs.pop("ax", None) or self._check_ax() - # Find the (x, y) values at the corner points. + # Find the `(x, y)` values at the corner points. with warnings.catch_warnings(): warnings.simplefilter("ignore", category=FutureWarning) p = pyproj.Proj(init="epsg:%s" % self.epsg, preserve_units=True) @@ -4346,17 +4356,15 @@ def arcgisimage(self, server="http://server.arcgisonline.com/ArcGIS", if verbose: print(basemap_url) + # Try to return fast if cache is enabled. if cachedir is not None: - # Generate a filename for the cached file. filename = "%s-bbox-%s-%s-%s-%s-bboxsr%s-imagesr%s-size-%s-%s-dpi%s.png" % \ (service, xmin, ymin, xmax, ymax, self.epsg, self.epsg, xpixels, ypixels, dpi) - # Check if the cache directory exists, if not create it. if not os.path.exists(cachedir): os.makedirs(cachedir) - - # Check if the image is already in the cachedir folder. + # Return fast if the image is already in the cache. cache_path = os.path.join(cachedir, filename) if os.path.isfile(cache_path): if verbose: @@ -4364,7 +4372,7 @@ def arcgisimage(self, server="http://server.arcgisonline.com/ArcGIS", img = Image.open(cache_path) return self.imshow(img, ax=ax, origin="upper") - # Retrieve image from remote server. + # Retrieve image from the remote server. import contextlib conn = urlopen(basemap_url) with contextlib.closing(conn): @@ -4372,8 +4380,6 @@ def arcgisimage(self, server="http://server.arcgisonline.com/ArcGIS", # Save to cache if requested. if cachedir is not None: img.save(cache_path) - - # Return AxesImage instance. return self.imshow(img, ax=ax, origin="upper") def wmsimage(self,server,\ From d9c9ee74cbe5c38e5ecb4a166f4012c9f65acc22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Wed, 14 Feb 2024 12:39:13 +0100 Subject: [PATCH 09/23] Add basic test for Basemap.arcgisimage with cache directory --- .../src/mpl_toolkits/basemap/__init__.py | 4 +-- .../test/mpl_toolkits/basemap/test_Basemap.py | 36 +++++++++++++++++++ 2 files changed, 38 insertions(+), 2 deletions(-) diff --git a/packages/basemap/src/mpl_toolkits/basemap/__init__.py b/packages/basemap/src/mpl_toolkits/basemap/__init__.py index bec68ab2e..efcc6f9c8 100644 --- a/packages/basemap/src/mpl_toolkits/basemap/__init__.py +++ b/packages/basemap/src/mpl_toolkits/basemap/__init__.py @@ -4353,7 +4353,7 @@ def arcgisimage(self, server="http://server.arcgisonline.com/ArcGIS", ]) % (server, service, xmin, ymin, xmax, ymax, self.epsg, self.epsg, xpixels, ypixels, dpi) # Print URL in verbose mode. - if verbose: + if verbose: # pragma: no cover print(basemap_url) # Try to return fast if cache is enabled. @@ -4367,7 +4367,7 @@ def arcgisimage(self, server="http://server.arcgisonline.com/ArcGIS", # Return fast if the image is already in the cache. cache_path = os.path.join(cachedir, filename) if os.path.isfile(cache_path): - if verbose: + if verbose: # pragma: no cover print("Image already in cache") img = Image.open(cache_path) return self.imshow(img, ax=ax, origin="upper") diff --git a/packages/basemap/test/mpl_toolkits/basemap/test_Basemap.py b/packages/basemap/test/mpl_toolkits/basemap/test_Basemap.py index 2565c1569..1579cfb5d 100644 --- a/packages/basemap/test/mpl_toolkits/basemap/test_Basemap.py +++ b/packages/basemap/test/mpl_toolkits/basemap/test_Basemap.py @@ -1,5 +1,8 @@ """Import test for the :mod:`mpl_toolkits.basemap.Basemap` class.""" +import os +import shutil +import tempfile import datetime as dt try: import unittest2 as unittest @@ -145,6 +148,39 @@ def test_arcgisimage_with_cyl(self, axs=None, axslen0=10): axs_children = axs_obj.get_children() self.assertEqual(len(axs_children), axslen0 + 1) + @unittest.skipIf(PIL is None, reason="pillow unavailable") + def test_arcgisimage_with_cyl_using_cache(self, axs=None, axslen0=10): + """Test showing an ArcGIS image as background.""" + + axs_obj = plt.gca() if axs is None else axs + axs_children = axs_obj.get_children() + self.assertEqual(len(axs_children), axslen0) + + bmap = Basemap(ax=axs, projection="cyl", resolution=None, + llcrnrlon=-90, llcrnrlat=30, + urcrnrlon=-60, urcrnrlat=60) + + cachedir = tempfile.mkdtemp(prefix="tmp-basemap-cachedir-") + try: + # Check that the cache is initially empty. + self.assertEqual(len(os.listdir(cachedir)), 0) + # Check that the first call populates the cache. + img = bmap.arcgisimage(verbose=False, cachedir=cachedir) + self.assertEqual(len(os.listdir(cachedir)), 1) + # Check output properties after the first call. + self.assertIsInstance(img, AxesImage) + axs_children = axs_obj.get_children() + self.assertEqual(len(axs_children), axslen0 + 1) + # Check that the second call does not update the cache. + img = bmap.arcgisimage(verbose=False, cachedir=cachedir) + self.assertEqual(len(os.listdir(cachedir)), 1) + # Check output properties after the second call. + self.assertIsInstance(img, AxesImage) + axs_children = axs_obj.get_children() + self.assertEqual(len(axs_children), axslen0 + 2) + finally: + shutil.rmtree(cachedir) + def _test_basemap_data_warpimage(self, method, axs=None, axslen0=10): """Test drawing a map background from :mod:`basemap_data`.""" From 0131763aa7d71de0c3b189f489228e9b55f767c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Wed, 14 Feb 2024 12:49:20 +0100 Subject: [PATCH 10/23] Fix block location Basemap.arcgisimage for cachedir creation --- packages/basemap/src/mpl_toolkits/basemap/__init__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/basemap/src/mpl_toolkits/basemap/__init__.py b/packages/basemap/src/mpl_toolkits/basemap/__init__.py index efcc6f9c8..a7050beed 100644 --- a/packages/basemap/src/mpl_toolkits/basemap/__init__.py +++ b/packages/basemap/src/mpl_toolkits/basemap/__init__.py @@ -4361,9 +4361,6 @@ def arcgisimage(self, server="http://server.arcgisonline.com/ArcGIS", # Generate a filename for the cached file. filename = "%s-bbox-%s-%s-%s-%s-bboxsr%s-imagesr%s-size-%s-%s-dpi%s.png" % \ (service, xmin, ymin, xmax, ymax, self.epsg, self.epsg, xpixels, ypixels, dpi) - # Check if the cache directory exists, if not create it. - if not os.path.exists(cachedir): - os.makedirs(cachedir) # Return fast if the image is already in the cache. cache_path = os.path.join(cachedir, filename) if os.path.isfile(cache_path): @@ -4379,6 +4376,9 @@ def arcgisimage(self, server="http://server.arcgisonline.com/ArcGIS", img = Image.open(conn) # Save to cache if requested. if cachedir is not None: + # Check if the cache directory exists, if not create it. + if not os.path.exists(cachedir): + os.makedirs(cachedir) img.save(cache_path) return self.imshow(img, ax=ax, origin="upper") From ec15505506a9570d74abbb28e0c76a7529d16bcf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Wed, 14 Feb 2024 12:49:46 +0100 Subject: [PATCH 11/23] Add test for Basemap.arcgisimage with on-the-fly cachedir creation --- .../test/mpl_toolkits/basemap/test_Basemap.py | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/packages/basemap/test/mpl_toolkits/basemap/test_Basemap.py b/packages/basemap/test/mpl_toolkits/basemap/test_Basemap.py index 1579cfb5d..6a94d291f 100644 --- a/packages/basemap/test/mpl_toolkits/basemap/test_Basemap.py +++ b/packages/basemap/test/mpl_toolkits/basemap/test_Basemap.py @@ -149,7 +149,7 @@ def test_arcgisimage_with_cyl(self, axs=None, axslen0=10): self.assertEqual(len(axs_children), axslen0 + 1) @unittest.skipIf(PIL is None, reason="pillow unavailable") - def test_arcgisimage_with_cyl_using_cache(self, axs=None, axslen0=10): + def test_arcgisimage_with_cyl_using_cache(self, existing=False, axs=None, axslen0=10): """Test showing an ArcGIS image as background.""" axs_obj = plt.gca() if axs is None else axs @@ -160,10 +160,13 @@ def test_arcgisimage_with_cyl_using_cache(self, axs=None, axslen0=10): llcrnrlon=-90, llcrnrlat=30, urcrnrlon=-60, urcrnrlat=60) - cachedir = tempfile.mkdtemp(prefix="tmp-basemap-cachedir-") - try: - # Check that the cache is initially empty. + # Create cache directory string and check it is empty. + tmpdir = tempfile.mkdtemp(prefix="tmp-basemap-cachedir-") + cachedir = tmpdir if existing else os.path.join(tmpdir, "cachedir") + if os.path.isdir(cachedir): self.assertEqual(len(os.listdir(cachedir)), 0) + + try: # Check that the first call populates the cache. img = bmap.arcgisimage(verbose=False, cachedir=cachedir) self.assertEqual(len(os.listdir(cachedir)), 1) @@ -179,7 +182,14 @@ def test_arcgisimage_with_cyl_using_cache(self, axs=None, axslen0=10): axs_children = axs_obj.get_children() self.assertEqual(len(axs_children), axslen0 + 2) finally: - shutil.rmtree(cachedir) + if os.path.isdir(tmpdir): + shutil.rmtree(tmpdir) + + @unittest.skipIf(PIL is None, reason="pillow unavailable") + def test_arcgisimage_with_cyl_using_cache_already_existing(self): + """Test showing an ArcGIS image as background.""" + + self.test_arcgisimage_with_cyl_using_cache(existing=True) def _test_basemap_data_warpimage(self, method, axs=None, axslen0=10): """Test drawing a map background from :mod:`basemap_data`.""" From a9583bbd67437d75b6f339d0b4af3e2aec9f27ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Wed, 14 Feb 2024 14:13:15 +0100 Subject: [PATCH 12/23] Update CHANGELOG --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4aa0075f2..42c394c56 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,8 @@ https://semver.org/spec/v2.0.0.html ### Fixed - Set recursive exclusion for `.DS_Store` folders in `MANIFEST.in`. +- Fix broken implementation and docstrings of `Basemap.arcgisimage` + method (PR [#598] by @nitram96). ## [1.4.0] - 2024-01-09 @@ -1086,6 +1088,8 @@ https://semver.org/spec/v2.0.0.html - Fix glitches in drawing of parallels and meridians. +[#598]: +https://github.com/matplotlib/basemap/pull/598 [#595]: https://github.com/matplotlib/basemap/pull/595 [#594]: From 0e8a4bb820ee4d3ecf1c3d62013dfa1490a3e705 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Wed, 14 Feb 2024 14:14:31 +0100 Subject: [PATCH 13/23] Update actions/checkout to v4 --- .github/workflows/basemap-data-hires.yml | 2 +- .github/workflows/basemap-data.yml | 2 +- .github/workflows/basemap-for-windows.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/basemap-data-hires.yml b/.github/workflows/basemap-data-hires.yml index a17c75bef..feb560f0e 100644 --- a/.github/workflows/basemap-data-hires.yml +++ b/.github/workflows/basemap-data-hires.yml @@ -27,7 +27,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Upload checkout uses: actions/upload-artifact@v3 diff --git a/.github/workflows/basemap-data.yml b/.github/workflows/basemap-data.yml index 60fabb8ad..df6af7a43 100644 --- a/.github/workflows/basemap-data.yml +++ b/.github/workflows/basemap-data.yml @@ -27,7 +27,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Upload checkout uses: actions/upload-artifact@v3 diff --git a/.github/workflows/basemap-for-windows.yml b/.github/workflows/basemap-for-windows.yml index 69b23d645..250d77b30 100644 --- a/.github/workflows/basemap-for-windows.yml +++ b/.github/workflows/basemap-for-windows.yml @@ -29,7 +29,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Upload checkout uses: actions/upload-artifact@v3 From 6583fdfd961d9279e4a0c216a8392608964acf9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Wed, 14 Feb 2024 14:15:59 +0100 Subject: [PATCH 14/23] Update actions/upload-artifact to v4 --- .github/workflows/basemap-data-hires.yml | 4 ++-- .github/workflows/basemap-data.yml | 4 ++-- .github/workflows/basemap-for-windows.yml | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/basemap-data-hires.yml b/.github/workflows/basemap-data-hires.yml index feb560f0e..7835c62ca 100644 --- a/.github/workflows/basemap-data-hires.yml +++ b/.github/workflows/basemap-data-hires.yml @@ -30,7 +30,7 @@ jobs: uses: actions/checkout@v4 - name: Upload checkout - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: checkout path: . @@ -59,7 +59,7 @@ jobs: pip wheel -w dist --no-deps dist/*.zip - name: Upload build artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: artifacts-build path: ${{ env.PKGDIR }}/dist diff --git a/.github/workflows/basemap-data.yml b/.github/workflows/basemap-data.yml index df6af7a43..74b7f4a3b 100644 --- a/.github/workflows/basemap-data.yml +++ b/.github/workflows/basemap-data.yml @@ -30,7 +30,7 @@ jobs: uses: actions/checkout@v4 - name: Upload checkout - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: checkout path: . @@ -59,7 +59,7 @@ jobs: pip wheel -w dist --no-deps dist/*.zip - name: Upload build artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: artifacts-build path: ${{ env.PKGDIR }}/dist diff --git a/.github/workflows/basemap-for-windows.yml b/.github/workflows/basemap-for-windows.yml index 250d77b30..486bc5fe9 100644 --- a/.github/workflows/basemap-for-windows.yml +++ b/.github/workflows/basemap-for-windows.yml @@ -32,7 +32,7 @@ jobs: uses: actions/checkout@v4 - name: Upload checkout - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: checkout path: . @@ -137,7 +137,7 @@ jobs: python -c "import utils; utils.GeosLibrary('3.6.5').build('extern', toolset='${{ matrix.msvc-toolset }}', njobs=16)" - name: Upload GEOS artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: artifacts-geos-${{ matrix.arch }}-msvc${{ matrix.msvc-toolset }} path: ${{ env.PKGDIR }}/extern @@ -212,7 +212,7 @@ jobs: python -m pip wheel -w dist --no-deps (Get-Item dist/*.zip) - name: Upload build artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: artifacts-build-${{ matrix.arch }}-${{ matrix.python-version }} path: ${{ env.PKGDIR }}/dist From 76622daac1f8c182b29129bc71e6544a2d40b9c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Wed, 14 Feb 2024 14:17:07 +0100 Subject: [PATCH 15/23] Update actions/download-artifact to v4 --- .github/workflows/basemap-data-hires.yml | 8 ++++---- .github/workflows/basemap-data.yml | 8 ++++---- .github/workflows/basemap-for-windows.yml | 14 +++++++------- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/workflows/basemap-data-hires.yml b/.github/workflows/basemap-data-hires.yml index 7835c62ca..6f7e5401f 100644 --- a/.github/workflows/basemap-data-hires.yml +++ b/.github/workflows/basemap-data-hires.yml @@ -47,7 +47,7 @@ jobs: steps: - name: Download checkout - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: checkout path: . @@ -78,13 +78,13 @@ jobs: steps: - name: Download checkout - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: checkout path: . - name: Download build artifacts - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: artifacts-build path: ${{ env.PKGDIR }}/dist @@ -111,7 +111,7 @@ jobs: steps: - name: Download build artifacts - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: artifacts-build path: ${{ env.PKGDIR }}/dist diff --git a/.github/workflows/basemap-data.yml b/.github/workflows/basemap-data.yml index 74b7f4a3b..0d1885c47 100644 --- a/.github/workflows/basemap-data.yml +++ b/.github/workflows/basemap-data.yml @@ -47,7 +47,7 @@ jobs: steps: - name: Download checkout - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: checkout path: . @@ -78,13 +78,13 @@ jobs: steps: - name: Download checkout - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: checkout path: . - name: Download build artifacts - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: artifacts-build path: ${{ env.PKGDIR }}/dist @@ -111,7 +111,7 @@ jobs: steps: - name: Download build artifacts - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: artifacts-build path: ${{ env.PKGDIR }}/dist diff --git a/.github/workflows/basemap-for-windows.yml b/.github/workflows/basemap-for-windows.yml index 486bc5fe9..f77a2aa50 100644 --- a/.github/workflows/basemap-for-windows.yml +++ b/.github/workflows/basemap-for-windows.yml @@ -49,7 +49,7 @@ jobs: steps: - name: Download checkout - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: checkout path: . @@ -109,7 +109,7 @@ jobs: steps: - name: Download checkout - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: checkout path: . @@ -156,7 +156,7 @@ jobs: steps: - name: Download checkout - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: checkout path: . @@ -198,7 +198,7 @@ jobs: toolset: ${{ env.msvc-toolset }} - name: Download GEOS artifacts - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: artifacts-geos-${{ matrix.arch }}-msvc${{ env.msvc-toolset }} path: ${{ env.PKGDIR }}/extern @@ -235,13 +235,13 @@ jobs: steps: - name: Download checkout - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: checkout path: . - name: Download build artifacts - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: artifacts-build-${{ matrix.arch }}-${{ matrix.python-version }} path: ${{ env.PKGDIR }}/dist @@ -301,7 +301,7 @@ jobs: python-version: ${{ matrix.python-version }} - name: Download build artifacts - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: artifacts-build-${{ matrix.arch }}-${{ matrix.python-version }} path: ${{ env.PKGDIR }}/dist From 21dd8083cbcd07b0492f4ccff8dd3d795645aba4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Wed, 14 Feb 2024 14:20:29 +0100 Subject: [PATCH 16/23] Update basemap-data workflows to use Debian 10 --- .github/workflows/basemap-data-hires.yml | 6 +++--- .github/workflows/basemap-data.yml | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/basemap-data-hires.yml b/.github/workflows/basemap-data-hires.yml index 6f7e5401f..445b04232 100644 --- a/.github/workflows/basemap-data-hires.yml +++ b/.github/workflows/basemap-data-hires.yml @@ -43,7 +43,7 @@ jobs: max-parallel: 1 needs: checkout runs-on: ubuntu-latest - container: "pylegacy/python:${{ matrix.python-version }}-debian-9" + container: "pylegacy/python:${{ matrix.python-version }}-debian-10" steps: - name: Download checkout @@ -74,7 +74,7 @@ jobs: fail-fast: false needs: build runs-on: ubuntu-latest - container: "pylegacy/python:${{ matrix.python-version }}-debian-9" + container: "pylegacy/python:${{ matrix.python-version }}-debian-10" steps: - name: Download checkout @@ -106,7 +106,7 @@ jobs: if: startsWith(github.event.ref, 'refs/tags/v') needs: test runs-on: ubuntu-latest - container: "pylegacy/python:${{ matrix.python-version }}-debian-9" + container: "pylegacy/python:${{ matrix.python-version }}-debian-10" environment: PyPI steps: - diff --git a/.github/workflows/basemap-data.yml b/.github/workflows/basemap-data.yml index 0d1885c47..366393121 100644 --- a/.github/workflows/basemap-data.yml +++ b/.github/workflows/basemap-data.yml @@ -43,7 +43,7 @@ jobs: max-parallel: 1 needs: checkout runs-on: ubuntu-latest - container: "pylegacy/python:${{ matrix.python-version }}-debian-9" + container: "pylegacy/python:${{ matrix.python-version }}-debian-10" steps: - name: Download checkout @@ -74,7 +74,7 @@ jobs: fail-fast: false needs: build runs-on: ubuntu-latest - container: "pylegacy/python:${{ matrix.python-version }}-debian-9" + container: "pylegacy/python:${{ matrix.python-version }}-debian-10" steps: - name: Download checkout @@ -106,7 +106,7 @@ jobs: if: startsWith(github.event.ref, 'refs/tags/v') needs: test runs-on: ubuntu-latest - container: "pylegacy/python:${{ matrix.python-version }}-debian-9" + container: "pylegacy/python:${{ matrix.python-version }}-debian-10" environment: PyPI steps: - From 4a4ce7b7827ecf5837a15c43f912e70752486f47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Wed, 14 Feb 2024 14:35:47 +0100 Subject: [PATCH 17/23] Update CHANGELOG --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 42c394c56..c99fb4c2f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,12 @@ https://semver.org/spec/v2.0.0.html ## [Unreleased] +### Changed +- Update workflow actions from v3 to v4 if possible (`actions/checkout`, + `actions/upload-artifact` and `actions/download-artifact`). +- Update base image for `basemap-data` and `basemap-data-hires` + GitHub workflows to use Debian 10. + ### Fixed - Set recursive exclusion for `.DS_Store` folders in `MANIFEST.in`. - Fix broken implementation and docstrings of `Basemap.arcgisimage` From be2ed1854258676bf380fac4bf22f5cc4f052da9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Wed, 14 Feb 2024 14:40:05 +0100 Subject: [PATCH 18/23] Update jwlawson/actions-setup-cmake from v1.13 to v2.0 --- .github/workflows/basemap-for-windows.yml | 2 +- CHANGELOG.md | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/basemap-for-windows.yml b/.github/workflows/basemap-for-windows.yml index f77a2aa50..e766dada0 100644 --- a/.github/workflows/basemap-for-windows.yml +++ b/.github/workflows/basemap-for-windows.yml @@ -121,7 +121,7 @@ jobs: toolset: ${{ matrix.msvc-toolset }} - name: Set CMake - uses: jwlawson/actions-setup-cmake@v1.13 + uses: jwlawson/actions-setup-cmake@v2.0 with: cmake-version: "3.24.2" - diff --git a/CHANGELOG.md b/CHANGELOG.md index c99fb4c2f..75738f7c9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,8 +13,10 @@ https://semver.org/spec/v2.0.0.html ## [Unreleased] ### Changed -- Update workflow actions from v3 to v4 if possible (`actions/checkout`, - `actions/upload-artifact` and `actions/download-artifact`). +- Update workflow actions to use NodeJS 20: + - Update base actions from v3 to v4 when possible (`actions/checkout`, + `actions/upload-artifact` and `actions/download-artifact`). + - Update `jwlawson/actions-setup-cmake` from v1.13 to v2.0. - Update base image for `basemap-data` and `basemap-data-hires` GitHub workflows to use Debian 10. From 2a9798dcb069038c92688ecdd582d0e82579ad66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Wed, 14 Feb 2024 22:55:04 +0100 Subject: [PATCH 19/23] Update actions/upload-artifact v1 to v4 in Windows workflow --- .github/workflows/basemap-for-windows.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/basemap-for-windows.yml b/.github/workflows/basemap-for-windows.yml index e766dada0..92eb337fc 100644 --- a/.github/workflows/basemap-for-windows.yml +++ b/.github/workflows/basemap-for-windows.yml @@ -269,16 +269,16 @@ jobs: name: Test package run: | cd ${{ env.PKGDIR }} - $env:COVERAGE_FILE = ".coverage.${{ matrix.python-version }}" + $env:COVERAGE_FILE = ".coverage.${{ matrix.arch }}.${{ matrix.python-version }}" python -m pytest ` --cov="mpl_toolkits.basemap" --cov-report=term ` --ignore=dist --ignore=build - name: Upload test artifacts - uses: actions/upload-artifact@v1 + uses: actions/upload-artifact@v4 with: - name: test - path: ${{ env.PKGDIR }}/.coverage.${{ matrix.python-version }} + name: artifacts-test-${{ matrix.arch }}-${{ matrix.python-version }} + path: ${{ env.PKGDIR }}/.coverage.${{ matrix.arch }}.${{ matrix.python-version }} upload: strategy: From 29e4a4e5baebc55c224c845afda74512482352a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Wed, 14 Feb 2024 22:58:27 +0100 Subject: [PATCH 20/23] Rename artifacts in basemap-for-manylinux workflow --- .github/workflows/basemap-for-manylinux.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/basemap-for-manylinux.yml b/.github/workflows/basemap-for-manylinux.yml index 35243d8a5..e247df2d1 100644 --- a/.github/workflows/basemap-for-manylinux.yml +++ b/.github/workflows/basemap-for-manylinux.yml @@ -311,7 +311,7 @@ jobs: name: Upload test artifacts uses: actions/upload-artifact@v1 with: - name: test + name: artifacts-test path: ${{ env.PKGDIR }}/.coverage.${{ matrix.python-version }} coverage: @@ -326,7 +326,7 @@ jobs: name: Download test artifacts uses: actions/download-artifact@v1 with: - name: test + name: artifacts-test path: ${{ env.PKGDIR }} - name: Install test requirements @@ -344,7 +344,7 @@ jobs: name: Upload coverage artifacts uses: actions/upload-artifact@v1 with: - name: coverage + name: artifacts-coverage path: ${{ env.PKGDIR }}/htmlcov docs: @@ -383,13 +383,13 @@ jobs: name: Upload docs artifacts uses: actions/upload-artifact@v1 with: - name: docs + name: artifacts-docs path: ${{ env.PKGDIR }}/public - name: Upload github-pages artifact uses: actions/upload-pages-artifact@v2 with: - name: github-pages + name: artifacts-github-pages path: ${{ env.PKGDIR }}/public pages: From 44b5e78f7dd2e28d6fe0d8972c3de4d6a6807e78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Thu, 15 Feb 2024 09:27:57 +0100 Subject: [PATCH 21/23] Update pages actions from v2 to v3 --- .github/workflows/basemap-for-manylinux.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/basemap-for-manylinux.yml b/.github/workflows/basemap-for-manylinux.yml index e247df2d1..cdd577b17 100644 --- a/.github/workflows/basemap-for-manylinux.yml +++ b/.github/workflows/basemap-for-manylinux.yml @@ -387,7 +387,7 @@ jobs: path: ${{ env.PKGDIR }}/public - name: Upload github-pages artifact - uses: actions/upload-pages-artifact@v2 + uses: actions/upload-pages-artifact@v3 with: name: artifacts-github-pages path: ${{ env.PKGDIR }}/public @@ -404,7 +404,7 @@ jobs: id-token: write steps: - name: Deploy github-pages - uses: actions/deploy-pages@v2 + uses: actions/deploy-pages@v3 id: deployment upload: From 32065ce8c4991922d6e1d9ecde2010b8b4c1fdb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Thu, 15 Feb 2024 12:44:46 +0100 Subject: [PATCH 22/23] Prepare for hotfix 1.4.1 --- CHANGELOG.md | 6 ++++-- packages/basemap/README.md | 4 ++-- packages/basemap/requirements-doc.txt | 2 +- packages/basemap/src/_geoslib.pyx | 2 +- packages/basemap/src/mpl_toolkits/basemap/__init__.py | 2 +- 5 files changed, 9 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 75738f7c9..d9bdc4fa9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,7 +10,7 @@ https://keepachangelog.com/en/1.0.0/ https://semver.org/spec/v2.0.0.html -## [Unreleased] +## [1.4.1] - 2024-02-15 ### Changed - Update workflow actions to use NodeJS 20: @@ -1252,7 +1252,9 @@ https://github.com/matplotlib/basemap/issues/228 https://github.com/matplotlib/basemap/issues/179 [Unreleased]: -https://github.com/matplotlib/basemap/compare/v1.4.0...develop +https://github.com/matplotlib/basemap/compare/v1.4.1...develop +[1.4.1]: +https://github.com/matplotlib/basemap/compare/v1.4.0...v1.4.1 [1.4.0]: https://github.com/matplotlib/basemap/compare/v1.3.9...v1.4.0 [1.3.9]: diff --git a/packages/basemap/README.md b/packages/basemap/README.md index 622e56303..be631e774 100644 --- a/packages/basemap/README.md +++ b/packages/basemap/README.md @@ -45,6 +45,6 @@ https://spdx.org/licenses/LGPL-2.1-only.html https://spdx.org/licenses/MIT.html [`LICENSE`]: -https://github.com/matplotlib/basemap/blob/v1.4.0/packages/basemap/LICENSE +https://github.com/matplotlib/basemap/blob/v1.4.1/packages/basemap/LICENSE [`LICENSE.geos`]: -https://github.com/matplotlib/basemap/blob/v1.4.0/packages/basemap/LICENSE.geos +https://github.com/matplotlib/basemap/blob/v1.4.1/packages/basemap/LICENSE.geos diff --git a/packages/basemap/requirements-doc.txt b/packages/basemap/requirements-doc.txt index 229abc2ac..385d1e158 100644 --- a/packages/basemap/requirements-doc.txt +++ b/packages/basemap/requirements-doc.txt @@ -2,5 +2,5 @@ sphinx >= 5.3, < 7.2; python_version >= "3.8" furo >= 2022.4.7, < 2023.9.11; python_version >= "3.8" scipy >= 1.2, < 1.12; python_version >= "3.5" -netCDF4 >= 1.5.6, < 1.7.0; python_version >= "3.6" cftime >= 1.4.0, < 1.7.0; python_version >= "3.6" +netCDF4 >= 1.5.6, < 1.7.0; python_version >= "3.6" diff --git a/packages/basemap/src/_geoslib.pyx b/packages/basemap/src/_geoslib.pyx index 676ac4d4b..1e2ced532 100644 --- a/packages/basemap/src/_geoslib.pyx +++ b/packages/basemap/src/_geoslib.pyx @@ -2,7 +2,7 @@ import sys import numpy cimport numpy as cnp -__version__ = "1.5.0-dev" +__version__ = "1.4.1" # Need some Python C-API functions for strings. diff --git a/packages/basemap/src/mpl_toolkits/basemap/__init__.py b/packages/basemap/src/mpl_toolkits/basemap/__init__.py index a7050beed..651a2dd5a 100644 --- a/packages/basemap/src/mpl_toolkits/basemap/__init__.py +++ b/packages/basemap/src/mpl_toolkits/basemap/__init__.py @@ -48,7 +48,7 @@ from . proj import Proj -__version__ = "1.5.0-dev" +__version__ = "1.4.1" # basemap data files now installed in lib/matplotlib/toolkits/basemap/data # check to see if environment variable BASEMAPDATA set to a directory, From 01b2218c7db034bb71f62c1ce4ae0a1d942a837a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Thu, 15 Feb 2024 13:18:15 +0100 Subject: [PATCH 23/23] Add Python 3.12 to basemap-data workflows --- .github/workflows/basemap-data-hires.yml | 2 +- .github/workflows/basemap-data.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/basemap-data-hires.yml b/.github/workflows/basemap-data-hires.yml index 445b04232..a33ddb149 100644 --- a/.github/workflows/basemap-data-hires.yml +++ b/.github/workflows/basemap-data-hires.yml @@ -69,7 +69,7 @@ jobs: matrix: python-version: ["2.6", "2.7", "3.2", "3.3", "3.4", "3.5", "3.6", "3.7", "3.8", - "3.9", "3.10", "3.11"] + "3.9", "3.10", "3.11", "3.12"] max-parallel: 3 fail-fast: false needs: build diff --git a/.github/workflows/basemap-data.yml b/.github/workflows/basemap-data.yml index 366393121..629213f31 100644 --- a/.github/workflows/basemap-data.yml +++ b/.github/workflows/basemap-data.yml @@ -69,7 +69,7 @@ jobs: matrix: python-version: ["2.6", "2.7", "3.2", "3.3", "3.4", "3.5", "3.6", "3.7", "3.8", - "3.9", "3.10", "3.11"] + "3.9", "3.10", "3.11", "3.12"] max-parallel: 3 fail-fast: false needs: build