diff --git a/common/basedir.py b/common/basedir.py index c840b86f7f..6b4811e53c 100644 --- a/common/basedir.py +++ b/common/basedir.py @@ -1,4 +1,4 @@ import os -BASEDIR = os.path.abspath(os.path.join(os.path.dirname(os.path.realpath(__file__)), "../")) \ No newline at end of file +BASEDIR = os.path.abspath(os.path.join(os.path.dirname(os.path.realpath(__file__)), "../")) diff --git a/common/kalman/simple_kalman.py b/common/kalman/simple_kalman.py index 5e1b6ce1fb..cd3b5a1df9 100644 --- a/common/kalman/simple_kalman.py +++ b/common/kalman/simple_kalman.py @@ -9,4 +9,4 @@ def get_kalman_gain(dt, A, C, Q, R, iterations=100): S = C.dot(P).dot(C.T) + R K = P.dot(C.T).dot(np.linalg.inv(S)) P = (np.eye(len(P)) - K.dot(C)).dot(P) - return K \ No newline at end of file + return K diff --git a/common/time.py b/common/time.py index b9da106fd0..c8ef9cd383 100644 --- a/common/time.py +++ b/common/time.py @@ -3,4 +3,4 @@ import datetime MIN_DATE = datetime.datetime(year=2023, month=6, day=1) def system_time_valid(): - return datetime.datetime.now() > MIN_DATE \ No newline at end of file + return datetime.datetime.now() > MIN_DATE diff --git a/conftest.py b/conftest.py index d1787c24ef..285d8b0238 100644 --- a/conftest.py +++ b/conftest.py @@ -52,7 +52,7 @@ def pytest_collection_modifyitems(config, items): @pytest.hookimpl(trylast=True) def pytest_configure(config): - config_line = ( - "xdist_group_class_property: group tests by a property of the class that contains them" - ) - config.addinivalue_line("markers", config_line) \ No newline at end of file + config_line = ( + "xdist_group_class_property: group tests by a property of the class that contains them" + ) + config.addinivalue_line("markers", config_line) diff --git a/pyproject.toml b/pyproject.toml index ffbd5d43b7..0116cb4c5e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -181,7 +181,7 @@ build-backend = "poetry.core.masonry.api" # https://beta.ruff.rs/docs/configuration/#using-pyprojecttoml [tool.ruff] select = ["E", "F", "W", "PIE", "C4", "ISC", "RUF008", "RUF100", "A", "B", "TID251"] -ignore = ["W292", "E741", "E402", "C408", "ISC003", "B027", "B024"] +ignore = ["E741", "E402", "C408", "ISC003", "B027", "B024"] line-length = 160 target-version="py311" exclude = [ @@ -202,4 +202,4 @@ flake8-implicit-str-concat.allow-multiline=false "tools".msg = "Use openpilot.tools" [tool.coverage.run] -concurrency = ["multiprocessing", "thread"] \ No newline at end of file +concurrency = ["multiprocessing", "thread"] diff --git a/selfdrive/boardd/tests/test_pandad.py b/selfdrive/boardd/tests/test_pandad.py index 4036766faa..21cc0b5f37 100755 --- a/selfdrive/boardd/tests/test_pandad.py +++ b/selfdrive/boardd/tests/test_pandad.py @@ -116,4 +116,4 @@ class TestPandad(unittest.TestCase): if __name__ == "__main__": - unittest.main() \ No newline at end of file + unittest.main() diff --git a/selfdrive/debug/auto_fingerprint.py b/selfdrive/debug/auto_fingerprint.py index 78b109b0bd..10e438e546 100755 --- a/selfdrive/debug/auto_fingerprint.py +++ b/selfdrive/debug/auto_fingerprint.py @@ -102,4 +102,4 @@ if __name__ == "__main__": if not new_fw_versions: print("No new fw versions found...") - add_fw_versions(brand, platform, new_fw_versions) \ No newline at end of file + add_fw_versions(brand, platform, new_fw_versions) diff --git a/selfdrive/test/cpp_harness.py b/selfdrive/test/cpp_harness.py index a16b5707f5..f9d3e681a5 100755 --- a/selfdrive/test/cpp_harness.py +++ b/selfdrive/test/cpp_harness.py @@ -8,4 +8,4 @@ from openpilot.common.prefix import OpenpilotPrefix with OpenpilotPrefix(): ret = subprocess.call(sys.argv[1:]) -exit(ret) \ No newline at end of file +exit(ret) diff --git a/selfdrive/test/helpers.py b/selfdrive/test/helpers.py index 552070f024..78b01c983f 100644 --- a/selfdrive/test/helpers.py +++ b/selfdrive/test/helpers.py @@ -71,4 +71,4 @@ def with_processes(processes, init_time=0, ignore_stopped=None): def noop(*args, **kwargs): - pass \ No newline at end of file + pass diff --git a/selfdrive/test/process_replay/conftest.py b/selfdrive/test/process_replay/conftest.py index 3f9744ed61..a78f37f392 100644 --- a/selfdrive/test/process_replay/conftest.py +++ b/selfdrive/test/process_replay/conftest.py @@ -34,4 +34,4 @@ def process_replay_test_arguments(request): request.cls.ignore_msgs = request.config.getoption("--ignore-msgs") request.cls.upload_only = request.config.getoption("--upload-only") request.cls.update_refs = request.config.getoption("--update-refs") - request.cls.long_diff = request.config.getoption("--long-diff") \ No newline at end of file + request.cls.long_diff = request.config.getoption("--long-diff") diff --git a/selfdrive/test/process_replay/helpers.py b/selfdrive/test/process_replay/helpers.py index 0952a01870..8e77454dae 100755 --- a/selfdrive/test/process_replay/helpers.py +++ b/selfdrive/test/process_replay/helpers.py @@ -147,4 +147,4 @@ class TestProcessReplayDiffBase(TestProcessReplayBase): diff_short, diff_long = format_process_diff(diff) - self.assertEqual(len(diff), 0, "\n" + diff_long if self.long_diff else diff_short) \ No newline at end of file + self.assertEqual(len(diff), 0, "\n" + diff_long if self.long_diff else diff_short) diff --git a/selfdrive/test/process_replay/test_processes.py b/selfdrive/test/process_replay/test_processes.py index eb01e50e33..1517d9bab0 100755 --- a/selfdrive/test/process_replay/test_processes.py +++ b/selfdrive/test/process_replay/test_processes.py @@ -96,4 +96,4 @@ class TestCarProcessReplay(TestProcessReplayDiffBase): if __name__ == '__main__': - pytest.main([*sys.argv[1:], __file__]) \ No newline at end of file + pytest.main([*sys.argv[1:], __file__]) diff --git a/selfdrive/ui/soundd.py b/selfdrive/ui/soundd.py index 9d6d24a594..dc1b7061e1 100644 --- a/selfdrive/ui/soundd.py +++ b/selfdrive/ui/soundd.py @@ -158,4 +158,4 @@ def main(): if __name__ == "__main__": - main() \ No newline at end of file + main() diff --git a/system/hardware/hw.py b/system/hardware/hw.py index 6c3d90345c..a8967520e3 100644 --- a/system/hardware/hw.py +++ b/system/hardware/hw.py @@ -53,4 +53,4 @@ class Paths: if PC: return Paths.comma_home() else: - return "/tmp/.comma" \ No newline at end of file + return "/tmp/.comma" diff --git a/tools/sim/bridge/carla/carla_bridge.py b/tools/sim/bridge/carla/carla_bridge.py index dc2377df30..fe7b34802f 100644 --- a/tools/sim/bridge/carla/carla_bridge.py +++ b/tools/sim/bridge/carla/carla_bridge.py @@ -19,4 +19,4 @@ class CarlaBridge(SimulatorBridge): client.set_timeout(5) return CarlaWorld(client, high_quality=self.high_quality, dual_camera=self.dual_camera, - num_selected_spawn_point=self.num_selected_spawn_point, town=self.town) \ No newline at end of file + num_selected_spawn_point=self.num_selected_spawn_point, town=self.town) diff --git a/tools/sim/bridge/metadrive/metadrive_process.py b/tools/sim/bridge/metadrive/metadrive_process.py index 3d21c0e508..3ce89d7d41 100644 --- a/tools/sim/bridge/metadrive/metadrive_process.py +++ b/tools/sim/bridge/metadrive/metadrive_process.py @@ -96,4 +96,4 @@ def metadrive_process(dual_camera: bool, config: dict, camera_array, controls_re # wide_road_image = get_cam_as_rgb("rgb_wide") road_image[...] = get_cam_as_rgb("rgb_road") - rk.keep_time() \ No newline at end of file + rk.keep_time() diff --git a/tools/sim/lib/camerad.py b/tools/sim/lib/camerad.py index cc6f0cd664..95769dd44e 100644 --- a/tools/sim/lib/camerad.py +++ b/tools/sim/lib/camerad.py @@ -67,4 +67,4 @@ class Camerad: 0.0, 0.0, 1.0] } setattr(dat, pub_type, msg) - self.pm.send(pub_type, dat) \ No newline at end of file + self.pm.send(pub_type, dat) diff --git a/tools/sim/lib/common.py b/tools/sim/lib/common.py index b7aa66f5c5..29c5858d33 100644 --- a/tools/sim/lib/common.py +++ b/tools/sim/lib/common.py @@ -91,4 +91,4 @@ class World(ABC): @abstractmethod def reset(self): - pass \ No newline at end of file + pass diff --git a/tools/sim/lib/simulated_car.py b/tools/sim/lib/simulated_car.py index ab60fad8d3..0740f9e3aa 100644 --- a/tools/sim/lib/simulated_car.py +++ b/tools/sim/lib/simulated_car.py @@ -116,4 +116,4 @@ class SimulatedCar: if self.idx % 50 == 0: # only send panda states at 2hz self.send_panda_state(simulator_state) - self.idx += 1 \ No newline at end of file + self.idx += 1 diff --git a/tools/sim/lib/simulated_sensors.py b/tools/sim/lib/simulated_sensors.py index 764f99f4d5..faa8c0691b 100644 --- a/tools/sim/lib/simulated_sensors.py +++ b/tools/sim/lib/simulated_sensors.py @@ -122,4 +122,4 @@ class SimulatedSensors: if (now - self.last_perp_update) > 0.25: self.send_peripheral_state() - self.last_perp_update = now \ No newline at end of file + self.last_perp_update = now