Skip to content

Commit

Permalink
Fix(typing): added a print of the mypy version used and added some ty…
Browse files Browse the repository at this point in the history
…pe: ignore to ignore the typing problems in the dela_stn
  • Loading branch information
Framba-Luca committed Mar 14, 2024
1 parent b6f716b commit bd60179
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ jobs:
python3 -m pip install black==22.6.0
python3 -m black --check --exclude=unified_planning/grpc/generated/ .
- name: MyPy version
run: python3 -m mypy --version

- name: MyPy check
run: python3 -m mypy unified_planning

Expand Down
12 changes: 6 additions & 6 deletions unified_planning/model/delta_stn.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,18 +148,18 @@ def _is_subsumed(self, x: Any, y: Any, b: T) -> bool:
def _inc_check(self, x: Any, y: Any, b: T) -> bool:
x_dist = self._distances[x]
x_plus_b = x_dist + b
if x_plus_b < self._distances[y]:
self._distances[y] = x_plus_b
if x_plus_b < self._distances[y]: # type: ignore[operator]
self._distances[y] = x_plus_b # type: ignore[assignment]
queue: Deque[Any] = deque()
queue.append(y)
while queue:
c = queue.popleft()
n = self._constraints[c]
while n is not None:
if self._distances[c] + n.bound < self._distances[n.dst]:
if n.dst == y and abs(n.bound - b) <= self._epsilon:
if self._distances[c] + n.bound < self._distances[n.dst]: # type: ignore[operator]
if n.dst == y and abs(n.bound - b) <= self._epsilon: # type: ignore[arg-type, operator]
return False
self._distances[n.dst] = self._distances[c] + n.bound
self._distances[n.dst] = self._distances[c] + n.bound # type: ignore[assignment]
queue.append(n.dst)
n = n.next
return True
Expand Down Expand Up @@ -191,7 +191,7 @@ def insert_interval(
to the right_event. If None the maximum length is set to +infinity.
"""
if left_bound is not None:
self.add(left_event, right_event, -left_bound)
self.add(left_event, right_event, -left_bound) # type: ignore[arg-type]
if right_bound is not None:
self.add(right_event, left_event, right_bound)
if left_bound is None and right_bound is None:
Expand Down

0 comments on commit bd60179

Please sign in to comment.