z3fdb.simple_store_builder ========================== .. py:module:: z3fdb.simple_store_builder Classes ------- .. autoapisummary:: z3fdb.simple_store_builder.SimpleStoreBuilder Module Contents --------------- .. py:class:: SimpleStoreBuilder(fdb_config_file: pathlib.Path | None = None) Builder to create a Zarr store with FDB backing. This builder will create a Zarr store with a Zarr Array at its root ("/") containing the data from your MARS request(s). It is exactly :class:`~z3fdb.CustomStoreBuilder` restricted to the root array, and delegates to it -- so the two cannot drift apart. :param fdb_config_file: Optional path to FDB config file. If not set normal FDB config file resolution is applied. .. py:attribute:: _builder .. py:method:: add_part(mars_request: pychunked_data_view.MarsSelection, axes: list[pychunked_data_view.AxisDefinition], extractor: pychunked_data_view.ExtractorType.Grib | pychunked_data_view.ExtractorType.GribJump) -> None Add a MARS request to the view. :param mars_request: A dict mapping MARS keys to their values. Single values may be given as ``str``, ``int``, or ``float``; multi-valued keys may be given as a list. MARS range expressions (e.g. ``"2020-01-01/to/2020-01-04"``) must be passed as a plain string value. For example:: { "type": "an", "class": "ea", "domain": "g", "expver": "0001", "stream": "oper", "date": "2020-01-01/to/2020-01-04", "levtype": "sfc", "step": 0, "param": [167, 131, 132], "time": "0/to/21/by/3", } :type mars_request: MarsSelection :param axes: List of AxisDefinitions that describe how axis in the MARS request are mapped to axis in the Zarr array. :type axes: :obj:`list` of :obj:`AxisDefinition` :param extractor: Extractor configuration object. Use ``ExtractorType.Grib()`` for full-field GRIB extraction or ``ExtractorType.GribJump(...)`` for partial-field extraction. .. py:method:: fill_missing_value(value: float) -> None Set the fill value used for bitmap-masked grid points. Call :meth:`add_part` first: this configures the array, so there has to be one. :param value: Fill value written into array positions that carry a GRIB bitmap missing flag. Also used as the zarr array fill_value. :type value: float :raises ValueError: If no part has been added yet. .. py:method:: extend_on_axis(axis: int) -> None Defines the extension axis when multiple parts are added. Call :meth:`add_part` first: this configures the array, so there has to be one. :param axis: Index of the axis that is extended when multiple parts have been added. :type axis: int :raises ValueError: If no part has been added yet. .. py:method:: build() -> z3fdb._internal.zarr.FdbZarrStore Build the store from the registered parts. :returns: :class:`~z3fdb._internal.zarr.FdbZarrStore` ready to pass to ``zarr.open_array()``. :raises RuntimeError: If the view is misconfigured -- no parts, a missing extension axis, incompatible part shapes, or parts that disagree about the grid. These originate as ``eckit::UserError`` in the C++ layer.