[pyresample] 01/03: New upstream version 1.2.8

Antonio Valentino a_valentino-guest at moszumanska.debian.org
Wed Dec 7 09:41:03 UTC 2016


This is an automated email from the git hooks/post-receive script.

a_valentino-guest pushed a commit to branch master
in repository pyresample.

commit 89b2e304c449bc32a1877b1ccb0d5b2668a2cfb4
Author: Antonio Valentino <antonio.valentino at tiscali.it>
Date:   Wed Dec 7 09:22:27 2016 +0000

    New upstream version 1.2.8
---
 .bumpversion.cfg       |  2 +-
 changelog.rst          | 18 +++++++++++++++++
 pyresample/geometry.py | 55 +++++++++++++++++++++++++-------------------------
 pyresample/version.py  |  2 +-
 setup.py               | 52 +++++++++++++++++++++++------------------------
 5 files changed, 73 insertions(+), 56 deletions(-)

diff --git a/.bumpversion.cfg b/.bumpversion.cfg
index 7ba38cd..d826b91 100644
--- a/.bumpversion.cfg
+++ b/.bumpversion.cfg
@@ -1,5 +1,5 @@
 [bumpversion]
-current_version = 1.2.7
+current_version = 1.2.8
 commit = True
 tag = True
 
diff --git a/changelog.rst b/changelog.rst
index 2e0d99a..e8957e8 100644
--- a/changelog.rst
+++ b/changelog.rst
@@ -1,6 +1,24 @@
 Changelog
 =========
 
+v1.2.8 (2016-12-06)
+-------------------
+
+- update changelog. [Martin Raspaud]
+
+- Bump version: 1.2.7 → 1.2.8. [Martin Raspaud]
+
+- Correct style in setup.py. [Martin Raspaud]
+
+- Make pykdtree a requirement. [Martin Raspaud]
+
+- Correct style in geometry.py. [Martin Raspaud]
+
+- Allow precision errors when comparing area_extents. [Martin Raspaud]
+
+- Allow numbers in proj dict when building proj4 string. [Martin
+  Raspaud]
+
 v1.2.7 (2016-11-15)
 -------------------
 
diff --git a/pyresample/geometry.py b/pyresample/geometry.py
index 3fda9f3..8f6a25c 100644
--- a/pyresample/geometry.py
+++ b/pyresample/geometry.py
@@ -23,8 +23,10 @@
 """Classes for geometry operations"""
 
 import warnings
+
 import numpy as np
-from pyresample import utils, _spatial_mp
+
+from pyresample import _spatial_mp, utils
 
 
 class DimensionError(Exception):
@@ -107,36 +109,36 @@ class BaseDefinition(object):
         return not self.__eq__(other)
 
     def get_area_extent_for_subset(self, row_LR, col_LR, row_UL, col_UL):
-        """Retrieves area_extent for a subdomain 
+        """Retrieves area_extent for a subdomain
         rows    are counted from upper left to lower left
-        columns are counted from upper left to upper right 
+        columns are counted from upper left to upper right
 
         :Parameters:
         row_LR : int
-            row of the lower right pixel 
+            row of the lower right pixel
         col_LR : int
             col of the lower right pixel
         row_UL : int
-            row of the upper left pixel 
+            row of the upper left pixel
         col_UL : int
             col of the upper left pixel
 
         :Returns:
-        area_extent : list 
+        area_extent : list
             Area extent as a list (LL_x, LL_y, UR_x, UR_y) of the subset
 
         :Author:
         Ulrich Hamann
         """
-        
-        (a,b) = self.get_proj_coords( data_slice=(row_LR,col_LR) )
-        a = a - 0.5*self.pixel_size_x
-        b = b - 0.5*self.pixel_size_y
-        (c,d) = self.get_proj_coords( data_slice=(row_UL,col_UL) )
-        c = c + 0.5*self.pixel_size_x
-        d = d + 0.5*self.pixel_size_y
 
-        return (a,b,c,d)
+        (a, b) = self.get_proj_coords(data_slice=(row_LR, col_LR))
+        a = a - 0.5 * self.pixel_size_x
+        b = b - 0.5 * self.pixel_size_y
+        (c, d) = self.get_proj_coords(data_slice=(row_UL, col_UL))
+        c = c + 0.5 * self.pixel_size_x
+        d = d + 0.5 * self.pixel_size_y
+
+        return (a, b, c, d)
 
     def get_lonlat(self, row, col):
         """Retrieve lon and lat of single pixel
