Skip to content

Commit

Permalink
Merge pull request h5py#2025 from mwtoews/class-wo-object
Browse files Browse the repository at this point in the history
MAINT: Python3 classes do not need to inherit from object
  • Loading branch information
takluyver authored Jan 8, 2022
2 parents 9c90338 + d110fe4 commit aa31f03
Show file tree
Hide file tree
Showing 13 changed files with 22 additions and 22 deletions.
4 changes: 2 additions & 2 deletions api_gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
import os.path as op


class Line(object):
class Line:

"""
Represents one line from the api_functions.txt file.
Expand Down Expand Up @@ -164,7 +164,7 @@ def __init__(self, text):
"""


class LineProcessor(object):
class LineProcessor:

def run(self):

Expand Down
4 changes: 2 additions & 2 deletions examples/threading_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def compute_escape(pos, escape):

self.eventcall()

class ComputeWidget(object):
class ComputeWidget:

"""
Responsible for input widgets, and starting new computation threads.
Expand Down Expand Up @@ -209,7 +209,7 @@ def suggest(self, *args):
self.suggest = (self.suggest+1)%len(suggestions)


class ViewWidget(object):
class ViewWidget:

"""
Draws images using the datasets recorded in the HDF5 file. Also
Expand Down
6 changes: 3 additions & 3 deletions h5py/_hl/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ def is_empty_dataspace(obj):
return False


class CommonStateObject(object):
class CommonStateObject:

"""
Mixin class that allows sharing information between objects which
Expand Down Expand Up @@ -225,7 +225,7 @@ def _d(self, name):
return name


class _RegionProxy(object):
class _RegionProxy:

"""
Proxy object which handles region references.
Expand Down Expand Up @@ -478,7 +478,7 @@ class MutableMappingHDF5(MappingHDF5, MutableMapping):
pass


class Empty(object):
class Empty:

"""
Proxy object to represent empty/null dataspaces (a.k.a H5S_NULL).
Expand Down
6 changes: 3 additions & 3 deletions h5py/_hl/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ def make_new_dset(parent, shape=None, dtype=None, data=None, name=None,
return dset_id


class AstypeWrapper(object):
class AstypeWrapper:
"""Wrapper to convert data on reading from a dataset.
"""
def __init__(self, dset, dtype):
Expand Down Expand Up @@ -249,7 +249,7 @@ def readtime_dtype(basetype, names):


if MPI:
class CollectiveContext(object):
class CollectiveContext:

""" Manages collective I/O in MPI mode """

Expand All @@ -267,7 +267,7 @@ def __exit__(self, *args):
self._dset._dxpl.set_dxpl_mpio(h5fd.MPIO_INDEPENDENT)


class ChunkIterator(object):
class ChunkIterator:
"""
Class to iterate through list of chunks of a given dataset
"""
Expand Down
6 changes: 3 additions & 3 deletions h5py/_hl/group.py
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,7 @@ def __repr__(self):
return r


class HardLink(object):
class HardLink:

"""
Represents a hard link in an HDF5 file. Provided only so that
Expand All @@ -635,7 +635,7 @@ class HardLink(object):
pass


class SoftLink(object):
class SoftLink:

"""
Represents a symbolic ("soft") link in an HDF5 file. The path
Expand All @@ -655,7 +655,7 @@ def __repr__(self):
return '<SoftLink to "%s">' % self.path


class ExternalLink(object):
class ExternalLink:

"""
Represents an HDF5 external link. Paths may be absolute or relative.
Expand Down
2 changes: 1 addition & 1 deletion h5py/_hl/selections.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def select(shape, args, dataset=None):
return selector.make_selection(args)


class Selection(object):
class Selection:

"""
Base class for HDF5 dataspace selections. Subclasses support the
Expand Down
2 changes: 1 addition & 1 deletion h5py/_hl/selections2.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def read_selections_scalar(dsid, args):

return out_shape, source_space

class ScalarReadSelection(object):
class ScalarReadSelection:

"""
Implements slicing for scalar datasets.
Expand Down
4 changes: 2 additions & 2 deletions h5py/_hl/vds.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def _convert_space_for_key(space, key):
space.select_hyperslab(start, count, stride, block)


class VirtualSource(object):
class VirtualSource:
"""Source definition for virtual data sets.
Instantiate this class to represent an entire source dataset, and then
Expand Down Expand Up @@ -143,7 +143,7 @@ def __getitem__(self, key):
_convert_space_for_key(tmp.sel.id, key)
return tmp

class VirtualLayout(object):
class VirtualLayout:
"""Object for building a virtual dataset.
Instantiate this class to define a virtual dataset, assign to slices of it
Expand Down
2 changes: 1 addition & 1 deletion h5py/_selector.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ cdef class Reader:
return arr


class MultiBlockSlice(object):
class MultiBlockSlice:
"""
A conceptual extension of the built-in slice object to allow selections
using start, stride, count and block.
Expand Down
2 changes: 1 addition & 1 deletion h5py/h5.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ NUMPY_VERSION_COMPILED_AGAINST = NUMPY_BUILD_VERSION
CYTHON_VERSION_COMPILED_WITH = CYTHON_BUILD_VERSION


class ByteStringContext(object):
class ByteStringContext:

def __init__(self):
self._readbytes = False
Expand Down
2 changes: 1 addition & 1 deletion h5py/tests/test_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -824,7 +824,7 @@ def test_dump_error(self):
# unittest doesn't work with pytest fixtures (and possibly other features),
# hence no subclassing TestCase
@pytest.mark.mpi
class TestMPI(object):
class TestMPI:
def test_mpio(self, mpi_file_name):
""" MPIO driver and options """
from mpi4py import MPI
Expand Down
2 changes: 1 addition & 1 deletion h5py/tests/test_vds/test_highlevel_vds.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def tearDown(self):
https://support.hdfgroup.org/HDF5/docNewFeatures/VDS/HDF5-VDS-requirements-use-cases-2014-12-10.pdf
'''

class ExcaliburData(object):
class ExcaliburData:
FEM_PIXELS_PER_CHIP_X = 256
FEM_PIXELS_PER_CHIP_Y = 256
FEM_CHIPS_PER_STRIPE_X = 8
Expand Down
2 changes: 1 addition & 1 deletion h5py/tests/test_vds/test_lowlevel_vds.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def tearDown(self):
'''


class ExcaliburData(object):
class ExcaliburData:
FEM_PIXELS_PER_CHIP_X = 256
FEM_PIXELS_PER_CHIP_Y = 256
FEM_CHIPS_PER_STRIPE_X = 8
Expand Down

0 comments on commit aa31f03

Please sign in to comment.