Skip to content

Commit

Permalink
Enable ruff UP031 rule (TheAlgorithms#11388)
Browse files Browse the repository at this point in the history
  • Loading branch information
MaximSmolskiy authored Apr 30, 2024
1 parent 3925b81 commit 2d6be5f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions data_structures/arrays/sudoku_solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def time_solve(grid):
display(grid_values(grid))
if values:
display(values)
print("(%.5f seconds)\n" % t)
print(f"({t:.5f} seconds)\n")
return (t, solved(values))

times, results = zip(*[time_solve(grid) for grid in grids])
Expand Down Expand Up @@ -217,4 +217,4 @@ def shuffled(seq):
start = time.monotonic()
solve(puzzle)
t = time.monotonic() - start
print("Solved: %.5f sec" % t)
print(f"Solved: {t:.5f} sec")
3 changes: 2 additions & 1 deletion neural_network/input_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,8 @@ def __init__(
self._rng = np.random.default_rng(seed1 if seed is None else seed2)
dtype = dtypes.as_dtype(dtype).base_dtype
if dtype not in (dtypes.uint8, dtypes.float32):
raise TypeError("Invalid image dtype %r, expected uint8 or float32" % dtype)
msg = f"Invalid image dtype {dtype!r}, expected uint8 or float32"
raise TypeError(msg)
if fake_data:
self._num_examples = 10000
self.one_hot = one_hot
Expand Down

0 comments on commit 2d6be5f

Please sign in to comment.