[pyresample] 12/15: Imported Upstream version 1.1.6

Antonio Valentino a_valentino-guest at moszumanska.debian.org
Sat Feb 27 18:18:18 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 09a3caa98d91b2d25f1dcec7de1f3563196b7da7
Author: Antonio Valentino <antonio.valentino at tiscali.it>
Date:   Sat Feb 27 10:12:46 2016 +0000

    Imported Upstream version 1.1.6
---
 .travis.yml                     |  5 +++++
 changelog.rst                   | 40 ++++++++++++++++++++++++++++++++++++++++
 pyresample/kd_tree.py           |  7 +++++++
 pyresample/test/test_kd_tree.py | 19 +++++++++++++++++++
 pyresample/version.py           |  2 +-
 requirements.txt                |  1 -
 6 files changed, 72 insertions(+), 2 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index 35f5411..3be4e50 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -10,6 +10,11 @@ before_install:
 - sudo apt-get install libfreetype6-dev
 - sudo apt-get install libgeos-3.3.8 libgeos-c1 libgeos-dev
 install:
+- if [[ $TRAVIS_PYTHON_VERSION == "2.6" ]]; then pip install "matplotlib<1.5.0"; fi
+- if [[ $TRAVIS_PYTHON_VERSION == "2.7" ]]; then pip install "matplotlib>=1.5.0"; fi
+- if [[ $TRAVIS_PYTHON_VERSION == "3.3" ]]; then pip install "matplotlib<1.5.0"; fi
+- if [[ $TRAVIS_PYTHON_VERSION == "3.4" ]]; then pip install "matplotlib>=1.5.0"; fi
+- if [[ $TRAVIS_PYTHON_VERSION == "3.5" ]]; then pip install "matplotlib>=1.5.0"; fi
 - pip install -r requirements.txt
 - pip install -e ".[pykdtree]"
 - pip install coveralls
diff --git a/changelog.rst b/changelog.rst
index 69a92dd..8e6fb57 100644
--- a/changelog.rst
+++ b/changelog.rst
@@ -6,6 +6,46 @@ Changelog
 
 - Update changelog. [Martin Raspaud]
 
+- Bump version: 1.1.5 → 1.1.6. [Martin Raspaud]
+
+- Fix #35 supporting scipy kdtree again. [Martin Raspaud]
+
+  A previous commit was looking for a 'data_pts' attribute in the kdtree
+  object, which is available in pykdtree, but not scipy.
+
+- Merge pull request #32 from mitkin/master. [Martin Raspaud]
+
+  [tests] Skip deprecation warnings in test_gauss_multi_uncert
+
+- Merge remote-tracking branch 'gh-pytroll/pre-master' [Mikhail Itkin]
+
+- Put quotes around pip version specifiers to make things work. [Martin
+  Raspaud]
+
+- Install the right matplotlib in travis. [Martin Raspaud]
+
+  The latest matplotlib (1.5) doesn't support python 2.6 and 3.3. This patch
+  chooses the right matplotlib version to install depending on the python
+  version at hand.
+
+- Skip deprecation warnings. [Mikhail Itkin]
+
+  Catch the rest of the warnings. Check if there is only one, and
+  whether it contains the relevant message ('possible more than 8
+  neighbours found'). This patch is necessary for python 2.7.9 and newer
+
+
+- Merge pull request #31 from bhawkins/fix-kdtree-dtype. [Martin
+  Raspaud]
+
+  Fix possible type mismatch with pykdtree.
+
+- Add test to expose pykdtree TypeError exception. [Brian Hawkins]
+
+- Fix possible type mismatch with pykdtree. [Brian Hawkins]
+
+- Update changelog. [Martin Raspaud]
+
 - Bump version: 1.1.4 → 1.1.5. [Martin Raspaud]
 
 - Don't build on 3.2 anymore (because of coverage's lack of support for
diff --git a/pyresample/kd_tree.py b/pyresample/kd_tree.py
index ded8587..6109c8b 100644
--- a/pyresample/kd_tree.py
+++ b/pyresample/kd_tree.py
@@ -541,6 +541,13 @@ def _query_resample_kdtree(resample_kdtree, source_geo_def, target_geo_def,
     output_coords = cartesian.transform_lonlats(
         target_lons_valid, target_lats_valid)
 
+    # pykdtree requires query points have same data type as kdtree.
+    try:
+        dt = resample_kdtree.data_pts.dtype
+    except AttributeError:
+        dt = resample_kdtree.data.dtype
+    output_coords = np.asarray(output_coords, dtype=dt)
+
     # Query kd-tree
     distance_array, index_array = resample_kdtree.query(output_coords,
                                                         k=neighbours,
diff --git a/pyresample/test/test_kd_tree.py b/pyresample/test/test_kd_tree.py
index 6859bf8..59c240c 100644
--- a/pyresample/test/test_kd_tree.py
+++ b/pyresample/test/test_kd_tree.py
@@ -400,6 +400,13 @@ class Test(unittest.TestCase):
                                                          segments=1, with_uncert=True)
         else:
             with warnings.catch_warnings(record=True) as w:
+                # The assertion below checks if there is only one warning raised
+                # and whether it contains a specific message from pyresample
+                # On python 2.7.9+ the resample_gauss method raises multiple deprecation warnings
+                # that cause to fail, so we ignore the unrelated warnings.
+                # TODO: better way would be to filter UserWarning correctly
+                from numpy import VisibleDeprecationWarning
+                warnings.simplefilter('ignore', (DeprecationWarning, VisibleDeprecationWarning))
                 res, stddev, counts = kd_tree.resample_gauss(swath_def, data_multi,
                                                              self.area_def, 50000, [
                                                                  25000, 15000, 10000],
@@ -786,6 +793,18 @@ class Test(unittest.TestCase):
         self.assertTrue(numpy.array_equal(fill_mask, expected_fill_mask),
                         msg='Failed to create fill mask on masked data')
 
+    def test_dtype(self):
+        lons = numpy.fromfunction(lambda y, x: 3 + x, (50, 10))
+        lats = numpy.fromfunction(lambda y, x: 75 - y, (50, 10))
+        grid_def = geometry.GridDefinition(lons, lats)
+        lons = numpy.asarray(lons, dtype='f4')
+        lats  = numpy.asarray(lats, dtype='f4')
+        swath_def = geometry.SwathDefinition(lons=lons, lats=lats)
+        valid_input_index, valid_output_index, index_array, distance_array = \
+            kd_tree.get_neighbour_info(swath_def,
+                                       grid_def,
+                                       50000, neighbours=1, segments=1)
+
     def test_nearest_from_sample(self):
         data = numpy.fromfunction(lambda y, x: y * x, (50, 10))
         lons = numpy.fromfunction(lambda y, x: 3 + x, (50, 10))
diff --git a/pyresample/version.py b/pyresample/version.py
index 3243b2a..e4d7292 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.1.5'
+__version__ = '1.1.6'
diff --git a/requirements.txt b/requirements.txt
index 4498b6b..27e0640 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,2 +1 @@
-git+https://github.com/matplotlib/matplotlib.git
 git+https://github.com/matplotlib/basemap.git

-- 
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