diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0e5e13434..969ad1a28 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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 diff --git a/unified_planning/model/delta_stn.py b/unified_planning/model/delta_stn.py index a67ec5c45..2cf54ce16 100644 --- a/unified_planning/model/delta_stn.py +++ b/unified_planning/model/delta_stn.py @@ -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 @@ -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: