File tree 2 files changed +4
-3
lines changed
2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -150,7 +150,7 @@ def time_solve(grid):
150
150
display (grid_values (grid ))
151
151
if values :
152
152
display (values )
153
- print ("(% .5f seconds)\n " % t )
153
+ print (f"( { t : .5f} seconds)\n " )
154
154
return (t , solved (values ))
155
155
156
156
times , results = zip (* [time_solve (grid ) for grid in grids ])
@@ -217,4 +217,4 @@ def shuffled(seq):
217
217
start = time .monotonic ()
218
218
solve (puzzle )
219
219
t = time .monotonic () - start
220
- print ("Solved: % .5f sec" % t )
220
+ print (f "Solved: { t : .5f} sec" )
Original file line number Diff line number Diff line change @@ -156,7 +156,8 @@ def __init__(
156
156
self ._rng = np .random .default_rng (seed1 if seed is None else seed2 )
157
157
dtype = dtypes .as_dtype (dtype ).base_dtype
158
158
if dtype not in (dtypes .uint8 , dtypes .float32 ):
159
- raise TypeError ("Invalid image dtype %r, expected uint8 or float32" % dtype )
159
+ msg = f"Invalid image dtype { dtype !r} , expected uint8 or float32"
160
+ raise TypeError (msg )
160
161
if fake_data :
161
162
self ._num_examples = 10000
162
163
self .one_hot = one_hot
You can’t perform that action at this time.
0 commit comments