-
Notifications
You must be signed in to change notification settings - Fork 216
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
A strange SQLite internal state corruption issue? #374
Comments
Thanks for the report and the reproducible example. I think the issue has to do with the soft limit of 1024 files open in Linux. I have an idea for a better way to handle this in pyproj and will work on it when I get a free moment. |
@snowman2 an alternative option that might be worth exploring is to not hold a (eg for a typical geopandas usage of transforming the geometries of a GeoDataFrame, the actual Transformer.transform call will be much more than creating the CRS/Transformer object. But of course, this is not the only typical usage of pyproj) |
@jorisvandenbossche, thanks for the thoughts there. However, the reasoning behind creating the transformer class was because re-creating the PJ* used in the transformation every time caused it to be very slow (#187). I am thinking the best solution will be able to present itself once this PR is merged in: OSGeo/PROJ#1566 |
Yes, but that is a case where you typically want to repeat something many times (transforming many points given a single crs->crs transformation). And the performance of the Transformer class would not be much impacted by needing to recreate the to/from CRS proj obj first.
I didn't read the full issue there, but that would allow to go back from a single global PROJ_CONTEXT to a context per PJ object? |
I believe so. |
I was doing a mass conversion of coordinates from various CRSs and stumbled on a strange bug. It seems fairly low-level, and even seems to affect some global Python SQLite state (interfering with later IPython functions for instance).
The included file "wkts.txt" is over 90k lines. I haven't yet been able to make a simpler test case that reproduces this issue.
wkts.txt
Running the code, I get the following output (in an ipython session):
Code Sample, a copy-pastable example if possible
Problem description
It would be ideal if the low level program state did not randomly get corrupted :-)
Expected Output
There should be no Internal pyproj errors.
Environment Information
I tried this with pipenv and conda/conda-forge versions of pyproj 2.2.1 on Ubuntu 18.04 (on two different machines as it happens).
pipenv:
System:
python: 3.7.3 | packaged by conda-forge | (default, Jul 1 2019, 21:52:21) [GCC 7.3.0]
executable: /home/elias/miniconda3/envs/bug/bin/python
machine: Linux-4.15.0-54-generic-x86_64-with-debian-buster-sid
PROJ:
PROJ: 6.1.0
data dir: /home/elias/miniconda3/envs/bug/share/proj
Python deps:
pyproj: 2.2.1
pip: 19.1.1
setuptools: 41.0.1
Cython: None
aenum: None
$ conda list | grep -E "proj|aenum"
proj4 6.1.0 he751ad9_2 conda-forge
pyproj 2.2.1 py37hc44880f_0 conda-forge
$ conda info
active environment : bug
active env location : /home/elias/miniconda3/envs/bug
shell level : 1
user config file : /home/elias/.condarc
populated config files : /home/elias/.condarc
conda version : 4.7.5
conda-build version : not installed
python version : 3.6.8.final.0
virtual packages :
base environment : /home/elias/miniconda3 (writable)
channel URLs : https://conda.anaconda.org/conda-forge/linux-64
https://conda.anaconda.org/conda-forge/noarch
package cache : /home/elias/miniconda3/pkgs
/home/elias/.conda/pkgs
envs directories : /home/elias/miniconda3/envs
/home/elias/.conda/envs
platform : linux-64
user-agent : conda/4.7.5 requests/2.21.0 CPython/3.6.8 Linux/4.15.0-54-generic ubuntu/18.04.2 glibc/2.27
UID:GID : 1000:1000
netrc file : None
offline mode : False
The text was updated successfully, but these errors were encountered: