@@ -675,10 +675,8 @@ def copy_store(
675
675
676
676
# setup logging
677
677
with _LogWriter (log ) as log :
678
-
679
678
# iterate over source keys
680
679
for source_key in sorted (source .keys ()):
681
-
682
680
# filter to keys under source path
683
681
if source_store_version == 2 :
684
682
if not source_key .startswith (source_path ):
@@ -757,7 +755,7 @@ def copy(
757
755
log = None ,
758
756
if_exists = "raise" ,
759
757
dry_run = False ,
760
- ** create_kws
758
+ ** create_kws ,
761
759
):
762
760
"""Copy the `source` array or group into the `dest` group.
763
761
@@ -878,7 +876,6 @@ def copy(
878
876
879
877
# setup logging
880
878
with _LogWriter (log ) as log :
881
-
882
879
# do the copying
883
880
n_copied , n_skipped , n_bytes_copied = _copy (
884
881
log ,
@@ -890,7 +887,7 @@ def copy(
890
887
without_attrs = without_attrs ,
891
888
if_exists = if_exists ,
892
889
dry_run = dry_run ,
893
- ** create_kws
890
+ ** create_kws ,
894
891
)
895
892
896
893
# log a final message with a summary of what happened
@@ -948,12 +945,10 @@ def _copy(log, source, dest, name, root, shallow, without_attrs, if_exists, dry_
948
945
949
946
# take action
950
947
if do_copy :
951
-
952
948
# log a message about what we're going to do
953
949
log ("copy {} {} {}" .format (source .name , source .shape , source .dtype ))
954
950
955
951
if not dry_run :
956
-
957
952
# clear the way
958
953
if exists :
959
954
del dest [name ]
@@ -1038,12 +1033,10 @@ def _copy(log, source, dest, name, root, shallow, without_attrs, if_exists, dry_
1038
1033
1039
1034
# take action
1040
1035
if do_copy :
1041
-
1042
1036
# log action
1043
1037
log ("copy {}" .format (source .name ))
1044
1038
1045
1039
if not dry_run :
1046
-
1047
1040
# clear the way
1048
1041
if exists_array :
1049
1042
del dest [name ]
@@ -1056,7 +1049,6 @@ def _copy(log, source, dest, name, root, shallow, without_attrs, if_exists, dry_
1056
1049
grp .attrs .update (source .attrs )
1057
1050
1058
1051
else :
1059
-
1060
1052
# setup for dry run without creating any groups in the
1061
1053
# destination
1062
1054
if dest is not None :
@@ -1076,7 +1068,7 @@ def _copy(log, source, dest, name, root, shallow, without_attrs, if_exists, dry_
1076
1068
without_attrs = without_attrs ,
1077
1069
if_exists = if_exists ,
1078
1070
dry_run = dry_run ,
1079
- ** create_kws
1071
+ ** create_kws ,
1080
1072
)
1081
1073
n_copied += c
1082
1074
n_skipped += s
@@ -1099,7 +1091,7 @@ def copy_all(
1099
1091
log = None ,
1100
1092
if_exists = "raise" ,
1101
1093
dry_run = False ,
1102
- ** create_kws
1094
+ ** create_kws ,
1103
1095
):
1104
1096
"""Copy all children of the `source` group into the `dest` group.
1105
1097
@@ -1189,7 +1181,6 @@ def copy_all(
1189
1181
1190
1182
# setup logging
1191
1183
with _LogWriter (log ) as log :
1192
-
1193
1184
for k in source .keys ():
1194
1185
c , s , b = _copy (
1195
1186
log ,
@@ -1201,7 +1192,7 @@ def copy_all(
1201
1192
without_attrs = without_attrs ,
1202
1193
if_exists = if_exists ,
1203
1194
dry_run = dry_run ,
1204
- ** create_kws
1195
+ ** create_kws ,
1205
1196
)
1206
1197
n_copied += c
1207
1198
n_skipped += s
@@ -1262,7 +1253,6 @@ def is_zarr_key(key):
1262
1253
return key .endswith (".zarray" ) or key .endswith (".zgroup" ) or key .endswith (".zattrs" )
1263
1254
1264
1255
else :
1265
-
1266
1256
assert_zarr_v3_api_available ()
1267
1257
1268
1258
sfx = _get_metadata_suffix (store ) # type: ignore
0 commit comments