Installation#

Z3FDB is distributed via PyPI. Install it together with the FDB Python client:

pip install z3fdb pyfdb

Verify the installation by importing the package in a Python REPL:

import z3fdb
print(z3fdb)

Optional: the GribJump Extractor#

Grib works in every installation. GribJump does not: it is compiled only when fdb is configured with

-DENABLE_ZARR_GRIBJUMP_EXTRACTOR=ON

which is off by default, so a wheel from PyPI will not normally have it. The feature needs a bundle build in which gribjump is present as a sibling project. Gribjump itself depends on fdb5, so it cannot simply be resolved as an ordinary installed dependency.

The class is importable and constructible either way, so code does not have to branch on how the wheel was built. Only building a view from it fails:

RuntimeError: GribJumpExtractorDefinition: this build has no GribJump support. Rebuild fdb
with -DENABLE_ZARR_GRIBJUMP_EXTRACTOR=ON (requires a bundle build providing gribjump).

To check before you get there:

from pychunked_data_view import has_gribjump_extractor

print(has_gribjump_extractor)   # False on a default build

The two tutorials both use GribJump; everything else in this documentation works without it.

See also

GRIB and GribJump Extractors for what the two backends do and how to choose.

Running the Tests#

The test suite lives in the FDB source tree rather than the installed wheel, so you need the source at the same version as your installation. Start by checking what version you have:

pip show z3fdb | grep Version
# Version: 5.22.0.3

Clone the repository and check out the tag corresponding to the first three version components (drop the trailing .3):

git clone https://github.com/ecmwf/fdb.git
cd fdb
git checkout 5.22.0

Install the test dependencies, then switch into the tests directory and run both suites together:

pip install eccodes pytest
cd tests
pytest z3fdb pychunked_data_view -v