Skip to content

Comments

Register drivers at most once per process#3260

Merged
sgillies merged 5 commits intomaint-1.4from
issue3250
Nov 29, 2024
Merged

Register drivers at most once per process#3260
sgillies merged 5 commits intomaint-1.4from
issue3250

Conversation

@sgillies
Copy link
Member

Resolves #3250.

@sgillies sgillies added the bug label Nov 28, 2024
@sgillies sgillies self-assigned this Nov 28, 2024
@vincentsarago
Copy link
Member

@sgillies does this change means we can't use

with rasterio.Env(GDAL_SKIP="driver"): 
    ...

anymore?

@sgillies
Copy link
Member Author

@vincentsarago you can only use it once per process now, which makes it so complicated to test that it's not worth it.

@vincentsarago
Copy link
Member

@sgillies I think we should at least report this in the changelog. I couldn't find a lot of code doing this in GitHub https://github.com/search?q=%22rasterio.Env%28GDAL_SKIP%3D%22+language%3APython+&type=code but still. I remember using it couple time recently when working with NetCDF/HDF files.

@sgillies
Copy link
Member Author

@vincentsarago would you like to have the option to re-register drivers?

@vincentsarago
Copy link
Member

@sgillies I don't think we need to add a new API for now as long as we document this kinda breaking change.

Let's see if users comeback with this need

(#3260).
(#3260). A side effect of this is that the GDAL_SKIP configuration option,
which affects format driver registration, only has an effect the first time
a dataset is opened.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about this @vincentsarago ?

@vincentsarago vincentsarago self-requested a review November 28, 2024 20:22
@rouault
Copy link
Contributor

rouault commented Dec 2, 2024

If you need to select HDF5 vs netCDF, you can use the allowed_drivers argument of GDALOpenEx() instead of GDAL_SKIP

sgillies added a commit that referenced this pull request Dec 2, 2024
* Eliminate boundless reads in merge, new compositing implementation (#3234)

* Eliminate boundless reads in merge, new compositing implementation

Resolves #3228

* Fix nits

* Compare non-zero mean of arrays

* Implement and use Window.align()

Combines the effects of Window.round_offsets and
Window.round_lengths, producing the same effect as gdal_merge.py

* Remove unused math import

* Add more docs about align()

Also increase the fraction used in round_offsets() to be
consistent with align()

* Move align() to a private func, use two existing methods in tests

* Add a test for merging WarpedVRTs (#3237)

Resolves #3196

* Backport of #3217 (#3243)

* Backport of #3217

* Update change log

* Increment GDAL and Python versions for CI (#3244)

* Rewrite _matches() to better support to_authority() and to_epsg() (#3255)

* Rewrite _matches() to better support to_authority() and to_epsg()

Resolves #3239

* Remove list() call and update change log

* Use to_epsg() in is_epsg_code() (#3258)

* Use to_epsg() in is_epsg_code()

Resolves #3248

* Update change log

* Allow MRF compression to surface in properties (#3259)

* Allow MRF compression to surface in properties

Resolves #3256

* Update change log

* Register drivers at most once per process (#3260)

* Register drivers at most once per process

Resolves #3250

* Appease flake8

* Add a note about GDAL_SKIP in the change log

* Support all GDALFillNodata() options in rasterio.fill (#3265)

* Support all GDALFillNodata() options

Resolve #3175.

* Cast values to str and update docs

* Update change log

* Prevent rasterio from trying to open a dataset object (#3266)

Resolves #3105.

* Fix typos discovered by codespell (#3264) (#3267)

* Fix typos discovered by codespell

* crasher



---------

Co-authored-by: Christian Clauss <[email protected]>

* Fix erroneous masking of 0-valued data (#3268)

* Fix erroneous masking of 0-valued data

Resolves #3245

* Add an assertion about data values and update change log

* This is 1.4.3

---------

Co-authored-by: Christian Clauss <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants