Update to 0.17.0.

This commit is contained in:
Elliott Sales de Andrade 2018-11-17 02:49:34 -05:00
commit 0cf216b969
10 changed files with 66 additions and 1222 deletions

1
.gitignore vendored
View file

@ -1,2 +1,3 @@
/Cartopy-0.16.0.tar.gz
/Cartopy-norm-images.tar.xz
/Cartopy-0.17.0.tar.gz

View file

@ -0,0 +1,44 @@
From 4b38cd074bcc3c9014926add54ea4ee331f3e47b Mon Sep 17 00:00:00 2001
From: Elliott Sales de Andrade <quantum.analyst@gmail.com>
Date: Mon, 26 Feb 2018 02:42:50 -0500
Subject: [PATCH] Increase tolerance for new FreeType.
Signed-off-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
---
lib/cartopy/tests/mpl/test_gridliner.py | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/lib/cartopy/tests/mpl/test_gridliner.py b/lib/cartopy/tests/mpl/test_gridliner.py
index aa772b9..e027741 100644
--- a/lib/cartopy/tests/mpl/test_gridliner.py
+++ b/lib/cartopy/tests/mpl/test_gridliner.py
@@ -17,7 +17,10 @@
from __future__ import (absolute_import, division, print_function)
+from distutils.version import LooseVersion
+
from matplotlib.backends.backend_agg import FigureCanvasAgg
+import matplotlib.ft2font
import matplotlib.pyplot as plt
import matplotlib.ticker as mticker
try:
@@ -109,10 +112,14 @@ if MPL_VERSION >= '2.0':
grid_label_image = 'gridliner_labels'
else:
grid_label_image = 'gridliner_labels_1.5'
+if LooseVersion(matplotlib.ft2font.__freetype_version__) >= '2.7':
+ grid_label_tolerance = 20.3
+else:
+ grid_label_tolerance = 0
@pytest.mark.natural_earth
-@ImageTesting([grid_label_image])
+@ImageTesting([grid_label_image], tolerance=grid_label_tolerance)
def test_grid_labels():
plt.figure(figsize=(8, 10))
--
2.17.2

View file

@ -1,911 +0,0 @@
From 756c9af63aee1785da91b218633a2c2fdfa09f11 Mon Sep 17 00:00:00 2001
From: Phil Elson <pelson.pub@gmail.com>
Date: Fri, 23 Feb 2018 06:55:16 +0000
Subject: [PATCH 1/7] Merge pull request #1032 from QuLogic/test-updates
Improvements to test metadata
Signed-off-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
---
lib/cartopy/_epsg.py | 5 +++--
lib/cartopy/tests/io/test_downloaders.py | 4 +++-
lib/cartopy/tests/io/test_ogc_clients.py | 5 ++++-
lib/cartopy/tests/io/test_srtm.py | 5 +++--
lib/cartopy/tests/mpl/test_caching.py | 3 +++
lib/cartopy/tests/mpl/test_crs.py | 5 ++++-
lib/cartopy/tests/mpl/test_examples.py | 2 ++
lib/cartopy/tests/mpl/test_features.py | 5 ++++-
lib/cartopy/tests/mpl/test_gridliner.py | 4 +++-
lib/cartopy/tests/mpl/test_images.py | 8 ++++++-
lib/cartopy/tests/mpl/test_img_transform.py | 3 ++-
lib/cartopy/tests/mpl/test_mpl_integration.py | 31 ++++++++++++++++++++++++++-
lib/cartopy/tests/mpl/test_shapely_to_mpl.py | 5 ++++-
lib/cartopy/tests/mpl/test_ticks.py | 7 +++++-
lib/cartopy/tests/mpl/test_web_services.py | 4 +++-
lib/cartopy/tests/test_coastline.py | 9 +++++---
lib/cartopy/tests/test_coding_standards.py | 6 ++++--
lib/cartopy/tests/test_crs.py | 3 ++-
lib/cartopy/tests/test_img_nest.py | 4 +++-
lib/cartopy/tests/test_img_tiles.py | 3 ++-
lib/cartopy/tests/test_shapereader.py | 19 ++++++++--------
lib/cartopy/util.py | 31 ++++++++++++++++-----------
22 files changed, 127 insertions(+), 44 deletions(-)
diff --git a/lib/cartopy/_epsg.py b/lib/cartopy/_epsg.py
index 8444d47..65c03de 100644
--- a/lib/cartopy/_epsg.py
+++ b/lib/cartopy/_epsg.py
@@ -21,11 +21,11 @@ Provide support for converting EPSG codes to Projection instances.
from __future__ import (absolute_import, division, print_function)
-import cartopy.crs as ccrs
import numpy as np
-import pyepsg
import shapely.geometry as sgeom
+import cartopy.crs as ccrs
+
_GLOBE_PARAMS = {'datum': 'datum',
'ellps': 'ellipse',
@@ -39,6 +39,7 @@ _GLOBE_PARAMS = {'datum': 'datum',
class _EPSGProjection(ccrs.Projection):
def __init__(self, code):
+ import pyepsg
projection = pyepsg.get(code)
if not isinstance(projection, pyepsg.ProjectedCRS):
raise ValueError('EPSG code does not define a projection')
diff --git a/lib/cartopy/tests/io/test_downloaders.py b/lib/cartopy/tests/io/test_downloaders.py
index 4fade4d..c935b41 100644
--- a/lib/cartopy/tests/io/test_downloaders.py
+++ b/lib/cartopy/tests/io/test_downloaders.py
@@ -1,4 +1,4 @@
-# (C) British Crown Copyright 2011 - 2017, Met Office
+# (C) British Crown Copyright 2011 - 2018, Met Office
#
# This file is part of cartopy.
#
@@ -107,6 +107,7 @@ def test_from_config():
assert r is land_downloader
+@pytest.mark.network
def test_downloading_simple_ascii(download_to_temp):
# downloads a file from the Google APIs. (very high uptime and file will
# always be there - if this goes down, most of the internet would break!)
@@ -139,6 +140,7 @@ def test_downloading_simple_ascii(download_to_temp):
assert counter.count == 0, 'Item was re-downloaded.'
+@pytest.mark.network
def test_natural_earth_downloader(tmpdir):
# downloads a file to a temporary location, and uses that temporary
# location, then:
diff --git a/lib/cartopy/tests/io/test_ogc_clients.py b/lib/cartopy/tests/io/test_ogc_clients.py
index 1dc7048..b1d0f3c 100644
--- a/lib/cartopy/tests/io/test_ogc_clients.py
+++ b/lib/cartopy/tests/io/test_ogc_clients.py
@@ -1,4 +1,4 @@
-# (C) British Crown Copyright 2011 - 2017, Met Office
+# (C) British Crown Copyright 2011 - 2018, Met Office
#
# This file is part of cartopy.
#
@@ -41,6 +41,7 @@ from cartopy.io.ogc_clients import _OWSLIB_AVAILABLE
RESOLUTION = (30, 30)
+@pytest.mark.network
@pytest.mark.skipif(not _OWSLIB_AVAILABLE, reason='OWSLib is unavailable.')
class TestWMSRasterSource(object):
URI = 'http://vmap0.tiles.osgeo.org/wms/vmap0'
@@ -144,6 +145,7 @@ class TestWMSRasterSource(object):
assert img.shape == (40, 20, 4)
+@pytest.mark.network
@pytest.mark.skipif(not _OWSLIB_AVAILABLE, reason='OWSLib is unavailable.')
class TestWMTSRasterSource(object):
URI = 'https://map1c.vis.earthdata.nasa.gov/wmts-geo/wmts.cgi'
@@ -217,6 +219,7 @@ class TestWMTSRasterSource(object):
assert im2.extent == extent
+@pytest.mark.network
@pytest.mark.skipif(not _OWSLIB_AVAILABLE, reason='OWSLib is unavailable.')
class TestWFSGeometrySource(object):
URI = 'https://nsidc.org/cgi-bin/atlas_south?service=WFS'
diff --git a/lib/cartopy/tests/io/test_srtm.py b/lib/cartopy/tests/io/test_srtm.py
index e998dfc..2f255d2 100644
--- a/lib/cartopy/tests/io/test_srtm.py
+++ b/lib/cartopy/tests/io/test_srtm.py
@@ -1,4 +1,4 @@
-# (C) British Crown Copyright 2011 - 2017, Met Office
+# (C) British Crown Copyright 2011 - 2018, Met Office
#
# This file is part of cartopy.
#
@@ -27,7 +27,8 @@ import cartopy.crs as ccrs
import cartopy.io.srtm
-pytestmark = pytest.mark.skip('SRTM login not supported')
+pytestmark = [pytest.mark.skip('SRTM login not supported'),
+ pytest.mark.network]
class TestRetrieve(object):
diff --git a/lib/cartopy/tests/mpl/test_caching.py b/lib/cartopy/tests/mpl/test_caching.py
index f8da599..dbc367f 100644
--- a/lib/cartopy/tests/mpl/test_caching.py
+++ b/lib/cartopy/tests/mpl/test_caching.py
@@ -76,6 +76,7 @@ class CallCounter(object):
setattr(self.parent, self.function_name, self.orig_fn)
+@pytest.mark.natural_earth
def test_coastline_loading_cache():
# a5caae040ee11e72a62a53100fe5edc355304419 added coastline caching.
# This test ensures it is working.
@@ -99,6 +100,7 @@ def test_coastline_loading_cache():
plt.close()
+@pytest.mark.natural_earth
def test_shapefile_transform_cache():
# a5caae040ee11e72a62a53100fe5edc355304419 added shapefile mpl
# geometry caching based on geometry object id. This test ensures
@@ -185,6 +187,7 @@ def test_contourf_transform_path_counting():
plt.close()
+@pytest.mark.network
@pytest.mark.skipif(not _OWSLIB_AVAILABLE, reason='OWSLib is unavailable.')
def test_wmts_tile_caching():
image_cache = WMTSRasterSource._shared_image_cache
diff --git a/lib/cartopy/tests/mpl/test_crs.py b/lib/cartopy/tests/mpl/test_crs.py
index d0099fa..9076e38 100644
--- a/lib/cartopy/tests/mpl/test_crs.py
+++ b/lib/cartopy/tests/mpl/test_crs.py
@@ -1,4 +1,4 @@
-# (C) British Crown Copyright 2013 - 2017, Met Office
+# (C) British Crown Copyright 2013 - 2018, Met Office
#
# This file is part of cartopy.
#
@@ -18,11 +18,13 @@
from __future__ import (absolute_import, division, print_function)
import matplotlib.pyplot as plt
+import pytest
import cartopy.crs as ccrs
from cartopy.tests.mpl import ImageTesting
+@pytest.mark.natural_earth
@ImageTesting(['lambert_conformal_south'])
def test_lambert_south():
# Reference image: http://www.icsm.gov.au/mapping/map_projections.html
@@ -33,6 +35,7 @@ def test_lambert_south():
ax.gridlines()
+@pytest.mark.natural_earth
@ImageTesting(['mercator_squashed'])
def test_mercator_squashed():
globe = ccrs.Globe(semimajor_axis=10000, semiminor_axis=9000,
diff --git a/lib/cartopy/tests/mpl/test_examples.py b/lib/cartopy/tests/mpl/test_examples.py
index 59fd1f5..db689e0 100644
--- a/lib/cartopy/tests/mpl/test_examples.py
+++ b/lib/cartopy/tests/mpl/test_examples.py
@@ -18,6 +18,7 @@
from __future__ import (absolute_import, division, print_function)
import matplotlib.pyplot as plt
+import pytest
from cartopy.tests.mpl import MPL_VERSION, ImageTesting
@@ -40,6 +41,7 @@ class ExampleImageTesting(ImageTesting):
return new_fn
+@pytest.mark.natural_earth
@ExampleImageTesting(['global_map'],
tolerance=4 if MPL_VERSION < '2' else 0)
def test_global_map():
diff --git a/lib/cartopy/tests/mpl/test_features.py b/lib/cartopy/tests/mpl/test_features.py
index c675a3b..250e3db 100644
--- a/lib/cartopy/tests/mpl/test_features.py
+++ b/lib/cartopy/tests/mpl/test_features.py
@@ -1,4 +1,4 @@
-# (C) British Crown Copyright 2011 - 2017, Met Office
+# (C) British Crown Copyright 2011 - 2018, Met Office
#
# This file is part of cartopy.
#
@@ -27,6 +27,7 @@ from cartopy.io.ogc_clients import _OWSLIB_AVAILABLE
from cartopy.tests.mpl import MPL_VERSION, ImageTesting
+@pytest.mark.natural_earth
@ImageTesting(['natural_earth'])
def test_natural_earth():
ax = plt.axes(projection=ccrs.PlateCarree())
@@ -40,6 +41,7 @@ def test_natural_earth():
ax.set_ylim((-40, 40))
+@pytest.mark.natural_earth
@ImageTesting(['natural_earth_custom'])
def test_natural_earth_custom():
ax = plt.axes(projection=ccrs.PlateCarree())
@@ -65,6 +67,7 @@ def test_gshhs():
facecolor='green'), facecolor='blue')
+@pytest.mark.network
@pytest.mark.skipif(not _OWSLIB_AVAILABLE, reason='OWSLib is unavailable.')
@ImageTesting(['wfs'])
def test_wfs():
diff --git a/lib/cartopy/tests/mpl/test_gridliner.py b/lib/cartopy/tests/mpl/test_gridliner.py
index d59e639..9fbeba7 100644
--- a/lib/cartopy/tests/mpl/test_gridliner.py
+++ b/lib/cartopy/tests/mpl/test_gridliner.py
@@ -1,4 +1,4 @@
-# (C) British Crown Copyright 2011 - 2017, Met Office
+# (C) British Crown Copyright 2011 - 2018, Met Office
#
# This file is part of cartopy.
#
@@ -33,6 +33,7 @@ from cartopy.mpl.gridliner import LATITUDE_FORMATTER, LONGITUDE_FORMATTER
from cartopy.tests.mpl import MPL_VERSION, ImageTesting
+@pytest.mark.natural_earth
@ImageTesting(['gridliner1'])
def test_gridliner():
ny, nx = 2, 4
@@ -112,6 +113,7 @@ else:
grid_label_image = 'gridliner_labels_pre_mpl_1.5'
+@pytest.mark.natural_earth
@ImageTesting([grid_label_image])
def test_grid_labels():
plt.figure(figsize=(8, 10))
diff --git a/lib/cartopy/tests/mpl/test_images.py b/lib/cartopy/tests/mpl/test_images.py
index b705c8d..105ee80 100644
--- a/lib/cartopy/tests/mpl/test_images.py
+++ b/lib/cartopy/tests/mpl/test_images.py
@@ -1,4 +1,4 @@
-# (C) British Crown Copyright 2011 - 2017, Met Office
+# (C) British Crown Copyright 2011 - 2018, Met Office
#
# This file is part of cartopy.
#
@@ -23,6 +23,7 @@ import types
import numpy as np
import matplotlib.pyplot as plt
from PIL import Image
+import pytest
import shapely.geometry as sgeom
from cartopy import config
@@ -43,6 +44,8 @@ REGIONAL_IMG = os.path.join(config['repo_data_dir'], 'raster', 'sample',
# We have an exceptionally large tolerance for the web_tiles test.
# The basemap changes on a regular basis (for seasons) and we really only
# care that it is putting images onto the map which are roughly correct.
+@pytest.mark.natural_earth
+@pytest.mark.network
@ImageTesting(['web_tiles'],
tolerance=12 if MPL_VERSION < '2' else 2.9)
def test_web_tiles():
@@ -78,6 +81,8 @@ def test_web_tiles():
ax.coastlines()
+@pytest.mark.natural_earth
+@pytest.mark.network
@ImageTesting(['image_merge'],
tolerance=3.6 if MPL_VERSION < '2' else 0)
def test_image_merge():
@@ -118,6 +123,7 @@ def test_imshow():
extent=[-180, 180, -90, 90])
+@pytest.mark.natural_earth
@ImageTesting(['imshow_regional_projected'],
tolerance=10.4 if MPL_VERSION < '2' else 0)
def test_imshow_projected():
diff --git a/lib/cartopy/tests/mpl/test_img_transform.py b/lib/cartopy/tests/mpl/test_img_transform.py
index d966cc8..3b53c0a 100644
--- a/lib/cartopy/tests/mpl/test_img_transform.py
+++ b/lib/cartopy/tests/mpl/test_img_transform.py
@@ -1,4 +1,4 @@
-# (C) British Crown Copyright 2011 - 2017, Met Office
+# (C) British Crown Copyright 2011 - 2018, Met Office
#
# This file is part of cartopy.
#
@@ -101,6 +101,7 @@ else:
regrid_tolerance = 0
+@pytest.mark.natural_earth
@ImageTesting(['regrid_image'],
tolerance=regrid_tolerance)
def test_regrid_image():
diff --git a/lib/cartopy/tests/mpl/test_mpl_integration.py b/lib/cartopy/tests/mpl/test_mpl_integration.py
index 1fe91f8..681c9bc 100644
--- a/lib/cartopy/tests/mpl/test_mpl_integration.py
+++ b/lib/cartopy/tests/mpl/test_mpl_integration.py
@@ -1,4 +1,4 @@
-# (C) British Crown Copyright 2011 - 2017, Met Office
+# (C) British Crown Copyright 2011 - 2018, Met Office
#
# This file is part of cartopy.
#
@@ -23,6 +23,7 @@ import warnings
import numpy as np
import matplotlib.pyplot as plt
+import pytest
import six
import cartopy.crs as ccrs
@@ -41,6 +42,7 @@ else:
_STREAMPLOT_IMAGE = 'streamplot_pre_mpl_1.4.3'
+@pytest.mark.natural_earth
@ImageTesting(['global_contour_wrap'])
def test_global_contour_wrap_new_transform():
ax = plt.axes(projection=ccrs.PlateCarree())
@@ -50,6 +52,7 @@ def test_global_contour_wrap_new_transform():
plt.contour(x, y, data, transform=ccrs.PlateCarree())
+@pytest.mark.natural_earth
@ImageTesting(['global_contour_wrap'])
def test_global_contour_wrap_no_transform():
ax = plt.axes(projection=ccrs.PlateCarree())
@@ -59,6 +62,7 @@ def test_global_contour_wrap_no_transform():
plt.contour(x, y, data)
+@pytest.mark.natural_earth
@ImageTesting(['global_contourf_wrap'])
def test_global_contourf_wrap_new_transform():
ax = plt.axes(projection=ccrs.PlateCarree())
@@ -68,6 +72,7 @@ def test_global_contourf_wrap_new_transform():
plt.contourf(x, y, data, transform=ccrs.PlateCarree())
+@pytest.mark.natural_earth
@ImageTesting(['global_contourf_wrap'])
def test_global_contourf_wrap_no_transform():
ax = plt.axes(projection=ccrs.PlateCarree())
@@ -82,6 +87,7 @@ global_pcolor_wrap = ('global_pcolor_wrap'
'global_pcolor_wrap_pre_mpl_1.4.3')
+@pytest.mark.natural_earth
@ImageTesting([global_pcolor_wrap])
def test_global_pcolor_wrap_new_transform():
ax = plt.axes(projection=ccrs.PlateCarree())
@@ -91,6 +97,7 @@ def test_global_pcolor_wrap_new_transform():
plt.pcolor(x, y, data, transform=ccrs.PlateCarree())
+@pytest.mark.natural_earth
@ImageTesting([global_pcolor_wrap])
def test_global_pcolor_wrap_no_transform():
ax = plt.axes(projection=ccrs.PlateCarree())
@@ -100,6 +107,7 @@ def test_global_pcolor_wrap_no_transform():
plt.pcolor(x, y, data)
+@pytest.mark.natural_earth
@ImageTesting(['global_scatter_wrap'])
def test_global_scatter_wrap_new_transform():
ax = plt.axes(projection=ccrs.PlateCarree())
@@ -112,6 +120,7 @@ def test_global_scatter_wrap_new_transform():
plt.scatter(x, y, c=data, transform=ccrs.PlateCarree())
+@pytest.mark.natural_earth
@ImageTesting(['global_scatter_wrap'])
def test_global_scatter_wrap_no_transform():
ax = plt.axes(projection=ccrs.PlateCarree())
@@ -137,6 +146,7 @@ def test_global_map():
transform=ccrs.Geodetic())
+@pytest.mark.natural_earth
@ImageTesting(['simple_global'])
def test_simple_global():
plt.axes(projection=ccrs.PlateCarree())
@@ -144,6 +154,7 @@ def test_simple_global():
# produces a global map, despite not having needed to set the limits
+@pytest.mark.natural_earth
@ImageTesting(['multiple_projections1'])
def test_multiple_projections():
@@ -206,6 +217,7 @@ def test_cursor_values():
plt.close()
+@pytest.mark.natural_earth
@ImageTesting(['natural_earth_interface'], tolerance=_ROB_TOL)
def test_axes_natural_earth_interface():
rob = ccrs.Robinson()
@@ -226,6 +238,7 @@ def test_axes_natural_earth_interface():
assert 'add_feature' in msg
+@pytest.mark.natural_earth
@ImageTesting(['pcolormesh_global_wrap1'])
def test_pcolormesh_global_with_wrap1():
# make up some realistic data with bounds (such as data from the UM)
@@ -248,6 +261,7 @@ def test_pcolormesh_global_with_wrap1():
ax.set_global() # make sure everything is visible
+@pytest.mark.natural_earth
@ImageTesting(['pcolormesh_global_wrap2'])
def test_pcolormesh_global_with_wrap2():
# make up some realistic data with bounds (such as data from the UM)
@@ -274,6 +288,7 @@ def test_pcolormesh_global_with_wrap2():
ax.set_global() # make sure everything is visible
+@pytest.mark.natural_earth
@ImageTesting(['pcolormesh_global_wrap3'], tolerance=_ROB_TOL)
def test_pcolormesh_global_with_wrap3():
nx, ny = 33, 17
@@ -311,6 +326,7 @@ def test_pcolormesh_global_with_wrap3():
ax.set_global() # make sure everything is visible
+@pytest.mark.natural_earth
@ImageTesting(['pcolormesh_limited_area_wrap'],
tolerance=1.41 if MPL_VERSION >= '2.1.0' else 0.7)
def test_pcolormesh_limited_area_wrap():
@@ -349,6 +365,7 @@ def test_pcolormesh_limited_area_wrap():
ax.coastlines()
+@pytest.mark.natural_earth
@ImageTesting(['pcolormesh_single_column_wrap'], tolerance=0.7)
def test_pcolormesh_single_column_wrap():
# Check a wrapped mesh like test_pcolormesh_limited_area_wrap, but only use
@@ -371,6 +388,7 @@ def test_pcolormesh_single_column_wrap():
ax.set_global()
+@pytest.mark.natural_earth
@ImageTesting(['pcolormesh_goode_wrap'])
def test_pcolormesh_goode_wrap():
# global data on an Interrupted Goode Homolosine projection
@@ -385,6 +403,7 @@ def test_pcolormesh_goode_wrap():
ax.pcolormesh(x, y, Z, transform=ccrs.PlateCarree())
+@pytest.mark.natural_earth
@ImageTesting(['pcolormesh_mercator_wrap'])
def test_pcolormesh_mercator_wrap():
x = np.linspace(0, 360, 73)
@@ -397,6 +416,7 @@ def test_pcolormesh_mercator_wrap():
ax.pcolormesh(x, y, Z, transform=ccrs.PlateCarree())
+@pytest.mark.natural_earth
@ImageTesting(['quiver_plate_carree'])
def test_quiver_plate_carree():
x = np.arange(-60, 42.5, 2.5)
@@ -419,6 +439,7 @@ def test_quiver_plate_carree():
ax.quiver(x, y, u, v, mag, transform=ccrs.PlateCarree())
+@pytest.mark.natural_earth
@ImageTesting(['quiver_rotated_pole'])
def test_quiver_rotated_pole():
nx, ny = 22, 36
@@ -443,6 +464,7 @@ def test_quiver_rotated_pole():
ax.quiver(x, y, u, v, mag, transform=rp)
+@pytest.mark.natural_earth
@ImageTesting(['quiver_regrid'])
def test_quiver_regrid():
x = np.arange(-60, 42.5, 2.5)
@@ -460,6 +482,7 @@ def test_quiver_regrid():
regrid_shape=30)
+@pytest.mark.natural_earth
@ImageTesting(['quiver_regrid_with_extent'])
def test_quiver_regrid_with_extent():
x = np.arange(-60, 42.5, 2.5)
@@ -478,6 +501,7 @@ def test_quiver_regrid_with_extent():
regrid_shape=10, target_extent=target_extent)
+@pytest.mark.natural_earth
@ImageTesting(['barbs_plate_carree'])
def test_barbs():
x = np.arange(-60, 45, 5)
@@ -499,6 +523,7 @@ def test_barbs():
ax.barbs(x, y, u, v, transform=ccrs.PlateCarree(), length=4, linewidth=.25)
+@pytest.mark.natural_earth
@ImageTesting(['barbs_regrid'])
def test_barbs_regrid():
x = np.arange(-60, 42.5, 2.5)
@@ -516,6 +541,7 @@ def test_barbs_regrid():
length=4, linewidth=.4, regrid_shape=20)
+@pytest.mark.natural_earth
@ImageTesting(['barbs_regrid_with_extent'])
def test_barbs_regrid_with_extent():
x = np.arange(-60, 42.5, 2.5)
@@ -535,6 +561,7 @@ def test_barbs_regrid_with_extent():
target_extent=target_extent)
+@pytest.mark.natural_earth
@ImageTesting(['barbs_1d'])
def test_barbs_1d():
x = np.array([20., 30., -17., 15.])
@@ -550,6 +577,7 @@ def test_barbs_1d():
length=8, linewidth=1, color='#7f7f7f')
+@pytest.mark.natural_earth
@ImageTesting(['barbs_1d_transformed'])
def test_barbs_1d_transformed():
x = np.array([20., 30., -17., 15.])
@@ -565,6 +593,7 @@ def test_barbs_1d_transformed():
length=8, linewidth=1, color='#7f7f7f')
+@pytest.mark.natural_earth
@ImageTesting([_STREAMPLOT_IMAGE])
def test_streamplot():
x = np.arange(-60, 42.5, 2.5)
diff --git a/lib/cartopy/tests/mpl/test_shapely_to_mpl.py b/lib/cartopy/tests/mpl/test_shapely_to_mpl.py
index f9146ae..f46dde3 100644
--- a/lib/cartopy/tests/mpl/test_shapely_to_mpl.py
+++ b/lib/cartopy/tests/mpl/test_shapely_to_mpl.py
@@ -1,4 +1,4 @@
-# (C) British Crown Copyright 2011 - 2017, Met Office
+# (C) British Crown Copyright 2011 - 2018, Met Office
#
# This file is part of cartopy.
#
@@ -22,6 +22,7 @@ import matplotlib.pyplot as plt
import matplotlib.patches as mpatches
from matplotlib.collections import PatchCollection
from matplotlib.path import Path
+import pytest
import shapely.geometry as sgeom
import cartopy.crs as ccrs
@@ -30,6 +31,7 @@ import cartopy.mpl.patch as cpatch
from cartopy.tests.mpl import MPL_VERSION, ImageTesting
+@pytest.mark.natural_earth
@ImageTesting(['poly_interiors'
if MPL_VERSION >= '1.5' else
'poly_interiors_pre_mpl_1.5'])
@@ -83,6 +85,7 @@ def test_polygon_interiors():
ax.add_collection(collection)
+@pytest.mark.natural_earth
@ImageTesting(['contour_with_interiors'])
def test_contour_interiors():
# produces a polygon with multiple holes:
diff --git a/lib/cartopy/tests/mpl/test_ticks.py b/lib/cartopy/tests/mpl/test_ticks.py
index 3ec6844..1397f19 100644
--- a/lib/cartopy/tests/mpl/test_ticks.py
+++ b/lib/cartopy/tests/mpl/test_ticks.py
@@ -1,4 +1,4 @@
-# (C) British Crown Copyright 2011 - 2017, Met Office
+# (C) British Crown Copyright 2011 - 2018, Met Office
#
# This file is part of cartopy.
#
@@ -61,6 +61,7 @@ else:
ticks_tolerance = 0.5
+@pytest.mark.natural_earth
@ImageTesting(['xticks_no_transform' + test_fn_suffix],
tolerance=ticks_tolerance)
def test_set_xticks_no_transform():
@@ -72,6 +73,7 @@ def test_set_xticks_no_transform():
ax.set_xticks([-135, -45, 45, 135], minor=True)
+@pytest.mark.natural_earth
@ImageTesting(['xticks_cylindrical' + test_fn_suffix],
tolerance=ticks_tolerance)
def test_set_xticks_cylindrical():
@@ -95,6 +97,7 @@ def test_set_xticks_non_cylindrical():
plt.close()
+@pytest.mark.natural_earth
@ImageTesting(['yticks_no_transform' + test_fn_suffix],
tolerance=ticks_tolerance)
def test_set_yticks_no_transform():
@@ -106,6 +109,7 @@ def test_set_yticks_no_transform():
ax.set_yticks([-75, -45, 15, 45, 75], minor=True)
+@pytest.mark.natural_earth
@ImageTesting(['yticks_cylindrical' + test_fn_suffix],
tolerance=ticks_tolerance)
def test_set_yticks_cylindrical():
@@ -129,6 +133,7 @@ def test_set_yticks_non_cylindrical():
plt.close()
+@pytest.mark.natural_earth
@ImageTesting(['xyticks' + test_fn_suffix], tolerance=ticks_tolerance)
def test_set_xyticks():
fig = plt.figure(figsize=(10, 10))
diff --git a/lib/cartopy/tests/mpl/test_web_services.py b/lib/cartopy/tests/mpl/test_web_services.py
index 1f50868..07aae88 100644
--- a/lib/cartopy/tests/mpl/test_web_services.py
+++ b/lib/cartopy/tests/mpl/test_web_services.py
@@ -1,4 +1,4 @@
-# (C) British Crown Copyright 2014 - 2017, Met Office
+# (C) British Crown Copyright 2014 - 2018, Met Office
#
# This file is part of cartopy.
#
@@ -25,6 +25,7 @@ import cartopy.crs as ccrs
from cartopy.io.ogc_clients import _OWSLIB_AVAILABLE
+@pytest.mark.network
@pytest.mark.skipif(not _OWSLIB_AVAILABLE, reason='OWSLib is unavailable.')
@ImageTesting(['wmts'], tolerance=7.56 if MPL_VERSION < '2' else 0)
def test_wmts():
@@ -34,6 +35,7 @@ def test_wmts():
ax.add_wmts(url, 'MODIS_Water_Mask')
+@pytest.mark.network
@pytest.mark.skipif(not _OWSLIB_AVAILABLE, reason='OWSLib is unavailable.')
@ImageTesting(['wms'], tolerance=7.76 if MPL_VERSION < '2' else 0)
def test_wms():
diff --git a/lib/cartopy/tests/test_coastline.py b/lib/cartopy/tests/test_coastline.py
index 7c995cb..d1eb76d 100644
--- a/lib/cartopy/tests/test_coastline.py
+++ b/lib/cartopy/tests/test_coastline.py
@@ -1,4 +1,4 @@
-# (C) British Crown Copyright 2011 - 2017, Met Office
+# (C) British Crown Copyright 2011 - 2018, Met Office
#
# This file is part of cartopy.
#
@@ -17,14 +17,17 @@
from __future__ import (absolute_import, division, print_function)
+import pytest
+
import cartopy
import cartopy.io.shapereader as shp
-COASTLINE_PATH = shp.natural_earth()
-
+@pytest.mark.natural_earth
class TestCoastline(object):
def test_robust(self):
+ COASTLINE_PATH = shp.natural_earth()
+
# Make sure all the coastlines can be projected without raising any
# exceptions.
projection = cartopy.crs.TransverseMercator(central_longitude=-90)
diff --git a/lib/cartopy/tests/test_coding_standards.py b/lib/cartopy/tests/test_coding_standards.py
index 0b0f1de..cfa1cd8 100644
--- a/lib/cartopy/tests/test_coding_standards.py
+++ b/lib/cartopy/tests/test_coding_standards.py
@@ -24,6 +24,8 @@ import os
import re
import subprocess
+import pytest
+
import cartopy
@@ -133,8 +135,8 @@ class TestLicenseHeaders(object):
last_change_by_fname = self.last_change_by_fname()
except ValueError as e:
# Caught the case where this is not a git repo.
- return self.skipTest('cartopy installation did not look like a '
- 'git repo: ' + str(e))
+ return pytest.skip('cartopy installation did not look like a git '
+ 'repo: ' + str(e))
failed = False
for fname, last_change in sorted(last_change_by_fname.items()):
diff --git a/lib/cartopy/tests/test_crs.py b/lib/cartopy/tests/test_crs.py
index a9dc3ff..b54463c 100644
--- a/lib/cartopy/tests/test_crs.py
+++ b/lib/cartopy/tests/test_crs.py
@@ -1,4 +1,4 @@
-# (C) British Crown Copyright 2011 - 2017, Met Office
+# (C) British Crown Copyright 2011 - 2018, Met Office
#
# This file is part of cartopy.
#
@@ -85,6 +85,7 @@ class TestCRS(object):
def test_osgb(self):
self._check_osgb(ccrs.OSGB())
+ @pytest.mark.network
@pytest.mark.skipif(pyepsg is None, reason='requires pyepsg')
def test_epsg(self):
uk = ccrs.epsg(27700)
diff --git a/lib/cartopy/tests/test_img_nest.py b/lib/cartopy/tests/test_img_nest.py
index aac87dd..97ee401 100644
--- a/lib/cartopy/tests/test_img_nest.py
+++ b/lib/cartopy/tests/test_img_nest.py
@@ -1,4 +1,4 @@
-# (C) British Crown Copyright 2011 - 2017, Met Office
+# (C) British Crown Copyright 2011 - 2018, Met Office
#
# This file is part of cartopy.
#
@@ -219,6 +219,7 @@ class RoundedImg(cimg_nest.Img):
@pytest.mark.xfail(reason='MapQuest is unavailable')
+@pytest.mark.network
def test_nest(nest_from_config):
crs = cimgt.GoogleTiles().crs
z0 = cimg_nest.ImageCollection('aerial z0 test', crs)
@@ -365,6 +366,7 @@ def wmts_data():
@pytest.mark.xfail(reason='MapQuest is unavailable')
+@pytest.mark.network
def test_find_images(wmts_data):
z2_dir = os.path.join(_TEST_DATA_DIR, 'z_2')
img_fname = os.path.join(z2_dir, 'x_2_y_0.png')
diff --git a/lib/cartopy/tests/test_img_tiles.py b/lib/cartopy/tests/test_img_tiles.py
index 11efda5..9af3cc9 100644
--- a/lib/cartopy/tests/test_img_tiles.py
+++ b/lib/cartopy/tests/test_img_tiles.py
@@ -1,4 +1,4 @@
-# (C) British Crown Copyright 2011 - 2017, Met Office
+# (C) British Crown Copyright 2011 - 2018, Met Office
#
# This file is part of cartopy.
#
@@ -141,6 +141,7 @@ def test_tile_find_images():
[(7, 4, 4), (7, 5, 4), (8, 4, 4), (8, 5, 4)])
+@pytest.mark.network
def test_image_for_domain():
gt = cimgt.GoogleTiles()
gt._image_url = types.MethodType(GOOGLE_IMAGE_URL_REPLACEMENT, gt)
diff --git a/lib/cartopy/tests/test_shapereader.py b/lib/cartopy/tests/test_shapereader.py
index 0e17fac..895721a 100644
--- a/lib/cartopy/tests/test_shapereader.py
+++ b/lib/cartopy/tests/test_shapereader.py
@@ -1,4 +1,4 @@
-# (C) British Crown Copyright 2011 - 2017, Met Office
+# (C) British Crown Copyright 2011 - 2018, Met Office
#
# This file is part of cartopy.
#
@@ -19,20 +19,17 @@ from __future__ import (absolute_import, division, print_function)
import numpy as np
from numpy.testing import assert_array_almost_equal
+import pytest
import cartopy.io.shapereader as shp
-LAKES_PATH = shp.natural_earth(resolution='110m',
- category='physical',
- name='lakes')
-RIVERS_PATH = shp.natural_earth(resolution='110m',
- category='physical',
- name='rivers_lake_centerlines')
-
-
+@pytest.mark.natural_earth
class TestLakes(object):
def setup_class(self):
+ LAKES_PATH = shp.natural_earth(resolution='110m',
+ category='physical',
+ name='lakes')
self.reader = shp.Reader(LAKES_PATH)
names = [record.attributes['name'] for record in self.reader.records()]
# Choose a nice small lake
@@ -83,8 +80,12 @@ class TestLakes(object):
'The geometry was loaded in order to create the bounds.'
+@pytest.mark.natural_earth
class TestRivers(object):
def setup_class(self):
+ RIVERS_PATH = shp.natural_earth(resolution='110m',
+ category='physical',
+ name='rivers_lake_centerlines')
self.reader = shp.Reader(RIVERS_PATH)
names = [record.attributes['name'] for record in self.reader.records()]
# Choose a nice small river
diff --git a/lib/cartopy/util.py b/lib/cartopy/util.py
index ec181ba..0725e8d 100644
--- a/lib/cartopy/util.py
+++ b/lib/cartopy/util.py
@@ -56,26 +56,33 @@ def add_cyclic_point(data, coord=None, axis=-1):
Adding a cyclic point to a data array, where the cyclic dimension is
the right-most dimension
+ .. testsetup::
+ >>> from distutils.version import LooseVersion
+ >>> import numpy as np
+ >>> if LooseVersion(np.__version__) >= '1.14.0':
+ ... # To provide consistent doctests.
+ ... np.set_printoptions(legacy='1.13')
+
>>> import numpy as np
>>> data = np.ones([5, 6]) * np.arange(6)
>>> cyclic_data = add_cyclic_point(data)
- >>> print(cyclic_data)
- [[0. 1. 2. 3. 4. 5. 0.]
- [0. 1. 2. 3. 4. 5. 0.]
- [0. 1. 2. 3. 4. 5. 0.]
- [0. 1. 2. 3. 4. 5. 0.]
- [0. 1. 2. 3. 4. 5. 0.]]
+ >>> print(cyclic_data) # doctest: +NORMALIZE_WHITESPACE
+ [[ 0. 1. 2. 3. 4. 5. 0.]
+ [ 0. 1. 2. 3. 4. 5. 0.]
+ [ 0. 1. 2. 3. 4. 5. 0.]
+ [ 0. 1. 2. 3. 4. 5. 0.]
+ [ 0. 1. 2. 3. 4. 5. 0.]]
Adding a cyclic point to a data array and an associated coordinate
>>> lons = np.arange(0, 360, 60)
>>> cyclic_data, cyclic_lons = add_cyclic_point(data, coord=lons)
- >>> print(cyclic_data)
- [[0. 1. 2. 3. 4. 5. 0.]
- [0. 1. 2. 3. 4. 5. 0.]
- [0. 1. 2. 3. 4. 5. 0.]
- [0. 1. 2. 3. 4. 5. 0.]
- [0. 1. 2. 3. 4. 5. 0.]]
+ >>> print(cyclic_data) # doctest: +NORMALIZE_WHITESPACE
+ [[ 0. 1. 2. 3. 4. 5. 0.]
+ [ 0. 1. 2. 3. 4. 5. 0.]
+ [ 0. 1. 2. 3. 4. 5. 0.]
+ [ 0. 1. 2. 3. 4. 5. 0.]
+ [ 0. 1. 2. 3. 4. 5. 0.]]
>>> print(cyclic_lons)
[ 0 60 120 180 240 300 360]
--
2.14.3

