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

misc: Remove (object) in class definitions #2378

Merged
merged 2 commits into from
May 29, 2024
Merged
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 benchmarks/regression/benchmarks/acoustic.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from examples.seismic.acoustic.acoustic_example import acoustic_setup


class IsotropicAcoustic(object):
class IsotropicAcoustic:

# ASV parametrization
params = ([(492, 492, 492)], [12])
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/regression/benchmarks/arguments.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
timeout = 600.0


class Processing(object):
class Processing:

def setup(self):
grid = Grid(shape=(5, 5, 5))
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/regression/benchmarks/codegen.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
repeat = 3


class TTI(object):
class TTI:

# ASV config
repeat = 1
Expand Down
2 changes: 1 addition & 1 deletion devito/arch/archinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,7 @@ def get_platform():
return CPU64


class Platform(object):
class Platform:

registry = {}
"""
Expand Down
2 changes: 1 addition & 1 deletion devito/builtins/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
__all__ = ['MPIReduction', 'nbl_to_padsize', 'pad_outhalo', 'abstract_args']


class MPIReduction(object):
class MPIReduction:
"""
A context manager to build MPI-aware reduction Operators.
"""
Expand Down
2 changes: 1 addition & 1 deletion devito/checkpointing/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
pass


class Noop(object):
class Noop:
""" Dummy replacement in case pyrevolve isn't available. """

def __init__(self, *args, **kwargs):
Expand Down
2 changes: 1 addition & 1 deletion devito/core/autotuning.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ def autotune(operator, args, level, mode):


@total_ordering
class Record(object):
class Record:

def __init__(self):
self.args = []
Expand Down
2 changes: 1 addition & 1 deletion devito/core/cpu.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
'Cpu64CustomOperator']


class Cpu64OperatorMixin(object):
class Cpu64OperatorMixin:

@classmethod
def _normalize_kwargs(cls, **kwargs):
Expand Down
6 changes: 3 additions & 3 deletions devito/core/gpu.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
'DeviceFsgAccOperator', 'DeviceCustomAccOperator']


class DeviceOperatorMixin(object):
class DeviceOperatorMixin:

BLOCK_LEVELS = 0
MPI_MODES = (True, 'basic',)
Expand Down Expand Up @@ -324,7 +324,7 @@ def _make_iet_passes_mapper(cls, **kwargs):

# OpenMP

class DeviceOmpOperatorMixin(object):
class DeviceOmpOperatorMixin:

_Target = DeviceOmpTarget

Expand Down Expand Up @@ -379,7 +379,7 @@ def _make_iet_passes_mapper(cls, **kwargs):

# OpenACC

class DeviceAccOperatorMixin(object):
class DeviceAccOperatorMixin:

_Target = DeviceAccTarget

Expand Down
2 changes: 1 addition & 1 deletion devito/core/operator.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ def _specialize_iet(cls, graph, **kwargs):
# Wrappers for optimization options


class OptOption(object):
class OptOption:
pass


Expand Down
2 changes: 1 addition & 1 deletion devito/data/allocators.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
'default_allocator']


class MemoryAllocator(object):
class MemoryAllocator:

"""Abstract class defining the interface to memory allocators."""

Expand Down
4 changes: 2 additions & 2 deletions devito/finite_differences/coefficients.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
__all__ = ['Coefficient', 'Substitutions', 'default_rules']


class Coefficient(object):
class Coefficient:
"""
Prepare custom coefficients to pass to a Substitutions object.

Expand Down Expand Up @@ -118,7 +118,7 @@ def _check_input(self, deriv_order, function, dimension, weights):
return


class Substitutions(object):
class Substitutions:
"""
Devito class to convert Coefficient objects into replacent rules
to be applied when constructing a Devito Eq.
Expand Down
2 changes: 1 addition & 1 deletion devito/finite_differences/differentiable.py
Original file line number Diff line number Diff line change
Expand Up @@ -893,7 +893,7 @@ def _new_rawargs(self, *args, **kwargs):
return self.func(*args, **kwargs)


class diffify(object):
class diffify:

"""
Helper class based on single dispatch to reconstruct all nodes in a sympy
Expand Down
2 changes: 1 addition & 1 deletion devito/ir/clusters/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
__all__ = ["Cluster", "ClusterGroup"]


class Cluster(object):
class Cluster:

"""
A Cluster is an ordered sequence of expressions in an IterationSpace.
Expand Down
6 changes: 3 additions & 3 deletions devito/ir/clusters/visitors.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
__all__ = ['Queue', 'QueueStateful', 'cluster_pass']


class Queue(object):
class Queue:

"""
A special queue to process Clusters based on a divide-and-conquer algorithm.
Expand Down Expand Up @@ -120,7 +120,7 @@ class QueueStateful(Queue):
expensive re-computations of information.
"""

class State(object):
class State:

def __init__(self):
self.properties = {}
Expand Down Expand Up @@ -176,7 +176,7 @@ def __hash__(self):
self.guards, self.properties, self.syncs))


class cluster_pass(object):
class cluster_pass:

def __new__(cls, *args, mode='dense'):
if args:
Expand Down
4 changes: 2 additions & 2 deletions devito/ir/iet/nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ def _signature_items(self):
return (str(self.ccode),)


class ExprStmt(object):
class ExprStmt:

"""
A mixin for Nodes that represent C expression statements, which are expressions
Expand Down Expand Up @@ -1234,7 +1234,7 @@ def pragmas(self):
return as_tuple(self.callback(*self.arguments))


class Transfer(object):
class Transfer:

"""
An interface for Nodes that represent host-device data transfers.
Expand Down
6 changes: 3 additions & 3 deletions devito/ir/support/basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ def touched_halo(self, findex):
return (touch_halo_left, touch_halo_right)


