CI: Unpin geopandas and rasterio after the fix in #3672#3305
Conversation
This reverts commit 3574603.
Trying to solve `pyogrio.errors.DataSourceError: No driver registered` error by forcing driver registration. Xref geopandas/pyogrio#145
examples/gallery/lines/roads.py
Outdated
| import pyogrio | ||
|
|
||
| # Read shapefile data using geopandas | ||
| pyogrio.core._register_drivers() | ||
| gdf = gpd.read_file( |
There was a problem hiding this comment.
Found this issue geopandas/pyogrio#144 that mentions an error like pyogrio.errors.DataSourceError: Could not obtain driver: GPKG (check that it was installed correctly into GDAL) was due to drivers not being loaded properly. This should have been fixed in geopandas/pyogrio#145, but unsure why we're still hitting into this in the sphinx build and not in the regular tests.
Calling pyogrio.core._register_drivers() seems to get the GDAL drivers to register, so the build passes. But it doesn't look nice, and we should report this as a bug upstream if we can find a way to reproduce this outside of sphinx.
examples/gallery/lines/roads.py
Outdated
| # %% | ||
| import geopandas as gpd | ||
| import pygmt | ||
| import pyogrio |
There was a problem hiding this comment.
Can we move it to conf.py so that we don't have to repeat it in multiple gallery examples?
There was a problem hiding this comment.
Just tried locally, no it doesn't work if I put it in doc/conf.py.
There was a problem hiding this comment.
I'm hesitating to merge this PR because (1) users may be confused about pyogrio.core._register_drivers(); (2) Users may still use geopandas v0.x and don't have pyogrio installed.
There was a problem hiding this comment.
Yeah, don't think it's a good option either. I just tried adding it to the Makefile and it doesn't work either.
The funny thing is, the examples/gallery/maps/choropleth_map.py example which also has a import geopandas as gpd line, and runs before the roads example, doesn't fail with the DataSourceError. If I move that choropleth_map.py file somewhere else, all the builds work without needing to register the driver manually 😅
There was a problem hiding this comment.
In commit 9883359, I use sphinx-gallery's sphinx_gallery_start_ignore/sphinx_gallery_end_ignore flags to hide the two lines of codes in the documentation.
Preview:
2deb0d0 to
e15462f
Compare
e15462f to
9883359
Compare
|
@seisman, maybe we should retry this again with |
Revert changes in #3304 so that we can track the issue #3301.
Edit on 2024/12/03: Also revert #3668