MCPcopy Index your code
hub / github.com/pydata/xarray / __init__

Method __init__

xarray/backends/netCDF4_.py:409–433  ·  view source on GitHub ↗
(
        self, manager, group=None, mode=None, lock=NETCDF4_PYTHON_LOCK, autoclose=False
    )

Source from the content-addressed store, hash-verified

407 )
408
409 def __init__(
410 self, manager, group=None, mode=None, lock=NETCDF4_PYTHON_LOCK, autoclose=False
411 ):
412 import netCDF4
413
414 if isinstance(manager, netCDF4.Dataset):
415 if group is None:
416 root, group = find_root_and_group(manager)
417 else:
418 if type(manager) is not netCDF4.Dataset:
419 raise ValueError(
420 "must supply a root netCDF4.Dataset if the group "
421 "argument is provided"
422 )
423 root = manager
424 manager = DummyFileManager(root, lock=NETCDF4_PYTHON_LOCK)
425
426 self._manager = manager
427 self._group = group
428 self._mode = mode
429 self.format = self.ds.data_model
430 self._filename = self.ds.filepath()
431 self.is_remote = is_remote_uri(self._filename)
432 self.lock = ensure_lock(lock)
433 self.autoclose = autoclose
434
435 def get_child_store(self, group: str) -> Self:
436 if self._group is not None:

Callers

nothing calls this directly

Calls 5

find_root_and_groupFunction · 0.90
DummyFileManagerClass · 0.90
is_remote_uriFunction · 0.90
ensure_lockFunction · 0.90
typeFunction · 0.85

Tested by

no test coverage detected