Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch support to nengo>=3.0 #187

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion nengolib/networks/reservoir.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from nengo.exceptions import NetworkContextError
from nengo.solvers import LstsqL2
from nengo.synapses import SynapseParam
from nengo.utils.compat import is_iterable
from nengo.utils.numpy import is_iterable

__all__ = ['Reservoir']

Expand Down
7 changes: 4 additions & 3 deletions nengolib/neurons.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ def _sample_lif_state(sim, ens, x0, rng):
lif = ens.neuron_type
params = sim.model.params

eval_points = x0[None, :]
x = np.dot(eval_points, params[ens].encoders.T / ens.radius)[0]
a = ens.neuron_type.rates(x, params[ens].gain, params[ens].bias)
eval_points = x0
x = np.dot(eval_points, params[ens].encoders.T / ens.radius)
a = ens.neuron_type.rates(
x[None, :], params[ens].gain, params[ens].bias).squeeze(axis=0)
J = params[ens].gain * x + params[ens].bias

# fast-forward to a random time within the ISI for any active neurons
Expand Down
4 changes: 2 additions & 2 deletions nengolib/signal/system.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
cont2discrete, zpk2ss, ss2tf, ss2zpk, tf2ss, tf2zpk, zpk2tf, normalize)

from nengo.synapses import LinearFilter
from nengo.utils.compat import is_integer, is_number, with_metaclass
from nengo.utils.numpy import is_integer, is_number

__all__ = [
'sys2ss', 'sys2tf', 'sys2zpk', 'canonical', 'sys_equal', 'ss_equal',
Expand Down Expand Up @@ -240,7 +240,7 @@ def __call__(self, sys, analog=None):
return super(LinearSystemType, self).__call__(sys, analog)


class LinearSystem(with_metaclass(LinearSystemType, NengoLinearFilterMixin)):
class LinearSystem(NengoLinearFilterMixin, metaclass=LinearSystemType):
"""Generic linear system representation.

This extends :class:`nengo.LinearFilter` to unify a variety of
Expand Down
2 changes: 1 addition & 1 deletion nengolib/stats/ntmdists.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from scipy.special import beta, betainc, betaincinv

from nengo.dists import Distribution, UniformHypersphere
from nengo.utils.compat import is_integer
from nengo.utils.numpy import is_integer

from nengolib.stats.ortho import random_orthogonal
from nengolib.stats._sobol_seq import i4_sobol_generate
Expand Down
2 changes: 1 addition & 1 deletion nengolib/synapses/analog.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from scipy.interpolate import pade
from scipy.special import factorial

from nengo.utils.compat import is_integer
from nengo.utils.numpy import is_integer

from nengolib.signal.system import LinearSystem, s

Expand Down
2 changes: 1 addition & 1 deletion nengolib/synapses/digital.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from nengo.utils.compat import is_integer
from nengo.utils.numpy import is_integer

from nengolib.signal.system import z

Expand Down
2 changes: 1 addition & 1 deletion nengolib/synapses/hetero_synapse.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import numpy as np
from scipy.linalg import block_diag

from nengo.utils.compat import is_iterable
from nengo.utils.numpy import is_iterable

from nengolib.signal.discrete import cont2discrete
from nengolib.signal.system import LinearSystem
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def read(*filenames, **kwargs):
'version', os.path.join(root, name, 'version.py'))

deps = [ # https://github.com/nengo/nengo/issues/508
"nengo>=2.2.0,<3.0",
"nengo>=3.0",
"numpy>=1.13",
"scipy>=0.19.0",
]
Expand Down