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

PROJ 6.2+ required; remove global context; autoclose database #412

Merged
merged 7 commits into from
Sep 10, 2019

Conversation

snowman2
Copy link
Member

@snowman2 snowman2 commented Aug 27, 2019

@snowman2 snowman2 force-pushed the remove_global_context branch 2 times, most recently from 1fb9e89 to be3c00c Compare August 27, 2019 00:58
@snowman2
Copy link
Member Author

Intermittent core dumping:

(pyproj) snowal@snowal-lx2:~/scripts/pyproj$ pytest test/test_transformer.py 
================================================================ test session starts ================================================================
platform linux -- Python 3.7.3, pytest-4.6.2, py-1.8.0, pluggy-0.12.0
rootdir: /home/snowal/scripts/pyproj
plugins: cov-2.7.1
collected 51 items                                                                                                                                  

test/test_transformer.py ...................................................                                                                  [100%]

============================================================= 51 passed in 3.57 seconds =============================================================
(pyproj) snowal@snowal-lx2:~/scripts/pyproj$ pytest test/test_transformer.py 
================================================================ test session starts ================================================================
platform linux -- Python 3.7.3, pytest-4.6.2, py-1.8.0, pluggy-0.12.0
rootdir: /home/snowal/scripts/pyproj
plugins: cov-2.7.1
collected 51 items                                                                                                                                  

test/test_transformer.py .............................................Aborted (core dumped)
(pyproj) snowal@snowal-lx2:~/scripts/pyproj$ pytest test/test_transformer.py 
================================================================ test session starts ================================================================
platform linux -- Python 3.7.3, pytest-4.6.2, py-1.8.0, pluggy-0.12.0
rootdir: /home/snowal/scripts/pyproj
plugins: cov-2.7.1
collected 51 items                                                                                                                                  

test/test_transformer.py ...................................................                                                                  [100%]

============================================================= 51 passed in 3.56 seconds =============================================================
(pyproj) snowal@snowal-lx2:~/scripts/pyproj$ pytest test/test_transformer.py 
================================================================ test session starts ================================================================
platform linux -- Python 3.7.3, pytest-4.6.2, py-1.8.0, pluggy-0.12.0
rootdir: /home/snowal/scripts/pyproj
plugins: cov-2.7.1
collected 51 items                                                                                                                                  

test/test_transformer.py ...................................................                                                                  [100%]

============================================================= 51 passed in 3.58 seconds =============================================================

@snowman2 snowman2 force-pushed the remove_global_context branch from be3c00c to 4551274 Compare August 27, 2019 01:23
@snowman2 snowman2 force-pushed the remove_global_context branch 2 times, most recently from 7db1ca6 to b90650f Compare September 1, 2019 00:15
@snowman2
Copy link
Member Author

snowman2 commented Sep 1, 2019

Core dumping still an issue.

@snowman2
Copy link
Member Author

snowman2 commented Sep 1, 2019

Core dumping does not seem to be an issue with the most recent change.

docs/history.rst Outdated Show resolved Hide resolved
pyproj/__init__.py Show resolved Hide resolved
@snowman2 snowman2 force-pushed the remove_global_context branch from 50294c3 to 0b3b3f0 Compare September 2, 2019 18:10
@snowman2 snowman2 force-pushed the remove_global_context branch from 83589c0 to 19a3c95 Compare September 2, 2019 18:14
@snowman2
Copy link
Member Author

snowman2 commented Sep 2, 2019

@cgohlke, if you have time, I would definitely appreciate it if you wouldn't mind building windows wheels from this PR and letting me know if #403 is addressed or not.

@cgohlke
Copy link
Contributor

cgohlke commented Sep 2, 2019

I built snowman2:remove_global_context against proj-6.2.0. The segfault in test_datumis gone but the tests now crash at

================================================= test session starts =================================================
platform win32 -- Python 3.7.4, pytest-5.1.2, py-1.8.0, pluggy-0.12.0 -- X:\Python37\python.exe
cachedir: .pytest_cache
hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase('D:\\Build\\pyproj\\pyproj-remove_global_context\\.hypothesis\\examples')
rootdir: D:\Build\pyproj\pyproj-remove_global_context
plugins: hypothesis-4.34.0, palladium-1.2.2, cov-2.7.1, forked-1.0.2, localserver-0.5.0, pep8-1.0.6, xdist-1.29.0
collected 253 items

test/test_awips221.py::test_awips221 PASSED                                                                      [  0%]
test/test_crs.py::test_from_proj4_json PASSED                                                                    [  0%]
test/test_crs.py::test_from_proj4 PASSED                                                                         [  1%]
test/test_crs.py::test_from_proj4__invalid PASSED                                                                [  1%]
test/test_crs.py::test_from_epsg PASSED                                                                          [  1%]
test/test_crs.py::test_from_epsg_string PASSED                                                                   [  2%]
test/test_crs.py::test_from_string PASSED                                                                        [  2%]
test/test_crs.py::test_bare_parameters PASSED                                                                    [  3%]
test/test_crs.py::test_is_geographic PASSED                                                                      [  3%]
test/test_crs.py::test_is_projected PASSED                                                                       [  3%]
test/test_crs.py::test_is_same_crs PASSED                                                                        [  4%]
test/test_crs.py::test_to_proj4 PASSED                                                                           [  4%]
test/test_crs.py::test_empty_json PASSED                                                                         [  5%]
test/test_crs.py::test_has_wkt_property PASSED                                                                   [  5%]
test/test_crs.py::test_to_wkt_pretty PASSED                                                                      [  5%]
test/test_crs.py::test_repr PASSED                                                                               [  6%]
test/test_crs.py::test_repr__long PASSED                                                                         [  6%]
test/test_crs.py::test_repr_epsg PASSED                                                                          [  7%]
test/test_crs.py::test_repr__undefined PASSED                                                                    [  7%]
test/test_crs.py::test_repr_compound PASSED                                                                      [  7%]
test/test_crs.py::test_dunder_str PASSED                                                                         [  8%]
test/test_crs.py::test_epsg PASSED                                                                               [  8%]
test/test_crs.py::test_datum PASSED                                                                              [  9%]
test/test_crs.py::test_datum_horizontal PASSED                                                                   [  9%]
test/test_crs.py::test_datum_unknown PASSED                                                                      [  9%]
test/test_crs.py::test_epsg__not_found PASSED                                                                    [ 10%]
test/test_crs.py::test_epsg__no_code_available PASSED                                                            [ 10%]
test/test_crs.py::test_crs_OSR_equivalence PASSED                                                                [ 11%]
test/test_crs.py::test_crs_OSR_no_equivalence PASSED                                                             [ 11%]
test/test_crs.py::test_init_from_wkt PASSED                                                                      [ 11%]
test/test_crs.py::test_init_from_wkt_invalid PASSED                                                              [ 12%]
test/test_crs.py::test_from_wkt PASSED                                                                           [ 12%]
test/test_crs.py::test_from_wkt_invalid PASSED                                                                   [ 13%]
test/test_crs.py::test_from_user_input_epsg PASSED                                                               [ 13%]
test/test_crs.py::test_from_esri_wkt PASSED                                                                      [ 13%]
test/test_crs.py::test_compound_crs PASSED                                                                       [ 14%]
test/test_crs.py::test_ellipsoid PASSED                                                                          [ 14%]
test/test_crs.py::test_area_of_use PASSED                                                                        [ 15%]
test/test_crs.py::test_from_user_input_custom_crs_class PASSED                                                   [ 15%]
test/test_crs.py::test_non_crs_error PASSED                                                                      [ 15%]
test/test_crs.py::test_sub_crs PASSED                                                                            [ 16%]
test/test_crs.py::test_sub_crs__none PASSED                                                                      [ 16%]
test/test_crs.py::test_coordinate_system PASSED                                                                  [ 16%]
test/test_crs.py::test_coordinate_system_geog PASSED                                                             [ 17%]
test/test_crs.py::test_coordinate_operation PASSED                                                               [ 17%]
test/test_crs.py::test_coordinate_operation_grids PASSED                                                         [ 18%]
test/test_crs.py::test_coordinate_operation_grids__alternative_grid_name PASSED                                  [ 18%]
test/test_crs.py::test_coordinate_operation__missing PASSED                                                      [ 18%]
test/test_crs.py::test_coordinate_operation__from_epsg PASSED                                                    [ 19%]
test/test_crs.py::test_coordinate_operation__from_authority PASSED                                               [ 19%]
test/test_crs.py::test_coordinate_operation__from_epsg__empty PASSED                                             [ 20%]
test/test_crs.py::test_coordinate_operation__from_authority__empty PASSED                                        [ 20%]
test/test_crs.py::test_datum__from_epsg PASSED                                                                   [ 20%]
test/test_crs.py::test_datum__from_authority PASSED                                                              [ 21%]
test/test_crs.py::test_datum__from_epsg__invalid PASSED                                                          [ 21%]
test/test_crs.py::test_datum__from_authority__invalid PASSED                                                     [ 22%]
test/test_crs.py::test_prime_meridian__from_epsg PASSED                                                          [ 22%]
test/test_crs.py::test_prime_meridian__from_authority PASSED                                                     [ 22%]
test/test_crs.py::test_prime_meridian__from_epsg__invalid PASSED                                                 [ 23%]
test/test_crs.py::test_prime_meridian__from_authority__invalid PASSED                                            [ 23%]
test/test_crs.py::test_ellipsoid__from_epsg PASSED                                                               [ 24%]
test/test_crs.py::test_ellipsoid__from_authority PASSED                                                          [ 24%]
test/test_crs.py::test_ellipsoid__from_epsg__invalid PASSED                                                      [ 24%]
test/test_crs.py::test_ellipsoid__from_authority__invalid PASSED                                                 [ 25%]
test/test_crs.py::test_bound_crs_is_geographic PASSED                                                            [ 25%]
test/test_crs.py::test_coordinate_operation_towgs84_three PASSED                                                 [ 26%]
test/test_crs.py::test_coordinate_operation_towgs84_seven PASSED                                                 [ 26%]
test/test_crs.py::test_coordinate_operation_towgs84_missing PASSED                                               [ 26%]
test/test_crs.py::test_to_wkt_enum PASSED                                                                        [ 27%]
test/test_crs.py::test_to_wkt_enum__invalid PASSED                                                               [ 27%]
test/test_crs.py::test_to_proj4_enum PASSED                                                                      [ 28%]
test/test_crs.py::test_datum__from_string PASSED                                                                 [ 28%]
test/test_crs.py::test_datum__from_string__invalid PASSED                                                        [ 28%]
test/test_crs.py::test_ellipsoid__from_string PASSED                                                             [ 29%]
test/test_crs.py::test_ellipsoid__from_string__invalid PASSED                                                    [ 29%]
test/test_crs.py::test_prime_meridian__from_string PASSED                                                        [ 30%]
test/test_crs.py::test_prime_meridian__from_string__invalid PASSED                                               [ 30%]
test/test_crs.py::test_coordinate_operation__from_string PASSED                                                  [ 30%]
test/test_crs.py::test_coordinate_operation__from_string__invalid PASSED                                         [ 31%]
test/test_crs.py::test_to_proj4_enum__invalid PASSED                                                             [ 31%]
test/test_crs.py::test_geodetic_crs PASSED                                                                       [ 32%]
test/test_crs.py::test_itrf_init PASSED                                                                          [ 32%]
test/test_crs.py::test_compound_crs_init PASSED                                                                  [ 32%]
test/test_crs.py::test_compound_crs_urn_init PASSED                                                              [ 33%]
test/test_crs.py::test_from_authority__ignf PASSED                                                               [ 33%]
test/test_crs.py::test_ignf_authority_repr PASSED                                                                [ 33%]
test/test_crs.py::test_crs_hash PASSED                                                                           [ 34%]
test/test_crs.py::test_crs_hash_unequal PASSED                                                                   [ 34%]
test/test_crs.py::test_crs_init_user_input PASSED                                                                [ 35%]
test/test_crs.py::test_to_string__no_auth PASSED                                                                 [ 35%]
test/test_crs.py::test_to_string__auth PASSED                                                                    [ 35%]
test/test_crs.py::test_srs__no_plus Windows fatal exception: access violation

Current thread 0x00003248 (most recent call first):
  File "D:\Build\pyproj\pyproj-remove_global_context\pyproj\crs.py", line 303 in __init__
  File "D:\Build\pyproj\pyproj-remove_global_context\test\test_crs.py", line 786 in test_srs__no_plus
  File "X:\Python37\lib\site-packages\_pytest\python.py", line 170 in pytest_pyfunc_call
  File "X:\Python37\lib\site-packages\pluggy\callers.py", line 187 in _multicall
  File "X:\Python37\lib\site-packages\pluggy\manager.py", line 81 in <lambda>
  File "X:\Python37\lib\site-packages\pluggy\manager.py", line 87 in _hookexec
  File "X:\Python37\lib\site-packages\pluggy\hooks.py", line 289 in __call__
  File "X:\Python37\lib\site-packages\_pytest\python.py", line 1423 in runtest
  File "X:\Python37\lib\site-packages\_pytest\runner.py", line 117 in pytest_runtest_call
  File "X:\Python37\lib\site-packages\pluggy\callers.py", line 187 in _multicall
  File "X:\Python37\lib\site-packages\pluggy\manager.py", line 81 in <lambda>
  File "X:\Python37\lib\site-packages\pluggy\manager.py", line 87 in _hookexec
  File "X:\Python37\lib\site-packages\pluggy\hooks.py", line 289 in __call__
  File "X:\Python37\lib\site-packages\_pytest\runner.py", line 192 in <lambda>
  File "X:\Python37\lib\site-packages\_pytest\runner.py", line 220 in from_call
  File "X:\Python37\lib\site-packages\_pytest\runner.py", line 192 in call_runtest_hook
  File "X:\Python37\lib\site-packages\_pytest\runner.py", line 167 in call_and_report
  File "X:\Python37\lib\site-packages\_pytest\runner.py", line 87 in runtestprotocol
  File "X:\Python37\lib\site-packages\_pytest\runner.py", line 72 in pytest_runtest_protocol
  File "X:\Python37\lib\site-packages\pluggy\callers.py", line 187 in _multicall
  File "X:\Python37\lib\site-packages\pluggy\manager.py", line 81 in <lambda>
  File "X:\Python37\lib\site-packages\pluggy\manager.py", line 87 in _hookexec
  File "X:\Python37\lib\site-packages\pluggy\hooks.py", line 289 in __call__
  File "X:\Python37\lib\site-packages\_pytest\main.py", line 256 in pytest_runtestloop
  File "X:\Python37\lib\site-packages\pluggy\callers.py", line 187 in _multicall
  File "X:\Python37\lib\site-packages\pluggy\manager.py", line 81 in <lambda>
  File "X:\Python37\lib\site-packages\pluggy\manager.py", line 87 in _hookexec
  File "X:\Python37\lib\site-packages\pluggy\hooks.py", line 289 in __call__
  File "X:\Python37\lib\site-packages\_pytest\main.py", line 235 in _main
  File "X:\Python37\lib\site-packages\_pytest\main.py", line 191 in wrap_session
  File "X:\Python37\lib\site-packages\_pytest\main.py", line 228 in pytest_cmdline_main
  File "X:\Python37\lib\site-packages\pluggy\callers.py", line 187 in _multicall
  File "X:\Python37\lib\site-packages\pluggy\manager.py", line 81 in <lambda>
  File "X:\Python37\lib\site-packages\pluggy\manager.py", line 87 in _hookexec
  File "X:\Python37\lib\site-packages\pluggy\hooks.py", line 289 in __call__
  File "X:\Python37\lib\site-packages\_pytest\config\__init__.py", line 78 in main
  File "X:\Python37\lib\site-packages\pytest.py", line 101 in <module>
  File "X:\Python37\lib\runpy.py", line 85 in _run_code
  File "X:\Python37\lib\runpy.py", line 193 in _run_module_as_main

