File tree 2 files changed +9
-8
lines changed 2 files changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -75,6 +75,9 @@ Bug fixes
75
75
- Add ``missing_dims `` parameter to transpose (:issue: `4647 `, :pull: `4767 `). By `Daniel Mesejo <https://github.com/mesejo >`_.
76
76
- Resolve intervals before appending other metadata to labels when plotting (:issue: `4322 `, :pull: `4794 `).
77
77
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 >`_.
78
81
79
82
Documentation
80
83
~~~~~~~~~~~~~
Original file line number Diff line number Diff line change @@ -887,7 +887,7 @@ def open_mfdataset(
887
887
paths
888
888
)
889
889
)
890
- paths = sorted (glob (paths ))
890
+ paths = sorted (glob (_normalize_path ( paths ) ))
891
891
else :
892
892
paths = [str (p ) if isinstance (p , Path ) else p for p in paths ]
893
893
@@ -1386,10 +1386,11 @@ def to_zarr(
1386
1386
1387
1387
See `Dataset.to_zarr` for full API docs.
1388
1388
"""
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
+
1393
1394
if encoding is None :
1394
1395
encoding = {}
1395
1396
@@ -1419,9 +1420,6 @@ def to_zarr(
1419
1420
"compute=False before writing data."
1420
1421
)
1421
1422
1422
- if isinstance (store , Path ):
1423
- store = str (store )
1424
-
1425
1423
# validate Dataset keys, DataArray names, and attr keys/values
1426
1424
_validate_dataset_names (dataset )
1427
1425
_validate_attrs (dataset )
You can’t perform that action at this time.
0 commit comments