class Relation(object):
class Relation:

"""
A relation between two TimedAccess objects.
Expand Down Expand Up @@ -813,7 +813,7 @@ def project(self, function):
return DependenceGroup(i for i in self if i.function is function)


class Scope(object):
class Scope:

def __init__(self, exprs, rules=None):
"""
Expand Down Expand Up @@ -1196,7 +1196,7 @@ def r_all(self):
return list(self.r_gen())


class ExprGeometry(object):
class ExprGeometry:

"""
Geometric representation of an expression by abstracting Indexeds as
Expand Down
2 changes: 1 addition & 1 deletion devito/ir/support/guards.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
'BaseGuardBoundNext', 'GuardOverflow', 'Guards']


class Guard(object):
class Guard:

@property
def _args_rebuild(self):
Expand Down
6 changes: 3 additions & 3 deletions devito/ir/support/space.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
S0 = Stamp()


class AbstractInterval(object):
class AbstractInterval:

"""
An abstract representation of an iterated closed interval on Z.
Expand Down Expand Up @@ -554,7 +554,7 @@ def __getitem__(self, key):
return NullInterval(key)


class IterationDirection(object):
class IterationDirection:

"""
A representation of the direction in which an iteration space is traversed.
Expand Down Expand Up @@ -610,7 +610,7 @@ def args(self):
return (self, self.sub_iterators, self.direction)


class Space(object):
class Space:

"""
A compact N-dimensional space defined by N Intervals.
Expand Down
2 changes: 1 addition & 1 deletion devito/ir/support/symregistry.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
__init__ = ['SymbolRegistry']


class SymbolRegistry(object):
class SymbolRegistry:

"""A registry for all the symbols used by an Operator."""

Expand Down
2 changes: 1 addition & 1 deletion devito/ir/support/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
'extrema', 'erange']


class AccessMode(object):
class AccessMode:

"""
A descriptor for access modes (read, write, ...).
Expand Down
2 changes: 1 addition & 1 deletion devito/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def set_log_level(level, comm=None):
configuration['log-level'] = level


class switch_log_level(object):
class switch_log_level:
"""
A context manager to temporarily change MPI logging.
"""
Expand Down
2 changes: 1 addition & 1 deletion devito/mpi/distributed.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class NoneMetaclass(type):
def __getattr__(self, name):
return None

class MPI(object, metaclass=NoneMetaclass):
class MPI(metaclass=NoneMetaclass):
init_error = e

@classmethod
Expand Down
2 changes: 1 addition & 1 deletion devito/mpi/halo_scheme.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class HaloLabel(Tag):
OMapper = namedtuple('OMapper', 'core owned')


class HaloScheme(object):
class HaloScheme:

"""
A HaloScheme describes a set of halo exchanges through a mapper:
Expand Down
2 changes: 1 addition & 1 deletion devito/mpi/routines.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
__all__ = ['HaloExchangeBuilder', 'mpi_registry']


class HaloExchangeBuilder(object):
class HaloExchangeBuilder:

"""
Build IET-based routines to implement MPI halo exchange.
Expand Down
2 changes: 1 addition & 1 deletion devito/operator/profiling.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
PerfEntry = namedtuple('PerfEntry', 'time gflopss gpointss oi ops itershapes')


class Profiler(object):
class Profiler:

_default_includes = []
_default_libs = []
Expand Down
2 changes: 1 addition & 1 deletion devito/parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ def init_configuration(configuration=configuration, env_vars_mapper=env_vars_map
configuration.initialize()


class switchconfig(object):
class switchconfig:

"""
Decorator or context manager to temporarily change `configuration` parameters.
Expand Down
6 changes: 3 additions & 3 deletions devito/passes/clusters/aliases.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def cire(clusters, mode, sregistry, options, platform):
return clusters


class CireTransformer(object):
class CireTransformer:

"""
Abstract base class for transformers implementing a CIRE variant.
Expand Down Expand Up @@ -1192,7 +1192,7 @@ def _pivot_legal_shifts(self):
Variant = namedtuple('Variant', 'schedule exprs')


class Alias(object):
class Alias:

def __init__(self, pivot, aliaseds, intervals, distances, score):
self.pivot = pivot
Expand Down Expand Up @@ -1233,7 +1233,7 @@ def is_frame(self):
return all(len([e for e in i if e != 0]) <= 1 for i in self.distances)


class AliasList(object):
class AliasList:

def __init__(self, aliases=None):
if aliases is None:
Expand Down
2 changes: 1 addition & 1 deletion devito/passes/clusters/asynchrony.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ def _actions_from_update_memcpy(self, cluster, clusters, prefix, actions):
# Utilities


class Actions(object):
class Actions:

def __init__(self, drop=False, syncs=None, insert=None):
self.drop = drop
Expand Down
2 changes: 1 addition & 1 deletion devito/passes/clusters/blocking.py
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ def decompose(ispace, d, block_dims):
return IterationSpace(intervals, sub_iterators, directions)


class BlockSizeGenerator(object):
class BlockSizeGenerator:

"""
A wrapper for several UnboundedMultiTuples.
Expand Down
4 changes: 2 additions & 2 deletions devito/passes/clusters/buffering.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ def callback(self, clusters, prefix, cache=None):
return init + processed


class Buffer(object):
class Buffer:

"""
A buffer with metadata attached.
Expand Down Expand Up @@ -660,7 +660,7 @@ def firstidx(self):
return Map(v % self.xd.symbolic_size, v)


class AccessValue(object):
class AccessValue:

"""
A simple data structure tracking the accesses performed by a given Function
Expand Down
Loading
Loading