chore: address linting errors

This commit is contained in:
Anand Balakrishnan 2023-09-01 11:23:37 -07:00
parent 7f97c97b30
commit b58f67b272
No known key found for this signature in database
8 changed files with 16 additions and 53 deletions

View file

@ -10,4 +10,3 @@ proc-macro = true
proc-macro2 = "1.0.58" proc-macro2 = "1.0.58"
quote = "1.0.27" quote = "1.0.27"
syn = { version = "2.0.16", features = ["full"] } syn = { version = "2.0.16", features = ["full"] }

View file

@ -1 +0,0 @@

View file

@ -1,13 +0,0 @@
from typing import List, Optional, Tuple, Type, Union
from argus._argus import DType as DType
from argus.exprs import ConstBool, ConstFloat, ConstInt, ConstUInt, VarBool, VarFloat, VarInt, VarUInt
from argus.signals import Signal
AllowedDtype = Union[bool, int, float]
def declare_var(name: str, dtype: Union[DType, Type[AllowedDtype]]) -> Union[VarBool, VarInt, VarUInt, VarFloat]: ...
def literal(value: AllowedDtype) -> Union[ConstBool, ConstInt, ConstUInt, ConstFloat]: ...
def signal(
dtype: Union[DType, Type[AllowedDtype]], *, data: Optional[Union[AllowedDtype, List[Tuple[float, AllowedDtype]]]] = ...
) -> Signal: ...

View file

@ -1,6 +1,6 @@
from abc import ABC from abc import ABC
from enum import Enum, auto from enum import Enum, auto
from typing import List, Tuple, final from typing import List, Optional, Tuple, final
class NumExpr(ABC): class NumExpr(ABC):
def __ge__(self, other) -> NumExpr: ... def __ge__(self, other) -> NumExpr: ...
@ -138,7 +138,9 @@ class BoolSignal(Signal):
def constant(value: bool) -> BoolSignal: ... def constant(value: bool) -> BoolSignal: ...
@staticmethod @staticmethod
def from_samples(samples: List[Tuple[float, bool]]) -> BoolSignal: ... def from_samples(samples: List[Tuple[float, bool]]) -> BoolSignal: ...
def push(self, time, value): ... def push(self, time: float, value: bool): ...
def is_empty(self) -> bool: ...
def at(self, time: float) -> Optional[bool]: ...
@final @final
class IntSignal(Signal): class IntSignal(Signal):
@ -147,7 +149,9 @@ class IntSignal(Signal):
def constant(value: int) -> IntSignal: ... def constant(value: int) -> IntSignal: ...
@staticmethod @staticmethod
def from_samples(samples: List[Tuple[float, int]]) -> IntSignal: ... def from_samples(samples: List[Tuple[float, int]]) -> IntSignal: ...
def push(self, time, value): ... def push(self, time: float, value: int): ...
def is_empty(self) -> bool: ...
def at(self, time: float) -> Optional[int]: ...
@final @final
class UnsignedIntSignal(Signal): class UnsignedIntSignal(Signal):
@ -156,16 +160,20 @@ class UnsignedIntSignal(Signal):
def constant(value: int) -> UnsignedIntSignal: ... def constant(value: int) -> UnsignedIntSignal: ...
@staticmethod @staticmethod
def from_samples(samples: List[Tuple[float, int]]) -> UnsignedIntSignal: ... def from_samples(samples: List[Tuple[float, int]]) -> UnsignedIntSignal: ...
def push(self, time, value): ... def push(self, time: float, value: int): ...
def is_empty(self) -> bool: ...
def at(self, time: float) -> Optional[int]: ...
@final @final
class FloatSignal(Signal): class FloatSignal(Signal):
def __init__(self): ... def __init__(self): ...
@staticmethod @staticmethod
def constant(value: float) -> UnsignedIntSignal: ... def constant(value: float) -> FloatSignal: ...
@staticmethod @staticmethod
def from_samples(samples: List[Tuple[float, float]]) -> FloatSignal: ... def from_samples(samples: List[Tuple[float, float]]) -> FloatSignal: ...
def push(self, time, value): ... def push(self, time: float, value: float): ...
def is_empty(self) -> bool: ...
def at(self, time: float) -> Optional[float]: ...
@final @final
class Trace: ... class Trace: ...

View file

@ -1,22 +0,0 @@
from argus._argus import Abs as Abs
from argus._argus import Add as Add
from argus._argus import Always as Always
from argus._argus import And as And
from argus._argus import BoolExpr as BoolExpr
from argus._argus import ConstBool as ConstBool
from argus._argus import ConstFloat as ConstFloat
from argus._argus import ConstInt as ConstInt
from argus._argus import ConstUInt as ConstUInt
from argus._argus import Div as Div
from argus._argus import Eventually as Eventually
from argus._argus import Mul as Mul
from argus._argus import Negate as Negate
from argus._argus import Next as Next
from argus._argus import Not as Not
from argus._argus import NumExpr as NumExpr
from argus._argus import Or as Or
from argus._argus import Until as Until
from argus._argus import VarBool as VarBool
from argus._argus import VarFloat as VarFloat
from argus._argus import VarInt as VarInt
from argus._argus import VarUInt as VarUInt

View file

@ -1,3 +0,0 @@
from argus._argus import Trace as Trace
from argus._argus import eval_bool_semantics as eval_bool_semantics
from argus._argus import eval_robust_semantics as eval_robust_semantics

View file

@ -1,5 +0,0 @@
from argus._argus import BoolSignal as BoolSignal
from argus._argus import FloatSignal as FloatSignal
from argus._argus import IntSignal as IntSignal
from argus._argus import Signal as Signal
from argus._argus import UnsignedIntSignal as UnsignedIntSignal

View file

@ -66,5 +66,5 @@ def test_correctly_create_signals(data: Tuple[List[Tuple[float, AllowedDtype]],
assert a < len(samples) assert a < len(samples)
assert b < len(samples) assert b < len(samples)
else: else:
assert signal.is_empty() assert signal.is_empty() # type: ignore[attr-defined]
assert signal.at(0) is None assert signal.at(0) is None # type: ignore[attr-defined]