From 1b1e57a4b7179d81701d49f7993e4c61aa1baefe Mon Sep 17 00:00:00 2001 From: Ryan May Date: Mon, 12 Nov 2018 14:51:23 -0700 Subject: [PATCH 1/3] Fix doctest to work on Python 2 and 3 (Fixes #1171) Eliminate the appearance of u'' on Python 2. --- lib/cartopy/io/shapereader.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/cartopy/io/shapereader.py b/lib/cartopy/io/shapereader.py index 594e28899..4621245d8 100644 --- a/lib/cartopy/io/shapereader.py +++ b/lib/cartopy/io/shapereader.py @@ -30,8 +30,8 @@ >>> records = list(reader.records()) >>> print(type(records[0])) - >>> print(sorted(records[0].attributes.keys())) - ['comment', ... 'name', 'name_alt', ... 'region', ...] + >>> print(', '.join(str(r) for r in sorted(records[0].attributes.keys()))) + comment, ... name, name_alt, ... region, ... >>> print(records[0].attributes['name']) Niagara Falls >>> geoms = list(reader.geometries()) From 03ad35e2690bdc4608aa4d5a2fe7b69498a266f5 Mon Sep 17 00:00:00 2001 From: Ryan May Date: Mon, 12 Nov 2018 14:53:00 -0700 Subject: [PATCH 2/3] Adjust condition for uploading releases to be more robust --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 381cffb80..95e1f0162 100644 --- a/.travis.yml +++ b/.travis.yml @@ -91,5 +91,5 @@ deploy: upload_docs: false on: repo: SciTools/cartopy - condition: $PYTHON_VERSION=="3.6" + condition: $NAME == "Latest everything"* tags: true From c8d30f1a9319047e0d1fd17199662219a4f09d61 Mon Sep 17 00:00:00 2001 From: Ryan May Date: Mon, 12 Nov 2018 14:55:22 -0700 Subject: [PATCH 3/3] Replace use of "pyplot" namespace with "plt" Addresses part of #1005 --- lib/cartopy/mpl/geoaxes.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/cartopy/mpl/geoaxes.py b/lib/cartopy/mpl/geoaxes.py index fd0056109..56726402c 100644 --- a/lib/cartopy/mpl/geoaxes.py +++ b/lib/cartopy/mpl/geoaxes.py @@ -236,18 +236,18 @@ class GeoAxes(matplotlib.axes.Axes): when created with the *projection* keyword. For example:: # Set up a standard map for latlon data. - geo_axes = pyplot.axes(projection=cartopy.crs.PlateCarree()) + geo_axes = plt.axes(projection=cartopy.crs.PlateCarree()) # Set up an OSGB map. - geo_axes = pyplot.subplot(2, 2, 1, projection=cartopy.crs.OSGB()) + geo_axes = plt.subplot(2, 2, 1, projection=cartopy.crs.OSGB()) When a source projection is provided to one of it's plotting methods, using the *transform* keyword, the standard Matplotlib plot result is transformed from source coordinates to the target projection. For example:: # Plot latlon data on an OSGB map. - pyplot.axes(projection=cartopy.crs.OSGB()) - pyplot.contourf(x, y, data, transform=cartopy.crs.PlateCarree()) + plt.axes(projection=cartopy.crs.OSGB()) + plt.contourf(x, y, data, transform=cartopy.crs.PlateCarree()) """ def __init__(self, *args, **kwargs):