Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
3 changes: 1 addition & 2 deletions examples/http/_bench/benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,8 +250,7 @@
f"std_ratio: {std_ratio}",
)

if len(m) >= TARGET_MEASUREMENTS and std_ratio <= MAX_STD_RATIO:
break
if len(m) >= TARGET_MEASUREMENTS and std_ratio <= MAX_STD_RATIO: break

m = remove_outliers(measurements, k=IQR_MULTIPLIER)
mean_rps = np.mean(m)
Expand Down
7 changes: 2 additions & 5 deletions notebooks/machine_learning/nmf.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,8 @@ def generate_led_digit(
shape: tuple = (11, 6),
pad: int = 1,
) -> np.ndarray:
if digit is not None:
segment = segments[digit]

if segment is None:
return np.zeros(shape)
if digit is not None: segment = segments[digit]
if segment is None: return np.zeros(shape)

height, width = shape
segment_height = (height - 3) // 2
Expand Down
6 changes: 2 additions & 4 deletions notebooks/random/simple_benchmarks.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
# %%timeit
total = 0

for _ in range(1_000_000):
total += 1 # noqa: SIM113
for _ in range(1_000_000): total += 1 # noqa: SIM113

# %%
# %%timeit
Expand All @@ -23,8 +22,7 @@ def fibonacci(n: int) -> int:
a = 0
b = 1

if n == 0:
return a
if n == 0: return a

for _ in range(1, n):
c = a + b
Expand Down
6 changes: 2 additions & 4 deletions notebooks/reinforcement_learning/frozen_lake.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@
state, reward, terminated, _, _ = env.step(action)
images.append(cast("np.ndarray", env.render()))

if terminated:
print("You reached the goal!")
if terminated: print("You reached the goal!")


# %%
Expand Down Expand Up @@ -92,8 +91,7 @@ def compute_state_value(
visited_states.append(state)
value += reward + gamma * value

if terminate:
break
if terminate: break

state = next_state

Expand Down
1 change: 1 addition & 0 deletions packages/config/ruff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ ignore = [
"E111", # indentation-with-invalid-multiple
"E114", # indentation-with-invalid-multiple-comment
"E501", # line-too-long
"E701", # multiple-statements-on-one-line-colon
"E731", # lambda-assignment
"E741", # ambiguous-variable-name
"N801", # invalid-class-name
Expand Down
Loading