Skip to content

Commit

Permalink
Fix prospector warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
mdabrowski1990 committed Nov 4, 2024
1 parent 06bc629 commit 90b0edb
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 16 deletions.
1 change: 1 addition & 0 deletions tests/software_tests/database/test_abstract_data_record.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import pytest
from mock import Mock, patch

from uds.database.abstract_data_record import AbstractDataRecord

SCRIPT_LOCATION = "uds.database.abstract_data_record"
Expand Down
4 changes: 2 additions & 2 deletions uds/can/flow_control.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ class CanFlowStatus(ValidatedEnum, NibbleEnum):

ContinueToSend: "CanFlowStatus" = 0x0 # type: ignore
"""Asks to resume Consecutive Frames transmission."""
Wait: "CanFlowStatus" = 0x1 # type: ignore # noqa: F841
Wait: "CanFlowStatus" = 0x1 # type: ignore
"""Asks to pause Consecutive Frames transmission."""
Overflow: "CanFlowStatus" = 0x2 # type: ignore # noqa: F841
Overflow: "CanFlowStatus" = 0x2 # type: ignore
"""Asks to abort transmission of a diagnostic message."""


Expand Down
24 changes: 12 additions & 12 deletions uds/database/abstract_data_record.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class DecodedDataRecord(TypedDict):

name: str
raw_value: int
physical_value: DataRecordPhysicalValueAlias
physical_value: DataRecordPhysicalValueAlias # noqa: F841


class DataRecordType(ValidatedEnum):
Expand All @@ -40,7 +40,7 @@ class AbstractDataRecord(ABC):

def __init__(self, name: str) -> None:
"""
Common part of initialization for all Data Records.
Initialize common part for all Data Records.
:param name: Name to assign to this Data Record.
Expand All @@ -55,17 +55,17 @@ def name(self) -> str:
"""Name of this Data Record."""
return self.__name

@property
@property # noqa: F841
@abstractmethod
def data_record_type(self) -> DataRecordType:
"""Type of this Data Record."""

@property
@property # noqa: F841
@abstractmethod
def length(self) -> int:
"""Number of bits that this Data Record is carried over."""
"""Get number of bits that this Data Record is stored over."""

@property
@property # noqa: F841
@abstractmethod
def is_reoccurring(self) -> bool:
"""
Expand All @@ -76,7 +76,7 @@ def is_reoccurring(self) -> bool:
- True - number of occurrences might vary
"""

@property
@property # noqa: F841
@abstractmethod
def min_occurrences(self) -> int:
"""
Expand All @@ -86,7 +86,7 @@ def min_occurrences(self) -> int:
equals True.
"""

@property
@property # noqa: F841
@abstractmethod
def max_occurrences(self) -> int:
"""
Expand All @@ -97,13 +97,13 @@ def max_occurrences(self) -> int:
.. warning:: No maximal number (infinite number of occurrences) is represented by `0` value.
"""

@property
@property # noqa: F841
@abstractmethod
def contains(self) -> Tuple["AbstractDataRecord", ...]:
"""Data Records contained by this Data Record."""
"""Get Data Records contained by this Data Record."""

@abstractmethod
def decode(self, raw_value: int) -> DecodedDataRecord:
def decode(self, raw_value: int) -> DecodedDataRecord: # noqa: F841
"""
Decode physical value for provided raw value.
Expand All @@ -113,7 +113,7 @@ def decode(self, raw_value: int) -> DecodedDataRecord:
"""

@abstractmethod
def encode(self, physical_value: DataRecordPhysicalValueAlias) -> int:
def encode(self, physical_value: DataRecordPhysicalValueAlias) -> int: # noqa: F841
"""
Encode raw value for provided physical value.
Expand Down
4 changes: 2 additions & 2 deletions uds/transmission_attributes/transmission_direction.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
class TransmissionDirection(ValidatedEnum, StrEnum):
"""Direction of a communication."""

RECEIVED: "TransmissionDirection" = "Rx" # type: ignore # noqa: F841
RECEIVED: "TransmissionDirection" = "Rx" # type: ignore
"""Incoming transmission from the perspective of the code."""
TRANSMITTED: "TransmissionDirection" = "Tx" # type: ignore # noqa: F841
TRANSMITTED: "TransmissionDirection" = "Tx" # type: ignore
"""Outgoing transmission from the perspective of the code."""

0 comments on commit 90b0edb

Please sign in to comment.