Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

`identical` returns False after read-write round trip

Đang mở
#141 2 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
58/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
python
Lĩnh vực
data

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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

Ngôn ngữ chính
Python
Star
139
Fork
14
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của xarray-contrib/xvec

Tất cả issue của xarray-contrib/xvec

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.