-
Notifications
You must be signed in to change notification settings - Fork 30
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
Avoid importing both rasterio and osgeo #1351
Comments
This could potentially have significant performance impacts. |
Not sure we have any or many that use both of those in one python file. That being said, we have a bunch of places that use gdal directly via shell commands in bash, which often do command line calls to python files to do more processing. Certainly worth looking in to. |
The imports don't necessarily have to happen in the same file, but rather in the same python interpreter session. Scripts that do this: https://github.com/NOAA-OWP/inundation-mapping/blob/1fa128f84460a7e3b15885a72e8a006d451812b3/src/make_rem.py (imports both libraries) https://github.com/NOAA-OWP/inundation-mapping/blob/1fa128f84460a7e3b15885a72e8a006d451812b3/tools/inundate_nation.py (imports both) https://github.com/NOAA-OWP/inundation-mapping/blob/1fa128f84460a7e3b15885a72e8a006d451812b3/data/ble/ble_benchmark/create_ble_benchmark.py (imports preprocess_benchmark which imports rasterio) https://github.com/NOAA-OWP/inundation-mapping/blob/1fa128f84460a7e3b15885a72e8a006d451812b3/data/bathymetry/preprocess_bathymetry.py (imports both) |
Only one of these files ( |
Reopening this issue since #1382 resolved the issues in FIM pipeline but there are additional cases in pre- and post-processing that are still being addressed. |
There are several places in this codebase that import both rasterio (or libraries that use rasterio) and osgeo gdal bindings. This is highly discouraged by the rasterio team.
https://rasterio.readthedocs.io/en/stable/topics/switch.html#mutual-incompatibilities
ping: @RobHanna-NOAA
The text was updated successfully, but these errors were encountered: