File tree Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ def reduce_references(results):
4040 coords = "minimal" ,
4141 compat = "override" ,
4242 )
43-
43+
4444 return combined_vds
4545
4646
@@ -55,5 +55,9 @@ def reduce_references(results):
5555
5656ds = futures .get_result ()
5757
58- # Save the virtual zarr manifest to s3
59- ds .virtualize .to_kerchunk (f"{ bucket_url } /combined.json" , format = "json" )
58+ # Save the virtual zarr manifest
59+ ds .virtualize .to_kerchunk (f"combined.json" , format = "json" )
60+
61+ # Upload manifest to s3
62+ fs_write = fsspec .filesystem ("s3" , anon = False , skip_instance_cache = True )
63+ fs_write .put ("combined.json" , f"{ bucket_url } /combined.json" )
Original file line number Diff line number Diff line change 77# aren't propogated until the kernel is restarted.
88
99import os
10+ import fsspec
1011import xarray as xr
1112
1213bucket_url = os .getenv ("BUCKET_URL" )
1314
15+ target = fsspec .get_mapper (f"{ bucket_url } /rechunked.zarr" )
16+ # client_kwargs={'region_name':'us-west-2'})
17+
1418combined_ds = xr .open_dataset (
1519 f"{ bucket_url } /combined.json" , # location must be accessible to workers
1620 engine = "kerchunk" ,
2630)
2731
2832rechunked_ds .to_zarr (
29- f" { bucket_url } /rechunked.zarr" ,
33+ target ,
3034 mode = "w" ,
3135 encoding = {}, # TODO
3236 consolidated = True ,
You can’t perform that action at this time.
0 commit comments