@snowman2
Copy link
Member Author

snowman2 commented Sep 2, 2019

Thanks @cgohlke! Sounds like I need to try a different approach.

@snowman2
Copy link
Member Author

snowman2 commented Sep 3, 2019

@cgohlke mind trying out this iteration?

@cgohlke
Copy link
Contributor

cgohlke commented Sep 3, 2019

This iteration segfaults during test_datum just as #403 (comment). I think there are two different kind of crashes: one due to the global context, which might be fixed here, and another one during frame_dealloc.

@snowman2
Copy link
Member Author

snowman2 commented Sep 4, 2019

This iteration segfaults during test_datum just as #403 (comment). I think there are two different kind of crashes: one due to the global context, which might be fixed here, and another one during frame_dealloc.

So, is it something that happens sometimes but not always? Or is it pretty regular?

@snowman2
Copy link
Member Author

snowman2 commented Sep 4, 2019

Just pushed another iteration to try. It's quite the guessing game what the problem could be.

@snowman2
Copy link
Member Author

snowman2 commented Sep 4, 2019

Interesting ...

test/test_transformer.py .............................................. [ 98%]
corrupted double-linked list
Aborted (core dumped)

@snowman2
Copy link
Member Author

snowman2 commented Sep 4, 2019

Okay, should be stable now.

@snowman2
Copy link
Member Author

snowman2 commented Sep 4, 2019

🤞

@cgohlke
Copy link
Contributor

cgohlke commented Sep 4, 2019

Okay, should be stable now.

Unfortunately it still crashes during test_datum.

So, is it something that happens sometimes but not always? Or is it pretty regular?

Tests always crash at the same point when Heap Verification is on. When it's turned off, the test most often finish with many failures:

============================================================= test session starts =============================================================
platform win32 -- Python 3.7.4, pytest-5.1.2, py-1.8.0, pluggy-0.12.0
rootdir: pyproj-remove_global_context
plugins: hypothesis-4.34.0, palladium-1.2.2, cov-2.7.1, forked-1.0.2, localserver-0.5.0, pep8-1.0.6, xdist-1.29.0
collected 253 items

test\test_awips221.py .                                                                                                                  [  0%]
test\test_crs.py ............................................FF.FF..FF..FF..FF.........F.F.F.F...........................                [ 41%]
test\test_crs_cf.py ................                                                                                                     [ 47%]
test\test_datadir.py ..........                                                                                                          [ 51%]
test\test_datum.py F                                                                                                                     [ 52%]
test\test_datum_shift.py ..FF                                                                                                            [ 53%]
test\test_doctest_wrapper.py F                                                                                                           [ 54%]
test\test_exception_logging.py ..                                                                                                        [ 54%]
test\test_geod.py ............................                                                                                           [ 66%]
test\test_list.py .....                                                                                                                  [ 67%]
test\test_pickle.py .                                                                                                                    [ 68%]
test\test_proj.py .........................                                                                                              [ 78%]
test\test_show_versions.py ...                                                                                                           [ 79%]
test\test_transform.py .                                                                                                                 [ 79%]
test\test_transformer.py .............FF.....F.F...................F.FFFFF..                                                             [100%]

================================================================== FAILURES ===================================================================
_______________________________________________________ test_coordinate_operation_grids _______________________________________________________

    def test_coordinate_operation_grids():
>       cc = CoordinateOperation.from_epsg(1312)

