Skip to content

Commit 087f0be

Browse files
committed
Reorganize imports
1 parent 14ef3ba commit 087f0be

8 files changed

Lines changed: 22 additions & 25 deletions

File tree

banquo/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
from typing import Final
22

3+
from ._banquo_impl import Bottom as _Bottom
4+
from ._banquo_impl import Top as _Top
35
from .core import Formula, evaluate, formula
46
from .expressions import Predicate
57
from .trace import Trace
6-
from ._banquo_impl import Top as _Top
7-
from ._banquo_impl import Bottom as _Bottom
88

99
Top: Final[_Top] = _Top()
1010
Bottom: Final[_Bottom] = _Bottom()

banquo/_banquo_impl.pyi

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
from collections.abc import Callable, Iterable
2-
from typing import Any, Generic, TypeVar
32
from types import ModuleType
3+
from typing import Any, Generic
44

5-
from typing_extensions import Self, override
5+
from typing_extensions import Self, TypeVar, override
66

77
from .core import Formula
8-
from .operators import Bounds, M, M_neg, M_le, M_ge, M_neg_ge
8+
from .operators import Bounds, M, M_ge, M_le, M_neg, M_neg_ge
99

1010
class PanicException(Exception): ...
1111

@@ -27,12 +27,12 @@ class Bottom(Any): # pyright: ignore[reportAny, reportExplicitAny]
2727
def __ge__(self, other: object) -> bool: ...
2828
def __gt__(self, other: object) -> bool: ...
2929

30-
class Trace(Generic[T]):
31-
def __new__(cls, elements: dict[float, T] | Trace[T]) -> Self: ...
32-
def __getitem__(self, value: float) -> T: ...
30+
class Trace(Generic[_T_co]):
31+
def __new__(cls, elements: dict[float, _T_co] | Trace[_T_co]) -> Self: ...
32+
def __getitem__(self, value: float) -> _T_co: ...
3333
def times(self) -> Iterable[float]: ...
34-
def states(self) -> Iterable[T]: ...
35-
def at_time(self, time: float) -> T | None: ...
34+
def states(self) -> Iterable[_T_co]: ...
35+
def at_time(self, time: float) -> _T_co | None: ...
3636

3737
class Predicate(Formula[dict[str, float], float]):
3838
def __new__(cls, coefficients: dict[str, float], constant: float) -> Self: ...

banquo/core.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
from __future__ import annotations
22

33
from collections.abc import Callable
4-
from typing import Protocol, TypeVar
4+
from typing import Protocol
55

6-
from typing_extensions import Self, override
6+
from typing_extensions import Self, TypeVar, override
77

88
from ._banquo_impl import Trace as _Trace
99
from .trace import Trace

banquo/expressions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
from collections.abc import Mapping
44

55
from ._banquo_impl import Predicate as _Predicate
6-
from .operators import OperatorMixin
76
from .core import EnsureOutput
7+
from .operators import OperatorMixin
88

99

1010
class Predicate(EnsureOutput[dict[str, float], float], OperatorMixin):

banquo/operators.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,21 @@
11
from __future__ import annotations
22

3-
import typing
3+
from typing_extensions import TypeAlias, TypeVar, override
44

5-
from typing_extensions import TypeAlias, override
6-
7-
from ._banquo_impl import And as _And
85
from ._banquo_impl import Always as _Always
6+
from ._banquo_impl import And as _And
97
from ._banquo_impl import Eventually as _Eventually
108
from ._banquo_impl import Implies as _Implies
119
from ._banquo_impl import Next as _Next
1210
from ._banquo_impl import Not as _Not
1311
from ._banquo_impl import Or as _Or
1412
from .core import (
15-
Formula,
1613
EnsureInput,
17-
SupportsNeg,
18-
SupportsLT,
19-
SupportsGT,
2014
EnsureOutput,
15+
Formula,
16+
SupportsGT,
17+
SupportsLT,
18+
SupportsNeg,
2119
SupportsNegGE,
2220
)
2321
from .trace import Trace

banquo/stl.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from __future__ import annotations
22

3-
from .core import EnsureOutput
43
from ._banquo_impl import stl as _stl
4+
from .core import EnsureOutput
55

66

77
class Formula(EnsureOutput[dict[str, float], float]):

banquo/trace.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
from __future__ import annotations
22

33
from collections.abc import Iterable, Iterator, Mapping
4-
from typing import TypeVar
54

6-
from typing_extensions import override
5+
from typing_extensions import TypeVar, override
76

87
from ._banquo_impl import Trace as _Trace
98

tests/test_operators.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import pytest
77
import typing_extensions
88

9-
from banquo import Bottom, Trace, operators, formula
9+
from banquo import Bottom, Trace, formula, operators
1010
from banquo.core import Formula
1111

1212
pytestmark = pytest.mark.unit

0 commit comments

Comments
 (0)