Skip to content

[pull] master from TheAlgorithms:master #31

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 30, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Enable ruff UP031 rule (TheAlgorithms#11388)
  • Loading branch information
MaximSmolskiy authored Apr 30, 2024
commit 2d6be5fbb0be2b738d2c246138db9ccda9b6a853
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