(
self, manager, group=None, mode=None, lock=NETCDF4_PYTHON_LOCK, autoclose=False
)
| 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: |
nothing calls this directly
no test coverage detected