Skip to content

Commit

Permalink
chore: code fixes for mypy (#810)
Browse files Browse the repository at this point in the history
  • Loading branch information
zarath authored Feb 27, 2025
1 parent e8b61c3 commit ace8e75
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/NanoVNASaver/Charts/TDR.py
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ def mouseMoveEvent(self, a0: QMouseEvent) -> None:
self.update()

def _draw_ticks(
self, height, _width, x_step, min_index, qp: QPainter
self, height, _width, _x_step, min_index, qp: QPainter
) -> None:
desired_steps = math.ceil(
(self.width() - self.leftMargin - self.rightMargin) / 100
Expand Down Expand Up @@ -483,7 +483,7 @@ def _draw_max_point(
True,
)

def _draw_marker(self, height, x_step, y_step, min_index, qp: QPainter):
def _draw_marker(self, height, _x_step, _y_step, _min_index, qp: QPainter):
marker_point = QPoint(
self.positionAtLength(self.marker_location, limit=False),
(self.topMargin + height),
Expand Down Expand Up @@ -568,14 +568,14 @@ def _draw_graph(self, height, width, qp: QPainter) -> None:
qp.drawLine(last_pt, point)
last_pt = point
else:
[qp.drawPoint(p) for p in tdr_points if self.isPlotable(p)]
for p in tdr_points:
if self.isPlotable(p):
qp.drawPoint(p)
pen.setColor(Chart.color.sweep_secondary)
qp.setPen(pen)
[
qp.drawPoint(p)
for p in step_response_points
if self.isPlotable(p)
]
for p in step_response_points:
if self.isPlotable(p):
qp.drawPoint(p)

self._draw_max_point(height, x_step, y_step, min_index, qp)

Expand Down Expand Up @@ -736,7 +736,7 @@ def _draw_centered_hanging_text(

# Compute top-left position for centered text
x = center.x() - text_width // 2
y = round(center.y() + (-text_height / 4 if above else text_height))
y = center.y() + (-text_height / 4 if above else text_height)

# enhance readability when drawn over ticks
margin = 5
Expand Down

0 comments on commit ace8e75

Please sign in to comment.