@@ -248,7 +248,7 @@ def save_group(store: StoreLike, *args, zarr_version=None, path=None, **kwargs):
248248 try :
249249 grp = _create_group (_store , path = path , overwrite = True , zarr_version = zarr_version )
250250 for i , arr in enumerate (args ):
251- k = 'arr_{}' . format ( i )
251+ k = f 'arr_{ i } '
252252 grp .create_dataset (k , data = arr , overwrite = True , zarr_version = zarr_version )
253253 for k , arr in kwargs .items ():
254254 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):
517517 message = 'dry run: '
518518 else :
519519 message = 'all done: '
520- message += '{ :,} copied, {:,} skipped'. format ( n_copied , n_skipped )
520+ message += f' { n_copied :,} copied, { n_skipped :,} skipped'
521521 if not dry_run :
522- message += ', {:,} bytes copied' . format ( n_bytes_copied )
522+ message += f ', { n_bytes_copied :,} bytes copied'
523523 log (message )
524524
525525
@@ -710,14 +710,14 @@ def copy_store(source, dest, source_path='', dest_path='', excludes=None,
710710
711711 # take action
712712 if do_copy :
713- log ('copy {}' . format ( descr ) )
713+ log (f 'copy { descr } ' )
714714 if not dry_run :
715715 data = source [source_key ]
716716 n_bytes_copied += buffer_size (data )
717717 dest [dest_key ] = data
718718 n_copied += 1
719719 else :
720- log ('skip {}' . format ( descr ) )
720+ log (f 'skip { descr } ' )
721721 n_skipped += 1
722722
723723 # 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,
728728
729729def _check_dest_is_group (dest ):
730730 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} ' )
732732
733733
734734def 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,
915915 if do_copy :
916916
917917 # 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 } ' )
919919
920920 if not dry_run :
921921
@@ -986,7 +986,7 @@ def _copy(log, source, dest, name, root, shallow, without_attrs, if_exists,
986986 n_copied += 1
987987
988988 else :
989- log ('skip {} {} {}' . format ( source .name , source .shape , source .dtype ) )
989+ log (f 'skip { source .name } { source .shape } { source .dtype } ' )
990990 n_skipped += 1
991991
992992 elif root or not shallow :
@@ -1008,7 +1008,7 @@ def _copy(log, source, dest, name, root, shallow, without_attrs, if_exists,
10081008 if do_copy :
10091009
10101010 # log action
1011- log ('copy {}' . format ( source .name ) )
1011+ log (f 'copy { source .name } ' )
10121012
10131013 if not dry_run :
10141014
@@ -1045,7 +1045,7 @@ def _copy(log, source, dest, name, root, shallow, without_attrs, if_exists,
10451045 n_copied += 1
10461046
10471047 else :
1048- log ('skip {}' . format ( source .name ) )
1048+ log (f 'skip { source .name } ' )
10491049 n_skipped += 1
10501050
10511051 return n_copied , n_skipped , n_bytes_copied
0 commit comments