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

TST: CI failures with PROJ 9.0.0 #2388

Closed
martinfleis opened this issue Mar 23, 2022 · 4 comments · Fixed by #2397
Closed

TST: CI failures with PROJ 9.0.0 #2388

martinfleis opened this issue Mar 23, 2022 · 4 comments · Fixed by #2397

Comments

@martinfleis
Copy link
Member

Since PROJ 9.0.0, our CI is reporting failures across environments due to some changes in precision during transformation. See the report https://github.com/geopandas/geopandas/runs/5504631593?check_suite_focus=true.

I didn't have time to debug this but we should have a look what is happening and likely adapt CI, if it is not caused by some underlying issue.

@jorisvandenbossche
Copy link
Member

jorisvandenbossche commented Apr 1, 2022

I am looking a bit into this, and it seems this is due to that fact that setting PROJ_NETWORK to "OFF" stopped working. Now, I don't know if that was ever really supposed to work (the documentation only mentions about setting it to "ON", although one might expect that you can then also set it to "OFF"):

In [1]: import os
   ...: os.environ["PROJ_NETWORK"] = "OFF"
   ...: 
   ...: import pyproj
   ...: print(pyproj.proj_version_str)
   ...: pyproj.network.is_network_enabled()
   ...: 
8.2.0
Out[1]: False

vs

In [1]: import os
   ...: os.environ["PROJ_NETWORK"] = "OFF"
   ...: 
   ...: import pyproj
   ...: print(pyproj.proj_version_str)
   ...: pyproj.network.is_network_enabled()
9.0.0
Out[1]: True

(pyproj version is the same in both cases (3.3.0), only PROJ version differs)

Maybe related to the changes in OSGeo/PROJ#3049? cc @snowman2 @rouault

@jorisvandenbossche
Copy link
Member

Actually, the above observation is caused by my IPython config where I already do some imports by default (including geopandas). So doing the above in a clean python env, that still gives False for PROJ 9.0.0.

But so the correct observation of what changed in behaviour, is that setting the env variable after importing pyproj no longer has effect:

>>> import os
>>> import pyproj
>>> pyproj.proj_version_str
'8.2.0'
>>> os.environ["PROJ_NETWORK"] = "OFF"
>>> pyproj.network.is_network_enabled()
False

vs

>>> import os
>>> import pyproj
>>> pyproj.proj_version_str
'9.0.0'
>>> os.environ["PROJ_NETWORK"] = "OFF"
>>> pyproj.network.is_network_enabled()
True

@rouault
Copy link

rouault commented Apr 1, 2022

This is certainly due to OSGeo/PROJ#3049 , but I don't consider that as a regression. Basically the effect of changing the value of PROJ_NETWORK after a PROJ context has been created is unspecified. Safer is to use set_network_enabled(False) as you did in #2397

@jorisvandenbossche
Copy link
Member

but I don't consider that as a regression

Yep, after realizing it was only for the case after import pyproj (which initializes a context), fully agreed that this should not be expected to work.

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

Successfully merging a pull request may close this issue.

3 participants