Skip to content

Commit 2060ca6

Browse files
Revert "added pipeline based tests for mock_wind_sensor"
This reverts commit ce1596e. Reverting an accidental push to the main branch
1 parent 0d57387 commit 2060ca6

File tree

2 files changed

+11
-14
lines changed

2 files changed

+11
-14
lines changed

src/local_pathfinding/local_pathfinding/mock_nodes/node_mock_gps.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,7 @@ def get_next_location(self) -> None:
113113
latitude=destination.latitude, longitude=destination.longitude
114114
)
115115
self._logger.debug(
116-
f"Distance Travelled: {cs.km_to_meters(distance_km):.2f} m," +
117-
f"direction: {self.__heading_deg.heading:.1f} deg," +
118-
f"speed: {self.__mean_speed_kmph.speed:.2f} kmph"
116+
f"Distance Travelled: {cs.km_to_meters(distance_km):.2f} m, direction: {self.__heading_deg.heading:.1f} deg, speed: {self.__mean_speed_kmph.speed:.2f} kmph" # noqa
119117
)
120118

121119
def desired_heading_callback(self, msg: ci.DesiredHeading):

src/local_pathfinding/test/test_wind_coord_systems.py

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
(-170.0, -30.0, -20.0),
2020
(120.0, -150.0, 150.0),
2121
(-45.0, 135.0, -90.0),
22-
],
22+
]
2323
)
2424
def test_boat_to_global_coordinate(boat_heading: float, wind_direction: float, expected: float):
2525
assert wcs.boat_to_global_coordinate(boat_heading, wind_direction) == pytest.approx(
@@ -39,14 +39,14 @@ def test_boat_to_global_coordinate(boat_heading: float, wind_direction: float, e
3939
(180.0, 0.0, 0.0),
4040
(-170.0, 150.0, 140.0),
4141
(120.0, -150.0, -90.0),
42-
],
42+
]
4343
)
44-
def test_global_to_boat_coordinate(
45-
boat_heading: float, global_wind_direction: float, expected: float
46-
):
47-
assert wcs.global_to_boat_coordinate(boat_heading, global_wind_direction) == pytest.approx(
48-
expected
49-
), "incorrect angle conversion" # noqa
44+
def test_global_to_boat_coordinate(boat_heading: float,
45+
global_wind_direction: float,
46+
expected: float):
47+
assert (
48+
wcs.global_to_boat_coordinate(boat_heading, global_wind_direction) == pytest.approx(expected) # noqa
49+
), "incorrect angle conversion"
5050

5151

5252
@pytest.mark.parametrize(
@@ -98,8 +98,6 @@ def test_get_true_wind_direction(
9898
(45.0, 3.0, 45.0, 3.0, 0.0, 0.0),
9999
(180.0, 10.0, 0.0, 5.0, 180.0, 15.0),
100100
(90.0, 8.0, -90.0, 8.0, 90.0, 16.0),
101-
(-90.0, 30.0, -74.0, 0.2, -90.1, 29.81),
102-
(0.0, 30.0, 0.0, 0.0, 0.0, 30.0),
103101
],
104102
)
105103
def test_get_apparent_wind_direction(
@@ -111,7 +109,8 @@ def test_get_apparent_wind_direction(
111109
expected_speed: float,
112110
):
113111
aw_dir_rad, aw_speed_kmph = wcs.get_apparent_wind(
114-
tw_direction_degrees, tw_speed, heading_degrees, speed
112+
tw_direction_degrees,
113+
tw_speed, heading_degrees, speed
115114
)
116115

117116
# Convert radians to degrees for easier comparison

0 commit comments

Comments
 (0)