Skip to content

Comments

Implement to_icechunk(region=...)#873

Open
vladidobro wants to merge 9 commits intozarr-developers:mainfrom
vladidobro:region
Open

Implement to_icechunk(region=...)#873
vladidobro wants to merge 9 commits intozarr-developers:mainfrom
vladidobro:region

Conversation

@vladidobro
Copy link

@vladidobro vladidobro commented Feb 8, 2026

Vladislav Wohlrath added 3 commits February 8, 2026 11:11
@codecov
Copy link

codecov bot commented Feb 8, 2026

Codecov Report

❌ Patch coverage is 94.73684% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.04%. Comparing base (bf0cb35) to head (30b2ee9).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
virtualizarr/writers/icechunk.py 94.59% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #873      +/-   ##
==========================================
+ Coverage   89.00%   89.04%   +0.03%     
==========================================
  Files          34       34              
  Lines        1956     1980      +24     
==========================================
+ Hits         1741     1763      +22     
- Misses        215      217       +2     
Files with missing lines Coverage Δ
virtualizarr/accessor.py 95.65% <100.00%> (+0.04%) ⬆️
virtualizarr/manifests/utils.py 90.74% <ø> (ø)
virtualizarr/writers/icechunk.py 92.12% <94.59%> (-0.14%) ⬇️

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@vladidobro
Copy link
Author

vladidobro commented Feb 8, 2026

Code coverage: 29 Missing ⚠️

this doesn't look right

EDIT: Ok I see it is because of the failed test probably

mode="r+",
)
vds = xarray_store._validate_and_autodetect_region(vds)
region = xarray_store._write_region

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I notice that this references "private" attributes of a class that's not from this package. Is that considered ok in VirtualiZarr?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi,
in the referenced issue,
#308 (comment)

@TomNicholas said

Whether or not we vendor xarray kind of depends on how much of xarray we would have to vendor... Some of the internals are more stable than others. I would start out by not vendoring anything and we'll see how fragile that looks.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah it's not "okay", but arguably the lesser of two evils. VirtualiZarr as a whole is a slightly weird re-purposing of xarray.

If this is the only internal import from xarray then we have done better than I expected for this feature.

Copy link
Member

@TomNicholas TomNicholas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is looking good @vladidobro !

@vladidobro vladidobro changed the title WIP: Implement to_icechunk(region=...) Implement to_icechunk(region=...) Feb 14, 2026
@aaron-kaplan
Copy link

aaron-kaplan commented Feb 14, 2026

[Edited: please ignore. The bug turned out to be in my test harness. Writes outside the region of the array do in fact raise an exception.]

write_session.store, region={"y": "auto", "x": "auto"}
)

@pytest.mark.xfail(
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should I leave this test here? turns out I was unable write a datatree with xarray anyway

@vladidobro
Copy link
Author

vladidobro commented Feb 14, 2026

Hi,
I think the PR is ready, what do you think about it?
Do you have some more ideas for useful tests that I should add?
@aaron-kaplan @TomNicholas @norlandrhagen

EDIT: actually let me just fix mypy, but otherwise I think it's ok

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Build virtual Zarr store using Xarray's dataset.to_zarr(region="...") model

3 participants