Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test failure in test_kd_tree.Test.test_custom #237

Closed
avalentino opened this issue Dec 2, 2019 · 4 comments
Closed

Test failure in test_kd_tree.Test.test_custom #237

avalentino opened this issue Dec 2, 2019 · 4 comments

Comments

@avalentino
Copy link
Contributor

The test has been run of Linux in a clean virtual environment.

$ python3 -m pytest
======================================================= test session starts ========================================================
platform linux -- Python 3.7.5, pytest-5.3.1, py-1.8.0, pluggy-0.13.1
rootdir: /home/antonio/projects/pyresample
collected 252 items                                                                                                                

pyresample/test/test_bilinear.py ...................................                                                         [ 13%]
pyresample/test/test_bucket.py ........                                                                                      [ 17%]
pyresample/test/test_data_reduce.py ......                                                                                   [ 19%]
pyresample/test/test_ewa_fornav.py ....                                                                                      [ 21%]
pyresample/test/test_ewa_ll2cr.py ......                                                                                     [ 23%]
pyresample/test/test_geometry.py .......................................................                                     [ 45%]
pyresample/test/test_grid.py ............                                                                                    [ 50%]
pyresample/test/test_image.py ..............                                                                                 [ 55%]
pyresample/test/test_kd_tree.py F........................................s..                                                 [ 73%]
pyresample/test/test_plot.py .s.....                                                                                         [ 75%]
pyresample/test/test_spherical.py ........................                                                                   [ 85%]
pyresample/test/test_spherical_geometry.py .....                                                                             [ 87%]
pyresample/test/test_swath.py ..                                                                                             [ 88%]
pyresample/test/test_utils.py ..............................                                                                 [100%]

============================================================= FAILURES =============================================================
_________________________________________________________ Test.test_custom _________________________________________________________

self = <pyresample.test.test_kd_tree.Test testMethod=test_custom>

    def test_custom(self):
        def wf(dist):
            return 1 - dist / 100000.0
    
        data = np.fromfunction(lambda y, x: (y + x) * 10 ** -5, (5000, 100))
        lons = np.fromfunction(
            lambda y, x: 3 + (10.0 / 100) * x, (5000, 100))
        lats = np.fromfunction(
            lambda y, x: 75 - (50.0 / 5000) * y, (5000, 100))
        swath_def = geometry.SwathDefinition(lons=lons, lats=lats)
        with catch_warnings(UserWarning) as w:
            res = kd_tree.resample_custom(swath_def, data.ravel(),
                                          self.area_def, 50000, wf, segments=1)
>           self.assertFalse(len(w) != 1)
E           AssertionError: True is not false

pyresample/test/test_kd_tree.py:417: AssertionError

[CUT]

================================ 1 failed, 249 passed, 2 skipped, 251 warnings in 158.67s (0:02:38) ================================

Installed packages

$ python3 -m pip freeze 
affine==2.3.0
attrs==19.3.0
Cartopy==0.17.0
Click==7.0
click-plugins==1.1.1
cligj==0.5.0
configobj==5.0.6
cycler==0.10.0
dask==2.8.1
importlib-metadata==1.1.0
kiwisolver==1.1.0
matplotlib==3.1.2
more-itertools==8.0.0
numpy==1.17.4
packaging==19.2
pandas==0.25.3
Pillow==6.2.1
pkg-resources==0.0.0
pluggy==0.13.1
py==1.8.0
pykdtree==1.3.1
pyparsing==2.4.5
pyproj==2.4.2.post1
pyresample==1.13.2+28.g19ff793
pyshp==2.1.0
pytest==5.3.1
python-dateutil==2.8.1
pytz==2019.3
PyYAML==5.2
rasterio==1.1.1
scipy==1.3.3
Shapely==1.6.4.post2
six==1.13.0
snuggs==1.4.7
toolz==0.10.0
wcwidth==0.1.7
xarray==0.14.1
zipp==0.6.0
@mraspaud
Copy link
Member

mraspaud commented Dec 2, 2019

@avalentino thanks for the report. I think @djhoese is looking at this now.

@djhoese
Copy link
Member

djhoese commented Dec 3, 2019

Yes I'm working on this in #236. This is caused by pyproj 2.4.2.post1 and it raising extra warnings about using PROJ strings/dicts.

@avalentino
Copy link
Contributor Author

Thank @djhoese and @mraspaud.
I can confirm that the patch in #236 works for my setup.

@avalentino
Copy link
Contributor Author

PR #236 has been merged to this issue can be considered solved.
Thanks a lot.
Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants