pyproj4 / pyproj

Python interface to PROJ (cartographic projections and coordinate transformations library)
https://pyproj4.github.io/pyproj
MIT License
1.04k stars 210 forks source link

3.6.1: pytest fails in `test/crs/test_crs_cf.py::test_azimuthal_equidistant` unit #1393

Closed kloczek closed 4 months ago

kloczek commented 4 months ago

I'm packaging your module as an rpm package so I'm using the typical PEP517 based build, install and test cycle used on building packages from non-root account.

Here is pytest output: ```console + PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-pyproj-3.6.1-2.fc37.x86_64/usr/lib64/python3.10/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-pyproj-3.6.1-2.fc37.x86_64/usr/lib/python3.10/site-packages + /usr/bin/pytest -ra -m 'not network' --import-mode=importlib ============================= test session starts ============================== platform linux -- Python 3.10.14, pytest-8.1.1, pluggy-1.4.0 rootdir: /home/tkloczko/rpmbuild/BUILD/pyproj-3.6.1 configfile: pytest.ini collected 1004 items / 24 deselected / 980 selected test/crs/test_crs.py ................................................... [ 5%] ........................................................................ [ 12%] ........................................................................ [ 19%] .................................................... [ 25%] test/crs/test_crs_cf.py ...........................F.................... [ 30%] ... [ 30%] test/crs/test_crs_coordinate_operation.py .............................. [ 33%] .................... [ 35%] test/crs/test_crs_coordinate_system.py ............................ [ 38%] test/crs/test_crs_datum.py ....... [ 39%] test/crs/test_crs_json.py ............................... [ 42%] test/crs/test_crs_maker.py ....................... [ 44%] test/test_aoi.py ......................... [ 47%] test/test_awips221.py . [ 47%] test/test_cli.py ...................... [ 49%] test/test_database.py .................................................. [ 54%] ... [ 54%] test/test_datadir.py ...................... [ 57%] test/test_datum.py .. [ 57%] test/test_datum_shift.py .... [ 57%] test/test_doctest_wrapper.py . [ 57%] test/test_exception_logging.py .. [ 58%] test/test_geod.py ...................................................... [ 63%] .......................................sssssssssssssssssssss............ [ 70%] ................................ [ 74%] test/test_list.py .... [ 74%] test/test_network.py ........... [ 75%] test/test_pickle.py . [ 75%] test/test_proj.py ...................................... [ 79%] test/test_show_versions.py .... [ 80%] test/test_sync.py ...... [ 80%] test/test_transform.py ... [ 81%] test/test_transformer.py ..s............................................ [ 85%] ........................................................................ [ 93%] ..................................................... [ 98%] test/test_utils.py .............. [100%] =================================== FAILURES =================================== __________________________ test_azimuthal_equidistant __________________________ def test_azimuthal_equidistant(): crs = CRS("ESRI:54032") expected_cf = { "semi_major_axis": 6378137.0, "semi_minor_axis": crs.ellipsoid.semi_minor_metre, "inverse_flattening": crs.ellipsoid.inverse_flattening, "reference_ellipsoid_name": "WGS 84", "longitude_of_prime_meridian": 0.0, "prime_meridian_name": "Greenwich", "geographic_crs_name": "WGS 84", "horizontal_datum_name": "World Geodetic System 1984", "projected_crs_name": "World_Azimuthal_Equidistant", "grid_mapping_name": "azimuthal_equidistant", "latitude_of_projection_origin": 0.0, "longitude_of_projection_origin": 0.0, "false_easting": 0.0, "false_northing": 0.0, } cf_dict = crs.to_cf() assert cf_dict.pop("crs_wkt").startswith("PROJCRS[") > assert cf_dict == expected_cf E AssertionError: assert {} == {'false_easti...distant', ...} E E Right contains 14 more items: E {'false_easting': 0.0, E 'false_northing': 0.0, E 'geographic_crs_name': 'WGS 84', E 'grid_mapping_name': 'azimuthal_equidistant', E 'horizontal_datum_name': 'World Geodetic System 1984',... E E ...Full output truncated (10 lines hidden), use '-vv' to show test/crs/test_crs_cf.py:1206: AssertionError =============================== warnings summary =============================== test/test_datadir.py::test_get_data_dir__from_user[str] test/test_datadir.py::test_get_data_dir__from_user[Path] test/test_datadir.py::test_append_data_dir__internal[str] test/test_datadir.py::test_append_data_dir__internal[Path] /home/tkloczko/rpmbuild/BUILDROOT/python-pyproj-3.6.1-2.fc37.x86_64/usr/lib64/python3.10/site-packages/pyproj/datadir.py:38: UserWarning: pyproj unable to set database path. _global_context_set_data_dir() test/test_doctest_wrapper.py::test_doctests /home/tkloczko/rpmbuild/BUILDROOT/python-pyproj-3.6.1-2.fc37.x86_64/usr/lib64/python3.10/site-packages/pyproj/geod.py:829: UserWarning: Back azimuth is being returned by default to be compatible with inv()This is a breaking change for pyproj 3.5+.To avoid this warning, set return_back_azimuth=True.Otherwise, to restore old behaviour, set return_back_azimuth=False.This warning will be removed in future version. warnings.warn( test/test_doctest_wrapper.py::test_doctests /home/tkloczko/rpmbuild/BUILDROOT/python-pyproj-3.6.1-2.fc37.x86_64/usr/lib64/python3.10/site-packages/pyproj/geod.py:681: UserWarning: Back azimuth is being returned by default to be compatible with fwd()This is a breaking change for pyproj 3.5+.To avoid this warning, set return_back_azimuth=True.Otherwise, to restore old behaviour, set return_back_azimuth=False.This warning will be removed in future version. warnings.warn( test/test_geod.py: 72 warnings /home/tkloczko/rpmbuild/BUILDROOT/python-pyproj-3.6.1-2.fc37.x86_64/usr/lib64/python3.10/site-packages/pyproj/geod.py:404: DeprecationWarning: Conversion of an array with ndim > 0 to a scalar is deprecated, and will error in future. Ensure you extract a single element from your array before performing this operation. (Deprecated NumPy 1.25.) return self._inv_point( test/test_geod.py: 20 warnings /home/tkloczko/rpmbuild/BUILDROOT/python-pyproj-3.6.1-2.fc37.x86_64/usr/lib64/python3.10/site-packages/pyproj/geod.py:312: DeprecationWarning: Conversion of an array with ndim > 0 to a scalar is deprecated, and will error in future. Ensure you extract a single element from your array before performing this operation. (Deprecated NumPy 1.25.) return self._fwd_point( test/test_transform.py::test_transform_single_point_nad83_to_nad27 /home/tkloczko/rpmbuild/BUILD/pyproj-3.6.1/test/test_transform.py:65: FutureWarning: This function is deprecated. See: https://pyproj4.github.io/pyproj/stable/gotchas.html#upgrading-to-pyproj-2-from-pyproj-1 x2, y2 = transform(p1, p2, x1, y1) test/test_transform.py::test_transform_tuple_nad83_to_nad27 /home/tkloczko/rpmbuild/BUILD/pyproj-3.6.1/test/test_transform.py:111: FutureWarning: This function is deprecated. See: https://pyproj4.github.io/pyproj/stable/gotchas.html#upgrading-to-pyproj-2-from-pyproj-1 x2, y2 = transform(p1, p2, x1, y1) test/test_transformer.py: 40 warnings /home/tkloczko/rpmbuild/BUILDROOT/python-pyproj-3.6.1-2.fc37.x86_64/usr/lib64/python3.10/site-packages/pyproj/transformer.py:820: DeprecationWarning: Conversion of an array with ndim > 0 to a scalar is deprecated, and will error in future. Ensure you extract a single element from your array before performing this operation. (Deprecated NumPy 1.25.) return self._transformer._transform_point( test/test_transformer.py::test_transformer_group__unavailable test/test_transformer.py::test_transformer_group__network_disabled test/test_transformer.py::test_transformer_group__download_grids__directory /home/tkloczko/rpmbuild/BUILDROOT/python-pyproj-3.6.1-2.fc37.x86_64/usr/lib64/python3.10/site-packages/pyproj/transformer.py:207: UserWarning: Best transformation is not available due to missing Grid(short_name=us_noaa_alaska.tif, full_name=, package_name=, url=https://cdn.proj.org/us_noaa_alaska.tif, direct_download=True, open_license=True, available=False) super().__init__( test/test_transformer.py::test_transformer_group__get_transform_crs /home/tkloczko/rpmbuild/BUILDROOT/python-pyproj-3.6.1-2.fc37.x86_64/usr/lib64/python3.10/site-packages/pyproj/transformer.py:207: UserWarning: Best transformation is not available due to missing Grid(short_name=nl_nsgi_rdtrans2018.tif, full_name=, package_name=, url=https://cdn.proj.org/nl_nsgi_rdtrans2018.tif, direct_download=True, open_license=True, available=False) super().__init__( test/test_transformer.py::test_transformer_group_allow_superseded_filter /home/tkloczko/rpmbuild/BUILDROOT/python-pyproj-3.6.1-2.fc37.x86_64/usr/lib64/python3.10/site-packages/pyproj/transformer.py:207: UserWarning: Best transformation is not available due to missing Grid(short_name=au_icsm_National_84_02_07_01.tif, full_name=, package_name=, url=https://cdn.proj.org/au_icsm_National_84_02_07_01.tif, direct_download=True, open_license=True, available=False) super().__init__( -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html =========================== short test summary info ============================ SKIPPED [1] test/test_geod.py:554: Missing shapely SKIPPED [1] test/test_geod.py:560: Missing shapely SKIPPED [1] test/test_geod.py:570: Missing shapely SKIPPED [1] test/test_geod.py:588: Missing shapely SKIPPED [1] test/test_geod.py:600: Missing shapely SKIPPED [1] test/test_geod.py:612: Missing shapely SKIPPED [1] test/test_geod.py:633: Missing shapely SKIPPED [1] test/test_geod.py:644: Missing shapely SKIPPED [1] test/test_geod.py:663: Missing shapely SKIPPED [1] test/test_geod.py:674: Missing shapely SKIPPED [1] test/test_geod.py:682: Missing shapely SKIPPED [1] test/test_geod.py:688: Missing shapely SKIPPED [1] test/test_geod.py:698: Missing shapely SKIPPED [1] test/test_geod.py:716: Missing shapely SKIPPED [1] test/test_geod.py:728: Missing shapely SKIPPED [1] test/test_geod.py:740: Missing shapely SKIPPED [1] test/test_geod.py:761: Missing shapely SKIPPED [1] test/test_geod.py:783: Missing shapely SKIPPED [1] test/test_geod.py:794: Missing shapely SKIPPED [1] test/test_geod.py:813: Missing shapely SKIPPED [1] test/test_geod.py:824: Missing shapely SKIPPED [1] test/test_transformer.py:58: https://github.com/OSGeo/PROJ/issues/2425 FAILED test/crs/test_crs_cf.py::test_azimuthal_equidistant - AssertionError: ... === 1 failed, 957 passed, 22 skipped, 24 deselected, 145 warnings in 27.40s ==== ```
List of installed modules in build env: ```console Package Version ----------------------------- ----------- alabaster 0.7.16 Babel 2.14.0 build 1.2.1 certifi 2023.7.22 charset-normalizer 3.3.2 Cython 3.0.10 docutils 0.20.1 exceptiongroup 1.1.3 idna 3.6 imagesize 1.4.1 importlib_metadata 7.1.0 iniconfig 2.0.0 installer 0.7.0 Jinja2 3.1.3 MarkupSafe 2.1.5 numpy 1.26.5 packaging 24.0 pandas 2.2.1 pluggy 1.4.0 Pygments 2.17.2 pyproject_hooks 1.0.0 pytest 8.1.1 python-dateutil 2.9.0.post0 pytz 2024.1 requests 2.31.0 setuptools 69.2.0 snowballstemmer 2.2.0 Sphinx 7.2.6 sphinx-argparse 0.4.0 sphinxcontrib-applehelp 1.0.8 sphinxcontrib-devhelp 1.0.6 sphinxcontrib-htmlhelp 2.0.5 sphinxcontrib-jsmath 1.0.1 sphinxcontrib-qthelp 1.0.7 sphinxcontrib-serializinghtml 1.1.10 tokenize_rt 5.2.0 tomli 2.0.1 urllib3 2.2.1 wheel 0.43.0 xarray 2024.3.0 zipp 3.18.1 ```

Please let me know if you need more details or want me to perform some diagnostics.

snowman2 commented 4 months ago

Duplicate of #1384