View file

@ -1,46 +0,0 @@
From 21375d8f3488af5d405f5dbba7340cb20a22432b Mon Sep 17 00:00:00 2001
From: Elliott Sales de Andrade <quantum.analyst@gmail.com>
Date: Wed, 21 Feb 2018 23:47:09 -0500
Subject: [PATCH 2/7] Skip doctest that uses the network.
Signed-off-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
---
lib/cartopy/io/shapereader.py | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/lib/cartopy/io/shapereader.py b/lib/cartopy/io/shapereader.py
index f857b38..fae9367 100644
--- a/lib/cartopy/io/shapereader.py
+++ b/lib/cartopy/io/shapereader.py
@@ -24,19 +24,20 @@ geometry representation of shapely:
>>> filename = natural_earth(resolution='110m',
... category='physical',
... name='geography_regions_points')
- >>> reader = shapereader.Reader(filename)
- >>> len(reader)
+ ... # doctest: +SKIP
+ >>> reader = shapereader.Reader(filename) # doctest: +SKIP
+ >>> len(reader) # doctest: +SKIP
3
- >>> records = list(reader.records())
- >>> print(type(records[0]))
+ >>> records = list(reader.records()) # doctest: +SKIP
+ >>> print(type(records[0])) # doctest: +SKIP
<class 'cartopy.io.shapereader.Record'>
- >>> print(sorted(records[0].attributes.keys()))
+ >>> print(sorted(records[0].attributes.keys())) # doctest: +SKIP
['comment', 'featurecla', 'lat_y', 'long_x', 'min_zoom', 'name', \
'name_alt', 'region', 'scalerank', 'subregion']
- >>> print(records[0].attributes['name'])
+ >>> print(records[0].attributes['name']) # doctest: +SKIP
Niagara Falls
- >>> geoms = list(reader.geometries())
- >>> print(type(geoms[0]))
+ >>> geoms = list(reader.geometries()) # doctest: +SKIP
+ >>> print(type(geoms[0])) # doctest: +SKIP
<class 'shapely.geometry.point.Point'>
"""
--
2.14.3

View file

@ -1,36 +0,0 @@
From 4c3cc0ec55edb54de25174e1c534cd7c03281954 Mon Sep 17 00:00:00 2001
From: Elliott Sales de Andrade <quantum.analyst@gmail.com>
Date: Fri, 23 Feb 2018 02:09:01 -0500
Subject: [PATCH 3/7] Add ne_ prefix to NaturalEarth cache files.
This prefix is used in the zip files provided by NaturalEarth, so if you
download anything manually, you need to rename all the files for Cartopy
to find them. This change makes that renaming no longer necessary, at
the expense of a few extra re-downloads.
Signed-off-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
---
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 fae9367..68471be 100644
--- a/lib/cartopy/io/shapereader.py
+++ b/lib/cartopy/io/shapereader.py
@@ -346,11 +346,11 @@ class NEShpDownloader(Downloader):
>>> ne_dnldr = NEShpDownloader.default_downloader()
>>> print(ne_dnldr.target_path_template)
{config[data_dir]}/shapefiles/natural_earth/{category}/\
-{resolution}_{name}.shp
+ne_{resolution}_{name}.shp
"""
default_spec = ('shapefiles', 'natural_earth', '{category}',
- '{resolution}_{name}.shp')
+ 'ne_{resolution}_{name}.shp')
ne_path_template = os.path.join('{config[data_dir]}', *default_spec)
pre_path_template = os.path.join('{config[pre_existing_data_dir]}',
*default_spec)
--
2.14.3

