Skip to content

Commit

Permalink
Merge pull request #727 from jiegec/neuron-8-0-0
Browse files Browse the repository at this point in the history
add missing __new__ for neuron 8.0.0, fixing issue #722
  • Loading branch information
apdavison committed Oct 19, 2021
2 parents 85f0f8d + 73e7378 commit 90ad2db
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions pyNN/neuron/cells.py
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 90ad2db

Please sign in to comment.