z3fdb.custom_store_builder#
Classes#
Builds a zarr store backed by FDB. |
Module Contents#
- class VGroup#
-
- name: str#
- static _join_path(group)#
- __eq__(value: object, /) bool#
- get_prefix_path() list[str]#
- class CustomStoreBuilder(fdb_config_file: pathlib.Path | None = None)#
Builds a zarr store backed by FDB.
Use add_view() to register one or more MARS request views (each producing a virtual zarr array) at arbitrary nested paths, then call build() to obtain a read-only FdbZarrStore that zarr can open directly.
- _config = None#
- root#
- _merge_vgroup(vgroup: VGroup)#
Insert vgroup into the virtual group tree rooted at self.root.
Navigates the parent chain stored on vgroup. At the first level where the expected child is not yet present (the divergence point) the group is appended and the traversal stops, so the whole subtree described by vgroup is inserted at the correct position.
- _build_structure(path: list[str]) pychunked_data_view.ChunkedDataViewBuilder#
Return the ChunkedDataViewBuilder for path, creating it if needed.
Also ensures the matching VGroup hierarchy is present in self.root and inserts a VArray leaf into its direct parent group.
- add_view(path: list[str], mars_request_key_values: str, axes: list[pychunked_data_view.AxisDefinition], extractor_type: pychunked_data_view.ExtractorType) None#
Register a MARS request as a virtual zarr array at path.
- Parameters:
path – Location of the array in the zarr hierarchy, e.g.
["group_a", "sub_group", "my_array"].mars_request_key_values – MARS request string, e.g.
"type=an,class=ea,date=20200101,param=131".axes – Axis definitions describing how the request dimensions map to zarr array dimensions.
extractor_type – How to extract data from the FDB response (e.g. GRIB).
- extend_on_axis(path: list[str], axis: int) None#
Extend the view at path along the given axis.
- Parameters:
path – Location of the array in the zarr hierarchy (same as used in add_view).
axis – Index of the axis to extend.
- build() zarr.abc.store.Store#
Assemble all registered views into a read-only FdbZarrStore.
Traverses the VGroup tree rooted at self.root. Each VGroup becomes an FdbZarrGroup and each VArray becomes an FdbZarrArray backed by its ChunkedDataViewBuilder.