Generate vector data cube

Generate a vector data cube representation of the final data product, using CF encoding of geometries.

import os

import xarray as xr
import xvec
import shapely

os.environ["ZARR_V3_EXPERIMENTAL_API"] = "1"
ds = xr.open_zarr("/eurofab_predictions_datacube.zarr", zarr_format=3).load()
/Users/martin/dev/xvec/.pixi/envs/default/lib/python3.13/site-packages/zarr/codecs/vlen_utf8.py:44: UserWarning: The codec `vlen-utf8` is currently not part in the Zarr format 3 specification. It may not be supported by other zarr implementations and may change in the future.
  return cls(**configuration_parsed)
ds['geometry'] = xr.apply_ufunc(shapely.from_wkt, ds['geometry'])
vdc = ds.swap_dims(obs='geometry').drop_vars('obs').xvec.set_geom_indexes("geometry", crs=27700)
encoded = vdc.drop_vars(['lon', 'lat']).xvec.encode_cf()
encoded.to_zarr("eurofab_predictions_vector_datacube.zarr", mode="w")
/Users/martin/dev/xvec/.pixi/envs/default/lib/python3.13/site-packages/zarr/api/asynchronous.py:205: UserWarning: Consolidated metadata is currently not part in the Zarr format 3 specification. It may not be supported by other zarr implementations and may change in the future.
  warnings.warn(
<xarray.backends.zarr.ZarrStore at 0x3ccce3be0>