From 73e7378cb7631c29673c119001e2b77d9b3ef2d8 Mon Sep 17 00:00:00 2001 From: Jiajie Chen Date: Fri, 6 Aug 2021 18:30:04 +0800 Subject: [PATCH] add missing __new__ for neuron 8.0.0, fixing issue #722 --- pyNN/neuron/cells.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pyNN/neuron/cells.py b/pyNN/neuron/cells.py index d38fea912..8fd5d85ed 100644 --- a/pyNN/neuron/cells.py +++ b/pyNN/neuron/cells.py @@ -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) @@ -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)): @@ -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)): @@ -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: