-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Move absolute path finder from open_mfdataset to own function #7968
Conversation
else: | ||
paths = sorted(glob(_normalize_path(paths))) | ||
elif isinstance(paths, os.PathLike): | ||
paths = [os.fspath(paths)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know that this is just moved from the previous location, but is there a reason why we don't convert to absolute path here and below?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure, it's a little odd to me as well.
I haven't really felt the need for os.PathLike in my normal usage so I don't have much experience with that part though.
Co-authored-by: Michael Niklas <[email protected]>
@Illviljan see also xarray-contrib/datatree#51 |
@TomNicholas I've found the current open_datatree implementations too focused on zarr and netcdf. Which is fine, it's the most popular after all. |
* main: Remove hue_style from plot1d docstring (pydata#7925) Add new what's new section (pydata#7986) Release summary for v2023.07.0 (pydata#7979) Improve explanation in example "Working with Multidimensional Coordinates" (pydata#7984) Fix typo in zarr.py (pydata#7983) Examples added to docstrings (pydata#7936) [pre-commit.ci] pre-commit autoupdate (pydata#7973) Skip broken tests on python 3.11 and windows (pydata#7972) Use another repository for upstream testing (pydata#7970) Move absolute path finder from open_mfdataset to own function (pydata#7968) ensure no forward slashes in names for HDF5-based backends (pydata#7953) Chunked array docs (pydata#7951) [pre-commit.ci] pre-commit autoupdate (pydata#7959) manually unshallow the repository on RTD (pydata#7961) Update minimum version of typing extensions in pre-commit (pydata#7960) Docstring examples (pydata#7881)
A simple refactor to make it easier to retrieve the proper paths that
open_mfdataset
uses and passes on the engine.I've been thinking how to make use of DataTree and one idea I wanted to try was:
_find_absolute_path
).xr.open_mfdataset(..., group=group)