@@ -885,19 +885,19 @@ def open_store_variable(self, name):
885
885
# probably be 3.1
886
886
import zarr
887
887
888
+ #
888
889
if Version (zarr .__version__ ) >= Version ("3.0.6" ):
889
890
attributes ["_FillValue" ] = (
890
891
# Use the new dtype infrastructure instead of doing xarray
891
892
# specific fill value decoding
892
- zarr_array . metadata . data_type . from_json_value (
893
+ FillValueCoder . decode (
893
894
attributes ["_FillValue" ],
894
- zarr_format = zarr_array .metadata .zarr_format ,
895
+ zarr_array .metadata .data_type . to_native_dtype () ,
895
896
)
896
897
)
897
898
else :
898
- original_zarr_dtype = zarr_array .metadata .data_type
899
899
attributes ["_FillValue" ] = FillValueCoder .decode (
900
- attributes ["_FillValue" ], original_zarr_dtype .value
900
+ attributes ["_FillValue" ], zarr_array . metadata . data_type .value
901
901
)
902
902
903
903
return Variable (dimensions , data , attributes , encoding )
@@ -1015,6 +1015,7 @@ def store(
1015
1015
variables_encoded , attributes = self .encode (
1016
1016
{vn : variables [vn ] for vn in new_variable_names }, attributes
1017
1017
)
1018
+ print (f"{ variables_encoded = } " )
1018
1019
1019
1020
if existing_variable_names :
1020
1021
# We make sure that values to be appended are encoded *exactly*
@@ -1067,6 +1068,7 @@ def store(
1067
1068
else :
1068
1069
variables_to_set = variables_encoded
1069
1070
1071
+ print (f"{ variables_to_set = } " )
1070
1072
self .set_variables (
1071
1073
variables_to_set , check_encoding_set , writer , unlimited_dims = unlimited_dims
1072
1074
)
@@ -1075,6 +1077,7 @@ def store(
1075
1077
if _zarr_v3 ():
1076
1078
kwargs ["zarr_format" ] = self .zarr_group .metadata .zarr_format
1077
1079
zarr .consolidate_metadata (self .zarr_group .store , ** kwargs )
1080
+ print ("DONE STORE.STORE" )
1078
1081
1079
1082
def sync (self ):
1080
1083
pass
@@ -1124,6 +1127,7 @@ def _open_existing_array(self, *, name) -> ZarrArray:
1124
1127
def _create_new_array (
1125
1128
self , * , name , shape , dtype , fill_value , encoding , attrs
1126
1129
) -> ZarrArray :
1130
+ # STRING ERROR FOR OBJECT HERE
1127
1131
if coding .strings .check_vlen_dtype (dtype ) is str :
1128
1132
dtype = str
1129
1133
@@ -1147,6 +1151,8 @@ def _create_new_array(
1147
1151
if c in encoding :
1148
1152
encoding ["config" ][c ] = encoding .pop (c )
1149
1153
1154
+ print ("create" )
1155
+ print (dtype )
1150
1156
zarr_array = self .zarr_group .create (
1151
1157
name ,
1152
1158
shape = shape ,
@@ -1253,6 +1259,8 @@ def set_variables(self, variables, check_encoding_set, writer, unlimited_dims=No
1253
1259
1254
1260
encoding ["overwrite" ] = True if self ._mode == "w" else False
1255
1261
1262
+ print (dtype )
1263
+ print (";sdf" )
1256
1264
zarr_array = self ._create_new_array (
1257
1265
name = name ,
1258
1266
dtype = dtype ,
@@ -1261,6 +1269,8 @@ def set_variables(self, variables, check_encoding_set, writer, unlimited_dims=No
1261
1269
encoding = encoding ,
1262
1270
attrs = encoded_attrs ,
1263
1271
)
1272
+ print (zarr_array )
1273
+ print (type (zarr_array ))
1264
1274
1265
1275
writer .add (v .data , zarr_array , region )
1266
1276
0 commit comments