Skip to content

Commit

Permalink
Merge pull request #1467 from SpiNNakerManchester/view_labels
Browse files Browse the repository at this point in the history
View labels
  • Loading branch information
rowleya authored Jul 16, 2024
2 parents 0abe490 + 4255c64 commit aa78940
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 1 addition & 2 deletions spynnaker/pyNN/models/populations/population.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,7 @@ def __getitem__(self, index_or_slice) -> PopulationView:
if isinstance(index_or_slice, int):
return IDMixin(self, index_or_slice)
else:
return PopulationView(
self, index_or_slice, label=f"view over {self.label}")
return PopulationView(self, index_or_slice)

def all(self) -> Iterable[PopulationView]:
"""
Expand Down
4 changes: 3 additions & 1 deletion spynnaker/pyNN/models/populations/population_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ def __init__(
self.__population = parent
self.__indexes = ids
self.__mask = selector
if label is None:
label = f"{parent.label}:{selector}"
self.__label = label
self.__annotations: Dict[str, Any] = dict()

Expand Down Expand Up @@ -146,7 +148,7 @@ def size(self) -> int:
return len(self.__indexes)

@property
def label(self) -> Optional[str]:
def label(self) -> str:
"""
A label for the Population View.
Expand Down

0 comments on commit aa78940

Please sign in to comment.