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

Don't use object as base class #1286

Merged
merged 1 commit into from
Oct 6, 2023
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 datashader/bundling.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ def get_gradients(img):
return (vert, horiz)


class BaseSegment(object):
class BaseSegment:
@classmethod
def create_delimiter(cls):
return np.full((1, cls.ndims), np.nan)
Expand Down
4 changes: 2 additions & 2 deletions datashader/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
except Exception:
spatialpandas = None

class Axis(object):
class Axis:
"""Interface for implementing axis transformations.

Instances hold implementations of transformations to and from axis space.
Expand Down Expand Up @@ -150,7 +150,7 @@ def validate_xy_or_geometry(glyph, x, y, geometry):
""".format(glyph=glyph, x=repr(x), y=repr(y), geometry=repr(geometry)))


class Canvas(object):
class Canvas:
"""An abstract canvas representing the space in which to bin.

Parameters
Expand Down
2 changes: 1 addition & 1 deletion datashader/datashape/coretypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -930,7 +930,7 @@ def _launder(x):
return x


class CollectionPrinter(object):
class CollectionPrinter:

def __repr__(self):
s = str(self)
Expand Down
2 changes: 1 addition & 1 deletion datashader/datashape/internal_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import re


class IndexCallable(object):
class IndexCallable:
""" Provide getitem syntax for functions

>>> def inc(x):
Expand Down
2 changes: 1 addition & 1 deletion datashader/datashape/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
__all__ = ['parse']


class DataShapeParser(object):
class DataShapeParser:
"""A DataShape parser object."""
def __init__(self, ds_str, sym):
# The datashape string being parsed
Expand Down
6 changes: 3 additions & 3 deletions datashader/datashape/tests/test_coretypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def test_error_on_datashape_with_string_argument():
DataShape('5 * int32')


class TestToNumpyDtype(object):
class TestToNumpyDtype:

def test_simple(self):
assert to_numpy_dtype(dshape('2 * int32')) == np.int32
Expand Down Expand Up @@ -135,7 +135,7 @@ def test_timedelta_aliases():
dshape('timedelta[unit=%r]' % _unit_aliases[alias]))


class TestFromNumPyDtype(object):
class TestFromNumPyDtype:

def test_int32(self):
assert from_numpy((2,), 'int32') == dshape('2 * int32')
Expand Down Expand Up @@ -230,7 +230,7 @@ def test_option_passes_itemsize():
dshape('float32').measure.itemsize)


class TestComplexFieldNames(object):
class TestComplexFieldNames:

"""
The tests in this class should verify that the datashape parser can handle
Expand Down
4 changes: 2 additions & 2 deletions datashader/datashape/tests/test_discovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ def test_letters_only_strings():


def test_discover_array_like():
class MyArray(object):
class MyArray:
def __init__(self, shape, dtype):
self.shape = shape
self.dtype = dtype
Expand All @@ -318,7 +318,7 @@ def test_discover_bytes():


def test_discover_undiscoverable():
class MyClass(object):
class MyClass:
pass
with pytest.raises(NotImplementedError):
discover(MyClass())
Expand Down
2 changes: 1 addition & 1 deletion datashader/datashape/type_symbol_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def _ellipsis(name):
]


class TypeSymbolTable(object):
class TypeSymbolTable:

"""
This is a class which holds symbols for types and type constructors,
Expand Down
2 changes: 1 addition & 1 deletion datashader/datashape/typesets.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def matches_typeset(types, signature):
return match


class TypesetRegistry(object):
class TypesetRegistry:
def __init__(self):
self.registry = {}
self.lookup = self.registry.get
Expand Down
2 changes: 1 addition & 1 deletion datashader/datatypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def _validate_ragged_properties(start_indices, flat_array):
# Internal ragged element array wrapper that provides
# equality, ordering, and hashing.
@total_ordering
class _RaggedElement(object):
class _RaggedElement:

@staticmethod
def ragged_or_nan(a):
Expand Down
2 changes: 1 addition & 1 deletion datashader/glyphs/line.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
spatialpandas = None


class _AntiAliasedLine(object):
class _AntiAliasedLine:
""" Methods common to all lines. """
_line_width = 0 # Use antialiasing if > 0.

Expand Down
2 changes: 1 addition & 1 deletion datashader/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from . import core


class Pipeline(object):
class Pipeline:
"""A datashading pipeline callback.

Given a declarative specification, creates a callable with the following
Expand Down
2 changes: 1 addition & 1 deletion datashader/tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def test_Dispatcher():
foo.register(float, lambda a, b, c=1: a - b + c)
foo.register(object, lambda a, b, c=1: 10)

class Bar(object):
class Bar:
pass
b = Bar()
assert foo(1, 2) == 4
Expand Down
4 changes: 2 additions & 2 deletions datashader/tiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def invert_y_tile(y, z):


# TODO: change name from source to definition
class MercatorTileDefinition(object):
class MercatorTileDefinition:
''' Implementation of mercator tile source
In general, tile sources are used as a required input for ``TileRenderer``.

Expand Down Expand Up @@ -277,7 +277,7 @@ def get_tile_meters(self, tx, ty, level):
return (xmin, ymin, xmax, ymax)


class TileRenderer(object):
class TileRenderer:

def __init__(self, tile_definition, output_location, tile_format='PNG',
post_render_func=None):
Expand Down
2 changes: 1 addition & 1 deletion datashader/transfer_functions/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def _repr_html_(self):



class Images(object):
class Images:
"""
A list of HTML-representable objects to display in a table.
Primarily intended for Image objects, but could be anything
Expand Down
4 changes: 2 additions & 2 deletions datashader/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class VisibleDeprecationWarning(UserWarning):
nb.__version__).groups()])


class Expr(object):
class Expr:
"""Base class for expression-like objects.

Implements hashing and equality checks. Subclasses should implement an
Expand Down Expand Up @@ -83,7 +83,7 @@ def _hashable_inputs(self):
return tuple(result)


class Dispatcher(object):
class Dispatcher:
"""Simple single dispatch."""
def __init__(self):
self._lookup = {}
Expand Down
2 changes: 1 addition & 1 deletion examples/filetimes.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
DD_FORCE_LOAD = False
DASK_CLIENT = None

class Parameters(object):
class Parameters:
base,x,y='data','x','y'
dftype='pandas'
categories=[]
Expand Down