Skip to content
Commits on Source (5)
[bumpversion]
current_version = 1.10.1
current_version = 1.10.2a0.dev0
commit = True
tag = False
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)((?P<pre>[a-z]+)(?P<num>\d+))?(\.(?P<release>dev)(?P<dev>\d+))?
......@@ -33,3 +33,4 @@ values =
b
rc
final
......@@ -5,7 +5,7 @@ env:
- NUMPY_VERSION=stable
- MAIN_CMD='python setup.py'
- CONDA_DEPENDENCIES='xarray dask toolz Cython pykdtree sphinx cartopy pillow matplotlib
basemap pyyaml pyproj coveralls configobj coverage codecov'
pyyaml pyproj coveralls configobj coverage codecov'
- SETUP_XVFB=False
- EVENT_TYPE='push pull_request'
- SETUP_CMD='test'
......
## Version 1.10.2 (2018/10/01)
### Issues Closed
###############################################################################
## Version 1.10.1 (2018/07/03)
* [Issue 133](https://github.com/pytroll/pyresample/issues/133) - Build issue with Python 3.7 ([PR 135](https://github.com/pytroll/pyresample/pull/135))
In this release 1 issue was closed.
### Pull Requests Merged
#### Bugs fixed
* [PR 139](https://github.com/pytroll/pyresample/pull/139) - Fix area parsing code to convert PROJ.4 parameters to float if possible
* [PR 135](https://github.com/pytroll/pyresample/pull/135) - Fix Python 3.7 compatibility ([133](https://github.com/pytroll/pyresample/issues/133))
In this release 2 pull requests were closed.
## Version 1.10.1 (2018/07/03)
### Pull Requests Merged
......@@ -68,5 +82,3 @@ In this release 2 pull requests were closed.
* [PR 115](https://github.com/pytroll/pyresample/pull/115) - Geos area reduction
In this release 1 pull request was closed.
###############################################################################
pyresample (1.10.1-2) UNRELEASED; urgency=medium
pyresample (1.10.2-1) unstable; urgency=medium
* New upstream release
* Bump Standards-Version to 4.2.1, no changes.
* Update watch file to limit matches to archive path.
* debian/patches
- drop 0004-Regenerate-cython-extensions.patch and
0005-Fix-StopIteration-handling.patch: applied upstream
- refrash remaining patches
-- Antonio Valentino <antonio.valentino@tiscali.it> Sun, 05 Aug 2018 20:48:13 +0200
-- Antonio Valentino <antonio.valentino@tiscali.it> Tue, 02 Oct 2018 18:31:56 +0000
pyresample (1.10.1-1) unstable; urgency=medium
......
......@@ -21,7 +21,7 @@ index 3c6ef3c..5346cb4 100644
YSIZE: 480
AREA_EXTENT: (-20037508.342789244, -10018754.171394622, 20037508.342789244, 10018754.171394622)
diff --git a/pyresample/test/test_geometry.py b/pyresample/test/test_geometry.py
index 15c0813..0077a31 100644
index 8c6aa9a..11ec7cd 100644
--- a/pyresample/test/test_geometry.py
+++ b/pyresample/test/test_geometry.py
@@ -401,7 +401,7 @@ class Test(unittest.TestCase):
......
From: Antonio Valentino <antonio.valentino@tiscali.it>
Date: Sat, 14 Jul 2018 10:36:51 +0000
Subject: Fix StopIteration handling
Compatibility with Python 3.7 and PEP 479.
See also https://github.com/pytroll/pyresample/pull/134.
---
pyresample/_multi_proc.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pyresample/_multi_proc.py b/pyresample/_multi_proc.py
index e40c293..1f318a3 100644
--- a/pyresample/_multi_proc.py
+++ b/pyresample/_multi_proc.py
@@ -71,7 +71,7 @@ class Scheduler(object):
yield slice(s0, s1)
else:
self._lock.release()
- raise StopIteration
+ return
def shmem_as_ndarray(raw_array):
0001-fix-doc-build.patch
0002-fix-proj4-initialization.patch
0003-Skip-TestXArrayResamplerNN-if-dask-is-not-available.patch
0004-Regenerate-cython-extensions.patch
0005-Fix-StopIteration-handling.patch
......@@ -48,15 +48,15 @@ Creating an area definition:
>>> x_size = 425
>>> y_size = 425
>>> area_extent = (-5326849.0625,-5326849.0625,5326849.0625,5326849.0625)
>>> proj_dict = {'a': '6371228.0', 'units': 'm', 'lon_0': '0',
... 'proj': 'laea', 'lat_0': '-90'}
>>> proj_dict = {'a': 6371228.0, 'units': 'm', 'lon_0': 0.0,
... 'proj': 'laea', 'lat_0': -90.0}
>>> area_def = geometry.AreaDefinition(area_id, description, proj_id,
... proj_dict, x_size, y_size, area_extent)
>>> print(area_def)
Area ID: ease_sh
Description: Antarctic EASE grid
Projection ID: ease_sh
Projection: {'a': '6371228.0', 'lat_0': '-90', 'lon_0': '0', 'proj': 'laea', 'units': 'm'}
Projection: {'a': '6371228.0', 'lat_0': '-90.0', 'lon_0': '0.0', 'proj': 'laea', 'units': 'm'}
Number of columns: 425
Number of rows: 425
Area extent: (-5326849.0625, -5326849.0625, 5326849.0625, 5326849.0625)
......@@ -83,7 +83,7 @@ based on area extent and a proj4-string or a list of proj4 arguments.
Area ID: ease_sh
Description: Antarctic EASE grid
Projection ID: ease_sh
Projection: {'a': '6371228.0', 'lat_0': '-90', 'lon_0': '0', 'proj': 'laea', 'units': 'm'}
Projection: {'a': '6371228.0', 'lat_0': '-90.0', 'lon_0': '0.0', 'proj': 'laea', 'units': 'm'}
Number of columns: 425
Number of rows: 425
Area extent: (-5326849.0625, -5326849.0625, 5326849.0625, 5326849.0625)
......@@ -136,7 +136,7 @@ An area definition dict can be read using
>>> print(area)
Area ID: ease_nh
Description: Arctic EASE grid
Projection: {'a': '6371228.0', 'lat_0': '90', 'lon_0': '0', 'proj': 'laea', 'units': 'm'}
Projection: {'a': '6371228.0', 'lat_0': '90.0', 'lon_0': '0.0', 'proj': 'laea', 'units': 'm'}
Number of columns: 425
Number of rows: 425
Area extent: (-5326849.0625, -5326849.0625, 5326849.0625, 5326849.0625)
......@@ -159,7 +159,7 @@ Several area definitions can be read at once using the region names in an argume
>>> print(sh_def)
Area ID: ease_sh
Description: Antarctic EASE grid
Projection: {'a': '6371228.0', 'lat_0': '-90', 'lon_0': '0', 'proj': 'laea', 'units': 'm'}
Projection: {'a': '6371228.0', 'lat_0': '-90.0', 'lon_0': '0.0', 'proj': 'laea', 'units': 'm'}
Number of columns: 425
Number of rows: 425
Area extent: (-5326849.0625, -5326849.0625, 5326849.0625, 5326849.0625)
......@@ -202,7 +202,7 @@ An area definition dict can be read using
Area ID: ease_nh
Description: Arctic EASE grid
Projection ID: ease_nh
Projection: {'a': '6371228.0', 'lat_0': '90', 'lon_0': '0', 'proj': 'laea', 'units': 'm'}
Projection: {'a': '6371228.0', 'lat_0': '90.0', 'lon_0': '0.0', 'proj': 'laea', 'units': 'm'}
Number of columns: 425
Number of rows: 425
Area extent: (-5326849.0625, -5326849.0625, 5326849.0625, 5326849.0625)
......@@ -219,7 +219,7 @@ Several area definitions can be read at once using the region names in an argume
Area ID: ease_sh
Description: Antarctic EASE grid
Projection ID: ease_sh
Projection: {'a': '6371228.0', 'lat_0': '-90', 'lon_0': '0', 'proj': 'laea', 'units': 'm'}
Projection: {'a': '6371228.0', 'lat_0': '-90.0', 'lon_0': '0.0', 'proj': 'laea', 'units': 'm'}
Number of columns: 425
Number of rows: 425
Area extent: (-5326849.0625, -5326849.0625, 5326849.0625, 5326849.0625)
......
......@@ -145,15 +145,13 @@ Getting a Basemap object
.. warning::
Basemap is no longer maintained. Cartopy (see above) should be used
instead.
instead. Basemap does not support Matplotlib 3.0+ either.
In order to make more advanced plots than the preconfigured quicklooks a Basemap object can be generated from an
AreaDefinition using the **plot.area_def2basemap(area_def, **kwargs)** function.
**Example usage:**
.. doctest::
>>> import numpy as np
>>> import matplotlib.pyplot as plt
>>> from pyresample import load_area, save_quicklook, area_def2basemap, SwathDefinition
......
......@@ -33,8 +33,6 @@ import shapely.geometry as sgeom
try:
from cartopy.crs import from_proj
except ImportError:
warnings.warn("'cartopy' >= 0.17 required for better 'from_proj' "
"functionality.")
from_proj = None
logger = getLogger(__name__)
......
......@@ -71,7 +71,7 @@ class Scheduler(object):
yield slice(s0, s1)
else:
self._lock.release()
raise StopIteration
return
def shmem_as_ndarray(raw_array):
......
This diff is collapsed.
This diff is collapsed.
......@@ -851,7 +851,7 @@ class AreaDefinition(BaseDefinition):
self.ndim = 2
self.pixel_size_x = (area_extent[2] - area_extent[0]) / float(x_size)
self.pixel_size_y = (area_extent[3] - area_extent[1]) / float(y_size)
self.proj_dict = proj_dict
self.proj_dict = utils.convert_proj_floats(proj_dict.items())
self.area_extent = tuple(area_extent)
# Calculate area_extent in lon lat
......
......@@ -63,7 +63,7 @@ class ImageContainer(object):
elif ((image_data.ndim > geo_def.ndim + 1) or
(image_data.ndim < geo_def.ndim)):
raise ValueError(('Unexpected number of dimensions for '
'image_data: ') % image_data.ndim)
'image_data: %s') % image_data.ndim)
for i, size in enumerate(geo_def.shape):
if image_data.shape[i] != size:
raise ValueError(('Size mismatch for image_data. Expected '
......
......@@ -181,8 +181,7 @@ def _basemap_get_quicklook(area_def, data, vmin=None, vmax=None,
def _get_quicklook(area_def, data, vmin=None, vmax=None,
label='Variable (units)', num_meridians=45,
num_parallels=10, coast_res='110m', cmap='jet'):
"""Get default Basemap matplotlib plot
"""
"""Get default cartopy matplotlib plot."""
bmap_to_cartopy_res = {
'c': '110m',
'l': '110m',
......@@ -229,7 +228,7 @@ def _get_quicklook(area_def, data, vmin=None, vmax=None,
ylocs = np.arange(-90, 90, num_parallels)
ax.gridlines(xlocs=xlocs, ylocs=ylocs)
if not (np.ma.isMaskedArray(data) and data.mask.all()):
col = plt.imshow(data, transform=crs, extent=crs.bounds,
col = ax.imshow(data, transform=crs, extent=crs.bounds,
origin='upper', vmin=vmin, vmax=vmax, cmap=cmap)
plt.colorbar(col, shrink=0.5, pad=0.05).set_label(label)
return plt
......
......@@ -869,6 +869,10 @@ class Test(unittest.TestCase):
self.assertEquals(area.proj_str,
'+a=6378144.0 +b=6356759.0 +lat_0=50.0 +lat_ts=50.0 +lon_0=8.0 +proj=stere')
proj_dict['no_rot'] = ''
area = geometry.AreaDefinition('areaD', 'Europe (3km, HRV, VTC)', 'areaD',
proj_dict, 10, 10,
[-1370912.72, -909968.64, 1029087.28,
1490031.36])
self.assertEquals(area.proj_str,
'+a=6378144.0 +b=6356759.0 +lat_0=50.0 +lat_ts=50.0 +lon_0=8.0 +no_rot +proj=stere')
......
......@@ -202,7 +202,7 @@ class Test(unittest.TestCase):
def test_proj4_string(self):
proj4_string = self.area_def.proj_str
expected_string = '+a=6378144.0 +b=6356759.0 +lat_ts=50.00 +lon_0=8.00 +proj=stere +lat_0=50.00'
expected_string = '+a=6378144.0 +b=6356759.0 +lat_ts=50.0 +lon_0=8.0 +proj=stere +lat_0=50.0'
self.assertEqual(
frozenset(proj4_string.split()), frozenset(expected_string.split()))
......
......@@ -22,20 +22,22 @@ class TestLegacyAreaParser(unittest.TestCase):
nh_str = """Area ID: ease_nh
Description: Arctic EASE grid
Projection ID: ease_nh
Projection: {'a': '6371228.0', 'lat_0': '90', 'lon_0': '0', 'proj': 'laea', 'units': 'm'}
Projection: {'a': '6371228.0', 'lat_0': '90.0', 'lon_0': '0.0', 'proj': 'laea', 'units': 'm'}
Number of columns: 425
Number of rows: 425
Area extent: (-5326849.0625, -5326849.0625, 5326849.0625, 5326849.0625)"""
self.assertEquals(ease_nh.__str__(), nh_str)
self.assertIsInstance(ease_nh.proj_dict['lat_0'], float)
sh_str = """Area ID: ease_sh
Description: Antarctic EASE grid
Projection ID: ease_sh
Projection: {'a': '6371228.0', 'lat_0': '-90', 'lon_0': '0', 'proj': 'laea', 'units': 'm'}
Projection: {'a': '6371228.0', 'lat_0': '-90.0', 'lon_0': '0.0', 'proj': 'laea', 'units': 'm'}
Number of columns: 425
Number of rows: 425
Area extent: (-5326849.0625, -5326849.0625, 5326849.0625, 5326849.0625)"""
self.assertEquals(ease_sh.__str__(), sh_str)
self.assertIsInstance(ease_sh.proj_dict['lat_0'], float)
def test_load_area(self):
from pyresample import utils
......@@ -45,7 +47,7 @@ Area extent: (-5326849.0625, -5326849.0625, 5326849.0625, 5326849.0625)"""
nh_str = """Area ID: ease_nh
Description: Arctic EASE grid
Projection ID: ease_nh
Projection: {'a': '6371228.0', 'lat_0': '90', 'lon_0': '0', 'proj': 'laea', 'units': 'm'}
Projection: {'a': '6371228.0', 'lat_0': '90.0', 'lon_0': '0.0', 'proj': 'laea', 'units': 'm'}
Number of columns: 425
Number of rows: 425
Area extent: (-5326849.0625, -5326849.0625, 5326849.0625, 5326849.0625)"""
......@@ -70,7 +72,7 @@ class TestYAMLAreaParser(unittest.TestCase):
nh_str = """Area ID: ease_nh
Description: Arctic EASE grid
Projection: {'a': '6371228.0', 'lat_0': '90', 'lon_0': '0', 'proj': 'laea', 'units': 'm'}
Projection: {'a': '6371228.0', 'lat_0': '90.0', 'lon_0': '0.0', 'proj': 'laea', 'units': 'm'}
Number of columns: 425
Number of rows: 425
Area extent: (-5326849.0625, -5326849.0625, 5326849.0625, 5326849.0625)"""
......@@ -78,7 +80,7 @@ Area extent: (-5326849.0625, -5326849.0625, 5326849.0625, 5326849.0625)"""
sh_str = """Area ID: ease_sh
Description: Antarctic EASE grid
Projection: {'a': '6371228.0', 'lat_0': '-90', 'lon_0': '0', 'proj': 'laea', 'units': 'm'}
Projection: {'a': '6371228.0', 'lat_0': '-90.0', 'lon_0': '0.0', 'proj': 'laea', 'units': 'm'}
Number of columns: 425
Number of rows: 425
Area extent: (-5326849.0625, -5326849.0625, 5326849.0625, 5326849.0625)"""
......@@ -246,6 +248,8 @@ class TestMisc(unittest.TestCase):
proj_str2 = utils.proj4_dict_to_str(proj_dict)
proj_dict2 = utils.proj4_str_to_dict(proj_str2)
self.assertDictEqual(proj_dict, proj_dict2)
self.assertIsInstance(proj_dict['lon_0'], float)
self.assertIsInstance(proj_dict2['lon_0'], float)
def suite():
......