File tree Expand file tree Collapse file tree 2 files changed +9
-8
lines changed Expand file tree Collapse file tree 2 files changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -75,6 +75,9 @@ Bug fixes
7575- Add ``missing_dims `` parameter to transpose (:issue: `4647 `, :pull: `4767 `). By `Daniel Mesejo <https://github.com/mesejo >`_.
7676- Resolve intervals before appending other metadata to labels when plotting (:issue: `4322 `, :pull: `4794 `).
7777 By `Justus Magin <https://github.com/keewis >`_.
78+ - Expand user directory paths (e.g. ``~/ ``) in :py:func: `open_mfdataset ` and
79+ :py:meth: `Dataset.to_zarr ` (:issue: `4783 `, :pull: `4795 `).
80+ By `Julien Seguinot <https://github.com/juseg >`_.
7881
7982Documentation
8083~~~~~~~~~~~~~
Original file line number Diff line number Diff line change @@ -887,7 +887,7 @@ def open_mfdataset(
887887 paths
888888 )
889889 )
890- paths = sorted (glob (paths ))
890+ paths = sorted (glob (_normalize_path ( paths ) ))
891891 else :
892892 paths = [str (p ) if isinstance (p , Path ) else p for p in paths ]
893893
@@ -1386,10 +1386,11 @@ def to_zarr(
13861386
13871387 See `Dataset.to_zarr` for full API docs.
13881388 """
1389- if isinstance (store , Path ):
1390- store = str (store )
1391- if isinstance (chunk_store , Path ):
1392- chunk_store = str (store )
1389+
1390+ # expand str and Path arguments
1391+ store = _normalize_path (store )
1392+ chunk_store = _normalize_path (chunk_store )
1393+
13931394 if encoding is None :
13941395 encoding = {}
13951396
@@ -1419,9 +1420,6 @@ def to_zarr(
14191420 "compute=False before writing data."
14201421 )
14211422
1422- if isinstance (store , Path ):
1423- store = str (store )
1424-
14251423 # validate Dataset keys, DataArray names, and attr keys/values
14261424 _validate_dataset_names (dataset )
14271425 _validate_attrs (dataset )
You can’t perform that action at this time.
0 commit comments