Skip to content

Commit

Permalink
typing fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian-B committed Mar 28, 2024
1 parent 5c80802 commit fc1fb81
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions spinn_machine/routing_entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ def __init__(self, *,
processor_ids or link_ids is missing or `None`
"""
self.__repr: Optional[str] = None
self._link_ids: Optional[FrozenSet[int]]
self._processor_ids: Optional[FrozenSet[int]]

# Add processor IDs, ignore duplicates
if spinnaker_route is None:
Expand All @@ -85,9 +87,8 @@ def __init__(self, *,
processor_ids = [processor_ids]
if isinstance(link_ids, int):
link_ids = [link_ids]
self._processor_ids: Optional[FrozenSet[int]] = \
frozenset(processor_ids)
self._link_ids: Optional[FrozenSet[int]] = frozenset(link_ids)
self._processor_ids = frozenset(processor_ids)
self._link_ids = frozenset(link_ids)
self._spinnaker_route: int = self._calc_spinnaker_route()
if incoming_link is None:
self._defaultable = False
Expand All @@ -112,7 +113,10 @@ def __init__(self, *,
self._spinnaker_route = spinnaker_route
self._processor_ids = None
self._link_ids = None
self._defaultable = defaultable
if defaultable:
self._defaultable = True
else:
self._defaultable = False

@property
def processor_ids(self) -> FrozenSet[int]:
Expand Down

0 comments on commit fc1fb81

Please sign in to comment.