View file

@ -1,71 +0,0 @@
From 9618c40af668c27dedd83fcc101a99f9573c1b09 Mon Sep 17 00:00:00 2001
From: Elliott Sales de Andrade <quantum.analyst@gmail.com>
Date: Mon, 26 Feb 2018 02:42:50 -0500
Subject: [PATCH 4/7] Increase tolerance for new FreeType.
Signed-off-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
---
lib/cartopy/tests/mpl/test_gridliner.py | 10 +++++++++-
lib/cartopy/tests/mpl/test_ticks.py | 5 +++++
2 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/lib/cartopy/tests/mpl/test_gridliner.py b/lib/cartopy/tests/mpl/test_gridliner.py
index 9fbeba7..3412b2f 100644
--- a/lib/cartopy/tests/mpl/test_gridliner.py
+++ b/lib/cartopy/tests/mpl/test_gridliner.py
@@ -17,7 +17,10 @@
from __future__ import (absolute_import, division, print_function)
+from distutils.version import LooseVersion
+
from matplotlib.backends.backend_agg import FigureCanvasAgg
+import matplotlib.ft2font
import matplotlib.pyplot as plt
import matplotlib.ticker as mticker
try:
@@ -111,10 +114,15 @@ elif MPL_VERSION >= '1.5':
grid_label_image = 'gridliner_labels_1.5'
else:
grid_label_image = 'gridliner_labels_pre_mpl_1.5'
+if (MPL_VERSION >= '1.5' and
+ LooseVersion(matplotlib.ft2font.__freetype_version__) >= '2.7'):
+ grid_label_tolerance = 20.3
+else:
+ grid_label_tolerance = 0
@pytest.mark.natural_earth
-@ImageTesting([grid_label_image])
+@ImageTesting([grid_label_image], tolerance=grid_label_tolerance)
def test_grid_labels():
plt.figure(figsize=(8, 10))
diff --git a/lib/cartopy/tests/mpl/test_ticks.py b/lib/cartopy/tests/mpl/test_ticks.py
index 1397f19..33e2b09 100644
--- a/lib/cartopy/tests/mpl/test_ticks.py
+++ b/lib/cartopy/tests/mpl/test_ticks.py
@@ -17,8 +17,10 @@
from __future__ import (absolute_import, division, print_function)
+from distutils.version import LooseVersion
import math
+import matplotlib.ft2font
import matplotlib.pyplot as plt
import matplotlib.ticker
import pytest
@@ -59,6 +61,9 @@ elif '2.0.0' <= MPL_VERSION < '2.0.1':
ticks_tolerance = 9
else:
ticks_tolerance = 0.5
+if (MPL_VERSION >= '1.5' and
+ LooseVersion(matplotlib.ft2font.__freetype_version__) >= '2.7'):
+ ticks_tolerance = max(ticks_tolerance, 6.67)
@pytest.mark.natural_earth
--
2.14.3

