@@ -248,7 +248,7 @@ def save_group(store: StoreLike, *args, zarr_version=None, path=None, **kwargs):
248
248
try :
249
249
grp = _create_group (_store , path = path , overwrite = True , zarr_version = zarr_version )
250
250
for i , arr in enumerate (args ):
251
- k = 'arr_{}' . format ( i )
251
+ k = f 'arr_{ i } '
252
252
grp .create_dataset (k , data = arr , overwrite = True , zarr_version = zarr_version )
253
253
for k , arr in kwargs .items ():
254
254
grp .create_dataset (k , data = arr , overwrite = True , zarr_version = zarr_version )
@@ -517,9 +517,9 @@ def _log_copy_summary(log, dry_run, n_copied, n_skipped, n_bytes_copied):
517
517
message = 'dry run: '
518
518
else :
519
519
message = 'all done: '
520
- message += '{ :,} copied, {:,} skipped'. format ( n_copied , n_skipped )
520
+ message += f' { n_copied :,} copied, { n_skipped :,} skipped'
521
521
if not dry_run :
522
- message += ', {:,} bytes copied' . format ( n_bytes_copied )
522
+ message += f ', { n_bytes_copied :,} bytes copied'
523
523
log (message )
524
524
525
525
@@ -710,14 +710,14 @@ def copy_store(source, dest, source_path='', dest_path='', excludes=None,
710
710
711
711
# take action
712
712
if do_copy :
713
- log ('copy {}' . format ( descr ) )
713
+ log (f 'copy { descr } ' )
714
714
if not dry_run :
715
715
data = source [source_key ]
716
716
n_bytes_copied += buffer_size (data )
717
717
dest [dest_key ] = data
718
718
n_copied += 1
719
719
else :
720
- log ('skip {}' . format ( descr ) )
720
+ log (f 'skip { descr } ' )
721
721
n_skipped += 1
722
722
723
723
# log a final message with a summary of what happened
@@ -728,7 +728,7 @@ def copy_store(source, dest, source_path='', dest_path='', excludes=None,
728
728
729
729
def _check_dest_is_group (dest ):
730
730
if not hasattr (dest , 'create_dataset' ):
731
- raise ValueError ('dest must be a group, got {!r}' . format ( dest ) )
731
+ raise ValueError (f 'dest must be a group, got { dest !r} ' )
732
732
733
733
734
734
def copy (source , dest , name = None , shallow = False , without_attrs = False , log = None ,
@@ -915,7 +915,7 @@ def _copy(log, source, dest, name, root, shallow, without_attrs, if_exists,
915
915
if do_copy :
916
916
917
917
# log a message about what we're going to do
918
- log ('copy {} {} {}' . format ( source .name , source .shape , source .dtype ) )
918
+ log (f 'copy { source .name } { source .shape } { source .dtype } ' )
919
919
920
920
if not dry_run :
921
921
@@ -986,7 +986,7 @@ def _copy(log, source, dest, name, root, shallow, without_attrs, if_exists,
986
986
n_copied += 1
987
987
988
988
else :
989
- log ('skip {} {} {}' . format ( source .name , source .shape , source .dtype ) )
989
+ log (f 'skip { source .name } { source .shape } { source .dtype } ' )
990
990
n_skipped += 1
991
991
992
992
elif root or not shallow :
@@ -1008,7 +1008,7 @@ def _copy(log, source, dest, name, root, shallow, without_attrs, if_exists,
1008
1008
if do_copy :
1009
1009
1010
1010
# log action
1011
- log ('copy {}' . format ( source .name ) )
1011
+ log (f 'copy { source .name } ' )
1012
1012
1013
1013
if not dry_run :
1014
1014
@@ -1045,7 +1045,7 @@ def _copy(log, source, dest, name, root, shallow, without_attrs, if_exists,
1045
1045
n_copied += 1
1046
1046
1047
1047
else :
1048
- log ('skip {}' . format ( source .name ) )
1048
+ log (f 'skip { source .name } ' )
1049
1049
n_skipped += 1
1050
1050
1051
1051
return n_copied , n_skipped , n_bytes_copied
0 commit comments