Skip to content

Commit

Permalink
change error raise to klipper style
Browse files Browse the repository at this point in the history
  • Loading branch information
sbtoonz committed Dec 21, 2024
1 parent f85f135 commit 4fc5ede
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions scanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -1721,7 +1721,7 @@ def _is_faulty_coordinate(self, x, y, add_offsets=False):
def _check_hardware(self, sample):
# Validate sample input
if "data" not in sample or "freq" not in sample:
raise ValueError("Sample must contain 'data' and 'freq' keys.")
raise error("Sample must contain 'data' and 'freq' keys.")

Check failure on line 1724 in scanner.py

View workflow job for this annotation

GitHub Actions / Standard Checks

Ruff (F821)

scanner.py:1724:19: F821 Undefined name `error`

Check failure on line 1724 in scanner.py

View workflow job for this annotation

GitHub Actions / Standard Checks

"error" is not defined (reportUndefinedVariable)

Check failure on line 1724 in scanner.py

View workflow job for this annotation

GitHub Actions / K1 Checks

Ruff (F821)

scanner.py:1724:19: F821 Undefined name `error`

Check failure on line 1724 in scanner.py

View workflow job for this annotation

GitHub Actions / K1 Checks

"error" is not defined (reportUndefinedVariable)

# Initialize variables on the first call
if not hasattr(self, "freq_window"):
Expand Down Expand Up @@ -3308,7 +3308,7 @@ def _generate_path(self):
pa = (begin_a, pos_p) if even else (end_a, pos_p)
pb = (end_a, pos_p) if even else (begin_a, pos_p)

l = (pa, pb)
line_segment = (pa, pb)

if len(points) > 0 and corner_radius > 0:
# We need to insert an overscan corner. Basically we insert
Expand Down Expand Up @@ -3340,8 +3340,8 @@ def _generate_path(self):
center, pos_p - corner_radius, corner_radius, 0, 90
)

points.append(l[0])
points.append(l[1])
points.append(line_segment[0])
points.append(line_segment[1])

if swap_coord:
for i in range(len(points)):
Expand Down

0 comments on commit 4fc5ede

Please sign in to comment.