Skip to content

Commit

Permalink
Remove explicit derivations from object
Browse files Browse the repository at this point in the history
No longer required with Python 3 and Python 2 support was dropped.

Closes #241.
  • Loading branch information
jgosmann committed Jun 15, 2020
1 parent 0af3c74 commit 28bb81e
Show file tree
Hide file tree
Showing 11 changed files with 19 additions and 19 deletions.
4 changes: 2 additions & 2 deletions nengo_spa/ast/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def infer_types(*nodes):
return type_


class Node(object):
class Node:
"""Base class for nodes in the AST for Nengo SPA operations.
Parameters
Expand Down Expand Up @@ -74,7 +74,7 @@ def evaluate(self):
raise NotImplementedError()


class TypeCheckedBinaryOp(object):
class TypeCheckedBinaryOp:
"""Decorator to check the type of the *other* parameter of an operator.
If the *other* parameter is not an instance of *expected_type*,
Expand Down
2 changes: 1 addition & 1 deletion nengo_spa/ast/symbolic.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ def __repr__(self):
return "PointerSymbol({!r}, {!r})".format(self.expr, self.type)


class PointerSymbolFactory(object):
class PointerSymbolFactory:
"""Provides syntactic sugar to create *PointerSymbol* instances.
Use the `.sym` instance of this class to create *PointerSymbols* like so::
Expand Down
2 changes: 1 addition & 1 deletion nengo_spa/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def Simulator(request):
from nengo_spa.algebras.vtb_algebra import VtbAlgebra


class TestConfig(object):
class TestConfig:
"""Parameters affecting all Nengo SPA testes.
These are essentially global variables used by py.test to modify aspects
Expand Down
8 changes: 4 additions & 4 deletions nengo_spa/connectors.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def as_sink(obj):
return ModuleInput(input_, TVocabulary(vocab))


class ModuleInput(object):
class ModuleInput:
"""Represents the input to a module with type information.
Supports the ``>>`` operator to provide input from an AST node. It will
Expand Down Expand Up @@ -92,7 +92,7 @@ def __rrshift__(self, other):
other.connect_to(self.input)


class RoutedConnection(object):
class RoutedConnection:
"""Represents a routed connection from an AST node to a `.ModuleInput`.
A routed connection is passed through an inhibitable channel to allow the
Expand Down Expand Up @@ -135,7 +135,7 @@ def transform(self):
return np.atleast_2d(self.source.evaluate().v).T


class SpaOperatorMixin(object):
class SpaOperatorMixin:
"""Mixin class that implements the SPA operators.
All operands will be converted to AST node and the implementation of the
Expand Down Expand Up @@ -184,7 +184,7 @@ def translate(self, vocab, populate=None, keys=None, solver=None):
return as_ast_node(self).translate(vocab, populate, keys, solver)


class ConnectorRegistry(object):
class ConnectorRegistry:
"""Registry associating connectors with vocabularies and enable SPA syntax.
A connector is either an input or output to a SPA module.
Expand Down
2 changes: 1 addition & 1 deletion nengo_spa/modules/basalganglia.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@


# connection weights from (Gurney, Prescott, & Redgrave, 2001)
class Weights(object):
class Weights:
mm = 1
mp = 1
me = 1
Expand Down
2 changes: 1 addition & 1 deletion nengo_spa/modules/tests/test_transcode.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def test_passthrough(Simulator, seed):


def test_decode(Simulator, seed):
class OutputFn(object):
class OutputFn:
def __init__(self):
self.called = False

Expand Down
2 changes: 1 addition & 1 deletion nengo_spa/modules/transcode.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from nengo_spa.vocabulary import VocabularyOrDimParam


class SpArrayExtractor(object):
class SpArrayExtractor:
def __init__(self, vocab):
self.vocab = vocab

Expand Down
2 changes: 1 addition & 1 deletion nengo_spa/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from nengo_spa.vocabulary import VocabularyMap, VocabularyMapParam


class _AutoConfig(object):
class _AutoConfig:
def __init__(self, cfg):
self._cfg = cfg

Expand Down
4 changes: 2 additions & 2 deletions nengo_spa/tests/test_vocabulary.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ def test_vocabulary_set(rng):


def test_vocabulary_map_param():
class Test(object):
class Test:
vocab_map = VocabularyMapParam("vocab_map", readonly=False)

obj = Test()
Expand All @@ -341,7 +341,7 @@ def test_vocabulary_or_dim_param():
v16 = Vocabulary(16)
v32 = Vocabulary(32)

class Test(object):
class Test:
vocabs = VocabularyMap([v16])
vocab = VocabularyOrDimParam("vocab", readonly=False)

Expand Down
2 changes: 1 addition & 1 deletion nengo_spa/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from nengo_spa.exceptions import SpaTypeError


class Type(object):
class Type:
"""Describes a type.
Types can be compared and by default two types are considered to be equal
Expand Down
8 changes: 4 additions & 4 deletions nengo_spa/vector_generation.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def AxisAlignedVectors(d):
yield v


class UnitLengthVectors(object):
class UnitLengthVectors:
"""Generator for uniformly distributed unit-length vectors.
Parameters
Expand Down Expand Up @@ -59,7 +59,7 @@ def next(self):
return self.__next__()


class UnitaryVectors(object):
class UnitaryVectors:
"""Generator for unitary vectors (given some binding method).
Parameters
Expand Down Expand Up @@ -90,7 +90,7 @@ def next(self):
return self.__next__()


class OrthonormalVectors(object):
class OrthonormalVectors:
"""Generator for random orthonormal vectors.
Parameters
Expand Down Expand Up @@ -130,7 +130,7 @@ def next(self):
return self.__next__()


class ExpectedUnitLengthVectors(object):
class ExpectedUnitLengthVectors:
r"""Generator for vectors with expected unit-length.
The vectors will be uniformly distributed with an expected norm
Expand Down

0 comments on commit 28bb81e

Please sign in to comment.