Skip to content

Commit

Permalink
typing fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian-B committed Mar 25, 2024
1 parent 726f032 commit 40ba0fd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions pacman/model/placements/placements.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# limitations under the License.

from collections import defaultdict
from typing import Dict, Iterable, Iterator
from typing import Collection, Dict, Iterable, Iterator

from spinn_utilities.typing.coords import XY

Expand Down Expand Up @@ -197,7 +197,7 @@ def placements(self) -> Iterable[Placement]:
"""
return iter(self._machine_vertices.values())

def placements_on_chip(self, xy: XY) -> Iterable[Placement]:
def placements_on_chip(self, xy: XY) -> Collection[Placement]:
"""
Get the placements on a specific chip.
Expand Down
8 changes: 4 additions & 4 deletions pacman/operations/placer_algorithms/application_placer.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def __init__(self, placements: Placements):
self.__current_chip: Optional[Chip] = None
self.__current_cores_free: List[int] = list()
self.__current_sdram_free = 0
self.__app_vertex_label = "NO APP VETERX SET"
self.__app_vertex_label = None

# Set some value so no Optional needed
self.__ethernet_x = -1
Expand Down Expand Up @@ -255,7 +255,7 @@ def _prepare_placements(self, same_chip_groups: Sequence[
return placements_to_make

def _filter_vertices(
self, vertices: List[MachineVertex]) -> List[MachineVertex]:
self, vertices: Sequence[MachineVertex]) -> List[MachineVertex]:
"""
Removes an already placed or virtual vertices.
Expand Down Expand Up @@ -335,9 +335,9 @@ def _place_error(self, system_placements: Placements,
f.write(f"Vertex: {app_vertex}\n")
same_chip_groups = app_vertex.splitter.get_same_chip_groups()
for vertices, sdram in same_chip_groups:
sdram = sdram.get_total_sdram(self.__plan_n_timesteps)
p_sdram = sdram.get_total_sdram(self.__plan_n_timesteps)
f.write(f" Group of {len(vertices)} vertices uses "
f"{sdram} bytes of SDRAM:\n")
f"{p_sdram} bytes of SDRAM:\n")
for vertex in vertices:
f.write(f" Vertex {vertex}")
if self.__placements.is_vertex_placed(vertex):
Expand Down

0 comments on commit 40ba0fd

Please sign in to comment.