Skip to content

Commit

Permalink
Ellipsis typing for Protocol
Browse files Browse the repository at this point in the history
  • Loading branch information
leonlan committed Oct 21, 2024
1 parent c336ccb commit 4530689
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions alns/ALNS.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ def __call__(
rng: rnd.Generator,
**kwargs,
) -> State:
...
... # pragma: no cover


class _CallbackType(Protocol):
__name__: str

def __call__(self, state: State, rng: rnd.Generator, **kwargs):
...
... # pragma: no cover


logger = logging.getLogger(__name__)
Expand Down
2 changes: 2 additions & 0 deletions alns/State.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ def objective(self) -> float:
"""
Computes the state's associated objective value.
"""
... # pragma: no cover


class ContextualState(State, Protocol):
Expand All @@ -25,3 +26,4 @@ def get_context(self) -> np.ndarray:
"""
Computes a context vector for the current state.
"""
... # pragma: no cover
2 changes: 1 addition & 1 deletion alns/accept/AcceptanceCriterion.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ def __call__(
bool
Whether to accept the candidate state (True), or not (False).
"""
...
... # pragma: no cover
2 changes: 1 addition & 1 deletion alns/stop/StoppingCriterion.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ def __call__(self, rng: Generator, best: State, current: State) -> bool:
bool
Whether to stop iterating (True), or not (False).
"""
...
... # pragma: no cover

0 comments on commit 4530689

Please sign in to comment.