View file

@ -1,47 +0,0 @@
From ad04b17fb9751816753d2416ccad05236b41cf1e Mon Sep 17 00:00:00 2001
From: Elliott Sales de Andrade <quantum.analyst@gmail.com>
Date: Tue, 27 Feb 2018 20:38:49 -0500
Subject: [PATCH 5/7] Normalize grid coordinates used for interpolation.
Most coordinates are in metres and thus fairly large. This can cause
precision issues in Qhull as it calculates distances via squares and
square roots, at least on non-x86_64 architectures.
This is equivalent to the `rescale=True` argument in SciPy, but doing it
ourselves means a) we don't need to bump requirements to 0.14 and b)
re-scaling is not done for every scalar/vector property.
Signed-off-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
---
lib/cartopy/vector_transform.py | 10 ++++++----
7 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/lib/cartopy/vector_transform.py b/lib/cartopy/vector_transform.py
index 1fe17a1..c684703 100644
--- a/lib/cartopy/vector_transform.py
+++ b/lib/cartopy/vector_transform.py
@@ -56,15 +56,17 @@ def _interpolate_to_grid(nx, ny, x, y, *scalars, **kwargs):
target_extent = kwargs.get('target_extent', None)
if target_extent is None:
target_extent = (x.min(), x.max(), y.min(), y.max())
- points = np.array([x.ravel(), y.ravel()]).T
x0, x1, y0, y1 = target_extent
- x_grid, y_grid = np.meshgrid(np.linspace(x0, x1, nx),
- np.linspace(y0, y1, ny))
+ xr = x1 - x0
+ yr = y1 - y0
+ points = np.column_stack([(x.ravel() - x0) / xr, (y.ravel() - y0) / yr])
+ x_grid, y_grid = np.meshgrid(np.linspace(0, 1, nx),
+ np.linspace(0, 1, ny))
s_grid_tuple = tuple()
for s in scalars:
s_grid_tuple += (griddata(points, s.ravel(), (x_grid, y_grid),
method='linear'),)
- return (x_grid, y_grid) + s_grid_tuple
+ return (x_grid * xr + x0, y_grid * yr + y0) + s_grid_tuple
def vector_scalar_to_grid(src_crs, target_proj, regrid_shape, x, y, u, v,
--
2.14.3

View file

@ -1,82 +0,0 @@
From 49e10df68f0c59f81aa5ec07ead5941db349da6d Mon Sep 17 00:00:00 2001
From: Elliott Sales de Andrade <quantum.analyst@gmail.com>
Date: Tue, 27 Feb 2018 02:14:00 -0500
Subject: [PATCH 6/7] Increase some tolerances for 32-bit systems.
Signed-off-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
---
lib/cartopy/tests/crs/test_lambert_azimuthal_equal_area.py | 2 +-
lib/cartopy/tests/mpl/test_examples.py | 2 +-
lib/cartopy/tests/mpl/test_features.py | 2 +-
lib/cartopy/tests/mpl/test_images.py | 2 +-
lib/cartopy/tests/mpl/test_img_transform.py | 2 +-
5 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/lib/cartopy/tests/crs/test_lambert_azimuthal_equal_area.py b/lib/cartopy/tests/crs/test_lambert_azimuthal_equal_area.py
index b6fb853..ca7e235 100644
--- a/lib/cartopy/tests/crs/test_lambert_azimuthal_equal_area.py
+++ b/lib/cartopy/tests/crs/test_lambert_azimuthal_equal_area.py
@@ -35,7 +35,7 @@ class TestLambertAzimuthalEqualArea(object):
decimal=4)
assert_almost_equal(np.array(crs.y_limits),
[-12727770.598700099, 12727770.598700099],
- decimal=4)
+ decimal=1)
def test_eccentric_globe(self):
globe = ccrs.Globe(semimajor_axis=1000, semiminor_axis=500,
diff --git a/lib/cartopy/tests/mpl/test_examples.py b/lib/cartopy/tests/mpl/test_examples.py
index db689e0..69d4f5a 100644
--- a/lib/cartopy/tests/mpl/test_examples.py
+++ b/lib/cartopy/tests/mpl/test_examples.py
@@ -43,7 +43,7 @@ class ExampleImageTesting(ImageTesting):
@pytest.mark.natural_earth
@ExampleImageTesting(['global_map'],
- tolerance=4 if MPL_VERSION < '2' else 0)
+ tolerance=4 if MPL_VERSION < '2' else 0.05)
def test_global_map():
import cartopy.examples.global_map as c
c.main()
diff --git a/lib/cartopy/tests/mpl/test_features.py b/lib/cartopy/tests/mpl/test_features.py
index 250e3db..f36c344 100644
--- a/lib/cartopy/tests/mpl/test_features.py
+++ b/lib/cartopy/tests/mpl/test_features.py
@@ -54,7 +54,7 @@ def test_natural_earth_custom():
@ImageTesting(['gshhs_coastlines'],
- tolerance=1.7 if MPL_VERSION < '2' else 0)
+ tolerance=1.7 if MPL_VERSION < '2' else 0.07)
def test_gshhs():
ax = plt.axes(projection=ccrs.Mollweide())
ax.set_extent([138, 142, 32, 42], ccrs.Geodetic())
diff --git a/lib/cartopy/tests/mpl/test_images.py b/lib/cartopy/tests/mpl/test_images.py
index 105ee80..119ba7c 100644
--- a/lib/cartopy/tests/mpl/test_images.py
+++ b/lib/cartopy/tests/mpl/test_images.py
@@ -155,7 +155,7 @@ def test_pil_Image():
@ImageTesting(['imshow_natural_earth_ortho'],
- tolerance=4.2 if MPL_VERSION < '2' else 0)
+ tolerance=4.2 if MPL_VERSION < '2' else 0.05)
def test_background_img():
ax = plt.axes(projection=ccrs.Orthographic())
ax.background_img(name='ne_shaded', resolution='low')
diff --git a/lib/cartopy/tests/mpl/test_img_transform.py b/lib/cartopy/tests/mpl/test_img_transform.py
index 3b53c0a..dfea25a 100644
--- a/lib/cartopy/tests/mpl/test_img_transform.py
+++ b/lib/cartopy/tests/mpl/test_img_transform.py
@@ -98,7 +98,7 @@ elif '2.0.1' <= MPL_VERSION:
# Bug in latest Matplotlib that we don't consider correct.
regrid_tolerance = 4.75
else:
- regrid_tolerance = 0
+ regrid_tolerance = 0.03
@pytest.mark.natural_earth
--
2.14.3