test\test_crs.py:493:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pyproj\_crs.pyx:1176: in pyproj._crs.CoordinateOperation.from_epsg
    return CoordinateOperation.from_authority(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

>   raise CRSError(
E   pyproj.exceptions.CRSError: Invalid authority or code (EPSG, 1312)

pyproj\_crs.pyx:1154: CRSError
------------------------------------------------------------ Captured stderr call -------------------------------------------------------------
proj_create_from_database: Cannot find proj.db
___________________________________________ test_coordinate_operation_grids__alternative_grid_name ____________________________________________

    def test_coordinate_operation_grids__alternative_grid_name():
>       cc = CoordinateOperation.from_epsg(1312, True)

test\test_crs.py:502:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pyproj\_crs.pyx:1176: in pyproj._crs.CoordinateOperation.from_epsg
    return CoordinateOperation.from_authority(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

>   raise CRSError(
E   pyproj.exceptions.CRSError: Invalid authority or code (EPSG, 1312)

pyproj\_crs.pyx:1154: CRSError
------------------------------------------------------------ Captured stderr call -------------------------------------------------------------
proj_create_from_database: Cannot find proj.db
____________________________________________________ test_coordinate_operation__from_epsg _____________________________________________________

    def test_coordinate_operation__from_epsg():
>       cc = CoordinateOperation.from_epsg(16031)

test\test_crs.py:520:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pyproj\_crs.pyx:1176: in pyproj._crs.CoordinateOperation.from_epsg
    return CoordinateOperation.from_authority(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

>   raise CRSError(
E   pyproj.exceptions.CRSError: Invalid authority or code (EPSG, 16031)

pyproj\_crs.pyx:1154: CRSError
------------------------------------------------------------ Captured stderr call -------------------------------------------------------------
proj_create_from_database: Cannot find proj.db
__________________________________________________ test_coordinate_operation__from_authority __________________________________________________

    def test_coordinate_operation__from_authority():
>       cc = CoordinateOperation.from_authority("EPSG", 16031)

test\test_crs.py:526:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

>   raise CRSError(
E   pyproj.exceptions.CRSError: Invalid authority or code (EPSG, 16031)

pyproj\_crs.pyx:1154: CRSError
------------------------------------------------------------ Captured stderr call -------------------------------------------------------------
proj_create_from_database: Cannot find proj.db
____________________________________________________________ test_datum__from_epsg ____________________________________________________________

    def test_datum__from_epsg():
>       assert Datum.from_epsg("6326").to_wkt() == (
            'DATUM["World Geodetic System 1984",'
            'ELLIPSOID["WGS 84",6378137,298.257223563,'
            'LENGTHUNIT["metre",1]],ID["EPSG",6326]]'
        )

test\test_crs.py:542:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pyproj\_crs.pyx:797: in pyproj._crs.Datum.from_epsg
    return Datum.from_authority("EPSG", code)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

>   raise CRSError(
E   pyproj.exceptions.CRSError: Invalid authority or code (EPSG, 6326)

pyproj\_crs.pyx:777: CRSError
------------------------------------------------------------ Captured stderr call -------------------------------------------------------------
proj_create_from_database: Cannot find proj.db
_________________________________________________________ test_datum__from_authority __________________________________________________________

    def test_datum__from_authority():
>       dt = Datum.from_authority("EPSG", 6326)

test\test_crs.py:550:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

>   raise CRSError(
E   pyproj.exceptions.CRSError: Invalid authority or code (EPSG, 6326)

pyproj\_crs.pyx:777: CRSError
------------------------------------------------------------ Captured stderr call -------------------------------------------------------------
proj_create_from_database: Cannot find proj.db
_______________________________________________________ test_prime_meridian__from_epsg ________________________________________________________

    def test_prime_meridian__from_epsg():
>       assert PrimeMeridian.from_epsg(8903).to_wkt() == (
            'PRIMEM["Paris",2.5969213,ANGLEUNIT["grad",0.0157079632679489],ID["EPSG",8903]]'
        )

test\test_crs.py:565:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pyproj\_crs.pyx:697: in pyproj._crs.PrimeMeridian.from_epsg
    return PrimeMeridian.from_authority("EPSG", code)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

>   raise CRSError(
E   pyproj.exceptions.CRSError: Invalid authority or code (EPSG, 8903)

pyproj\_crs.pyx:677: CRSError
------------------------------------------------------------ Captured stderr call -------------------------------------------------------------
proj_create_from_database: Cannot find proj.db
_____________________________________________________ test_prime_meridian__from_authority _____________________________________________________

    def test_prime_meridian__from_authority():
>       assert PrimeMeridian.from_authority("EPSG", 8903).name == "Paris"

test\test_crs.py:571:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

>   raise CRSError(
E   pyproj.exceptions.CRSError: Invalid authority or code (EPSG, 8903)

pyproj\_crs.pyx:677: CRSError
------------------------------------------------------------ Captured stderr call -------------------------------------------------------------
proj_create_from_database: Cannot find proj.db
__________________________________________________________ test_ellipsoid__from_epsg __________________________________________________________

    def test_ellipsoid__from_epsg():
>       assert Ellipsoid.from_epsg(7030).to_wkt() == (
            'ELLIPSOID["WGS 84",6378137,298.257223563,'
            'LENGTHUNIT["metre",1],ID["EPSG",7030]]'
        )

test\test_crs.py:585:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pyproj\_crs.pyx:545: in pyproj._crs.Ellipsoid.from_epsg
    return Ellipsoid.from_authority("EPSG", code)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

>   raise CRSError(
E   pyproj.exceptions.CRSError: Invalid authority or code (EPSG, 7030)

pyproj\_crs.pyx:525: CRSError
------------------------------------------------------------ Captured stderr call -------------------------------------------------------------
proj_create_from_database: Cannot find proj.db
_______________________________________________________ test_ellipsoid__from_authority ________________________________________________________

    def test_ellipsoid__from_authority():
>       assert Ellipsoid.from_authority("EPSG", 7030).name == "WGS 84"

test\test_crs.py:592:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

>   raise CRSError(
E   pyproj.exceptions.CRSError: Invalid authority or code (EPSG, 7030)

pyproj\_crs.pyx:525: CRSError
------------------------------------------------------------ Captured stderr call -------------------------------------------------------------
proj_create_from_database: Cannot find proj.db
___________________________________________________________ test_datum__from_string ___________________________________________________________

    def test_datum__from_string():
>       dd = Datum.from_string("urn:ogc:def:datum:EPSG::6326")

test\test_crs.py:663:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

>   raise CRSError(
E   pyproj.exceptions.CRSError: Invalid datum string: urn:ogc:def:datum:EPSG::6326

pyproj\_crs.pyx:831: CRSError
------------------------------------------------------------ Captured stderr call -------------------------------------------------------------
proj_create: Cannot find proj.db
proj_create: no database context specified
_________________________________________________________ test_ellipsoid__from_string _________________________________________________________

    def test_ellipsoid__from_string():
>       ee = Ellipsoid.from_string("urn:ogc:def:ellipsoid:EPSG::7001")

test\test_crs.py:675:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

>   raise CRSError(
E   pyproj.exceptions.CRSError: Invalid ellipsoid string: urn:ogc:def:ellipsoid:EPSG::7001

pyproj\_crs.pyx:572: CRSError
------------------------------------------------------------ Captured stderr call -------------------------------------------------------------
proj_create: Cannot find proj.db
proj_create: no database context specified
______________________________________________________ test_prime_meridian__from_string _______________________________________________________

    def test_prime_meridian__from_string():
>       pm = PrimeMeridian.from_string("urn:ogc:def:meridian:EPSG::8901")

test\test_crs.py:687:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

>   raise CRSError(
E   pyproj.exceptions.CRSError: Invalid prime meridian string: urn:ogc:def:meridian:EPSG::8901

pyproj\_crs.pyx:724: CRSError
------------------------------------------------------------ Captured stderr call -------------------------------------------------------------
proj_create: Cannot find proj.db
proj_create: no database context specified
___________________________________________________ test_coordinate_operation__from_string ____________________________________________________

    def test_coordinate_operation__from_string():
>       co = CoordinateOperation.from_string("urn:ogc:def:coordinateOperation:EPSG::1671")

test\test_crs.py:699:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

>   raise CRSError(
E   pyproj.exceptions.CRSError: Invalid coordinate operation string: urn:ogc:def:coordinateOperation:EPSG::1671

pyproj\_crs.pyx:1207: CRSError
------------------------------------------------------------ Captured stderr call -------------------------------------------------------------
proj_create: Cannot find proj.db
proj_create: no database context specified
_________________________________________________________________ test_datum __________________________________________________________________

    def test_datum():
        p1 = Proj(proj="latlong", datum="WGS84")
        s_1 = -111.5
        s_2 = 45.25919444444
        p2 = Proj(proj="utm", zone=10, datum="NAD27")
        x2, y2 = transform(p1, p2, s_1, s_2)
>       assert_almost_equal((x2, y2), (1402291.0833290431, 5076289.591846835))

test\test_datum.py:12:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

x = array([inf, inf]), y = array([1402291.08332904, 5076289.59184683])
func = <function assert_array_compare.<locals>.<lambda> at 0x0000029A5A0C41F8>, hasval = '+inf'

    def func_assert_same_pos(x, y, func=isnan, hasval='nan'):
        """Handling nan/inf.

        Combine results of running func on x and y, checking that they are True
        at the same locations.

        """
        x_id = func(x)
        y_id = func(y)
        # We include work-arounds here to handle three types of slightly
        # pathological ndarray subclasses:
        # (1) all() on `masked` array scalars can return masked arrays, so we
        #     use != True
        # (2) __eq__ on some ndarray subclasses returns Python booleans
        #     instead of element-wise comparisons, so we cast to bool_() and
        #     use isinstance(..., bool) checks
        # (3) subclasses with bare-bones __array_function__ implemenations may
        #     not implement np.all(), so favor using the .all() method
        # We are not committed to supporting such subclasses, but it's nice to
        # support them if possible.
        if bool_(x_id == y_id).all() != True:
            msg = build_err_msg([x, y],
                                err_msg + '\nx and y %s location mismatch:'
                                % (hasval), verbose=verbose, header=header,
                                names=('x', 'y'), precision=precision)
>           raise AssertionError(msg)
E           AssertionError:
E           Arrays are not almost equal to 7 decimals
E
E           x and y +inf location mismatch:
E            x: array([inf, inf])
E            y: array([1402291.083329 , 5076289.5918468])

X:\Python37\lib\site-packages\numpy\testing\_private\utils.py:735: AssertionError
_______________________________________________ test_shift_wgs84_to_gaussb_no_ellisoidal_height _______________________________________________

    def test_shift_wgs84_to_gaussb_no_ellisoidal_height():
        xgb, ygb, zgb = transform(WGS84_PROJ, GAUSSSB_PROJ, WGS84_lon, WGS84_lat, 0)
>       assert_almost_equal((xgb, ygb, zgb), (GB_x, 5055619.899, 0), decimal=2)
E       AssertionError:
E       Arrays are not almost equal to 2 decimals
E
E       Mismatch: 66.7%
E       Max absolute difference: 3559357.16710312
E       Max relative difference: nan
E        x: array([5982704.16, 1758416.88,       0.  ])
E        y: array([2423346.99, 5055619.9 ,       0.  ])

test\test_datum_shift.py:55: AssertionError
_______________________________________________ test_shift_gaussb_to_wgs84_no_ellisoidal_height _______________________________________________

    def test_shift_gaussb_to_wgs84_no_ellisoidal_height():
        back_lon, back_lat, back_z = transform(GAUSSSB_PROJ, WGS84_PROJ, GB_x, GB_y, 0)
        assert_almost_equal(
>           (back_lon, back_lat, back_z), (WGS84_lon, WGS84_lat, 0), decimal=3
        )
E       AssertionError:
E       Arrays are not almost equal to 3 decimals
E
E       Mismatch: 66.7%
E       Max absolute difference: 31.88763397
E       Max relative difference: nan
E        x: array([45.647, 13.76 ,  0.   ])
E        y: array([13.76 , 45.647,  0.   ])

test\test_datum_shift.py:61: AssertionError
________________________________________________________________ test_doctests ________________________________________________________________

    def test_doctests():
        failure_count = pyproj.test()

        # shapely wheels not on windows, so allow failures there
        expected_failure_count = 0
        try:
            import shapely  # noqa
        except ImportError:
            if os.name == "nt" or platform.uname()[4] != "x86_64":
                expected_failure_count = 6

        # if the below line fails, doctests have failed
>       assert (
            failure_count == expected_failure_count
        ), "{0} of the doctests in " "lib/pyproj/__init__.py failed".format(failure_count)
E       AssertionError: 9 of the doctests in lib/pyproj/__init__.py failed
E       assert 9 == 0

test\test_doctest_wrapper.py:23: AssertionError
------------------------------------------------------------ Captured stdout call -------------------------------------------------------------
**********************************************************************
File "pyproj-remove_global_context\pyproj\transformer.py", line 467, in pyproj.transformer.Transformer.itransform
Failed example:
    for pt in transproj.itransform(
        [(-2704026.010, -4253051.810, 3895878.820)],
        radians=True,
    ):
        '{:.3f} {:.3f} {:.3f}'.format(*pt)
Expected:
    '-2.137 0.661 -20.531'
Got:
    '0.661 -2.137 -20.531'
**********************************************************************
File "pyproj-remove_global_context\pyproj\transformer.py", line 478, in pyproj.transformer.Transformer.itransform
Failed example:
    for pt in transprojr.itransform(
        [(-2.137, 0.661, -20.531)],
        radians=True
    ):
        '{:.3f} {:.3f} {:.3f}'.format(*pt)
Expected:
    '-2704214.394 -4254414.478 3894270.731'
Got:
    'inf inf inf'
**********************************************************************
File "pyproj-remove_global_context\pyproj\transformer.py", line 363, in pyproj.transformer.Transformer.transform
Failed example:
    "%.3f %.3f %.3f" % (xpj, ypj, zpj)
Expected:
    '-2.137 0.661 -20.531'
Got:
    '0.661 -2.137 -20.531'
**********************************************************************
File "pyproj-remove_global_context\pyproj\transformer.py", line 637, in pyproj.transformer.transform
Failed example:
    '%9.3f %11.3f' % (x2,y2)
Expected:
    '569722.342 4268814.028'
Got:
    '      inf         inf'
**********************************************************************
File "pyproj-remove_global_context\pyproj\transformer.py", line 639, in pyproj.transformer.transform
Failed example:
    '%8.3f %5.3f' % p2(x2,y2,inverse=True)
Expected:
    ' -92.200 38.567'
Got:
    '1000000000000000019884624838656.000 1000000000000000019884624838656.000'
**********************************************************************
File "pyproj-remove_global_context\pyproj\transformer.py", line 650, in pyproj.transformer.transform
Failed example:
    '%9.3f %9.3f %9.3f %11.3f %11.3f %11.3f' % xy
Expected:
    '567721.149 351747.558 728569.133 4297989.112 4353489.645 4292106.305'
Got:
    '      inf       inf       inf         inf         inf         inf'
**********************************************************************
File "pyproj-remove_global_context\pyproj\transformer.py", line 654, in pyproj.transformer.transform
Failed example:
    '%8.3f %8.3f %8.3f %5.3f %5.3f %5.3f' % xy
Expected:
    ' -92.220  -94.720  -90.370 38.830 39.320 38.750'
Got:
    '1000000000000000019884624838656.000 1000000000000000019884624838656.000 1000000000000000019884624838656.000 1000000000000000019884624838656.000 1000000000000000019884624838656.000 1000000000000000019884624838656.000'
**********************************************************************
File "pyproj-remove_global_context\pyproj\transformer.py", line 661, in pyproj.transformer.transform
Failed example:
    "%s  %s" % (str(x2)[:9],str(y2)[:9])
Expected:
    '1402291.0  5076289.5'
Got:
    'inf  inf'
**********************************************************************
File "pyproj-remove_global_context\pyproj\transformer.py", line 668, in pyproj.transformer.transform
Failed example:
    "%s  %s" % (str(x2)[:9],str(y2)[:9])
Expected:
    '1402291.0  5076289.5'
Got:
    'inf  inf'
**********************************************************************
3 items had failures:
   2 of  13 in pyproj.transformer.Transformer.itransform
   1 of  17 in pyproj.transformer.Transformer.transform
   6 of  32 in pyproj.transformer.transform
***Test Failed*** 9 failures.
_________________________________________________________ test_4d_transform_crs_obs1 __________________________________________________________

    def test_4d_transform_crs_obs1():
>       transformer = Transformer.from_proj(7789, 8401)

test\test_transformer.py:135:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pyproj\transformer.py:242: in from_proj
    area_of_interest=area_of_interest,
pyproj\transformer.py:279: in from_crs
    area_of_interest=area_of_interest,
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

>   raise ProjError("Error creating Transformer from CRS.")
E   pyproj.exceptions.ProjError: Error creating Transformer from CRS.

pyproj\_transformer.pyx:269: ProjError
_____________________________________________________ test_4d_transform_orginal_crs_obs1 ______________________________________________________

    def test_4d_transform_orginal_crs_obs1():
        assert_almost_equal(
>           transform(7789, 8401, x=3496737.2679, y=743254.4507, z=5264462.9620, tt=2019.0),
            (3496737.757717311, 743253.9940103051, 5264462.701132784, 2019.0),
        )

test\test_transformer.py:146:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pyproj\transformer.py:675: in transform
    p1, p2, skip_equivalent=skip_equivalent, always_xy=always_xy
pyproj\transformer.py:242: in from_proj
    area_of_interest=area_of_interest,
pyproj\transformer.py:279: in from_crs
    area_of_interest=area_of_interest,
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

>   raise ProjError("Error creating Transformer from CRS.")
E   pyproj.exceptions.ProjError: Error creating Transformer from CRS.

pyproj\_transformer.pyx:269: ProjError
_____________________________________________________ test_4d_itransform_orginal_crs_obs1 _____________________________________________________

    def test_4d_itransform_orginal_crs_obs1():
        assert_almost_equal(
            list(
>               itransform(7789, 8401, [(3496737.2679, 743254.4507, 5264462.9620, 2019.0)])
            ),
            [(3496737.757717311, 743253.9940103051, 5264462.701132784, 2019.0)],
        )

test\test_transformer.py:203:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pyproj\transformer.py:745: in itransform
    p1, p2, skip_equivalent=skip_equivalent, always_xy=always_xy
pyproj\transformer.py:242: in from_proj
    area_of_interest=area_of_interest,
pyproj\transformer.py:279: in from_crs
    area_of_interest=area_of_interest,
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

>   raise ProjError("Error creating Transformer from CRS.")
E   pyproj.exceptions.ProjError: Error creating Transformer from CRS.

pyproj\_transformer.pyx:269: ProjError
______________________________________________________ test_itransform_time_3rd_invalid _______________________________________________________

    def test_itransform_time_3rd_invalid():

        with pytest.raises(ValueError, match="'time_3rd' is only valid for 3 coordinates."):
            list(
                itransform(
                    7789,
                    8401,
                    [(3496737.2679, 743254.4507, 5264462.9620, 2019.0)],
>                   time_3rd=True,
                )
            )

test\test_transformer.py:226:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pyproj\transformer.py:745: in itransform
    p1, p2, skip_equivalent=skip_equivalent, always_xy=always_xy
pyproj\transformer.py:242: in from_proj
    area_of_interest=area_of_interest,
pyproj\transformer.py:279: in from_crs
    area_of_interest=area_of_interest,
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

>   raise ProjError("Error creating Transformer from CRS.")
E   pyproj.exceptions.ProjError: Error creating Transformer from CRS.

pyproj\_transformer.pyx:269: ProjError
__________________________________________________________________ test_repr __________________________________________________________________

    def test_repr():
>       assert repr(Transformer.from_crs(7789, 8401)) == (
            "<Transformation Transformer: helmert>\n"
            "Description: ITRF2014 to ETRF2014 (1)\n"
            "Area of Use:\n"
            "- name: Europe - ETRS89\n"
            "- bounds: (-16.1, 32.88, 40.18, 84.17)"
        )

test\test_transformer.py:417:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pyproj\transformer.py:279: in from_crs
    area_of_interest=area_of_interest,
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

>   raise ProjError("Error creating Transformer from CRS.")
E   pyproj.exceptions.ProjError: Error creating Transformer from CRS.

pyproj\_transformer.pyx:269: ProjError
_____________________________________________________ test_transformer_group__unavailable _____________________________________________________

    def test_transformer_group__unavailable():
        trans_group = TransformerGroup(4326, 2964)
>       assert len(trans_group.unavailable_operations) == 1
E       assert 0 == 1
E        +  where 0 = len([])
E        +    where [] = <pyproj.transformer.TransformerGroup object at 0x0000029A5A103708>.unavailable_operations

test\test_transformer.py:451: AssertionError
_____________________________________________________ test_transform_group__missing_best ______________________________________________________

    def test_transform_group__missing_best():
        with pytest.warns(DeprecationWarning):
            lat_lon_proj = pyproj.Proj(init="epsg:4326", preserve_units=False)
            alaska_aea_proj = pyproj.Proj(init="epsg:2964", preserve_units=False)

        with pytest.warns(
            UserWarning, match="Best transformation is not available due to missing Grid"
        ):
            trans_group = pyproj.transformer.TransformerGroup(
>               lat_lon_proj.crs, alaska_aea_proj.crs
            )
E           Failed: DID NOT WARN. No warnings of type (<class 'UserWarning'>,) was emitted. The list of emitted warnings is: [].

test\test_transformer.py:469: Failed
___________________________________________________ test_transform_group__area_of_interest ____________________________________________________

    def test_transform_group__area_of_interest():
        with pytest.warns(
            UserWarning, match="Best transformation is not available due to missing Grid"
        ):
            trans_group = TransformerGroup(
>               4326, 2964, area_of_interest=AreaOfInterest(-136.46, 49.0, -60.72, 83.17)
            )
E           Failed: DID NOT WARN. No warnings of type (<class 'UserWarning'>,) was emitted. The list of emitted warnings is: [].

test\test_transformer.py:482: Failed
_____________________________________________________ test_transformer__area_of_interest ______________________________________________________

    def test_transformer__area_of_interest():
        transformer = Transformer.from_crs(
            4326, 2964, area_of_interest=AreaOfInterest(-136.46, 49.0, -60.72, 83.17)
        )
>       assert transformer.description == "Inverse of NAD27 to WGS 84 (13) + Alaska Albers"
E       AssertionError: assert 'Inverse of N...Alaska Albers' == 'Inverse of N...Alaska Albers'
E         - Inverse of NAD27 to WGS 84 (33) + Alaska Albers
E         ?                             ^
E         + Inverse of NAD27 to WGS 84 (13) + Alaska Albers
E         ?                             ^

test\test_transformer.py:494: AssertionError
___________________________________________________ test_transformer_proj__area_of_interest ___________________________________________________

    def test_transformer_proj__area_of_interest():
        transformer = Transformer.from_proj(
            4326, 2964, area_of_interest=AreaOfInterest(-136.46, 49.0, -60.72, 83.17)
        )
>       assert transformer.description == "Inverse of NAD27 to WGS 84 (13) + Alaska Albers"
E       AssertionError: assert 'Inverse of N...Alaska Albers' == 'Inverse of N...Alaska Albers'
E         - Inverse of NAD27 to WGS 84 (33) + Alaska Albers
E         ?                             ^
E         + Inverse of NAD27 to WGS 84 (13) + Alaska Albers
E         ?                             ^

test\test_transformer.py:501: AssertionError
======================================================= 28 failed, 225 passed in 16.36s =======================================================

@snowman2
Copy link
Member Author

snowman2 commented Sep 5, 2019

@cgohlke thanks for running it again! The test failure output is very useful, so thanks for sharing. Sounds like I need to try something different.

@snowman2
Copy link
Member Author

snowman2 commented Sep 6, 2019

It seems like may will have to wait for 6.2.1:

Many of the attempts I have tried have led to dead ends:

Use the context of the parent object:

  • This causes core dumping when the parent object is cleaned up as it cleans up its context
  • For example, the datum derived from CRS will not have core dumping if the parent CRS goes out of existence.

Create temporary context:

  • this is not safe in many instances as the PJ* object often references the context used to create it. So, it causes core dumping if the context is freed too soon.

Use the global (NULL) context for children:

@snowman2 snowman2 force-pushed the remove_global_context branch from 74858af to 503060d Compare September 7, 2019 01:04
@snowman2 snowman2 force-pushed the remove_global_context branch from 503060d to 1bbb0b6 Compare September 7, 2019 01:16
@cgohlke
Copy link
Contributor

cgohlke commented Sep 7, 2019

test\test_crs.py now passes if there is no crash. The other test failures and the occasional crashes remain.

@snowman2
Copy link
Member Author

snowman2 commented Sep 7, 2019

Thanks for running it again. Sounds like a step in the right direction with more adjustments needed. Mind sharing where the crashes occur?

@jorisvandenbossche
Copy link
Contributor

Maybe this has been discussed before, but @cgohlke is there something specific about your environment that might be reproduced on Appveyor? It would be good to cover those failures on traivs (and also easier for @snowman2 to iterate)

@cgohlke
Copy link
Contributor

cgohlke commented Sep 7, 2019

Maybe this has been discussed before, but @cgohlke is there something specific about your environment that might be reproduced on Appveyor?

I think the main difference is that I link to libproj statically. In fact, switching to dynamic linking previously solved some issues. See #403 (comment)

Mind sharing where the crashes occur?

See #403 (comment)

import pyproj;pyproj.CRS.from_epsg(5972).datum is enough to trigger the crash when Heap Verification is on:

 	_crs.cp37-win_amd64.pyd!pj_ctx_get_errno�()	C++
 	_crs.cp37-win_amd64.pyd!pj_free�()	C++
 	_crs.cp37-win_amd64.pyd!proj_destroy�()	C++
>	_crs.cp37-win_amd64.pyd!__pyx_pf_6pyproj_4_crs_4Base_2__dealloc__(__pyx_obj_6pyproj_4_crs_Base * __pyx_v_self=0x000001663f322b88) Line 5274	C
 	_crs.cp37-win_amd64.pyd!__pyx_pw_6pyproj_4_crs_4Base_3__dealloc__(_object * __pyx_v_self=0x000001663f322b88) Line 5241	C
 	_crs.cp37-win_amd64.pyd!__pyx_tp_dealloc_6pyproj_4_crs_Base(_object * o=0x000001663f322b88) Line 22598	C
 	_crs.cp37-win_amd64.pyd!__pyx_tp_dealloc_6pyproj_4_crs_Datum(_object * o=0x000001663f322b88) Line 23063	C
 	python37.dll!_PyEval_EvalFrameDefault(_frame * f=0x0000016638324428, int throwflag=1060033256) Line 1104	C
 	[Inline Frame] python37.dll!PyEval_EvalFrameEx(_frame *) Line 547	C
  5266: 
  5267:     /* "pyproj/_crs.pyx":286
  5268:  *         if self.projobj != NULL:
  5269:  *             proj_destroy(self.projobj)
  5270:  *             self.projobj = NULL             # <<<<<<<<<<<<<<
  5271:  *         if self.context != NULL:
  5272:  *             proj_context_destroy(self.context)
  5273:  */
  5274:     __pyx_v_self->projobj = NULL;
00007FFD78737CFD 48 8B 44 24 50       mov         rax,qword ptr [__pyx_v_self]  
00007FFD78737D02 48 C7 40 10 00 00 00 00 mov         qword ptr [rax+10h],0 

  | Name | Value | Type
-- | -- | -- | --
◢ | __pyx_v_self | 0x000001663f322b88 {ob_base={ob_refcnt=1 ob_type=0x00007ffd78961070 {_crs.cp37-win_amd64.pyd!_typeobject __pyx_type_6pyproj_4_crs_Datum} {...} } ...} | __pyx_obj_6pyproj_4_crs_Base *
  | ◢ ob_base | {ob_refcnt=1 ob_type=0x00007ffd78961070 {_crs.cp37-win_amd64.pyd!_typeobject __pyx_type_6pyproj_4_crs_Datum} {...} } | _object
  | ob_refcnt | 1 | __int64
  | ▶ ob_type | 0x00007ffd78961070 {_crs.cp37-win_amd64.pyd!_typeobject __pyx_type_6pyproj_4_crs_Datum} {ob_base={ob_base=...} ...} | _typeobject *
  | projobj | 0x00000166351a9c60 {...} | PJconsts *
  | context | 0x0000000000000000 <NULL> | projCtx_t *
  | ◢ name | 0x000001663f32f150 {ob_refcnt=1 ob_type=0x00007ffd794c5e50 {python37.dll!_typeobject PyUnicode_Type} {...} } | _object *
  | ob_refcnt | 1 | __int64
  | ▶ ob_type | 0x00007ffd794c5e50 {python37.dll!_typeobject PyUnicode_Type} {ob_base={ob_base={ob_refcnt=93 ob_type=...} ...} ...} | _typeobject *

@snowman2
Copy link
Member Author

snowman2 commented Sep 8, 2019

This part was super helpful:

  5267:     /* "pyproj/_crs.pyx":286
  5268:  *         if self.projobj != NULL:
  5269:  *             proj_destroy(self.projobj)
  5270:  *             self.projobj = NULL             # <<<<<<<<<<<<<<

I removed all instances where I set the variable to NULL after destroying it. Mind trying again @cgohlke?

@cgohlke
Copy link
Contributor

cgohlke commented Sep 8, 2019

This part was super helpful

Actually, this might just be the debugger positioning the cursor after the instruction that crashes. The crash is in proj_destroy(self.projobj), not at self.projobj = NULL

@snowman2
Copy link
Member Author

snowman2 commented Sep 8, 2019

Ha, oh well. Okay, I have another idea I plan to try out later.

@snowman2
Copy link
Member Author

snowman2 commented Sep 9, 2019

Alright, next iteration ready. @cgohlke if you wouldn't mind trying it out, I would appreciate it. Thanks!

@cgohlke
Copy link
Contributor

cgohlke commented Sep 9, 2019

The crashes are gone! Some test failures remain:

============================================================================ test session starts ============================================================================
platform win32 -- Python 3.7.4, pytest-5.1.2, py-1.8.0, pluggy-0.12.0 -- X:\Python37\python.exe
cachedir: .pytest_cache
hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase('pyproj-remove_global_context\\.hypothesis\\examples')
rootdir: pyproj-remove_global_context
plugins: hypothesis-4.35.0, palladium-1.2.2, cov-2.7.1, forked-1.0.2, localserver-0.5.0, pep8-1.0.6, xdist-1.29.0
collected 253 items

test/test_awips221.py::test_awips221 PASSED                                                                                                                            [  0%]
test/test_crs.py::test_from_proj4_json PASSED                                                                                                                          [  0%]
test/test_crs.py::test_from_proj4 PASSED                                                                                                                               [  1%]
test/test_crs.py::test_from_proj4__invalid PASSED                                                                                                                      [  1%]
test/test_crs.py::test_from_epsg PASSED                                                                                                                                [  1%]
test/test_crs.py::test_from_epsg_string PASSED                                                                                                                         [  2%]
test/test_crs.py::test_from_string PASSED                                                                                                                              [  2%]
test/test_crs.py::test_bare_parameters PASSED                                                                                                                          [  3%]
test/test_crs.py::test_is_geographic PASSED                                                                                                                            [  3%]
test/test_crs.py::test_is_projected PASSED                                                                                                                             [  3%]
test/test_crs.py::test_is_same_crs PASSED                                                                                                                              [  4%]
test/test_crs.py::test_to_proj4 PASSED                                                                                                                                 [  4%]
test/test_crs.py::test_empty_json PASSED                                                                                                                               [  5%]
test/test_crs.py::test_has_wkt_property PASSED                                                                                                                         [  5%]
test/test_crs.py::test_to_wkt_pretty PASSED                                                                                                                            [  5%]
test/test_crs.py::test_repr PASSED                                                                                                                                     [  6%]
test/test_crs.py::test_repr__long PASSED                                                                                                                               [  6%]
test/test_crs.py::test_repr_epsg PASSED                                                                                                                                [  7%]
test/test_crs.py::test_repr__undefined PASSED                                                                                                                          [  7%]
test/test_crs.py::test_repr_compound PASSED                                                                                                                            [  7%]
test/test_crs.py::test_dunder_str PASSED                                                                                                                               [  8%]
test/test_crs.py::test_epsg PASSED                                                                                                                                     [  8%]
test/test_crs.py::test_datum PASSED                                                                                                                                    [  9%]
test/test_crs.py::test_datum_horizontal PASSED                                                                                                                         [  9%]
test/test_crs.py::test_datum_unknown PASSED                                                                                                                            [  9%]
test/test_crs.py::test_epsg__not_found PASSED                                                                                                                          [ 10%]
test/test_crs.py::test_epsg__no_code_available PASSED                                                                                                                  [ 10%]
test/test_crs.py::test_crs_OSR_equivalence PASSED                                                                                                                      [ 11%]
test/test_crs.py::test_crs_OSR_no_equivalence PASSED                                                                                                                   [ 11%]
test/test_crs.py::test_init_from_wkt PASSED                                                                                                                            [ 11%]
test/test_crs.py::test_init_from_wkt_invalid PASSED                                                                                                                    [ 12%]
test/test_crs.py::test_from_wkt PASSED                                                                                                                                 [ 12%]
test/test_crs.py::test_from_wkt_invalid PASSED                                                                                                                         [ 13%]
test/test_crs.py::test_from_user_input_epsg PASSED                                                                                                                     [ 13%]
test/test_crs.py::test_from_esri_wkt PASSED                                                                                                                            [ 13%]
test/test_crs.py::test_compound_crs PASSED                                                                                                                             [ 14%]
test/test_crs.py::test_ellipsoid PASSED                                                                                                                                [ 14%]
test/test_crs.py::test_area_of_use PASSED                                                                                                                              [ 15%]
test/test_crs.py::test_from_user_input_custom_crs_class PASSED                                                                                                         [ 15%]
test/test_crs.py::test_non_crs_error PASSED                                                                                                                            [ 15%]
test/test_crs.py::test_sub_crs PASSED                                                                                                                                  [ 16%]
test/test_crs.py::test_sub_crs__none PASSED                                                                                                                            [ 16%]
test/test_crs.py::test_coordinate_system PASSED                                                                                                                        [ 16%]
test/test_crs.py::test_coordinate_system_geog PASSED                                                                                                                   [ 17%]
test/test_crs.py::test_coordinate_operation PASSED                                                                                                                     [ 17%]
test/test_crs.py::test_coordinate_operation_grids PASSED                                                                                                               [ 18%]
test/test_crs.py::test_coordinate_operation_grids__alternative_grid_name PASSED                                                                                        [ 18%]
test/test_crs.py::test_coordinate_operation__missing PASSED                                                                                                            [ 18%]
test/test_crs.py::test_coordinate_operation__from_epsg PASSED                                                                                                          [ 19%]
test/test_crs.py::test_coordinate_operation__from_authority PASSED                                                                                                     [ 19%]
test/test_crs.py::test_coordinate_operation__from_epsg__empty PASSED                                                                                                   [ 20%]
test/test_crs.py::test_coordinate_operation__from_authority__empty PASSED                                                                                              [ 20%]
test/test_crs.py::test_datum__from_epsg PASSED                                                                                                                         [ 20%]
test/test_crs.py::test_datum__from_authority PASSED                                                                                                                    [ 21%]
test/test_crs.py::test_datum__from_epsg__invalid PASSED                                                                                                                [ 21%]
test/test_crs.py::test_datum__from_authority__invalid PASSED                                                                                                           [ 22%]
test/test_crs.py::test_prime_meridian__from_epsg PASSED                                                                                                                [ 22%]
test/test_crs.py::test_prime_meridian__from_authority PASSED                                                                                                           [ 22%]
test/test_crs.py::test_prime_meridian__from_epsg__invalid PASSED                                                                                                       [ 23%]
test/test_crs.py::test_prime_meridian__from_authority__invalid PASSED                                                                                                  [ 23%]
test/test_crs.py::test_ellipsoid__from_epsg PASSED                                                                                                                     [ 24%]
test/test_crs.py::test_ellipsoid__from_authority PASSED                                                                                                                [ 24%]
test/test_crs.py::test_ellipsoid__from_epsg__invalid PASSED                                                                                                            [ 24%]
test/test_crs.py::test_ellipsoid__from_authority__invalid PASSED                                                                                                       [ 25%]
test/test_crs.py::test_bound_crs_is_geographic PASSED                                                                                                                  [ 25%]
test/test_crs.py::test_coordinate_operation_towgs84_three PASSED                                                                                                       [ 26%]
test/test_crs.py::test_coordinate_operation_towgs84_seven PASSED                                                                                                       [ 26%]
test/test_crs.py::test_coordinate_operation_towgs84_missing PASSED                                                                                                     [ 26%]
test/test_crs.py::test_to_wkt_enum PASSED                                                                                                                              [ 27%]
test/test_crs.py::test_to_wkt_enum__invalid PASSED                                                                                                                     [ 27%]
test/test_crs.py::test_to_proj4_enum PASSED                                                                                                                            [ 28%]
test/test_crs.py::test_datum__from_string PASSED                                                                                                                       [ 28%]
test/test_crs.py::test_datum__from_string__invalid PASSED                                                                                                              [ 28%]
test/test_crs.py::test_ellipsoid__from_string PASSED                                                                                                                   [ 29%]
test/test_crs.py::test_ellipsoid__from_string__invalid PASSED                                                                                                          [ 29%]
test/test_crs.py::test_prime_meridian__from_string PASSED                                                                                                              [ 30%]
test/test_crs.py::test_prime_meridian__from_string__invalid PASSED                                                                                                     [ 30%]
test/test_crs.py::test_coordinate_operation__from_string PASSED                                                                                                        [ 30%]
test/test_crs.py::test_coordinate_operation__from_string__invalid PASSED                                                                                               [ 31%]
test/test_crs.py::test_to_proj4_enum__invalid PASSED                                                                                                                   [ 31%]
test/test_crs.py::test_geodetic_crs PASSED                                                                                                                             [ 32%]
test/test_crs.py::test_itrf_init PASSED                                                                                                                                [ 32%]
test/test_crs.py::test_compound_crs_init PASSED                                                                                                                        [ 32%]
test/test_crs.py::test_compound_crs_urn_init PASSED                                                                                                                    [ 33%]
test/test_crs.py::test_from_authority__ignf PASSED                                                                                                                     [ 33%]
test/test_crs.py::test_ignf_authority_repr PASSED                                                                                                                      [ 33%]
test/test_crs.py::test_crs_hash PASSED                                                                                                                                 [ 34%]
test/test_crs.py::test_crs_hash_unequal PASSED                                                                                                                         [ 34%]
test/test_crs.py::test_crs_init_user_input PASSED                                                                                                                      [ 35%]
test/test_crs.py::test_to_string__no_auth PASSED                                                                                                                       [ 35%]
test/test_crs.py::test_to_string__auth PASSED                                                                                                                          [ 35%]
test/test_crs.py::test_srs__no_plus PASSED                                                                                                                             [ 36%]
test/test_crs.py::test_equals_different_type PASSED                                                                                                                    [ 36%]
test/test_crs.py::test_is_exact_same_different_type PASSED                                                                                                             [ 37%]
test/test_crs.py::test_compare_crs_non_crs PASSED                                                                                                                      [ 37%]
test/test_crs.py::test_is_geocentric__bound PASSED                                                                                                                     [ 37%]
test/test_crs.py::test_is_geocentric PASSED                                                                                                                            [ 38%]
test/test_crs.py::test_is_vertical PASSED                                                                                                                              [ 38%]
test/test_crs.py::test_is_engineering PASSED                                                                                                                           [ 39%]
test/test_crs.py::test_source_crs__bound PASSED                                                                                                                        [ 39%]
test/test_crs.py::test_source_crs__missing PASSED                                                                                                                      [ 39%]
test/test_crs.py::test_target_crs__bound PASSED                                                                                                                        [ 40%]
test/test_crs.py::test_target_crs__missing PASSED                                                                                                                      [ 40%]
test/test_crs.py::test_whitepace_between_equals PASSED                                                                                                                 [ 41%]
test/test_crs.py::test_to_dict_no_proj4 PASSED                                                                                                                         [ 41%]
test/test_crs_cf.py::test_to_cf_transverse_mercator PASSED                                                                                                             [ 41%]
test/test_crs_cf.py::test_from_cf_transverse_mercator PASSED                                                                                                           [ 42%]
test/test_crs_cf.py::test_cf_from_latlon PASSED                                                                                                                        [ 42%]
test/test_crs_cf.py::test_cf_from_latlon__named PASSED                                                                                                                 [ 43%]
test/test_crs_cf.py::test_cf_from_utm PASSED                                                                                                                           [ 43%]
test/test_crs_cf.py::test_cf_from_utm__nad83 PASSED                                                                                                                    [ 43%]
test/test_crs_cf.py::test_cf_rotated_latlon PASSED                                                                                                                     [ 44%]
test/test_crs_cf.py::test_cf_rotated_latlon__grid PASSED                                                                                                               [ 44%]
test/test_crs_cf.py::test_cf_lambert_conformal_conic PASSED                                                                                                            [ 45%]
test/test_crs_cf.py::test_cf_lambert_conformal_conic_1sp PASSED                                                                                                        [ 45%]
test/test_crs_cf.py::test_cf_lambert_conformal_conic_2sp PASSED                                                                                                        [ 45%]
test/test_crs_cf.py::test_oblique_mercator PASSED                                                                                                                      [ 46%]
test/test_crs_cf.py::test_cf_from_invalid PASSED                                                                                                                       [ 46%]
test/test_crs_cf.py::test_crs_sweep PASSED                                                                                                                             [ 47%]
test/test_crs_cf.py::test_crs_fixed_angle_axis PASSED                                                                                                                  [ 47%]
test/test_crs_cf.py::test_ob_tran_not_rotated_latlon PASSED                                                                                                            [ 47%]
test/test_datadir.py::test_get_data_dir__missing PASSED                                                                                                                [ 48%]
test/test_datadir.py::test_pyproj_global_context_initialize__datadir_missing PASSED                                                                                    [ 48%]
test/test_datadir.py::test_get_data_dir__from_user PASSED                                                                                                              [ 49%]
test/test_datadir.py::test_get_data_dir__internal PASSED                                                                                                               [ 49%]
test/test_datadir.py::test_get_data_dir__from_env_var PASSED                                                                                                           [ 49%]
test/test_datadir.py::test_get_data_dir__from_env_var__multiple PASSED                                                                                                 [ 50%]
test/test_datadir.py::test_get_data_dir__from_prefix PASSED                                                                                                            [ 50%]
test/test_datadir.py::test_get_data_dir__from_path PASSED                                                                                                              [ 50%]
test/test_datadir.py::test_append_data_dir__internal PASSED                                                                                                            [ 51%]
test/test_datadir.py::test_creating_multiple_crs_without_file_limit PASSED                                                                                             [ 51%]
test/test_datum.py::test_datum FAILED                                                                                                                                  [ 52%]
test/test_datum_shift.py::test_shift_wgs84_to_utm33 PASSED                                                                                                             [ 52%]
test/test_datum_shift.py::test_shift_utm33_to_wgs84 PASSED                                                                                                             [ 52%]
test/test_datum_shift.py::test_shift_wgs84_to_gaussb_no_ellisoidal_height FAILED                                                                                       [ 53%]
test/test_datum_shift.py::test_shift_gaussb_to_wgs84_no_ellisoidal_height FAILED                                                                                       [ 53%]
test/test_doctest_wrapper.py::test_doctests FAILED                                                                                                                     [ 54%]
test/test_exception_logging.py::test_proj_exception PASSED                                                                                                             [ 54%]
test/test_exception_logging.py::test_crs_exception PASSED                                                                                                              [ 54%]
test/test_geod.py::test_geod_inverse_transform PASSED                                                                                                                  [ 55%]
test/test_geod.py::test_geod_cities PASSED                                                                                                                             [ 55%]
test/test_geod.py::test_line_length__single_point PASSED                                                                                                               [ 56%]
test/test_geod.py::test_line_length__radians PASSED                                                                                                                    [ 56%]
test/test_geod.py::test_line_lengths__single_point PASSED                                                                                                              [ 56%]
test/test_geod.py::test_line_lengths__radians PASSED                                                                                                                   [ 57%]
test/test_geod.py::test_polygon_area_perimeter__single_point PASSED                                                                                                    [ 57%]
test/test_geod.py::test_geometry_length__point PASSED                                                                                                                  [ 58%]
test/test_geod.py::test_geometry_length__linestring PASSED                                                                                                             [ 58%]
test/test_geod.py::test_geometry_length__linestring__radians PASSED                                                                                                    [ 58%]
test/test_geod.py::test_geometry_length__linearring PASSED                                                                                                             [ 59%]
test/test_geod.py::test_geometry_length__polygon PASSED                                                                                                                [ 59%]
test/test_geod.py::test_geometry_length__polygon__radians PASSED                                                                                                       [ 60%]
test/test_geod.py::test_geometry_length__multipolygon PASSED                                                                                                           [ 60%]
test/test_geod.py::test_geometry_length__multipolygon__radians PASSED                                                                                                  [ 60%]
test/test_geod.py::test_geometry_length__multilinestring PASSED                                                                                                        [ 61%]
test/test_geod.py::test_geometry_length__multipoint PASSED                                                                                                             [ 61%]
test/test_geod.py::test_geometry_area_perimeter__point PASSED                                                                                                          [ 62%]
test/test_geod.py::test_geometry_area_perimeter__linestring PASSED                                                                                                     [ 62%]
test/test_geod.py::test_geometry_area_perimeter__linestring__radians PASSED                                                                                            [ 62%]
test/test_geod.py::test_geometry_area_perimeter__linearring PASSED                                                                                                     [ 63%]
test/test_geod.py::test_geometry_area_perimeter__polygon PASSED                                                                                                        [ 63%]
test/test_geod.py::test_geometry_area_perimeter__polygon__radians PASSED                                                                                               [ 64%]
test/test_geod.py::test_geometry_area_perimeter__polygon__holes PASSED                                                                                                 [ 64%]
test/test_geod.py::test_geometry_area_perimeter__multipolygon PASSED                                                                                                   [ 64%]
test/test_geod.py::test_geometry_area_perimeter__multipolygon__radians PASSED                                                                                          [ 65%]
test/test_geod.py::test_geometry_area_perimeter__multilinestring PASSED                                                                                                [ 65%]
test/test_geod.py::test_geometry_area_perimeter__multipoint PASSED                                                                                                     [ 66%]
test/test_list.py::test_units_map PASSED                                                                                                                               [ 66%]
test/test_list.py::test_angular_units_map PASSED                                                                                                                       [ 66%]
test/test_list.py::test_get_ellps_map PASSED                                                                                                                           [ 67%]
test/test_list.py::test_get_prime_meridians_map PASSED                                                                                                                 [ 67%]
test/test_list.py::test_get_proj_operations_map PASSED                                                                                                                 [ 67%]
test/test_pickle.py::test_pickle PASSED                                                                                                                                [ 68%]
test/test_proj.py::BasicTest::testInitWithBackupString4 PASSED                                                                                                         [ 68%]
test/test_proj.py::BasicTest::testProjAwips221 PASSED                                                                                                                  [ 69%]
test/test_proj.py::BasicTest::test_from_dict_with_bool PASSED                                                                                                          [ 69%]
test/test_proj.py::InverseHammerTest::test_forward PASSED                                                                                                              [ 69%]
test/test_proj.py::InverseHammerTest::test_inverse PASSED                                                                                                              [ 70%]
test/test_proj.py::TypeError_Transform_Issue8_Test::test_tranform_none_1st_parmeter PASSED                                                                             [ 70%]
test/test_proj.py::TypeError_Transform_Issue8_Test::test_tranform_none_2nd_parmeter PASSED                                                                             [ 71%]
test/test_proj.py::Geod_NoDefs_Issue22_Test::test_geod_nodefs PASSED                                                                                                   [ 71%]
test/test_proj.py::ProjLatLongTypeErrorTest::test_latlong_typeerror PASSED                                                                                             [ 71%]
test/test_proj.py::ForwardInverseTest::test_fwd_inv PASSED                                                                                                             [ 72%]
test/test_proj.py::GeodSharedMemoryBugTestIssue64::test_distances PASSED                                                                                               [ 72%]
test/test_proj.py::GeodSharedMemoryBugTestIssue64::test_not_shared_memory PASSED                                                                                       [ 73%]
test/test_proj.py::ReprTests::test_ellps_name_round_trip PASSED                                                                                                        [ 73%]
test/test_proj.py::ReprTests::test_repr PASSED                                                                                                                         [ 73%]
test/test_proj.py::ReprTests::test_sphere PASSED                                                                                                                       [ 74%]
test/test_proj.py::TestRadians::test_fwd_radians PASSED                                                                                                                [ 74%]
test/test_proj.py::TestRadians::test_inv_radians PASSED                                                                                                                [ 75%]
test/test_proj.py::TestRadians::test_npts_radians PASSED                                                                                                               [ 75%]
test/test_proj.py::Geod_NaN_Issue112_Test::test_geod_nans PASSED                                                                                                       [ 75%]
test/test_proj.py::test_proj_equals PASSED                                                                                                                             [ 76%]
test/test_proj.py::test_initialize_proj_crs_no_proj4 PASSED                                                                                                            [ 76%]
test/test_proj.py::test_initialize_proj_crs_no_plus PASSED                                                                                                             [ 77%]
test/test_proj.py::test_equals_different_type PASSED                                                                                                                   [ 77%]
test/test_proj.py::test_is_exact_same_different_type PASSED                                                                                                            [ 77%]
test/test_proj.py::test_reset_errno PASSED                                                                                                                             [ 78%]
test/test_show_versions.py::test_get_sys_info PASSED                                                                                                                   [ 78%]
test/test_show_versions.py::test_get_deps_info PASSED                                                                                                                  [ 79%]
test/test_show_versions.py::test_show_versions_with_proj PASSED                                                                                                        [ 79%]
test/test_transform.py::test_transform PASSED                                                                                                                          [ 79%]
test/test_transformer.py::test_tranform_wgs84_to_custom PASSED                                                                                                         [ 80%]
test/test_transformer.py::test_transform_wgs84_to_alaska PASSED                                                                                                        [ 80%]
test/test_transformer.py::test_illegal_transformation PASSED                                                                                                           [ 81%]
test/test_transformer.py::test_lambert_conformal_transform PASSED                                                                                                      [ 81%]
test/test_transformer.py::test_equivalent_crs PASSED                                                                                                                   [ 81%]
test/test_transformer.py::test_equivalent_crs__disabled PASSED                                                                                                         [ 82%]
test/test_transformer.py::test_equivalent_crs__different PASSED                                                                                                        [ 82%]
test/test_transformer.py::test_equivalent_proj PASSED                                                                                                                  [ 83%]
test/test_transformer.py::test_equivalent_proj__disabled PASSED                                                                                                        [ 83%]
test/test_transformer.py::test_equivalent_proj__different PASSED                                                                                                       [ 83%]
test/test_transformer.py::test_equivalent_pipeline PASSED                                                                                                              [ 84%]
test/test_transformer.py::test_4d_transform PASSED                                                                                                                     [ 84%]
test/test_transformer.py::test_2d_with_time_transform PASSED                                                                                                           [ 84%]
test/test_transformer.py::test_4d_transform_crs_obs1 FAILED                                                                                                            [ 85%]
test/test_transformer.py::test_4d_transform_orginal_crs_obs1 FAILED                                                                                                    [ 85%]
test/test_transformer.py::test_4d_transform_crs_obs2 PASSED                                                                                                            [ 86%]
test/test_transformer.py::test_2d_with_time_transform_crs_obs2 PASSED                                                                                                  [ 86%]
test/test_transformer.py::test_2d_with_time_transform_original_crs_obs2 PASSED                                                                                         [ 86%]
test/test_transformer.py::test_4d_itransform PASSED                                                                                                                    [ 87%]
test/test_transformer.py::test_3d_time_itransform PASSED                                                                                                               [ 87%]
test/test_transformer.py::test_4d_itransform_orginal_crs_obs1 FAILED                                                                                                   [ 88%]
test/test_transformer.py::test_2d_with_time_itransform_original_crs_obs2 PASSED                                                                                        [ 88%]
test/test_transformer.py::test_itransform_time_3rd_invalid FAILED                                                                                                      [ 88%]
test/test_transformer.py::test_transform_no_error PASSED                                                                                                               [ 89%]
test/test_transformer.py::test_itransform_no_error PASSED                                                                                                              [ 89%]
test/test_transformer.py::test_transform_no_exception PASSED                                                                                                           [ 90%]
test/test_transformer.py::test_transform__out_of_bounds PASSED                                                                                                         [ 90%]
test/test_transformer.py::test_transform_radians PASSED                                                                                                                [ 90%]
test/test_transformer.py::test_itransform_radians PASSED                                                                                                               [ 91%]
test/test_transformer.py::test_4d_transform__inverse PASSED                                                                                                            [ 91%]
test/test_transformer.py::test_transform_direction PASSED                                                                                                              [ 92%]
test/test_transformer.py::test_always_xy__transformer PASSED                                                                                                           [ 92%]
test/test_transformer.py::test_always_xy__transform PASSED                                                                                                             [ 92%]
test/test_transformer.py::test_always_xy__itransform PASSED                                                                                                            [ 93%]
test/test_transformer.py::test_transform_direction__string PASSED                                                                                                      [ 93%]
test/test_transformer.py::test_transform_direction__string_lowercase PASSED                                                                                            [ 94%]
test/test_transformer.py::test_transform_direction__invalid PASSED                                                                                                     [ 94%]
test/test_transformer.py::test_from_pipeline__non_transform_input PASSED                                                                                               [ 94%]
test/test_transformer.py::test_non_supported_initialization PASSED                                                                                                     [ 95%]
test/test_transformer.py::test_pj_info_properties PASSED                                                                                                               [ 95%]
test/test_transformer.py::test_to_wkt PASSED                                                                                                                           [ 96%]
test/test_transformer.py::test_str PASSED                                                                                                                              [ 96%]
test/test_transformer.py::test_repr FAILED                                                                                                                             [ 96%]
test/test_transformer.py::test_transformer_group PASSED                                                                                                                [ 97%]
test/test_transformer.py::test_transformer_group__unavailable FAILED                                                                                                   [ 97%]
test/test_transformer.py::test_transform_group__missing_best FAILED                                                                                                    [ 98%]
test/test_transformer.py::test_transform_group__area_of_interest FAILED                                                                                                [ 98%]
test/test_transformer.py::test_transformer__area_of_interest FAILED                                                                                                    [ 98%]
test/test_transformer.py::test_transformer_proj__area_of_interest FAILED                                                                                               [ 99%]
test/test_transformer.py::test_transformer__area_of_interest__invalid PASSED                                                                                           [ 99%]
test/test_transformer.py::test_transformer_group__area_of_interest__invalid PASSED                                                                                     [100%]

================================================================================= FAILURES ==================================================================================
________________________________________________________________________________ test_datum _________________________________________________________________________________

    def test_datum():
        p1 = Proj(proj="latlong", datum="WGS84")
        s_1 = -111.5
        s_2 = 45.25919444444
        p2 = Proj(proj="utm", zone=10, datum="NAD27")
        x2, y2 = transform(p1, p2, s_1, s_2)
>       assert_almost_equal((x2, y2), (1402291.0833290431, 5076289.591846835))

test\test_datum.py:12:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

x = array([inf, inf]), y = array([1402291.08332904, 5076289.59184683]), func = <function assert_array_compare.<locals>.<lambda> at 0x00000160E1684048>, hasval = '+inf'

    def func_assert_same_pos(x, y, func=isnan, hasval='nan'):
        """Handling nan/inf.

        Combine results of running func on x and y, checking that they are True
        at the same locations.

        """
        x_id = func(x)
        y_id = func(y)
        # We include work-arounds here to handle three types of slightly
        # pathological ndarray subclasses:
        # (1) all() on `masked` array scalars can return masked arrays, so we
        #     use != True
        # (2) __eq__ on some ndarray subclasses returns Python booleans
        #     instead of element-wise comparisons, so we cast to bool_() and
        #     use isinstance(..., bool) checks
        # (3) subclasses with bare-bones __array_function__ implemenations may
        #     not implement np.all(), so favor using the .all() method
        # We are not committed to supporting such subclasses, but it's nice to
        # support them if possible.
        if bool_(x_id == y_id).all() != True:
            msg = build_err_msg([x, y],
                                err_msg + '\nx and y %s location mismatch:'
                                % (hasval), verbose=verbose, header=header,
                                names=('x', 'y'), precision=precision)
>           raise AssertionError(msg)
E           AssertionError:
E           Arrays are not almost equal to 7 decimals
E
E           x and y +inf location mismatch:
E            x: array([inf, inf])
E            y: array([1402291.083329 , 5076289.5918468])

X:\Python37\lib\site-packages\numpy\testing\_private\utils.py:735: AssertionError
______________________________________________________________ test_shift_wgs84_to_gaussb_no_ellisoidal_height ______________________________________________________________

    def test_shift_wgs84_to_gaussb_no_ellisoidal_height():
        xgb, ygb, zgb = transform(WGS84_PROJ, GAUSSSB_PROJ, WGS84_lon, WGS84_lat, 0)
>       assert_almost_equal((xgb, ygb, zgb), (GB_x, 5055619.899, 0), decimal=2)
E       AssertionError:
E       Arrays are not almost equal to 2 decimals
E
E       Mismatch: 66.7%
E       Max absolute difference: 3559357.16710312
E       Max relative difference: nan
E        x: array([5982704.16, 1758416.88,       0.  ])
E        y: array([2423346.99, 5055619.9 ,       0.  ])

test\test_datum_shift.py:55: AssertionError
______________________________________________________________ test_shift_gaussb_to_wgs84_no_ellisoidal_height ______________________________________________________________

    def test_shift_gaussb_to_wgs84_no_ellisoidal_height():
        back_lon, back_lat, back_z = transform(GAUSSSB_PROJ, WGS84_PROJ, GB_x, GB_y, 0)
        assert_almost_equal(
>           (back_lon, back_lat, back_z), (WGS84_lon, WGS84_lat, 0), decimal=3
        )
E       AssertionError:
E       Arrays are not almost equal to 3 decimals
E
E       Mismatch: 66.7%
E       Max absolute difference: 31.88763397
E       Max relative difference: nan
E        x: array([45.647, 13.76 ,  0.   ])
E        y: array([13.76 , 45.647,  0.   ])

test\test_datum_shift.py:61: AssertionError
_______________________________________________________________________________ test_doctests _______________________________________________________________________________

    def test_doctests():
        failure_count = pyproj.test()

        # shapely wheels not on windows, so allow failures there
        expected_failure_count = 0
        try:
            import shapely  # noqa
        except ImportError:
            if os.name == "nt" or platform.uname()[4] != "x86_64":
                expected_failure_count = 6

        # if the below line fails, doctests have failed
>       assert (
            failure_count == expected_failure_count
        ), "{0} of the doctests in " "lib/pyproj/__init__.py failed".format(failure_count)
E       AssertionError: 9 of the doctests in lib/pyproj/__init__.py failed
E       assert 9 == 0
E         -9
E         +0

test\test_doctest_wrapper.py:23: AssertionError
--------------------------------------------------------------------------- Captured stdout call ----------------------------------------------------------------------------
Trying:
    from pyproj import Proj
Expecting nothing
ok
Trying:
    p = Proj(proj='utm',zone=10,ellps='WGS84', preserve_units=False)
Expecting nothing
ok
Trying:
    x,y = p(-120.108, 34.36116666)
Expecting nothing
ok
Trying:
    'x=%9.3f y=%11.3f' % (x,y)
Expecting:
    'x=765975.641 y=3805993.134'
ok
Trying:
    'lon=%8.3f lat=%5.3f' % p(x,y,inverse=True)
Expecting:
    'lon=-120.108 lat=34.361'
ok
Trying:
    lons = (-119.72,-118.40,-122.38)
Expecting nothing
ok
Trying:
    lats = (36.77, 33.93, 37.62 )
Expecting nothing
ok
Trying:
    x,y = p(lons, lats)
Expecting nothing
ok
Trying:
    'x: %9.3f %9.3f %9.3f' % x
Expecting:
    'x: 792763.863 925321.537 554714.301'
ok
Trying:
    'y: %9.3f %9.3f %9.3f' % y
Expecting:
    'y: 4074377.617 3763936.941 4163835.303'
ok
Trying:
    lons, lats = p(x, y, inverse=True) # inverse transform
Expecting nothing
ok
Trying:
    'lons: %8.3f %8.3f %8.3f' % lons
Expecting:
    'lons: -119.720 -118.400 -122.380'
ok
Trying:
    'lats: %8.3f %8.3f %8.3f' % lats
Expecting:
    'lats:   36.770   33.930   37.620'
ok
Trying:
    p2 = Proj('+proj=utm +zone=10 +ellps=WGS84', preserve_units=False)
Expecting nothing
ok
Trying:
    x,y = p2(-120.108, 34.36116666)
Expecting nothing
ok
Trying:
    'x=%9.3f y=%11.3f' % (x,y)
Expecting:
    'x=765975.641 y=3805993.134'
ok
Trying:
    p = Proj("epsg:32667", preserve_units=False)
Expecting nothing
ok
Trying:
    'x=%12.3f y=%12.3f (meters)' % p(-114.057222, 51.045)
Expecting:
    'x=-1783506.250 y= 6193827.033 (meters)'
ok
Trying:
    p = Proj("epsg:32667")
Expecting nothing
ok
Trying:
    'x=%12.3f y=%12.3f (feet)' % p(-114.057222, 51.045)
Expecting:
    'x=-5851386.754 y=20320914.191 (feet)'
ok
Trying:
    p1 = Proj("epsg:4214")
Expecting nothing
ok
Trying:
    x1, y1 = p1(116.366, 39.867)
Expecting nothing
ok
Trying:
    '{:.3f} {:.3f}'.format(x1, y1)
Expecting:
    '116.366 39.867'
ok
Trying:
    x2, y2 = p1(x1, y1, inverse=True)
Expecting nothing
ok
Trying:
    '{:.3f} {:.3f}'.format(x2, y2)
Expecting:
    '116.366 39.867'
ok
Trying:
    Proj("epsg:4326").definition_string()
Expecting:
    'proj=longlat datum=WGS84 no_defs ellps=WGS84 towgs84=0,0,0'
ok
8 items had no tests:
    pyproj.proj
    pyproj.proj.Proj
    pyproj.proj.Proj.__call__
    pyproj.proj.Proj.__eq__
    pyproj.proj.Proj.__reduce__
    pyproj.proj.Proj.__repr__
    pyproj.proj.Proj.to_latlong
    pyproj.proj.Proj.to_latlong_def
2 items passed all tests:
  25 tests in pyproj.proj.Proj.__init__
   1 tests in pyproj.proj.Proj.definition_string
26 tests in 10 items.
26 passed and 0 failed.
Test passed.
Trying:
    from pyproj import CRS
Expecting nothing
ok
Trying:
    crs_utm = CRS.from_user_input(26915)
Expecting nothing
ok
Trying:
    crs_utm
Expecting:
    <Projected CRS: EPSG:26915>
    Name: NAD83 / UTM zone 15N
    Axis Info [cartesian]:
    - E[east]: Easting (metre)
    - N[north]: Northing (metre)
    Area of Use:
    - name: North America - 96°W to 90°W and NAD83 by country
    - bounds: (-96.0, 25.61, -90.0, 84.0)
    Coordinate Operation:
    - name: UTM zone 15N
    - method: Transverse Mercator
    Datum: North American Datum 1983
    - Ellipsoid: GRS 1980
    - Prime Meridian: Greenwich
    <BLANKLINE>
ok
Trying:
    crs_utm.area_of_use.bounds
Expecting:
    (-96.0, 25.61, -90.0, 84.0)
ok
Trying:
    crs_utm.ellipsoid
Expecting:
    ELLIPSOID["GRS 1980",6378137,298.257222101,
        LENGTHUNIT["metre",1],
        ID["EPSG",7019]]
ok
Trying:
    crs_utm.ellipsoid.inverse_flattening
Expecting:
    298.257222101
ok
Trying:
    crs_utm.ellipsoid.semi_major_metre
Expecting:
    6378137.0
ok
Trying:
    crs_utm.ellipsoid.semi_minor_metre
Expecting:
    6356752.314140356
ok
Trying:
    crs_utm.prime_meridian
Expecting:
    PRIMEM["Greenwich",0,
        ANGLEUNIT["degree",0.0174532925199433],
        ID["EPSG",8901]]
ok
Trying:
    crs_utm.prime_meridian.unit_name
Expecting:
    'degree'
ok
Trying:
    crs_utm.prime_meridian.unit_conversion_factor
Expecting:
    0.017453292519943295
ok
Trying:
    crs_utm.prime_meridian.longitude
Expecting:
    0.0
ok
Trying:
    crs_utm.datum
Expecting:
    DATUM["North American Datum 1983",
        ELLIPSOID["GRS 1980",6378137,298.257222101,
            LENGTHUNIT["metre",1]],
        ID["EPSG",6269]]
ok
Trying:
    crs_utm.coordinate_system
Expecting:
    CS[Cartesian,2],
        AXIS["(E)",east,
            ORDER[1],
            LENGTHUNIT["metre",1,
                ID["EPSG",9001]]],
        AXIS["(N)",north,
            ORDER[2],
            LENGTHUNIT["metre",1,
                ID["EPSG",9001]]]
ok
Trying:
    crs_utm.coordinate_operation
Expecting:
    CONVERSION["UTM zone 15N",
        METHOD["Transverse Mercator",
            ID["EPSG",9807]],
        PARAMETER["Latitude of natural origin",0,
            ANGLEUNIT["degree",0.0174532925199433],
            ID["EPSG",8801]],
        PARAMETER["Longitude of natural origin",-93,
            ANGLEUNIT["degree",0.0174532925199433],
            ID["EPSG",8802]],
        PARAMETER["Scale factor at natural origin",0.9996,
            SCALEUNIT["unity",1],
            ID["EPSG",8805]],
        PARAMETER["False easting",500000,
            LENGTHUNIT["metre",1],
            ID["EPSG",8806]],
        PARAMETER["False northing",0,
            LENGTHUNIT["metre",1],
            ID["EPSG",8807]],
        ID["EPSG",16015]]
ok
Trying:
    crs = CRS(proj='utm', zone=10, ellps='WGS84')
Expecting nothing
ok
Trying:
    crs.to_proj4()
Expecting:
    '+proj=utm +zone=10 +ellps=WGS84 +units=m +no_defs +type=crs'
ok
Trying:
    print(crs.to_wkt(pretty=True))
Expecting:
    PROJCRS["unknown",
        BASEGEOGCRS["unknown",
            DATUM["Unknown based on WGS84 ellipsoid",
                ELLIPSOID["WGS 84",6378137,298.257223563,
                    LENGTHUNIT["metre",1],
                    ID["EPSG",7030]]],
            PRIMEM["Greenwich",0,
                ANGLEUNIT["degree",0.0174532925199433],
                ID["EPSG",8901]]],
        CONVERSION["UTM zone 10N",
            METHOD["Transverse Mercator",
                ID["EPSG",9807]],
            PARAMETER["Latitude of natural origin",0,
                ANGLEUNIT["degree",0.0174532925199433],
                ID["EPSG",8801]],
            PARAMETER["Longitude of natural origin",-123,
                ANGLEUNIT["degree",0.0174532925199433],
                ID["EPSG",8802]],
            PARAMETER["Scale factor at natural origin",0.9996,
                SCALEUNIT["unity",1],
                ID["EPSG",8805]],
            PARAMETER["False easting",500000,
                LENGTHUNIT["metre",1],
                ID["EPSG",8806]],
            PARAMETER["False northing",0,
                LENGTHUNIT["metre",1],
                ID["EPSG",8807]],
            ID["EPSG",16010]],
        CS[Cartesian,2],
            AXIS["(E)",east,
                ORDER[1],
                LENGTHUNIT["metre",1,
                    ID["EPSG",9001]]],
            AXIS["(N)",north,
                ORDER[2],
                LENGTHUNIT["metre",1,
                    ID["EPSG",9001]]]]
ok
Trying:
    geod = crs.get_geod()
Expecting nothing
ok
Trying:
    "+a={:.0f} +f={:.8f}".format(geod.a, geod.f)
Expecting:
    '+a=6378137 +f=0.00335281'
ok
Trying:
    crs.is_projected
Expecting:
    True
ok
Trying:
    crs.is_geographic
Expecting:
    False
ok
23 items had no tests:
    pyproj.crs
    pyproj.crs.CRS
    pyproj.crs.CRS.__eq__
    pyproj.crs.CRS.__hash__
    pyproj.crs.CRS.__reduce__
    pyproj.crs.CRS.__repr__
    pyproj.crs.CRS.__str__
    pyproj.crs.CRS.from_authority
    pyproj.crs.CRS.from_cf
    pyproj.crs.CRS.from_dict
    pyproj.crs.CRS.from_epsg
    pyproj.crs.CRS.from_proj4
    pyproj.crs.CRS.from_string
    pyproj.crs.CRS.from_user_input
    pyproj.crs.CRS.from_wkt
    pyproj.crs.CRS.get_geod
    pyproj.crs.CRS.to_cf
    pyproj.crs.CRS.to_dict
    pyproj.crs.CRS.to_string
    pyproj.crs._prepare_from_authority
    pyproj.crs._prepare_from_dict
    pyproj.crs._prepare_from_epsg
    pyproj.crs._prepare_from_string
1 items passed all tests:
  22 tests in pyproj.crs.CRS.__init__
22 tests in 24 items.
22 passed and 0 failed.
Test passed.
Trying:
    from pyproj import Geod
Expecting nothing
ok
Trying:
    gclrk1 = Geod(ellps='clrk66')
Expecting nothing
ok
Trying:
    gclrk2 = Geod(a=6378206.4, b=6356583.8)
Expecting nothing
ok
Trying:
    gclrk1 == gclrk2
Expecting:
    True
ok
Trying:
    gwgs66 = Geod('+ellps=WGS66')
Expecting nothing
ok
Trying:
    gnwl9d = Geod('+ellps=NWL9D')
Expecting nothing
ok
Trying:
    gnwl9d == gwgs66
Expecting:
    True
ok
Trying:
    gclrk1 != gnwl9d  # Clarke 1866 is unlike NWL9D
Expecting:
    True
ok
Trying:
    from pyproj import Geod
Expecting nothing
ok
Trying:
    g = Geod(ellps='clrk66') # Use Clarke 1866 ellipsoid.
Expecting nothing
ok
Trying:
    boston_lat = 42.+(15./60.); boston_lon = -71.-(7./60.)
Expecting nothing
ok
Trying:
    portland_lat = 45.+(31./60.); portland_lon = -123.-(41./60.)
Expecting nothing
ok
Trying:
    newyork_lat = 40.+(47./60.); newyork_lon = -73.-(58./60.)
Expecting nothing
ok
Trying:
    london_lat = 51.+(32./60.); london_lon = -(5./60.)
Expecting nothing
ok
Trying:
    az12,az21,dist = g.inv(boston_lon,boston_lat,portland_lon,portland_lat)
Expecting nothing
ok
Trying:
    "%7.3f %6.3f %12.3f" % (az12,az21,dist)
Expecting:
    '-66.531 75.654  4164192.708'
ok
Trying:
    endlon, endlat, backaz = g.fwd(boston_lon, boston_lat, az12, dist)
Expecting nothing
ok
Trying:
    "%6.3f  %6.3f %13.3f" % (endlat,endlon,backaz)
Expecting:
    '45.517  -123.683        75.654'
ok
Trying:
    lons1 = 3*[newyork_lon]; lats1 = 3*[newyork_lat]
Expecting nothing
ok
Trying:
    lons2 = [boston_lon, portland_lon, london_lon]
Expecting nothing
ok
Trying:
    lats2 = [boston_lat, portland_lat, london_lat]
Expecting nothing
ok
Trying:
    az12,az21,dist = g.inv(lons1,lats1,lons2,lats2)
Expecting nothing
ok
Trying:
    for faz, baz, d in list(zip(az12,az21,dist)):
        "%7.3f %7.3f %9.3f" % (faz, baz, d)
Expecting:
    ' 54.663 -123.448 288303.720'
    '-65.463  79.342 4013037.318'
    ' 51.254 -71.576 5579916.651'
ok
Trying:
    g2 = Geod('+ellps=clrk66') # use proj4 style initialization string
Expecting nothing
ok
Trying:
    az12,az21,dist = g2.inv(boston_lon,boston_lat,portland_lon,portland_lat)
Expecting nothing
ok
Trying:
    "%7.3f %6.3f %12.3f" % (az12,az21,dist)
Expecting:
    '-66.531 75.654  4164192.708'
ok
Trying:
    from pyproj import Geod
Expecting nothing
ok
Trying:
    from shapely.geometry import LineString, Point, Polygon
Expecting nothing
ok
Trying:
    geod = Geod(ellps="WGS84")
Expecting nothing
ok
Trying:
    poly_area, poly_perimeter = geod.geometry_area_perimeter(
        Polygon(
            LineString([
                Point(1, 1), Point(1, 10), Point(10, 10), Point(10, 1)
            ]),
            holes=[LineString([Point(1, 2), Point(3, 4), Point(5, 2)])],
        )
    )
Expecting nothing
ok
Trying:
    "{:.3f} {:.3f}".format(poly_area, poly_perimeter)
Expecting:
    '-944373881400.339 3979008.036'
ok
Trying:
    from pyproj import Geod
Expecting nothing
ok
Trying:
    from shapely.geometry import Point, LineString
Expecting nothing
ok
Trying:
    line_string = LineString([Point(1, 2), Point(3, 4)])
Expecting nothing
ok
Trying:
    geod = Geod(ellps="WGS84")
Expecting nothing
ok
Trying:
    "{:.3f}".format(geod.geometry_length(line_string))
Expecting:
    '313588.397'
ok
Trying:
    from pyproj import Geod
Expecting nothing
ok
Trying:
    geod = Geod('+a=6378137 +f=0.0033528106647475126')
Expecting nothing
ok
Trying:
    lats = [-72.9, -71.9, -74.9, -74.3, -77.5, -77.4, -71.7, -65.9, -65.7,
            -66.6, -66.9, -69.8, -70.0, -71.0, -77.3, -77.9, -74.7]
Expecting nothing
ok
Trying:
    lons = [-74, -102, -102, -131, -163, 163, 172, 140, 113,
            88, 59, 25, -4, -14, -33, -46, -61]
Expecting nothing
ok
Trying:
    total_length = geod.line_length(lons, lats)
Expecting nothing
ok
Trying:
    "{:.3f}".format(total_length)
Expecting:
    '14259605.611'
ok
Trying:
    from pyproj import Geod
Expecting nothing
ok
Trying:
    geod = Geod(ellps="WGS84")
Expecting nothing
ok
Trying:
    lats = [-72.9, -71.9, -74.9]
Expecting nothing
ok
Trying:
    lons = [-74, -102, -102]
Expecting nothing
ok
Trying:
    for line_length in geod.line_lengths(lons, lats):
        "{:.3f}".format(line_length)
Expecting:
    '943065.744'
    '334805.010'
ok
Trying:
    from pyproj import Geod
Expecting nothing
ok
Trying:
    g = Geod(ellps='clrk66') # Use Clarke 1866 ellipsoid.
Expecting nothing
ok
Trying:
    boston_lat = 42.+(15./60.); boston_lon = -71.-(7./60.)
Expecting nothing
ok
Trying:
    portland_lat = 45.+(31./60.); portland_lon = -123.-(41./60.)
Expecting nothing
ok
Trying:
    lonlats = g.npts(boston_lon,boston_lat,portland_lon,portland_lat,10)
Expecting nothing
ok
Trying:
    for lon,lat in lonlats: '%6.3f  %7.3f' % (lat, lon)
Expecting:
    '43.528  -75.414'
    '44.637  -79.883'
    '45.565  -84.512'
    '46.299  -89.279'
    '46.830  -94.156'
    '47.149  -99.112'
    '47.251  -104.106'
    '47.136  -109.100'
    '46.805  -114.051'
    '46.262  -118.924'
ok
Trying:
    import math
Expecting nothing
ok
Trying:
    dg2rad = math.radians(1.)
Expecting nothing
ok
Trying:
    rad2dg = math.degrees(1.)
Expecting nothing
ok
Trying:
    lonlats = g.npts(
       dg2rad*boston_lon,
       dg2rad*boston_lat,
       dg2rad*portland_lon,
       dg2rad*portland_lat,
       10,
       radians=True
    )
Expecting nothing
ok
Trying:
    for lon,lat in lonlats: '%6.3f  %7.3f' % (rad2dg*lat, rad2dg*lon)
Expecting:
    '43.528  -75.414'
    '44.637  -79.883'
    '45.565  -84.512'
    '46.299  -89.279'
    '46.830  -94.156'
    '47.149  -99.112'
    '47.251  -104.106'
    '47.136  -109.100'
    '46.805  -114.051'
    '46.262  -118.924'
ok
Trying:
    from pyproj import Geod
Expecting nothing
ok
Trying:
    geod = Geod('+a=6378137 +f=0.0033528106647475126')
Expecting nothing
ok
Trying:
    lats = [-72.9, -71.9, -74.9, -74.3, -77.5, -77.4, -71.7, -65.9, -65.7,
            -66.6, -66.9, -69.8, -70.0, -71.0, -77.3, -77.9, -74.7]
Expecting nothing
ok
Trying:
    lons = [-74, -102, -102, -131, -163, 163, 172, 140, 113,
            88, 59, 25, -4, -14, -33, -46, -61]
Expecting nothing
ok
Trying:
    poly_area, poly_perimeter = geod.polygon_area_perimeter(lons, lats)
Expecting nothing
ok
Trying:
    "{:.1f} {:.1f}".format(poly_area, poly_perimeter)
Expecting:
    '13376856682207.4 14710425.4'
ok
5 items had no tests:
    pyproj.geod
    pyproj.geod.Geod
    pyproj.geod.Geod.__repr__
    pyproj.geod.Geod.fwd
    pyproj.geod.Geod.inv
8 items passed all tests:
   8 tests in pyproj.geod.Geod.__eq__
  18 tests in pyproj.geod.Geod.__init__
   5 tests in pyproj.geod.Geod.geometry_area_perimeter
   5 tests in pyproj.geod.Geod.geometry_length
   6 tests in pyproj.geod.Geod.line_length
   5 tests in pyproj.geod.Geod.line_lengths
  11 tests in pyproj.geod.Geod.npts
   6 tests in pyproj.geod.Geod.polygon_area_perimeter
64 tests in 13 items.
64 passed and 0 failed.
Test passed.
Trying:
    from pyproj import Transformer
Expecting nothing
ok
Trying:
    transformer = Transformer.from_crs(4326, 2100)
Expecting nothing
ok
Trying:
    points = [(22.95, 40.63), (22.81, 40.53), (23.51, 40.86)]
Expecting nothing
ok
Trying:
    for pt in transformer.itransform(points): '{:.3f} {:.3f}'.format(*pt)
Expecting:
    '2221638.801 2637034.372'
    '2212924.125 2619851.898'
    '2238294.779 2703763.736'
ok
Trying:
    pipeline_str = (
        "+proj=pipeline +step +proj=longlat +ellps=WGS84 "
        "+step +proj=unitconvert +xy_in=rad +xy_out=deg"
    )
Expecting nothing
ok
Trying:
    pipe_trans = Transformer.from_pipeline(pipeline_str)
Expecting nothing
ok
Trying:
    for pt in pipe_trans.itransform([(2.1, 0.001)]):
        '{:.3f} {:.3f}'.format(*pt)
Expecting:
    '120.321 0.057'
ok
Trying:
    transproj = Transformer.from_crs(
        {"proj":'geocent', "ellps":'WGS84', "datum":'WGS84'},
        "EPSG:4326",
        always_xy=True,
    )
Expecting nothing
ok
Trying:
    for pt in transproj.itransform(
        [(-2704026.010, -4253051.810, 3895878.820)],
        radians=True,
    ):
        '{:.3f} {:.3f} {:.3f}'.format(*pt)
Expecting:
    '-2.137 0.661 -20.531'
**********************************************************************
File "pyproj-remove_global_context\pyproj\transformer.py", line 449, in pyproj.transformer.Transformer.itransform
Failed example:
    for pt in transproj.itransform(
        [(-2704026.010, -4253051.810, 3895878.820)],
        radians=True,
    ):
        '{:.3f} {:.3f} {:.3f}'.format(*pt)
Expected:
    '-2.137 0.661 -20.531'
Got:
    '0.661 -2.137 -20.531'
Trying:
    transprojr = Transformer.from_crs(
        "EPSG:4326",
        {"proj":'geocent', "ellps":'WGS84', "datum":'WGS84'},
        always_xy=True,
    )
Expecting nothing
ok
Trying:
    for pt in transprojr.itransform(
        [(-2.137, 0.661, -20.531)],
        radians=True
    ):
        '{:.3f} {:.3f} {:.3f}'.format(*pt)
Expecting:
    '-2704214.394 -4254414.478 3894270.731'
**********************************************************************
File "pyproj-remove_global_context\pyproj\transformer.py", line 460, in pyproj.transformer.Transformer.itransform
Failed example:
    for pt in transprojr.itransform(
        [(-2.137, 0.661, -20.531)],
        radians=True
    ):
        '{:.3f} {:.3f} {:.3f}'.format(*pt)
Expected:
    '-2704214.394 -4254414.478 3894270.731'
Got:
    'inf inf inf'
Trying:
    transproj_eq = Transformer.from_proj(
        'EPSG:4326',
        '+proj=longlat +datum=WGS84 +no_defs +type=crs',
        always_xy=True,
        skip_equivalent=True
    )
Expecting nothing
ok
Trying:
    for pt in transproj_eq.itransform([(-2.137, 0.661)]):
        '{:.3f} {:.3f}'.format(*pt)
Expecting:
    '-2.137 0.661'
ok
Trying:
    from pyproj import Transformer
Expecting nothing
ok
Trying:
    transformer = Transformer.from_crs("epsg:4326", "epsg:3857")
Expecting nothing
ok
Trying:
    x3, y3 = transformer.transform(33, 98)
Expecting nothing
ok
Trying:
    "%.3f  %.3f" % (x3, y3)
Expecting:
    '10909310.098  3895303.963'
ok
Trying:
    pipeline_str = (
        "+proj=pipeline +step +proj=longlat +ellps=WGS84 "
        "+step +proj=unitconvert +xy_in=rad +xy_out=deg"
    )
Expecting nothing
ok
Trying:
    pipe_trans = Transformer.from_pipeline(pipeline_str)
Expecting nothing
ok
Trying:
    xt, yt = pipe_trans.transform(2.1, 0.001)
Expecting nothing
ok
Trying:
    "%.3f  %.3f" % (xt, yt)
Expecting:
    '120.321  0.057'
ok
Trying:
    transproj = Transformer.from_crs(
        {"proj":'geocent', "ellps":'WGS84', "datum":'WGS84'},
        "EPSG:4326",
        always_xy=True,
    )
Expecting nothing
ok
Trying:
    xpj, ypj, zpj = transproj.transform(
        -2704026.010,
        -4253051.810,
        3895878.820,
        radians=True,
    )
Expecting nothing
ok
Trying:
    "%.3f %.3f %.3f" % (xpj, ypj, zpj)
Expecting:
    '-2.137 0.661 -20.531'
**********************************************************************
File "pyproj-remove_global_context\pyproj\transformer.py", line 345, in pyproj.transformer.Transformer.transform
Failed example:
    "%.3f %.3f %.3f" % (xpj, ypj, zpj)
Expected:
    '-2.137 0.661 -20.531'
Got:
    '0.661 -2.137 -20.531'
Trying:
    transprojr = Transformer.from_crs(
        "EPSG:4326",
        {"proj":'geocent', "ellps":'WGS84', "datum":'WGS84'},
        always_xy=True,
    )
Expecting nothing
ok
Trying:
    xpjr, ypjr, zpjr = transprojr.transform(xpj, ypj, zpj, radians=True)
Expecting nothing
ok
Trying:
    "%.3f %.3f %.3f" % (xpjr, ypjr, zpjr)
Expecting:
    '-2704026.010 -4253051.810 3895878.820'
ok
Trying:
    transformer = Transformer.from_proj("epsg:4326", 4326, skip_equivalent=True)
Expecting nothing
ok
Trying:
    xeq, yeq = transformer.transform(33, 98)
Expecting nothing
ok
Trying:
    "%.0f  %.0f" % (xeq, yeq)
Expecting:
    '33  98'
ok
Trying:
    from pyproj import Proj, itransform
Expecting nothing
ok
Trying:
    p1 = Proj('epsg:4326', preserve_units=False)
Expecting nothing
ok
Trying:
    p2 = Proj('epsg:2100', preserve_units=False)
Expecting nothing
ok
Trying:
    points = [(22.95, 40.63), (22.81, 40.53), (23.51, 40.86)]
Expecting nothing
ok
Trying:
    for pt in itransform(p1,p2,points, always_xy=True): '%6.3f %7.3f' % pt
Expecting:
    '411050.470 4497928.574'
    '399060.236 4486978.710'
    '458553.243 4523045.485'
ok
Trying:
    for pt in itransform(4326, 4326, [(30, 60)], skip_equivalent=True):
        '{:.0f} {:.0f}'.format(*pt)
Expecting:
    '30 60'
ok
Trying:
    from pyproj import Proj, transform
Expecting nothing
ok
Trying:
    p1 = Proj('epsg:26915', preserve_units=False)
Expecting nothing
ok
Trying:
    p2 = Proj('epsg:26715', preserve_units=False)
Expecting nothing
ok
Trying:
    x1, y1 = p1(-92.199881,38.56694)
Expecting nothing
ok
Trying:
    x2, y2 = transform(p1,p2,x1,y1)
Expecting nothing
ok
Trying:
    '%9.3f %11.3f' % (x1,y1)
Expecting:
    '569704.566 4269024.671'
ok
Trying:
    '%9.3f %11.3f' % (x2,y2)
Expecting:
    '569722.342 4268814.028'
**********************************************************************
File "pyproj-remove_global_context\pyproj\transformer.py", line 619, in pyproj.transformer.transform
Failed example:
    '%9.3f %11.3f' % (x2,y2)
Expected:
    '569722.342 4268814.028'
Got:
    '      inf         inf'
Trying:
    '%8.3f %5.3f' % p2(x2,y2,inverse=True)
Expecting:
    ' -92.200 38.567'
**********************************************************************
File "pyproj-remove_global_context\pyproj\transformer.py", line 621, in pyproj.transformer.transform
Failed example:
    '%8.3f %5.3f' % p2(x2,y2,inverse=True)
Expected:
    ' -92.200 38.567'
Got:
    '1000000000000000019884624838656.000 1000000000000000019884624838656.000'
Trying:
    lats = (38.83,39.32,38.75) # Columbia, KC and StL Missouri
Expecting nothing
ok
Trying:
    lons = (-92.22,-94.72,-90.37)
Expecting nothing
ok
Trying:
    x1, y1 = p1(lons,lats)
Expecting nothing
ok
Trying:
    x2, y2 = transform(p1,p2,x1,y1)
Expecting nothing
ok
Trying:
    xy = x1+y1
Expecting nothing
ok
Trying:
    '%9.3f %9.3f %9.3f %11.3f %11.3f %11.3f' % xy
Expecting:
    '567703.344 351730.944 728553.093 4298200.739 4353698.725 4292319.005'
ok
Trying:
    xy = x2+y2
Expecting nothing
ok
Trying:
    '%9.3f %9.3f %9.3f %11.3f %11.3f %11.3f' % xy
Expecting:
    '567721.149 351747.558 728569.133 4297989.112 4353489.645 4292106.305'
**********************************************************************
File "pyproj-remove_global_context\pyproj\transformer.py", line 632, in pyproj.transformer.transform
Failed example:
    '%9.3f %9.3f %9.3f %11.3f %11.3f %11.3f' % xy
Expected:
    '567721.149 351747.558 728569.133 4297989.112 4353489.645 4292106.305'
Got:
    '      inf       inf       inf         inf         inf         inf'
Trying:
    lons, lats = p2(x2,y2,inverse=True)
Expecting nothing
ok
Trying:
    xy = lons+lats
Expecting nothing
ok
Trying:
    '%8.3f %8.3f %8.3f %5.3f %5.3f %5.3f' % xy
Expecting:
    ' -92.220  -94.720  -90.370 38.830 39.320 38.750'
**********************************************************************
File "pyproj-remove_global_context\pyproj\transformer.py", line 636, in pyproj.transformer.transform
Failed example:
    '%8.3f %8.3f %8.3f %5.3f %5.3f %5.3f' % xy
Expected:
    ' -92.220  -94.720  -90.370 38.830 39.320 38.750'
Got:
    '1000000000000000019884624838656.000 1000000000000000019884624838656.000 1000000000000000019884624838656.000 1000000000000000019884624838656.000 1000000000000000019884624838656.000 1000000000000000019884624838656.000'
Trying:
    p1 = Proj(proj='latlong',datum='WGS84')
Expecting nothing
ok
Trying:
    x1 = -111.5; y1 = 45.25919444444
Expecting nothing
ok
Trying:
    p2 = Proj(proj="utm",zone=10,datum='NAD27', preserve_units=False)
Expecting nothing
ok
Trying:
    x2, y2 = transform(p1, p2, x1, y1)
Expecting nothing
ok
Trying:
    "%s  %s" % (str(x2)[:9],str(y2)[:9])
Expecting:
    '1402291.0  5076289.5'
**********************************************************************
File "pyproj-remove_global_context\pyproj\transformer.py", line 643, in pyproj.transformer.transform
Failed example:
    "%s  %s" % (str(x2)[:9],str(y2)[:9])
Expected:
    '1402291.0  5076289.5'
Got:
    'inf  inf'
Trying:
    from pyproj import CRS
Expecting nothing
ok
Trying:
    c1 = CRS(proj='latlong',datum='WGS84')
Expecting nothing
ok
Trying:
    x1 = -111.5; y1 = 45.25919444444
Expecting nothing
ok
Trying:
    c2 = CRS(proj="utm",zone=10,datum='NAD27')
Expecting nothing
ok
Trying:
    x2, y2 = transform(c1, c2, x1, y1)
Expecting nothing
ok
Trying:
    "%s  %s" % (str(x2)[:9],str(y2)[:9])
Expecting:
    '1402291.0  5076289.5'
**********************************************************************
File "pyproj-remove_global_context\pyproj\transformer.py", line 650, in pyproj.transformer.transform
Failed example:
    "%s  %s" % (str(x2)[:9],str(y2)[:9])
Expected:
    '1402291.0  5076289.5'
Got:
    'inf  inf'
Trying:
    xeq, yeq = transform(4326, 4326, 30, 60, skip_equivalent=True)
Expecting nothing
ok
Trying:
    "%.0f %.0f" % (xeq, yeq)
Expecting:
    '30 60'
ok
20 items had no tests:
    pyproj.transformer
    pyproj.transformer.Transformer
    pyproj.transformer.Transformer.__init__
    pyproj.transformer.Transformer.__repr__
    pyproj.transformer.Transformer.__str__
    pyproj.transformer.Transformer.accuracy
    pyproj.transformer.Transformer.area_of_use
    pyproj.transformer.Transformer.definition
    pyproj.transformer.Transformer.description
    pyproj.transformer.Transformer.from_crs
    pyproj.transformer.Transformer.from_pipeline
    pyproj.transformer.Transformer.from_proj
    pyproj.transformer.Transformer.has_inverse
    pyproj.transformer.Transformer.name
    pyproj.transformer.Transformer.to_wkt
    pyproj.transformer.TransformerGroup
    pyproj.transformer.TransformerGroup.__init__
    pyproj.transformer.TransformerGroup.best_available
    pyproj.transformer.TransformerGroup.transformers
    pyproj.transformer.TransformerGroup.unavailable_operations
1 items passed all tests:
   6 tests in pyproj.transformer.itransform
**********************************************************************
3 items had failures:
   2 of  13 in pyproj.transformer.Transformer.itransform
   1 of  17 in pyproj.transformer.Transformer.transform
   6 of  32 in pyproj.transformer.transform
68 tests in 24 items.
59 passed and 9 failed.
***Test Failed*** 9 failures.
________________________________________________________________________ test_4d_transform_crs_obs1 _________________________________________________________________________

    def test_4d_transform_crs_obs1():
>       transformer = Transformer.from_proj(7789, 8401)

test\test_transformer.py:135:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pyproj\transformer.py:224: in from_proj
    area_of_interest=area_of_interest,
pyproj\transformer.py:261: in from_crs
    area_of_interest=area_of_interest,
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

>   raise ProjError("Error creating Transformer from CRS.")
E   pyproj.exceptions.ProjError: Error creating Transformer from CRS.

pyproj\_transformer.pyx:290: ProjError
____________________________________________________________________ test_4d_transform_orginal_crs_obs1 _____________________________________________________________________

    def test_4d_transform_orginal_crs_obs1():
        assert_almost_equal(
>           transform(7789, 8401, x=3496737.2679, y=743254.4507, z=5264462.9620, tt=2019.0),
            (3496737.757717311, 743253.9940103051, 5264462.701132784, 2019.0),
        )

test\test_transformer.py:146:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pyproj\transformer.py:657: in transform
    p1, p2, skip_equivalent=skip_equivalent, always_xy=always_xy
pyproj\transformer.py:224: in from_proj
    area_of_interest=area_of_interest,
pyproj\transformer.py:261: in from_crs
    area_of_interest=area_of_interest,
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

>   raise ProjError("Error creating Transformer from CRS.")
E   pyproj.exceptions.ProjError: Error creating Transformer from CRS.

pyproj\_transformer.pyx:290: ProjError
____________________________________________________________________ test_4d_itransform_orginal_crs_obs1 ____________________________________________________________________

    def test_4d_itransform_orginal_crs_obs1():
        assert_almost_equal(
            list(
>               itransform(7789, 8401, [(3496737.2679, 743254.4507, 5264462.9620, 2019.0)])
            ),
            [(3496737.757717311, 743253.9940103051, 5264462.701132784, 2019.0)],
        )

test\test_transformer.py:203:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pyproj\transformer.py:727: in itransform
    p1, p2, skip_equivalent=skip_equivalent, always_xy=always_xy
pyproj\transformer.py:224: in from_proj
    area_of_interest=area_of_interest,
pyproj\transformer.py:261: in from_crs
    area_of_interest=area_of_interest,
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

>   raise ProjError("Error creating Transformer from CRS.")
E   pyproj.exceptions.ProjError: Error creating Transformer from CRS.

pyproj\_transformer.pyx:290: ProjError
_____________________________________________________________________ test_itransform_time_3rd_invalid ______________________________________________________________________

    def test_itransform_time_3rd_invalid():

        with pytest.raises(ValueError, match="'time_3rd' is only valid for 3 coordinates."):
            list(
                itransform(
                    7789,
                    8401,
                    [(3496737.2679, 743254.4507, 5264462.9620, 2019.0)],
>                   time_3rd=True,
                )
            )

test\test_transformer.py:226:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pyproj\transformer.py:727: in itransform
    p1, p2, skip_equivalent=skip_equivalent, always_xy=always_xy
pyproj\transformer.py:224: in from_proj
    area_of_interest=area_of_interest,
pyproj\transformer.py:261: in from_crs
    area_of_interest=area_of_interest,
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

>   raise ProjError("Error creating Transformer from CRS.")
E   pyproj.exceptions.ProjError: Error creating Transformer from CRS.

pyproj\_transformer.pyx:290: ProjError
_________________________________________________________________________________ test_repr _________________________________________________________________________________

    def test_repr():
>       assert repr(Transformer.from_crs(7789, 8401)) == (
            "<Transformation Transformer: helmert>\n"
            "Description: ITRF2014 to ETRF2014 (1)\n"
            "Area of Use:\n"
            "- name: Europe - ETRS89\n"
            "- bounds: (-16.1, 32.88, 40.18, 84.17)"
        )

test\test_transformer.py:417:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pyproj\transformer.py:261: in from_crs
    area_of_interest=area_of_interest,
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

>   raise ProjError("Error creating Transformer from CRS.")
E   pyproj.exceptions.ProjError: Error creating Transformer from CRS.

pyproj\_transformer.pyx:290: ProjError
____________________________________________________________________ test_transformer_group__unavailable ____________________________________________________________________

    def test_transformer_group__unavailable():
        trans_group = TransformerGroup(4326, 2964)
>       assert len(trans_group.unavailable_operations) == 1
E       assert 0 == 1
E         -0
E         +1

test\test_transformer.py:451: AssertionError
____________________________________________________________________ test_transform_group__missing_best _____________________________________________________________________

    def test_transform_group__missing_best():
        with pytest.warns(DeprecationWarning):
            lat_lon_proj = pyproj.Proj(init="epsg:4326", preserve_units=False)
            alaska_aea_proj = pyproj.Proj(init="epsg:2964", preserve_units=False)

        with pytest.warns(
            UserWarning, match="Best transformation is not available due to missing Grid"
        ):
            trans_group = pyproj.transformer.TransformerGroup(
>               lat_lon_proj.crs, alaska_aea_proj.crs
            )
E           Failed: DID NOT WARN. No warnings of type (<class 'UserWarning'>,) was emitted. The list of emitted warnings is: [].

test\test_transformer.py:469: Failed
__________________________________________________________________ test_transform_group__area_of_interest ___________________________________________________________________

    def test_transform_group__area_of_interest():
        with pytest.warns(
            UserWarning, match="Best transformation is not available due to missing Grid"
        ):
            trans_group = TransformerGroup(
>               4326, 2964, area_of_interest=AreaOfInterest(-136.46, 49.0, -60.72, 83.17)
            )
E           Failed: DID NOT WARN. No warnings of type (<class 'UserWarning'>,) was emitted. The list of emitted warnings is: [].

test\test_transformer.py:482: Failed
____________________________________________________________________ test_transformer__area_of_interest _____________________________________________________________________

    def test_transformer__area_of_interest():
        transformer = Transformer.from_crs(
            4326, 2964, area_of_interest=AreaOfInterest(-136.46, 49.0, -60.72, 83.17)
        )
>       assert transformer.description == "Inverse of NAD27 to WGS 84 (13) + Alaska Albers"
E       AssertionError: assert 'Inverse of N...Alaska Albers' == 'Inverse of N...Alaska Albers'
E         - Inverse of NAD27 to WGS 84 (33) + Alaska Albers
E         ?                             ^
E         + Inverse of NAD27 to WGS 84 (13) + Alaska Albers
E         ?                             ^

test\test_transformer.py:494: AssertionError
__________________________________________________________________ test_transformer_proj__area_of_interest __________________________________________________________________

    def test_transformer_proj__area_of_interest():
        transformer = Transformer.from_proj(
            4326, 2964, area_of_interest=AreaOfInterest(-136.46, 49.0, -60.72, 83.17)
        )
>       assert transformer.description == "Inverse of NAD27 to WGS 84 (13) + Alaska Albers"
E       AssertionError: assert 'Inverse of N...Alaska Albers' == 'Inverse of N...Alaska Albers'
E         - Inverse of NAD27 to WGS 84 (33) + Alaska Albers
E         ?                             ^
E         + Inverse of NAD27 to WGS 84 (13) + Alaska Albers
E         ?                             ^

test\test_transformer.py:501: AssertionError
====================================================================== 14 failed, 239 passed in 16.63s ======================================================================

@snowman2
Copy link
Member Author

snowman2 commented Sep 9, 2019

Fantastic! Alright, I will push another change in a bit that will hopefully get us another step closer.

@snowman2
Copy link
Member Author

snowman2 commented Sep 9, 2019

@cgohlke, just pushed another update.

@snowman2
Copy link
Member Author

snowman2 commented Sep 9, 2019

@cgohlke, do you happen to have proj-datumgrid-north-america-latest.zip files extracted in your data directory? More specifically, do you have ntv2_0.gsb in the data directory?

The reason I ask is the tests expect it to not be there. This is the full warning expected:

transformer.py:89: UserWarning: Best transformation is not available due to missing Grid(short_name=ntv2_0.gsb, full_name=, package_name=proj-datumgrid-north-america, url=https://download.osgeo.org/proj/proj-datumgrid-north-america-latest.zip, direct_download=True, open_license=True, available=False)

@cgohlke
Copy link
Contributor

cgohlke commented Sep 9, 2019

do you have ntv2_0.gsb in the data directory?

Yes. Should that file not be distributed with pyproj? I added it because project monitor reported the file failed to open.

I removed the file an rebuilt the latest remove_global_context branch: all tests pass, no crash!

================================================= test session starts =================================================
platform win32 -- Python 3.7.4, pytest-5.1.2, py-1.8.0, pluggy-0.12.0
hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase('pyproj-remove_global_context\\.hypothesis\\examples')
rootdir: pyproj-remove_global_context
plugins: hypothesis-4.35.0, palladium-1.2.2, cov-2.7.1, forked-1.0.2, localserver-0.5.0, pep8-1.0.6, xdist-1.29.0
collected 253 items

test\test_awips221.py .                                                                                          [  0%]
test\test_crs.py ............................................................................................... [ 37%]
.........                                                                                                        [ 41%]
test\test_crs_cf.py ................                                                                             [ 47%]
test\test_datadir.py ..........                                                                                  [ 51%]
test\test_datum.py .                                                                                             [ 52%]
test\test_datum_shift.py ....                                                                                    [ 53%]
test\test_doctest_wrapper.py .                                                                                   [ 54%]
test\test_exception_logging.py ..                                                                                [ 54%]
test\test_geod.py ............................                                                                   [ 66%]
test\test_list.py .....                                                                                          [ 67%]
test\test_pickle.py .                                                                                            [ 68%]
test\test_proj.py .........................                                                                      [ 78%]
test\test_show_versions.py ...                                                                                   [ 79%]
test\test_transform.py .                                                                                         [ 79%]
test\test_transformer.py ...................................................                                     [100%]

================================================ 253 passed in 16.73s =================================================

@snowman2
Copy link
Member Author

snowman2 commented Sep 9, 2019

That is great news!

Should that file not be distributed with pyproj?

That's fine to distribute it with it. I just need to update the tests to be a little more defensive about it's existence. Probably good to have it documented somewhere for reference what files are included in the windows wheels. Maybe in the installation instructions. Mind letting me know what datumgrid files you include in the wheel?

@snowman2
Copy link
Member Author

Thanks again for your help @cgohlke!

@snowman2 snowman2 merged commit 0713cda into pyproj4:master Sep 10, 2019
@snowman2 snowman2 deleted the remove_global_context branch September 10, 2019 00:10
@jorisvandenbossche
Copy link
Contributor

Maybe this has been discussed before, but @cgohlke is there something specific about your environment that might be reproduced on Appveyor?

I think the main difference is that I link to libproj statically. In fact, switching to dynamic linking previously solved some issues. See #403 (comment)

@snowman2 is this something that can be done on one of the appveyor builds as well? (just a question, totally unfamiliar with this aspect)

@snowman2
Copy link
Member Author

@snowman2 is this something that can be done on one of the appveyor builds as well? (just a question, totally unfamiliar with this aspect)

It would be nice to have. I am not familiar with static linking on Windows/MSVC, so it would require some research to get it done.

@jorisvandenbossche
Copy link
Contributor

jorisvandenbossche commented Sep 11, 2019

Fully understand that :) (and I am also not the one going to do it, just making suggestions) Maybe open an issue for it?

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