Skip to content

Commit 8da74cf

Browse files
committed
Fix codestyle
1 parent 0f233ee commit 8da74cf

File tree

4 files changed

+10
-7
lines changed

4 files changed

+10
-7
lines changed

jupyter_output_monitor/_monitor.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,10 @@ def monitor_group():
5353
@click.option(
5454
"--atol",
5555
default=0,
56-
help="If an output image for a cell exists, a new image will only be written out if the maximum uint8 difference between the two exceeds atol",
56+
help=(
57+
"If an output image for a cell exists, a new image will only be written "
58+
"out if the maximum uint8 difference between the two exceeds atol"
59+
),
5760
)
5861
@click.option("--headless", is_flag=True, help="Whether to run in headless mode")
5962
def monitor(notebook, url, output, wait_after_execute, atol, headless):

jupyter_output_monitor/_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def max_uint8_difference(image1_bytes, image2_bytes):
4747

4848
# Ensure both images have the same dimensions
4949
if array1.shape != array2.shape:
50-
raise ValueError("Images have different dimensions")
50+
return 256
5151

5252
# Calculate the absolute difference
5353
diff = np.abs(array1.astype(np.int16) - array2.astype(np.int16))

jupyter_output_monitor/tests/test_monitor.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ def test_simple(output_path, threshold):
2626
"--output",
2727
str(output_path),
2828
"--headless",
29-
]
30-
+ extra,
29+
*extra,
30+
],
3131
check=True,
3232
)
3333

@@ -38,7 +38,7 @@ def test_simple(output_path, threshold):
3838

3939
# Output screenshots
4040
if threshold:
41-
assert len(list(output_path.glob("output-*.png"))) in (4,5)
41+
assert len(list(output_path.glob("output-*.png"))) in (4, 5)
4242
else:
4343
assert len(list(output_path.glob("output-*.png"))) >= 4
4444

@@ -50,11 +50,10 @@ def test_simple(output_path, threshold):
5050

5151
# Specifically for cell with index 33
5252
if threshold:
53-
assert len(list(output_path.glob("output-033-*.png"))) in (3,4)
53+
assert len(list(output_path.glob("output-033-*.png"))) in (3, 4)
5454
else:
5555
assert len(list(output_path.glob("output-033-*.png"))) >= 3
5656

57-
5857
# Check that event log exists and is parsable
5958
with open(output_path / "event_log.csv") as f:
6059
reader = csv.reader(f, delimiter=",")

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ lint.ignore = [
5050
"D103",
5151
"D104",
5252
"C901",
53+
"PLR0913",
5354
"PLR0915",
5455
"PLR2004",
5556
"DTZ",

0 commit comments

Comments
 (0)