@@ -587,7 +589,8 @@ class AreaDefinition(BaseDefinition):
 
     def create_areas_def(self):
         proj_dict = self.proj_dict
-        proj_str = ','.join(["%s=%s" % (str(k), str(proj_dict[k])) for k in sorted(proj_dict.keys())])
+        proj_str = ','.join(["%s=%s" % (str(k), str(proj_dict[k]))
+                             for k in sorted(proj_dict.keys())])
 
         fmt = "REGION: {name} {{\n"
         fmt += "\tNAME:\t{name}\n"
@@ -597,7 +600,7 @@ class AreaDefinition(BaseDefinition):
         fmt += "\tYSIZE:\t{y_size}\n"
         fmt += "\tAREA_EXTENT: {area_extent}\n}};\n"
         area_def_str = fmt.format(name=self.name, area_id=self.area_id, proj_str=proj_str,
-                                x_size=self.x_size, y_size=self.y_size, area_extent=self.area_extent)
+                                  x_size=self.x_size, y_size=self.y_size, area_extent=self.area_extent)
         return area_def_str
 
     __repr__ = __str__
@@ -608,7 +611,7 @@ class AreaDefinition(BaseDefinition):
         try:
             return ((self.proj_dict == other.proj_dict) and
                     (self.shape == other.shape) and
-                    (self.area_extent == other.area_extent))
+                    (np.allclose(self.area_extent, other.area_extent)))
         except AttributeError:
             return super(AreaDefinition, self).__eq__(other)
 
@@ -617,8 +620,7 @@ class AreaDefinition(BaseDefinition):
 
         return not self.__eq__(other)
 
-
-    def colrow2lonlat(self,cols,rows):
+    def colrow2lonlat(self, cols, rows):
         """
         Return longitudes and latitudes for the given image columns
         and rows. Both scalars and arrays are supported.
@@ -628,8 +630,7 @@ class AreaDefinition(BaseDefinition):
         p = _spatial_mp.Proj(self.proj4_string)
         x = self.proj_x_coords
         y = self.proj_y_coords
-        return p(y[y.size-cols], x[x.size-rows], inverse=True)
-
+        return p(y[y.size - cols], x[x.size - rows], inverse=True)
 
     def lonlat2colrow(self, lons, lats):
         """
@@ -639,7 +640,6 @@ class AreaDefinition(BaseDefinition):
         """
         return self.get_xy_from_lonlat(lons, lats)
 
-
     def get_xy_from_lonlat(self, lon, lat):
         """Retrieve closest x and y coordinates (column, row indices) for the
         specified geolocation (lon,lat) if inside area. If lon,lat is a point a
@@ -698,10 +698,9 @@ class AreaDefinition(BaseDefinition):
                 raise ValueError('Point outside area:( %f %f)' % (x__, y__))
             return int(x__), int(y__)
 
-
     def get_xy_from_proj_coords(self, xm_, ym_):
-        """Retrieve closest x and y coordinates (column, row indices) for a 
-        location specified with projection coordinates (xm_,ym_) in meters. 
+        """Retrieve closest x and y coordinates (column, row indices) for a
+        location specified with projection coordinates (xm_,ym_) in meters.
         A ValueError is raised, if the return point is outside the area domain. If
         xm_,ym_ is a tuple of sequences of projection coordinates, a tuple of
         masked arrays are returned.
@@ -728,7 +727,8 @@ class AreaDefinition(BaseDefinition):
 
         if isinstance(xm_, np.ndarray) and isinstance(ym_, np.ndarray):
             if xm_.shape != ym_.shape:
-                raise ValueError("projection coordinates xm_ and ym_ is not of the same shape!")
+                raise ValueError(
+                    "projection coordinates xm_ and ym_ is not of the same shape!")
 
         upl_x = self.area_extent[0]
         upl_y = self.area_extent[3]
