Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

`identical` returns False after read-write round trip

Open
#141 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
58/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
python
Domain
data

Research direction

Run the reproducible example and compare the geometry variable and metadata before and after the Zarr round trip. Start with the encode_cf and decode_cf entry points, using issue #26 for context; done means roundtripped.identical(encoded) returns True while the non-geometry comparison remains unchanged.

Written by the indexing model from the issue text.

Description

Following #26.

The identical method returns False after a read-write round trip following the user guide instructions.

Reproducible example:

import geopandas as gpd
import xarray as xr
import xvec  # noqa: F401

cube = xr.Dataset(
    data_vars={"temperature": [20, 20, 20], "relative_humidity": [60, 60, 60]},
    coords={
        "geometry": gpd.points_from_xy(
            [6.7928, 6.1278, 7.3303], [47.0838, 46.2475, 46.2186]
        )
    },
).xvec.set_geom_indexes("geometry", crs="epsg:4326")

encoded = cube.xvec.encode_cf()
encoded.to_zarr("cube.zarr", mode="w")
roundtripped = xr.open_zarr("cube.zarr").xvec.decode_cf()
print("identical: ", roundtripped.identical(encoded))
print(
    "identical (no geometry): ",
    cube.drop_vars("geometry").identical(roundtripped.drop_vars("geometry")),
)

outputs:

identical:  False
identical (no geometry):  True

also note that I am getting this warning:

/path/to/pixi/env/lib/python3.13/site-packages/zarr/api/asynchronous.py:247: ZarrUserWarning: 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(

versions:
geopandas 1.1.2
numpy 2.3.5
xarray 2026.1.0
xvec 0.5.2
zarr 3.1.5

Dominant language
Python
Stars
139
Forks
14
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from xarray-contrib/xvec

All issues in xarray-contrib/xvec

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.