Uh oh!
There was an error while loading. Please reload this page.
fix warning from scipy backend guess_can_open on directory - #9911
Conversation
Thank you for opening this pull request! It may take us a few days to respond here, so thank you for being patient. |
headtr1ck
left a comment
There was a problem hiding this comment.
Looks like a useful addition, thanks!
Should we maybe catch a PermissionError as well?
And feel free to add an entry in whats-new.
When passing a directory to open_dataset(), the scipy backend fails and a "RuntimeWarning: 'scipy' fails while guessing" is produced. This affects me since I'm implementing a backend to read data written by the adios2 package, whose data "files" are actually a directory. This tiny patch treats this case just like file not found, that is, the scipy backend will now return that it cannot open such a "file", but without raising an exception.
4505e6f to
133e3ddComparegermasch
commented
Dec 25, 2024
I figured this change is too minor to justify a whats-new entry, but I'd be happy to do so if you'd like. Good point about considering |
headtr1ck
commented
Dec 29, 2024
You are right, a PermissionError should be raised normally here. You can still add an entry in what's new if you like. |
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
headtr1ck
commented
Jan 1, 2025
Thanks! |
* main: (63 commits) Fix zarr upstream tests (pydata#9927) Update pre-commit hooks (pydata#9925) split out CFDatetimeCoder, deprecate use_cftime as kwarg (pydata#9901) dev whats-new (pydata#9923) Whats-new 2025.01.0 (pydata#9919) Silence upstream Zarr warnings (pydata#9920) time coding refactor (pydata#9906) fix warning from scipy backend guess_can_open on directory (pydata#9911) Enhance and move ISO-8601 parser to coding.times (pydata#9899) Edit serialization error message (pydata#9916) friendlier error messages for missing chunk managers (pydata#9676) Bump codecov/codecov-action from 5.1.1 to 5.1.2 in the actions group (pydata#9915) Rewrite interp to use `apply_ufunc` (pydata#9881) Skip dask rolling (pydata#9909) Explicitly configure ReadTheDocs build to use conf.py (pydata#9908) Cache pre-existing Zarr arrays in Zarr backend (pydata#9861) Optimize idxmin, idxmax with dask (pydata#9800) remove unused "type: ignore" comments in test_plot.py (fixed in matplotlib 3.10.0) (pydata#9904) move scalar-handling logic into `possibly_convert_objects` (pydata#9900) Add missing DataTree attributes to docs (pydata#9876) ...

When passing a directory to open_dataset(), the scipy backend fails and a "RuntimeWarning: 'scipy' fails while guessing" is produced.
This affects me since I'm implementing a backend to read data written by the adios2 package, whose data "files" are actually a directory.
This tiny patch treats this case just like file not found, that is, the scipy backend will now return that it cannot open such a "file", but without raising an exception.