zarr.open_group
zarr.open_group ¶
open_group(
store: StoreLike | None = None,
*,
mode: AccessModeLiteral = "a",
cache_attrs: bool | None = None,
synchronizer: Any = None,
path: str | None = None,
chunk_store: StoreLike | None = None,
storage_options: dict[str, Any] | None = None,
zarr_format: ZarrFormat | None = None,
meta_array: Any | None = None,
attributes: dict[str, JSON] | None = None,
use_consolidated: bool | str | None = None,
) -> Group
Open a group using file-mode-like semantics.
Parameters:
-
store(StoreLike or None, default:None) –StoreLike object to open. See the storage documentation in the user guide for a description of all valid StoreLike values.
-
mode(('r', 'r+', 'a', 'w', 'w-'), default:'r') –Persistence mode: 'r' means read only (must exist); 'r+' means read/write (must exist); 'a' means read/write (create if doesn't exist); 'w' means create (overwrite if exists); 'w-' means create (fail if exists). On a store that cannot delete keys, 'w' raises an error instead of replacing an existing node.
-
cache_attrs(bool, default:None) –If True (default), user attributes will be cached for attribute read operations. If False, user attributes are reloaded from the store prior to all attribute read operations.
-
synchronizer(object, default:None) –Array synchronizer.
-
path(str, default:None) –Group path within store.
-
chunk_store(StoreLike or None, default:None) –Separate storage for chunks. See the storage documentation in the user guide for a description of all valid StoreLike values.
-
storage_options(dict, default:None) –If using an fsspec URL to create the store, these will be passed to the backend implementation. Ignored otherwise.
-
meta_array(array - like, default:None) –An array instance to use for determining arrays to create and return to users. Use
numpy.empty(())by default. -
attributes(dict, default:None) –A dictionary of JSON-serializable values with user-defined attributes.
-
use_consolidated(bool or str, default:None) –Whether to use consolidated metadata.
By default, consolidated metadata is used if it's present in the store (in the
zarr.jsonfor Zarr format 3 and in the.zmetadatafile for Zarr format 2).To explicitly require consolidated metadata, set
use_consolidated=True, which will raise an exception if consolidated metadata is not found.To explicitly not use consolidated metadata, set
use_consolidated=False, which will fall back to using the regular, non consolidated metadata.Zarr format 2 allowed configuring the key storing the consolidated metadata (
.zmetadataby default). Specify the custom key asuse_consolidatedto load consolidated metadata from a non-default key.
Returns:
-
g(Group) –The new group.
Source code in src/zarr/api/synchronous.py
503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 | |