Skip to content

Commit

Permalink
pylint fixes/ignores
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian-B committed Jan 30, 2025
1 parent 4f7ffee commit 69fd817
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 4 deletions.
7 changes: 4 additions & 3 deletions spynnaker/pyNN/models/populations/population_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def all_cells(self) -> Sequence[IDMixin]:
raise NotImplementedError

@final
def __add__(self, other: PopulationBase) -> Never:
def __add__(self, other: PopulationBase) -> Never: #pylint: disable=W0613
"""
A Population / PopulationView can be added to another
Population, PopulationView or Assembly, returning an Assembly.
Expand Down Expand Up @@ -204,7 +204,8 @@ def mean_spike_count(self, gather: bool = True) -> float:
return sum(counts.values()) / len(counts)

@final
def nearest(self, position: Any) -> Never:
def nearest(
self, position: Any) -> Never: # pylint: disable=unused-argument
"""
Return the neuron closest to the specified position.
Expand Down Expand Up @@ -299,7 +300,7 @@ def record(self, variables: Names, to_file: IoDest = None,

@final
def save_positions(
self, file: Any) -> Never: # pylint: disable=redefined-builtin
self, file: Any) -> Never: #pylint: disable=W0622,W0613
"""
Save positions to file. The output format is index x y z
Expand Down
16 changes: 16 additions & 0 deletions spynnaker/pyNN/models/populations/population_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -550,6 +550,7 @@ def record(self, variables: Names, to_file: IoDest = None,
self.__recorder.record(
variables, to_file, sampling_interval, self.__indexes)

@property
@overrides(PopulationBase.structure)
def structure(self) -> Optional[BaseStructure]:
raise NotImplementedError("Not implemented for views")
Expand Down Expand Up @@ -741,3 +742,18 @@ def local(self) -> bool:
"""
# There are no MPI nodes!
return True

@property
@overrides(PopulationBase.positions)
def positions(self) -> NDArray[numpy.floating]:
raise NotImplementedError("Not implemented for IDMixin")

@property
@overrides(PopulationBase.position_generator)
def position_generator(self) -> Callable[[int], NDArray[numpy.floating]]:
raise NotImplementedError("Not implemented for IDMixin")

@property
@overrides(PopulationBase.structure)
def structure(self) -> Optional[BaseStructure]:
raise NotImplementedError("Not implemented for IDMixin")
2 changes: 1 addition & 1 deletion spynnaker/pyNN/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
from numpy.typing import NDArray
from typing_extensions import TypeAlias, TypeGuard

import neo
import neo # type: ignore[import]
from pyNN.random import RandomDistribution

#: The type of weights and delays provided by Synapse / SynapseInformation
Expand Down

0 comments on commit 69fd817

Please sign in to comment.