From dbaba022a26f095a2b00f9f1918abda10be03eec Mon Sep 17 00:00:00 2001 From: Jason Wen Date: Tue, 27 Feb 2024 21:28:12 -0500 Subject: [PATCH] Fix upstream merge conflicts --- common/realtime.py | 2 +- selfdrive/car/interfaces.py | 4 ++-- selfdrive/car/subaru/carcontroller.py | 3 +-- selfdrive/sentry.py | 3 +-- 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/common/realtime.py b/common/realtime.py index 49a38a8ff5..ed0d46532d 100644 --- a/common/realtime.py +++ b/common/realtime.py @@ -46,7 +46,7 @@ def config_realtime_process(cores: int | list[int], priority: int) -> None: set_core_affinity(c) -def set_thread_affinity(thread: threading.Thread, cores: List[int]) -> None: +def set_thread_affinity(thread: threading.Thread, cores: list[int]) -> None: try: process = psutil.Process(thread.ident) process.cpu_affinity(cores) diff --git a/selfdrive/car/interfaces.py b/selfdrive/car/interfaces.py index 9433bcf5eb..0ef758cafe 100644 --- a/selfdrive/car/interfaces.py +++ b/selfdrive/car/interfaces.py @@ -155,7 +155,7 @@ class FluxModel: self.friction_override = (y < 0.1) -def get_nn_model_path(_car, eps_firmware) -> Tuple[Optional[str], float]: +def get_nn_model_path(_car, eps_firmware) -> tuple[str | None, float]: def check_nn_path(_check_model): _model_path = None _max_similarity = -1.0 @@ -182,7 +182,7 @@ def get_nn_model_path(_car, eps_firmware) -> Tuple[Optional[str], float]: return model_path, max_similarity -def get_nn_model(_car, eps_firmware) -> Tuple[Optional[FluxModel], float]: +def get_nn_model(_car, eps_firmware) -> tuple[FluxModel | None, float]: model, similarity_score = get_nn_model_path(_car, eps_firmware) if model is not None: model = FluxModel(model) diff --git a/selfdrive/car/subaru/carcontroller.py b/selfdrive/car/subaru/carcontroller.py index df7447269c..8dc4e1e702 100644 --- a/selfdrive/car/subaru/carcontroller.py +++ b/selfdrive/car/subaru/carcontroller.py @@ -1,5 +1,4 @@ from cereal import car -from typing import Tuple from openpilot.common.numpy_fast import clip, interp from openpilot.common.params import Params from opendbc.can.packer import CANPacker @@ -179,7 +178,7 @@ class CarController: return new_actuators, can_sends # Stop and Go auto-resume thanks to martinl from subaru-community - def stop_and_go(self, CC: car.CarControl, CS: car.CarState, throttle_cmd: bool = False, speed_cmd: bool = False) -> Tuple[bool, bool]: + def stop_and_go(self, CC: car.CarControl, CS: car.CarState, throttle_cmd: bool = False, speed_cmd: bool = False) -> tuple[bool, bool]: if not self.subaru_sng: return throttle_cmd, speed_cmd if self.CP.carFingerprint in PREGLOBAL_CARS: diff --git a/selfdrive/sentry.py b/selfdrive/sentry.py index 6a789e12f0..b94ab0fb8b 100644 --- a/selfdrive/sentry.py +++ b/selfdrive/sentry.py @@ -2,7 +2,6 @@ import sentry_sdk import subprocess from enum import Enum -from typing import Tuple from sentry_sdk.integrations.threading import ThreadingIntegration from openpilot.common.basedir import BASEDIR @@ -93,7 +92,7 @@ def set_tag(key: str, value: str) -> None: sentry_sdk.set_tag(key, value) -def get_properties() -> Tuple[str, str]: +def get_properties() -> tuple[str, str]: params = Params() dongle_id = params.get("DongleId", encoding='utf-8') if dongle_id in (None, UNREGISTERED_DONGLE_ID):