Skip to content

Commit

Permalink
Merge pull request #288 from SpiNNakerManchester/type_fix
Browse files Browse the repository at this point in the history
Type fix
  • Loading branch information
rowleya authored Jan 8, 2025
2 parents e0781d6 + 61147e3 commit 1de5d3e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion mypy.bash
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@
# pip install --upgrade mypy


mypy --python-version 3.8 --disallow-untyped-defs spinn_utilities unittests
mypy --python-version 3.8 spinn_utilities unittests
2 changes: 1 addition & 1 deletion spinn_utilities/ranged/ids_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def __init__(self, range_dict: RangeDictionary[T], ids: IdsType):
Use :py:meth:`RangeDictionary.view_factory` to create views
"""
super().__init__(range_dict)
self._ids = tuple(ids)
self._ids: Sequence[int] = tuple(ids)

def __str__(self) -> str:
return f"View with IDs: {self._ids}"
Expand Down
4 changes: 3 additions & 1 deletion spinn_utilities/ranged/ranged_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,9 @@ def set_value_by_slice(

def _set_values_list(self, ids: IdsType, value: _ListType) -> None:
values = self.as_list(value=value, size=len(ids), ids=ids)
for id_value, val in zip(ids, values):
val: T
as_int: Sequence[int] = list(ids)
for id_value, val in zip(as_int, values):
self.set_value_by_id(id_value, val)

def set_value_by_ids(
Expand Down

0 comments on commit 1de5d3e

Please sign in to comment.