question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

PROJ 9.1.1 doesn't work with Global Context

See original GitHub issue

https://github.com/pyproj4/pyproj/actions/runs/3596938993/jobs/6058180954

=================================== FAILURES ===================================
___________________ test_transformer_group__network_disabled ___________________

    @pytest.mark.grid
    @patch.dict("os.environ", {"PROJ_NETWORK": "ON"}, clear=True)
    def test_transformer_group__network_disabled():
        with proj_network_env():
            pyproj.network.set_network_enabled(active=False)
>           trans_group = TransformerGroup(4326, 2964)

test/test_transformer.py:869: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
pyproj/transformer.py:197: in __init__
    super().__init__(
pyproj/_transformer.pyx:215: in pyproj._transformer._TransformerGroup.__init__
    _Transformer._from_pj(
pyproj/_transformer.pyx:563: in pyproj._transformer._Transformer._from_pj
    transformer._init_from_crs(always_xy)
pyproj/_transformer.pyx:614: in pyproj._transformer._Transformer._init_from_crs
    self._initialize_from_projobj()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   raise ProjError("Input is not a transformation.")
E   pyproj.exceptions.ProjError: Input is not a transformation.: (Internal Proj Error: pipeline: Pipeline: Bad step definition: inv (File not found or invalid))

pyproj/_transformer.pyx:324: ProjError
------------------------------ Captured log call -------------------------------
DEBUG    pyproj:transformer.py:197 PROJ_ERROR: hgridshift: could not find required grid(s).
DEBUG    pyproj:transformer.py:197 PROJ_ERROR: pipeline: Pipeline: Bad step definition: inv (File not found or invalid)
____________________ test_transformer_group__download_grids ____________________

get_user_data_dir_mock = <MagicMock name='get_user_data_dir' id='140700317128784'>
tmp_path = PosixPath('/tmp/pytest-of-runner/pytest-2/test_transformer_group__downlo0')
capsys = <_pytest.capture.CaptureFixture object at 0x7ff7586c11f0>

    @pytest.mark.grid
    @pytest.mark.network
    @patch("pyproj.transformer.get_user_data_dir")
    def test_transformer_group__download_grids(get_user_data_dir_mock, tmp_path, capsys):
        get_user_data_dir_mock.return_value = str(tmp_path)
        with proj_network_env():
            pyproj.network.set_network_enabled(active=False)
>           trans_group = TransformerGroup(4326, 2964)
E   pyproj.exceptions.ProjError: Input is not a transformation.: (Internal Proj Error: pipeline: Pipeline: Bad step definition: inv (File not found or invalid))

pyproj/_transformer.pyx:324: ProjError
------------------------------ Captured log call -------------------------------
DEBUG    pyproj:transformer.py:197 PROJ_ERROR: hgridshift: could not find required grid(s).
DEBUG    pyproj:transformer.py:197 PROJ_ERROR: pipeline: Pipeline: Bad step definition: inv (File not found or invalid)
____________ test_coordinate_operation_grids__alternative_grid_name ____________

    @pytest.mark.grid
    def test_coordinate_operation_grids__alternative_grid_name():
        cc = CoordinateOperation.from_epsg(1312, True)
        assert len(cc.grids) == 1
        grid = cc.grids[0]
        assert grid.direct_download is True
        assert grid.open_license is True
        assert grid.short_name == "ca_nrc_ntv1_can.tif"
        assert grid.package_name == ""
        assert grid.url == "https://cdn.proj.org/ca_nrc_ntv1_can.tif"
        if (PROJ_GTE_91 and grids_available(grid.short_name, check_network=False)) or (
            not PROJ_GTE_91 and grids_available(grid.short_name)
        ):
            assert grid.available is True
            assert grid.full_name.endswith(grid.short_name)
        elif PROJ_GTE_911 and pyproj.network.is_network_enabled():
            assert grid.available is True
>           assert grid.full_name == grid.url
E           AssertionError: assert '' == 'https://cdn...._ntv1_can.tif/'
E             - https://cdn.proj.org/ca_nrc_ntv1_can.tif

test/crs/test_crs.py:622: AssertionError
=============================== warnings summary ===============================
test/test_datadir.py::test_get_data_dir__from_user[str]
test/test_datadir.py::test_get_data_dir__from_user[Path]
test/test_datadir.py::test_append_data_dir__internal[str]
test/test_datadir.py::test_append_data_dir__internal[Path]
  /home/runner/work/pyproj/pyproj/pyproj/datadir.py:38: UserWarning: pyproj unable to set database path.
    _global_context_set_data_dir()

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=========================== short test summary info ============================
FAILED test/test_transformer.py::test_transformer_group__network_disabled - pyproj.exceptions.ProjError: Input is not a transformation.: (Internal Proj Error: pipeline: Pipeline: Bad step definition: inv (File not found or invalid))
FAILED test/test_transformer.py::test_transformer_group__download_grids - pyproj.exceptions.ProjError: Input is not a transformation.: (Internal Proj Error: pipeline: Pipeline: Bad step definition: inv (File not found or invalid))
FAILED test/test_transformer.py::test_transformer_group__download_grids__directory - pyproj.exceptions.ProjError: Input is not a transformation.: (Internal Proj Error: pipeline: Pipeline: Bad step definition: inv (File not found or invalid))
FAILED test/crs/test_crs.py::test_coordinate_operation_grids__alternative_grid_name - AssertionError: assert '' == 'https://cdn...._ntv1_can.tif/'
  - https://cdn.proj.org/ca_nrc_ntv1_can.tif
============ 4 failed, 832 passed, 5 skipped, 4 warnings in 22.53s =============

Going to need to do a git bisect with PROJ.

Issue Analytics

  • State:open
  • Created 10 months ago
  • Comments:25 (18 by maintainers)

github_iconTop GitHub Comments

1reaction
rouaultcommented, Dec 5, 2022

ok, you’ll probably have to identify the minimum sequence of PROJ operations that trigger the bug (since I assume those failing tests work when run individually?)

0reactions
snowman2commented, Dec 10, 2022

Is it really PROJ 9.1.1 specific ?

It seems to be the case. Testing 9.1.0 wheel building in #1195.

https://github.com/pyproj4/pyproj/actions/runs/3662102493/jobs/6190946199

All of the tests are passing.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Issues · pyproj4/pyproj - GitHub
Python interface to PROJ (cartographic projections and coordinate transformations library) - Issues ... Open. PROJ 9.1.1 doesn't work with Global Context.
Read more >
Functions — PROJ 9.1.1 documentation
Create a new threading-context based on an existing context. ... If a proj-string does not contain +type=crs, then it is interpreted as a...
Read more >
IssueContext (Atlassian Jira - Server 9.1.1 API)
A context (scope) for an issue or custom field. For example, global custom fields ... Global context not associated with any project or...
Read more >
Fix list for Rational Developer for i - IBM
This document contains a complete listing of releases, refreshes, fix packs and interim fixes sorted by version for IBM Rational Developer ...
Read more >
Reactor 3 Reference Guide
Parallelizing Work with ParallelFlux; 9.6. Replacing Default Schedulers; 9.7. Using Global Hooks; 9.8. Adding a Context to a Reactive ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found