From 8264377ad67bdbaf12771f0dd1ff910dab496f0b Mon Sep 17 00:00:00 2001 From: Lukas Baecker Date: Wed, 27 Nov 2024 16:48:44 +0100 Subject: [PATCH] ruff --- field_friend/__init__.py | 2 +- field_friend/automations/__init__.py | 2 +- field_friend/automations/implements/__init__.py | 8 ++++---- field_friend/automations/navigation/__init__.py | 8 ++++---- field_friend/automations/navigation/field_navigation.py | 9 +++++---- field_friend/interface/components/__init__.py | 6 +++--- field_friend/interface/components/field_creator.py | 5 ++++- field_friend/interface/components/operation.py | 2 ++ field_friend/vision/__init__.py | 4 ++-- tests/test_navigation.py | 3 ++- 10 files changed, 28 insertions(+), 21 deletions(-) diff --git a/field_friend/__init__.py b/field_friend/__init__.py index 414c02ac..90373bf5 100644 --- a/field_friend/__init__.py +++ b/field_friend/__init__.py @@ -2,7 +2,7 @@ from .system import System __all__ = [ + 'System', 'interface', 'log_configuration', - 'System', ] diff --git a/field_friend/automations/__init__.py b/field_friend/automations/__init__.py index f555317f..0505a36e 100644 --- a/field_friend/automations/__init__.py +++ b/field_friend/automations/__init__.py @@ -20,9 +20,9 @@ 'KpiProvider', 'Path', 'PathProvider', + 'Plant', 'PlantLocator', 'PlantProvider', - 'Plant', 'Puncher', 'Row', 'RowSupportPoint', diff --git a/field_friend/automations/implements/__init__.py b/field_friend/automations/implements/__init__.py index a8b6203f..cb1696b1 100644 --- a/field_friend/automations/implements/__init__.py +++ b/field_friend/automations/implements/__init__.py @@ -6,11 +6,11 @@ from .weeding_screw import WeedingScrew __all__ = [ + 'ExternalMower', 'Implement', - 'WeedingImplement', + 'ImplementException', 'Recorder', - 'WeedingScrew', 'Tornado', - 'ExternalMower', - 'ImplementException', + 'WeedingImplement', + 'WeedingScrew', ] diff --git a/field_friend/automations/navigation/__init__.py b/field_friend/automations/navigation/__init__.py index 16642506..ced232fc 100644 --- a/field_friend/automations/navigation/__init__.py +++ b/field_friend/automations/navigation/__init__.py @@ -5,10 +5,10 @@ from .straight_line_navigation import StraightLineNavigation __all__ = [ + 'CrossglideDemoNavigation', + 'FieldNavigation', + 'FollowCropsNavigation', 'Navigation', - 'WorkflowException', 'StraightLineNavigation', - 'FollowCropsNavigation', - 'FieldNavigation', - 'CrossglideDemoNavigation', + 'WorkflowException', ] diff --git a/field_friend/automations/navigation/field_navigation.py b/field_friend/automations/navigation/field_navigation.py index 99a3ef3b..57acd7bf 100644 --- a/field_friend/automations/navigation/field_navigation.py +++ b/field_friend/automations/navigation/field_navigation.py @@ -1,7 +1,3 @@ -from .straight_line_navigation import StraightLineNavigation -from ..implements.implement import Implement -from ..implements.weeding_implement import WeedingImplement -from ..field import Field, Row from enum import Enum, auto from random import randint from typing import TYPE_CHECKING, Any @@ -11,6 +7,11 @@ from nicegui import ui from rosys.geometry import Point, Pose +from ..field import Field, Row +from ..implements.implement import Implement +from ..implements.weeding_implement import WeedingImplement +from .straight_line_navigation import StraightLineNavigation + if TYPE_CHECKING: from ...system import System diff --git a/field_friend/interface/components/__init__.py b/field_friend/interface/components/__init__.py index 4b7388f4..9d401da0 100644 --- a/field_friend/interface/components/__init__.py +++ b/field_friend/interface/components/__init__.py @@ -9,11 +9,11 @@ __all__ = [ 'CameraCard', - 'create_development_ui', - 'create_header', - 'create_status_drawer', 'LeafletMap', 'Monitoring', 'Operation', 'RobotScene', + 'create_development_ui', + 'create_header', + 'create_status_drawer', ] diff --git a/field_friend/interface/components/field_creator.py b/field_friend/interface/components/field_creator.py index e6ee4041..4acfdafc 100644 --- a/field_friend/interface/components/field_creator.py +++ b/field_friend/interface/components/field_creator.py @@ -3,12 +3,15 @@ from collections.abc import Callable from typing import TYPE_CHECKING from uuid import uuid4 + import rosys from nicegui import ui +from nicegui.elements.leaflet_layers import Marker + from field_friend.automations.field import Field from field_friend.interface.components.monitoring import CameraPosition from field_friend.localization import GeoPoint -from nicegui.elements.leaflet_layers import Marker + if TYPE_CHECKING: from ...system import System diff --git a/field_friend/interface/components/operation.py b/field_friend/interface/components/operation.py index c725f930..ec30f939 100644 --- a/field_friend/interface/components/operation.py +++ b/field_friend/interface/components/operation.py @@ -2,7 +2,9 @@ import logging from typing import TYPE_CHECKING + from nicegui import app, events, ui + from .field_creator import FieldCreator from .key_controls import KeyControls from .support_point_dialog import SupportPointDialog diff --git a/field_friend/vision/__init__.py b/field_friend/vision/__init__.py index 64487c87..1fc4ed81 100644 --- a/field_friend/vision/__init__.py +++ b/field_friend/vision/__init__.py @@ -5,12 +5,12 @@ from .camera_configurator import CameraConfigurator __all__ = [ + 'DOT_DISTANCE', 'CalibratableUsbCamera', 'CalibratableUsbCameraProvider', 'CameraConfigurator', - 'configurations', 'Contour', 'Dot', 'Network', - 'DOT_DISTANCE', + 'configurations', ] diff --git a/tests/test_navigation.py b/tests/test_navigation.py index fc10c9df..c059632c 100644 --- a/tests/test_navigation.py +++ b/tests/test_navigation.py @@ -5,9 +5,10 @@ import rosys from conftest import ROBOT_GEO_START_POSITION from rosys.testing import forward + from field_friend import System from field_friend.automations import Field -from field_friend.automations.implements import Implement, Recorder, WeedingImplement, Tornado +from field_friend.automations.implements import Implement, Recorder, Tornado, WeedingImplement from field_friend.automations.navigation import StraightLineNavigation from field_friend.automations.navigation.field_navigation import State as FieldNavigationState from field_friend.localization import GnssSimulation