-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Autodetect the engine only when
engine=None
(#4458)
* Perform engine autodetection only when `engine=None` * More specific "is it a file" condition * Add test for wrong combination of file object and engine * Add what's new * Better wording of what's new * Fix code style * Move path normalization code in an helper function * Move some autodetection logic back into _get_engine_from_magic_number * Simplify input validation and move it all to the open function * Fix code style * Remove tests that never trigger and make error message more precise * Update doc/whats-new.rst Co-authored-by: Deepak Cherian <dcherian@users.noreply.github.com> * Update xarray/backends/api.py Co-authored-by: Deepak Cherian <dcherian@users.noreply.github.com> * Update xarray/backends/api.py Co-authored-by: Joe Hamman <jhamman1@gmail.com> * Update xarray/backends/api.py Co-authored-by: Deepak Cherian <dcherian@users.noreply.github.com> * Add tests for file-objects with `engine=None` * Trivial code style * Code style, use f-string in error message Co-authored-by: Deepak Cherian <dcherian@users.noreply.github.com> Co-authored-by: Joe Hamman <jhamman1@gmail.com>
- Loading branch information
1 parent
ed1b865
commit f821fe2
Showing
5 changed files
with
65 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters