Skip to content

Commit

Permalink
mypy
Browse files Browse the repository at this point in the history
  • Loading branch information
LukasBaecker committed Nov 27, 2024
1 parent 30ef220 commit 487d4d8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions field_friend/automations/field_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,5 +167,7 @@ def get_rows_to_work_on(self) -> list[Row]:
def is_row_in_selected_beds(self, row_index: int) -> bool:
if not self._only_specific_beds:
return True
if self.selected_field is None:
return False
bed_index = row_index // self.selected_field.row_count + 1
return bed_index in self.selected_beds
2 changes: 1 addition & 1 deletion field_friend/automations/navigation/field_navigation.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ async def finish(self) -> None:
self.automation_watcher.stop_field_watch()
await self.implement.deactivate()

def get_nearest_row(self) -> Row:
def get_nearest_row(self) -> Row | None:
assert self.field is not None
assert self.gnss.device is not None
row = min(self.field.rows, key=lambda r: r.line_segment().line.foot_point(
Expand Down

0 comments on commit 487d4d8

Please sign in to comment.