[Git][debian-gis-team/pyresample][upstream] New upstream version 1.10.2
Antonio Valentino
gitlab at salsa.debian.org
Tue Oct 2 20:36:52 BST 2018
Antonio Valentino pushed to branch upstream at Debian GIS Project / pyresample
Commits:
206da791 by Antonio Valentino at 2018-10-02T18:13:16Z
New upstream version 1.10.2
- - - - -
17 changed files:
- .bumpversion.cfg
- .travis.yml
- CHANGELOG.md
- docs/source/geo_def.rst
- docs/source/plot.rst
- pyresample/_cartopy.py
- pyresample/_multi_proc.py
- pyresample/ewa/_fornav.cpp
- pyresample/ewa/_ll2cr.c
- pyresample/geometry.py
- pyresample/image.py
- pyresample/plot.py
- pyresample/test/test_geometry.py
- pyresample/test/test_grid.py
- pyresample/test/test_utils.py
- pyresample/utils.py
- pyresample/version.py
Changes:
=====================================
.bumpversion.cfg
=====================================
@@ -1,9 +1,9 @@
[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+))?
-serialize =
+serialize =
{major}.{minor}.{patch}{pre}{num}.{release}{dev}
{major}.{minor}.{patch}{pre}{num}
{major}.{minor}.{patch}.{release}{dev}
@@ -13,12 +13,12 @@ serialize =
[bumpversion:part:release]
optional_value = gamma
-values =
+values =
dev
gamma
[bumpversion:part:dev]
-values =
+values =
0
1
2
@@ -28,8 +28,9 @@ optional_value = 4
[bumpversion:part:pre]
optional_value = final
-values =
+values =
a
b
rc
final
+
=====================================
.travis.yml
=====================================
@@ -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'
=====================================
CHANGELOG.md
=====================================
@@ -1,8 +1,22 @@
+## 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.
-
-###############################################################################
=====================================
docs/source/geo_def.rst
=====================================
@@ -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)
=====================================
docs/source/plot.rst
=====================================
@@ -145,16 +145,14 @@ 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 numpy as np
>>> import matplotlib.pyplot as plt
>>> from pyresample import load_area, save_quicklook, area_def2basemap, SwathDefinition
>>> from pyresample.kd_tree import resample_nearest
=====================================
pyresample/_cartopy.py
=====================================
@@ -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__)
=====================================
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):
=====================================
pyresample/ewa/_fornav.cpp
=====================================
The diff for this file was not included because it is too large.
=====================================
pyresample/ewa/_ll2cr.c
=====================================
The diff for this file was not included because it is too large.
=====================================
pyresample/geometry.py
=====================================
@@ -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
=====================================
pyresample/image.py
=====================================
@@ -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 '
=====================================
pyresample/plot.py
=====================================
@@ -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,8 +228,8 @@ 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,
- origin='upper', vmin=vmin, vmax=vmax, cmap=cmap)
+ 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
=====================================
pyresample/test/test_geometry.py
=====================================
@@ -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')
=====================================
pyresample/test/test_grid.py
=====================================
@@ -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()))
=====================================
pyresample/test/test_utils.py
=====================================
@@ -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():
=====================================
pyresample/utils.py
=====================================
@@ -408,6 +408,22 @@ def fwhm2sigma(fwhm):
return fwhm / (2 * np.sqrt(np.log(2)))
+def convert_proj_floats(proj_pairs):
+ """Convert PROJ.4 parameters to floats if possible."""
+ proj_dict = {}
+ for x in proj_pairs:
+ if len(x) == 1 or x[1] is True:
+ proj_dict[x[0]] = True
+ continue
+
+ try:
+ proj_dict[x[0]] = float(x[1])
+ except ValueError:
+ proj_dict[x[0]] = x[1]
+
+ return proj_dict
+
+
def _get_proj4_args(proj4_args):
"""Create dict from proj4 args
"""
@@ -416,7 +432,7 @@ def _get_proj4_args(proj4_args):
proj_config = ConfigObj(str(proj4_args).replace('+', '').split())
else:
proj_config = ConfigObj(proj4_args)
- return proj_config.dict()
+ return convert_proj_floats(proj_config.dict().items())
def proj4_str_to_dict(proj4_str):
@@ -425,7 +441,7 @@ def proj4_str_to_dict(proj4_str):
Note: Key only parameters will be assigned a value of `True`.
"""
pairs = (x.split('=', 1) for x in proj4_str.replace('+', '').split(" "))
- return dict((x[0], (x[1] if len(x) == 2 else True)) for x in pairs)
+ return convert_proj_floats(pairs)
def proj4_dict_to_str(proj4_dict, sort=False):
=====================================
pyresample/version.py
=====================================
@@ -16,4 +16,4 @@
# You should have received a copy of the GNU Lesser General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-__version__ = '1.10.1'
+__version__ = '1.10.2'
View it on GitLab: https://salsa.debian.org/debian-gis-team/pyresample/commit/206da791ad7a77d17a0202c41b2f9ba543e27de9
--
View it on GitLab: https://salsa.debian.org/debian-gis-team/pyresample/commit/206da791ad7a77d17a0202c41b2f9ba543e27de9
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-grass-devel/attachments/20181002/3c55f303/attachment-0001.html>
More information about the Pkg-grass-devel
mailing list