View file

@ -2,8 +2,8 @@
%global Srcname Cartopy
Name: python-%{srcname}
Version: 0.16.0
Release: 6%{?dist}
Version: 0.17.0
Release: 1%{?dist}
Summary: Cartographic Python library with Matplotlib visualisations
License: LGPLv3
@ -11,19 +11,8 @@ URL: http://scitools.org.uk/cartopy/docs/latest/
Source0: https://files.pythonhosted.org/packages/source/C/%{Srcname}/%{Srcname}-%{version}.tar.gz
# Set location of Fedora-provided pre-existing data.
Source1: siteconfig.py
# https://github.com/SciTools/cartopy/pull/1032
Patch0001: 0001-Merge-pull-request-1032-from-QuLogic-test-updates.patch
# Probably won't go upstream.
Patch0002: 0002-Skip-doctest-that-uses-the-network.patch
# https://github.com/SciTools/cartopy/pull/1037
Patch0003: 0003-Add-ne_-prefix-to-NaturalEarth-cache-files.patch
# Might not go upstream in current form.
Patch0004: 0004-Increase-tolerance-for-new-FreeType.patch
# https://github.com/SciTools/cartopy/pull/1042
Patch0005: 0005-Normalize-grid-coordinates-used-for-interpolation.patch
Source5: %{Srcname}-norm-images.tar.xz
# Might not go upstream.
Patch0006: 0006-Increase-some-tolerances-for-32-bit-systems.patch
Patch0004: 0001-Increase-tolerance-for-new-FreeType.patch
BuildRequires: gcc-c++
BuildRequires: geos-devel >= 3.3.3
@ -50,20 +39,21 @@ BuildRequires: python2-devel
BuildRequires: python2-setuptools >= 0.7.2
BuildRequires: python2-Cython >= 0.15.1
BuildRequires: python2-six >= 1.3.0
BuildRequires: python2-numpy >= 1.6
BuildRequires: python2-numpy >= 1.10
BuildRequires: python2-shapely >= 1.5.6
BuildRequires: python2-pyshp >= 1.1.4
# OWS requirements
BuildRequires: python2-owslib >= 0.8.11
BuildRequires: python2-pillow >= 1.7.8
# Plotting requirements
BuildRequires: python2-matplotlib >= 1.3.0
BuildRequires: python2-matplotlib >= 1.5.1
BuildRequires: python2-gdal >= 1.10.0
BuildRequires: python2-pillow >= 1.7.8
BuildRequires: python2-scipy >= 0.10
# Testing requirements
BuildRequires: python2-filelock
BuildRequires: python2-mock >= 1.0.1
BuildRequires: python2-pytest >= 3.0.0
BuildRequires: python2-pytest >= 3.1.0
%if %{fedora} < 28
# For old matplotlib
BuildRequires: python2-nose
@ -71,7 +61,7 @@ BuildRequires: python2-nose
Requires: python-%{srcname}-common = %{version}-%{release}
Requires: python2-six >= 1.3.0
Requires: python2-numpy >= 1.6
Requires: python2-numpy >= 1.10
Requires: python2-shapely >= 1.5.6
Requires: python2-pyshp >= 1.1.4
Requires: python2-setuptools >= 0.7.2
@ -79,7 +69,7 @@ Requires: python2-setuptools >= 0.7.2
Recommends: python2-owslib >= 0.8.11
Recommends: python2-pillow >= 1.7.8
# Plotting requirements
Recommends: python2-matplotlib >= 1.3.0
Recommends: python2-matplotlib >= 1.5.1
Recommends: python2-gdal >= 1.10.0
Recommends: python2-pillow >= 1.7.8
Recommends: python2-scipy >= 0.10
@ -95,20 +85,22 @@ BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-Cython >= 0.15.1
BuildRequires: python3-six >= 1.3.0
BuildRequires: python3-numpy >= 1.6
BuildRequires: python3-numpy >= 1.10
BuildRequires: python3-shapely >= 1.5.6
BuildRequires: python3-pyshp >= 1.1.4
# OWS requirements
BuildRequires: python3-OWSLib >= 0.8.11
BuildRequires: python3-pillow >= 1.7.8
# Plotting requirements
BuildRequires: python3-matplotlib >= 1.3.0
BuildRequires: python3-matplotlib >= 1.5.1
BuildRequires: gdal-python3 >= 1.10.0
BuildRequires: python3-pillow >= 1.7.8
BuildRequires: python3-pykdtree >= 1.2.2
BuildRequires: python3-scipy >= 0.10
# Testing requirements
BuildRequires: python3-filelock
BuildRequires: python3-mock >= 1.0.1
BuildRequires: python3-pytest >= 3.0.0
BuildRequires: python3-pytest >= 3.1.0
%if %{fedora} < 28
# For old matplotlib
BuildRequires: python3-nose
@ -117,16 +109,17 @@ BuildRequires: python3-nose
Requires: python-%{srcname}-common = %{version}-%{release}
Requires: python3-setuptools >= 0.7.2
Requires: python3-six >= 1.3.0
Requires: python3-numpy >= 1.6
Requires: python3-numpy >= 1.10
Requires: python3-shapely >= 1.5.6
Requires: python3-pyshp >= 1.1.4
# OWS requirements
Recommends: python3-OWSLib >= 0.8.11
Recommends: python3-pillow >= 1.7.8
# Plotting requirements
Recommends: python3-matplotlib >= 1.3.0
Recommends: python3-matplotlib >= 1.5.1
Recommends: gdal-python3 >= 1.10.0
Recommends: python3-pillow >= 1.7.8
Recommends: python3-pykdtree >= 1.2.2
Recommends: python3-scipy >= 0.10
%description -n python3-%{srcname} %{_description}
@ -150,7 +143,6 @@ Data files for %{srcname}.
%prep
%autosetup -n %{Srcname}-%{version} -p1
cp -a %SOURCE1 lib/cartopy/
%setup -q -n %{Srcname}-%{version} -D -T -a 5
# Remove bundled egg-info
rm -rf %{srcname}.egg-info
@ -186,7 +178,7 @@ PYTHONPATH="%{buildroot}%{python3_sitearch}" MPLBACKEND=Agg \
%files -n python-%{srcname}-common
%doc README.rst
%doc README.md
%license COPYING.LESSER lib/cartopy/data/LICENSE
%{_datadir}/cartopy/
@ -200,7 +192,8 @@ PYTHONPATH="%{buildroot}%{python3_sitearch}" MPLBACKEND=Agg \
%changelog
* Sat Nov 17 2018 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 0.16.0-7
* Sat Nov 17 2018 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 0.17.0-1
- Update to latest version
- Remove workaround for unpackaged Natural Earth data
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.16.0-6

View file

@ -1,2 +1 @@
SHA512 (Cartopy-0.16.0.tar.gz) = aaef27eda5a31b49361a014156ac6f6cf92b7ea84356f342afc1b7f818162537ea6447cf1af4799196482bc811aba8cb3db3044d8a2fa501c327fee079205c44
SHA512 (Cartopy-norm-images.tar.xz) = bfea8ab2045e89acd2e4cff45fecee5baf6efdc41b90cf160c931e90c0e41b35ea553ccf8d36e9ae9009157a99c7eb4a0054e6301948d40b045ce0a880105f40
SHA512 (Cartopy-0.17.0.tar.gz) = 19c3eb373aaf81534028fc0c03033d21da224f00b4a8590ecbda6156d00acf2312e2ed2478ffcea2dcc6fc4227e7c57623fb5cc3c8bbdf48b14f432cbb72ae27