@@ -109,28 +109,30 @@ def open(
109
109
group = None ,
110
110
application = None ,
111
111
session = None ,
112
+ output_grid = None ,
112
113
timeout = None ,
113
114
verify = None ,
114
115
user_charset = None ,
115
- use_cache = None ,
116
- session_kwargs = None ,
117
- cache_kwargs = None ,
118
- get_kwargs = None ,
119
116
):
120
117
from pydap .client import open_url
121
118
from pydap .net import DEFAULT_TIMEOUT
122
119
120
+ if output_grid is not None :
121
+ # output_grid is no longer passed to pydap.client.open_url
122
+ from xarray .core .utils import emit_user_level_warning
123
+
124
+ emit_user_level_warning (
125
+ "`output_grid` is deprecated and will be removed in a future version"
126
+ " of xarray. Will be set to `None`, the new default. " ,
127
+ DeprecationWarning ,
128
+ )
123
129
kwargs = {
124
130
"url" : url ,
125
131
"application" : application ,
126
132
"session" : session ,
127
133
"timeout" : timeout or DEFAULT_TIMEOUT ,
128
134
"verify" : verify or True ,
129
135
"user_charset" : user_charset ,
130
- "use_cache" : use_cache or False ,
131
- "session_kwargs" : session_kwargs or {},
132
- "cache_kwargs" : cache_kwargs or {},
133
- "get_kwargs" : get_kwargs or {},
134
136
}
135
137
if isinstance (url , str ):
136
138
# check uit begins with an acceptable scheme
@@ -146,9 +148,14 @@ def open(
146
148
147
149
def open_store_variable (self , var ):
148
150
data = indexing .LazilyIndexedArray (PydapArrayWrapper (var ))
149
- dimensions = [
150
- dim .split ("/" )[- 1 ] if dim .startswith ("/" ) else dim for dim in var .dims
151
- ]
151
+ try :
152
+ dimensions = [
153
+ dim .split ("/" )[- 1 ] if dim .startswith ("/" ) else dim for dim in var .dims
154
+ ]
155
+ except AttributeError :
156
+ # GridType does not have a dims attribute - instead get `dimensions`
157
+ # see https://github.com/pydap/pydap/issues/485
158
+ dimensions = var .dimensions
152
159
return Variable (dimensions , data , var .attributes )
153
160
154
161
def get_variables (self ):
@@ -219,26 +226,20 @@ def open_dataset(
219
226
group = None ,
220
227
application = None ,
221
228
session = None ,
229
+ output_grid = None ,
222
230
timeout = None ,
223
231
verify = None ,
224
232
user_charset = None ,
225
- use_cache = None ,
226
- session_kwargs = None ,
227
- cache_kwargs = None ,
228
- get_kwargs = None ,
229
233
) -> Dataset :
230
234
store = PydapDataStore .open (
231
235
url = filename_or_obj ,
232
236
group = group ,
233
237
application = application ,
234
238
session = session ,
239
+ output_grid = output_grid ,
235
240
timeout = timeout ,
236
241
verify = verify ,
237
242
user_charset = user_charset ,
238
- use_cache = use_cache ,
239
- session_kwargs = session_kwargs ,
240
- cache_kwargs = cache_kwargs ,
241
- get_kwargs = get_kwargs ,
242
243
)
243
244
store_entrypoint = StoreBackendEntrypoint ()
244
245
with close_on_error (store ):
@@ -271,10 +272,6 @@ def open_datatree(
271
272
timeout = None ,
272
273
verify = None ,
273
274
user_charset = None ,
274
- use_cache = None ,
275
- session_kwargs = None ,
276
- cache_kwargs = None ,
277
- get_kwargs = None ,
278
275
) -> DataTree :
279
276
groups_dict = self .open_groups_as_dict (
280
277
filename_or_obj ,
@@ -291,10 +288,6 @@ def open_datatree(
291
288
timeout = None ,
292
289
verify = None ,
293
290
user_charset = None ,
294
- use_cache = None ,
295
- session_kwargs = None ,
296
- cache_kwargs = None ,
297
- get_kwargs = None ,
298
291
)
299
292
300
293
return datatree_from_dict_with_io_cleanup (groups_dict )
@@ -316,10 +309,6 @@ def open_groups_as_dict(
316
309
timeout = None ,
317
310
verify = None ,
318
311
user_charset = None ,
319
- use_cache = None ,
320
- session_kwargs = None ,
321
- cache_kwargs = None ,
322
- get_kwargs = None ,
323
312
) -> dict [str , Dataset ]:
324
313
from xarray .core .treenode import NodePath
325
314
@@ -331,10 +320,6 @@ def open_groups_as_dict(
331
320
timeout = timeout ,
332
321
verify = verify ,
333
322
user_charset = user_charset ,
334
- use_cache = use_cache ,
335
- session_kwargs = session_kwargs ,
336
- cache_kwargs = cache_kwargs ,
337
- get_kwargs = get_kwargs ,
338
323
)
339
324
340
325
# Check for a group and make it a parent if it exists
0 commit comments