Skip to content

Commit

Permalink
add missing __new__ for neuron 8.0.0, fixing issue #722
Browse files Browse the repository at this point in the history
  • Loading branch information
jiegec committed Aug 6, 2021
1 parent 4feecd7 commit 73e7378
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions pyNN/neuron/cells.py
Original file line number Diff line number Diff line change
Expand Up @@ -529,6 +529,9 @@ def __init__(self, start=0, _interval=1e12, duration=0):
# should allow user to set specific seeds somewhere, e.g. in setup()
self.seed(state.mpi_rank + state.native_rng_baseseed)

def __new__(cls, *arg, **kwargs):
return super().__new__(cls, *arg, **kwargs)

def _set_interval(self, value):
self.switch.weight[0] = -1
self.switch.event(h.t + 1e-12, 0)
Expand Down Expand Up @@ -556,6 +559,9 @@ def __init__(self, rate=1, tau_refrac=0.0, start=0, duration=0):
self.source_section = None
self.seed(state.mpi_rank + state.native_rng_baseseed)

def __new__(cls, *arg, **kwargs):
return super().__new__(cls, *arg, **kwargs)


class RandomGammaSpikeSource(hclass(h.GammaStim)):

Expand All @@ -573,6 +579,9 @@ def __init__(self, alpha=1, beta=0.1, start=0, duration=0):
self.source_section = None
self.seed(state.mpi_rank + state.native_rng_baseseed)

def __new__(cls, *arg, **kwargs):
return super().__new__(cls, *arg, **kwargs)


class VectorSpikeSource(hclass(h.VecStim)):

Expand All @@ -586,6 +595,9 @@ def __init__(self, spike_times=[]):
self.rec = None
self._recorded_spikes = np.array([])

def __new__(cls, *arg, **kwargs):
return super().__new__(cls, *arg, **kwargs)

def _set_spike_times(self, spike_times):
# spike_times should be a Sequence object
try:
Expand Down

0 comments on commit 73e7378

Please sign in to comment.