File tree Expand file tree Collapse file tree 4 files changed +27
-2
lines changed Expand file tree Collapse file tree 4 files changed +27
-2
lines changed Original file line number Diff line number Diff line change @@ -133,6 +133,11 @@ Deprecations
133
133
:py:func: `xarray.open_mfdataset ` when `combine='by_coords' ` is specified.
134
134
Fixes (:issue: `5230 `), via (:pull: `5231 `, :pull: `5255 `).
135
135
By `Tom Nicholas <https://github.com/TomNicholas >`_.
136
+ - The `lock ` keyword argument to :py:func: `open_dataset ` and :py:func: `open_dataarray ` is now
137
+ a backend specific option. It will give a warning if passed to a backend that doesn't support it
138
+ instead of being silently ignored. From the next version it will raise an error.
139
+ This is part of the refactor to support external backends (:issue: `5073 `).
140
+ By `Tom Nicholas <https://github.com/TomNicholas >`_ and `Alessandro Amici <https://github.com/alexamici >`_.
136
141
137
142
138
143
Bug fixes
Original file line number Diff line number Diff line change @@ -449,7 +449,7 @@ def open_dataset(
449
449
relevant when using dask or another form of parallelism. By default,
450
450
appropriate locks are chosen to safely read and write files with the
451
451
currently active dask scheduler. Supported by "netcdf4", "h5netcdf",
452
- "pynio", "pseudonetcdf", "cfgrib".
452
+ "scipy", " pynio", "pseudonetcdf", "cfgrib".
453
453
454
454
See engine open function for kwargs accepted by each specific engine.
455
455
@@ -633,7 +633,7 @@ def open_dataarray(
633
633
relevant when using dask or another form of parallelism. By default,
634
634
appropriate locks are chosen to safely read and write files with the
635
635
currently active dask scheduler. Supported by "netcdf4", "h5netcdf",
636
- "pynio", "pseudonetcdf", "cfgrib".
636
+ "scipy", " pynio", "pseudonetcdf", "cfgrib".
637
637
638
638
See engine open function for kwargs accepted by each specific engine.
639
639
Original file line number Diff line number Diff line change
1
+ import warnings
2
+
1
3
import numpy as np
2
4
3
5
from ..core import indexing
@@ -122,7 +124,16 @@ def open_dataset(
122
124
use_cftime = None ,
123
125
decode_timedelta = None ,
124
126
session = None ,
127
+ lock = None ,
125
128
):
129
+ # TODO remove after v0.19
130
+ if lock is not None :
131
+ warnings .warn (
132
+ "The kwarg 'lock' has been deprecated for this backend, and is now "
133
+ "ignored. In the future passing lock will raise an error." ,
134
+ DeprecationWarning ,
135
+ )
136
+
126
137
store = PydapDataStore .open (
127
138
filename_or_obj ,
128
139
session = session ,
Original file line number Diff line number Diff line change 1
1
import os
2
2
import pathlib
3
+ import warnings
3
4
from distutils .version import LooseVersion
4
5
5
6
import numpy as np
@@ -721,7 +722,15 @@ def open_dataset(
721
722
consolidate_on_close = False ,
722
723
chunk_store = None ,
723
724
storage_options = None ,
725
+ lock = None ,
724
726
):
727
+ # TODO remove after v0.19
728
+ if lock is not None :
729
+ warnings .warn (
730
+ "The kwarg 'lock' has been deprecated for this backend, and is now "
731
+ "ignored. In the future passing lock will raise an error." ,
732
+ DeprecationWarning ,
733
+ )
725
734
726
735
filename_or_obj = _normalize_path (filename_or_obj )
727
736
store = ZarrStore .open_group (
You can’t perform that action at this time.
0 commit comments