@@ -753,7 +753,6 @@ class AreaDefinition(BaseDefinition):
                 raise ValueError('Point outside area:( %f %f)' % (x__, y__))
             return int(x__), int(y__)
 
-
     def get_lonlat(self, row, col):
         """Retrieves lon and lat values of single point in area grid
 
@@ -980,7 +979,7 @@ class AreaDefinition(BaseDefinition):
         """Returns projection definition as Proj.4 string"""
 
         items = self.proj_dict.items()
-        return '+' + ' +'.join([t[0] + '=' + t[1] for t in items])
+        return '+' + ' +'.join([t[0] + '=' + str(t[1]) for t in items])
 
 
 def _get_slice(segments, shape):
diff --git a/pyresample/version.py b/pyresample/version.py
index e4c3540..02feda8 100644
--- a/pyresample/version.py
+++ b/pyresample/version.py
@@ -15,4 +15,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.2.7'
+__version__ = '1.2.8'
diff --git a/setup.py b/setup.py
index eb61761..07630a4 100644
--- a/setup.py
+++ b/setup.py
@@ -21,12 +21,12 @@ import multiprocessing
 import os
 import sys
 
-from setuptools import find_packages, setup, Extension
+from setuptools import Extension, find_packages, setup
 from setuptools.command.build_ext import build_ext as _build_ext
 
 version = imp.load_source('pyresample.version', 'pyresample/version.py')
 
-requirements = ['pyproj', 'numpy', 'configobj']
+requirements = ['pyproj', 'numpy', 'configobj', 'pykdtree>=1.1.1']
 extras_require = {'pykdtree': ['pykdtree>=1.1.1'],
                   'numexpr': ['numexpr'],
                   'quicklook': ['matplotlib', 'basemap', 'pillow']}
@@ -79,7 +79,8 @@ class build_ext(_build_ext):
 
 if __name__ == "__main__":
     if not os.getenv("USE_CYTHON", False) or cythonize is None:
-        print("Cython will not be used. Use environment variable 'USE_CYTHON=True' to use it")
+        print(
+            "Cython will not be used. Use environment variable 'USE_CYTHON=True' to use it")
 
         def cythonize(extensions, **_ignore):
             """Fake function to compile from C/C++ files instead of compiling .pyx files with cython.
@@ -98,27 +99,26 @@ if __name__ == "__main__":
                 extension.sources[:] = sources
             return extensions
 
-
     setup(name='pyresample',
-      version=version.__version__,
-      description='Resampling of remote sensing data in Python',
-      author='Thomas Lavergne',
-      author_email='t.lavergne at met.no',
-      package_dir={'pyresample': 'pyresample'},
-      packages=find_packages(),
-      setup_requires=['numpy'],
-      install_requires=requirements,
-      extras_require=extras_require,
-      cmdclass={'build_ext': build_ext},
-      ext_modules=cythonize(extensions),
-      test_suite='pyresample.test.suite',
-      zip_safe=False,
-      classifiers=[
-          'Development Status :: 5 - Production/Stable',
-          'License :: OSI Approved :: GNU Lesser General Public License v3 or later (LGPLv3+)',
-          'Programming Language :: Python',
-          'Operating System :: OS Independent',
-          'Intended Audience :: Science/Research',
-          'Topic :: Scientific/Engineering'
-      ]
-      )
+          version=version.__version__,
+          description='Resampling of remote sensing data in Python',
+          author='Thomas Lavergne',
+          author_email='t.lavergne at met.no',
+          package_dir={'pyresample': 'pyresample'},
+          packages=find_packages(),
+          setup_requires=['numpy'],
+          install_requires=requirements,
+          extras_require=extras_require,
+          cmdclass={'build_ext': build_ext},
+          ext_modules=cythonize(extensions),
+          test_suite='pyresample.test.suite',
+          zip_safe=False,
+          classifiers=[
+              'Development Status :: 5 - Production/Stable',
+              'License :: OSI Approved :: GNU Lesser General Public License v3 or later (LGPLv3+)',
+              'Programming Language :: Python',
+              'Operating System :: OS Independent',
+              'Intended Audience :: Science/Research',
+              'Topic :: Scientific/Engineering'
+          ]
+          )

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-grass/pyresample.git



More information about the Pkg-grass-devel mailing list