From 550b58c3055bf5c75429a9d4cadab14f26fb0430 Mon Sep 17 00:00:00 2001 From: Dimitri Papadopoulos <3234522+DimitriPapadopoulos@users.noreply.github.com> Date: Mon, 27 Mar 2023 08:57:28 +0200 Subject: [PATCH] MAINT: object is an implicit base for all classes --- mne/_ola.py | 4 ++-- mne/annotations.py | 2 +- mne/channels/channels.py | 4 ++-- mne/channels/layout.py | 2 +- mne/channels/montage.py | 2 +- mne/coreg.py | 2 +- mne/decoding/mixin.py | 4 ++-- mne/epochs.py | 2 +- mne/event.py | 2 +- mne/filter.py | 2 +- mne/fixes.py | 2 +- mne/gui/__init__.py | 2 +- mne/gui/tests/test_coreg.py | 2 +- mne/inverse_sparse/mxne_optim.py | 4 ++-- mne/io/base.py | 4 ++-- mne/io/meas_info.py | 4 ++-- mne/io/open.py | 2 +- mne/io/proj.py | 2 +- mne/io/tag.py | 2 +- mne/label.py | 2 +- mne/report/report.py | 2 +- mne/simulation/raw.py | 4 ++-- mne/simulation/source.py | 2 +- mne/surface.py | 6 +++--- mne/time_frequency/csd.py | 2 +- mne/transforms.py | 4 ++-- mne/utils/_bunch.py | 2 +- mne/utils/_logging.py | 4 ++-- mne/utils/_testing.py | 4 ++-- mne/utils/check.py | 4 ++-- mne/utils/mixin.py | 8 ++++---- mne/utils/numerics.py | 4 ++-- mne/utils/progressbar.py | 4 ++-- mne/viz/_3d_overlay.py | 4 ++-- mne/viz/_brain/_brain.py | 2 +- mne/viz/_brain/_linkviewer.py | 2 +- mne/viz/_brain/_scraper.py | 2 +- mne/viz/_brain/callback.py | 10 +++++----- mne/viz/_brain/surface.py | 2 +- mne/viz/_brain/tests/test_brain.py | 4 ++-- mne/viz/backends/_notebook.py | 4 ++-- mne/viz/backends/_pyvista.py | 2 +- mne/viz/topomap.py | 2 +- mne/viz/utils.py | 6 +++--- 44 files changed, 71 insertions(+), 71 deletions(-) diff --git a/mne/_ola.py b/mne/_ola.py index d1ab34c235f..68c24a79278 100644 --- a/mne/_ola.py +++ b/mne/_ola.py @@ -11,7 +11,7 @@ ############################################################################### # Class for interpolation between adjacent points -class _Interp2(object): +class _Interp2: r"""Interpolate between two points. Parameters @@ -416,7 +416,7 @@ def _check_cola(win, nperseg, step, window_name, tol=1e-10): return const -class _Storer(object): +class _Storer: """Store data in chunks.""" def __init__(self, *outs, picks=None): diff --git a/mne/annotations.py b/mne/annotations.py index cf45d951c04..e941fb10d71 100644 --- a/mne/annotations.py +++ b/mne/annotations.py @@ -87,7 +87,7 @@ def _ndarray_ch_names(ch_names): @fill_doc -class Annotations(object): +class Annotations: """Annotation object for annotating segments of raw data. .. note:: diff --git a/mne/channels/channels.py b/mne/channels/channels.py index 12e797a5c10..7b2afb2ffbb 100644 --- a/mne/channels/channels.py +++ b/mne/channels/channels.py @@ -586,7 +586,7 @@ def set_meas_date(self, meas_date): return self -class UpdateChannelsMixin(object): +class UpdateChannelsMixin: """Mixin class for Raw, Evoked, Epochs, Spectrum, AverageTFR.""" @verbose @@ -980,7 +980,7 @@ def add_reference_channels(self, ref_channels): return add_reference_channels(self, ref_channels, copy=False) -class InterpolationMixin(object): +class InterpolationMixin: """Mixin class for Raw, Evoked, Epochs.""" @verbose diff --git a/mne/channels/layout.py b/mne/channels/layout.py index 87149f458a4..e59bb80a2a1 100644 --- a/mne/channels/layout.py +++ b/mne/channels/layout.py @@ -25,7 +25,7 @@ from .channels import _get_ch_info -class Layout(object): +class Layout: """Sensor layouts. Layouts are typically loaded from a file using diff --git a/mne/channels/montage.py b/mne/channels/montage.py index 3bc153a0d14..e28ded3f3d7 100644 --- a/mne/channels/montage.py +++ b/mne/channels/montage.py @@ -276,7 +276,7 @@ def make_dig_montage(ch_pos=None, nasion=None, lpa=None, rpa=None, return DigMontage(dig=dig, ch_names=ch_names) -class DigMontage(object): +class DigMontage: """Montage for digitized electrode and headshape position data. .. warning:: Montages are typically created using one of the helper diff --git a/mne/coreg.py b/mne/coreg.py index 3419392a013..0f3cb97988f 100644 --- a/mne/coreg.py +++ b/mne/coreg.py @@ -1278,7 +1278,7 @@ def _read_surface(filename, *, on_defects): @fill_doc -class Coregistration(object): +class Coregistration: """Class for MRI<->head coregistration. Parameters diff --git a/mne/decoding/mixin.py b/mne/decoding/mixin.py index b2c491b9118..d38e9e4aff4 100644 --- a/mne/decoding/mixin.py +++ b/mne/decoding/mixin.py @@ -1,6 +1,6 @@ -class TransformerMixin(object): +class TransformerMixin: """Mixin class for all transformers in scikit-learn.""" def fit_transform(self, X, y=None, **fit_params): @@ -33,7 +33,7 @@ def fit_transform(self, X, y=None, **fit_params): return self.fit(X, y, **fit_params).transform(X) -class EstimatorMixin(object): +class EstimatorMixin: """Mixin class for estimators.""" def get_params(self, deep=True): diff --git a/mne/epochs.py b/mne/epochs.py index b2448bd95ba..319bb4ecdb4 100644 --- a/mne/epochs.py +++ b/mne/epochs.py @@ -3211,7 +3211,7 @@ def read_epochs(fname, proj=True, preload=True, verbose=None): return EpochsFIF(fname, proj, preload, verbose) -class _RawContainer(object): +class _RawContainer: """Helper for a raw data container.""" def __init__(self, fid, data_tag, event_samps, epoch_shape, diff --git a/mne/event.py b/mne/event.py index 104897014d9..1478b4ae105 100644 --- a/mne/event.py +++ b/mne/event.py @@ -954,7 +954,7 @@ def concatenate_events(events, first_samps, last_samps): @fill_doc -class AcqParserFIF(object): +class AcqParserFIF: """Parser for Elekta data acquisition settings. This class parses parameters (e.g. events and averaging categories) that diff --git a/mne/filter.py b/mne/filter.py index 5c934ae52ec..5a3a25b5bec 100644 --- a/mne/filter.py +++ b/mne/filter.py @@ -1880,7 +1880,7 @@ def float_array(c): fir_window, fir_design) -class FilterMixin(object): +class FilterMixin: """Object for Epoch/Evoked filtering.""" @verbose diff --git a/mne/fixes.py b/mne/fixes.py index 09bc6a58947..642841a5225 100644 --- a/mne/fixes.py +++ b/mne/fixes.py @@ -214,7 +214,7 @@ def is_regressor(estimator): } -class BaseEstimator(object): +class BaseEstimator: """Base class for all estimators in scikit-learn. Notes diff --git a/mne/gui/__init__.py b/mne/gui/__init__.py index f92817bf637..c86b413b634 100644 --- a/mne/gui/__init__.py +++ b/mne/gui/__init__.py @@ -249,7 +249,7 @@ def locate_ieeg(info, trans, base_image, subject=None, subjects_dir=None, return gui -class _GUIScraper(object): +class _GUIScraper: """Scrape GUI outputs.""" def __repr__(self): diff --git a/mne/gui/tests/test_coreg.py b/mne/gui/tests/test_coreg.py index 44374d3c048..5c705c6dcb5 100644 --- a/mne/gui/tests/test_coreg.py +++ b/mne/gui/tests/test_coreg.py @@ -55,7 +55,7 @@ pytest.importorskip('nibabel') -class TstVTKPicker(object): +class TstVTKPicker: """Class to test cell picking.""" def __init__(self, mesh, cell_id, event_pos): diff --git a/mne/inverse_sparse/mxne_optim.py b/mne/inverse_sparse/mxne_optim.py index 587f1744400..bff7a909781 100644 --- a/mne/inverse_sparse/mxne_optim.py +++ b/mne/inverse_sparse/mxne_optim.py @@ -662,7 +662,7 @@ def safe_max_abs_diff(A, ia, B, ib): return np.max(np.abs(A - B)) -class _Phi(object): +class _Phi: """Have phi stft as callable w/o using a lambda that does not pickle.""" def __init__(self, wsize, tstep, n_coefs, n_times): # noqa: D102 @@ -705,7 +705,7 @@ def norm(self, z, ord=2): return norm -class _PhiT(object): +class _PhiT: """Have phi.T istft as callable w/o using a lambda that does not pickle.""" def __init__(self, tstep, n_freqs, n_steps, n_times): # noqa: D102 diff --git a/mne/io/base.py b/mne/io/base.py index b97290a1a7e..0dcc1b9eee4 100644 --- a/mne/io/base.py +++ b/mne/io/base.py @@ -2146,7 +2146,7 @@ def _get_scaling(ch_type, target_unit): return scaling -class _ReadSegmentFileProtector(object): +class _ReadSegmentFileProtector: """Ensure only _filenames, _raw_extras, and _read_segment_file are used.""" def __init__(self, raw): @@ -2160,7 +2160,7 @@ def _read_segment_file(self, data, idx, fi, start, stop, cals, mult): self, data, idx, fi, start, stop, cals, mult) -class _RawShell(object): +class _RawShell: """Create a temporary raw object.""" def __init__(self): # noqa: D102 diff --git a/mne/io/meas_info.py b/mne/io/meas_info.py index 20b795ab478..493542cce4d 100644 --- a/mne/io/meas_info.py +++ b/mne/io/meas_info.py @@ -147,7 +147,7 @@ def _unique_channel_names(ch_names, max_length=None, verbose=None): return ch_names -class MontageMixin(object): +class MontageMixin: """Mixin for Montage getting and setting.""" @fill_doc @@ -240,7 +240,7 @@ def set_montage(self, montage, match_case=True, match_alias=False, return self -class ContainsMixin(object): +class ContainsMixin: """Mixin class for Raw, Evoked, Epochs and Info.""" def __contains__(self, ch_type): diff --git a/mne/io/open.py b/mne/io/open.py index 7680c1344b5..d9aa7f3d53f 100644 --- a/mne/io/open.py +++ b/mne/io/open.py @@ -16,7 +16,7 @@ from ..utils import logger, verbose, _file_like, warn -class _NoCloseRead(object): +class _NoCloseRead: """Create a wrapper that will not close when used as a context manager.""" def __init__(self, fid): diff --git a/mne/io/proj.py b/mne/io/proj.py index 12db504f372..7774a8edb02 100644 --- a/mne/io/proj.py +++ b/mne/io/proj.py @@ -141,7 +141,7 @@ def plot_topomap( show=show) -class ProjMixin(object): +class ProjMixin: """Mixin class for Raw, Evoked, Epochs. Notes diff --git a/mne/io/tag.py b/mne/io/tag.py index 69504a5e49a..6d4b5df2ee4 100644 --- a/mne/io/tag.py +++ b/mne/io/tag.py @@ -17,7 +17,7 @@ ############################################################################## # HELPERS -class Tag(object): +class Tag: """Tag in FIF tree structure. Parameters diff --git a/mne/label.py b/mne/label.py index 69e9af93f52..767d836b789 100644 --- a/mne/label.py +++ b/mne/label.py @@ -872,7 +872,7 @@ def _get_label_src(label, src): return hemi_src -class BiHemiLabel(object): +class BiHemiLabel: """A freesurfer/MNE label with vertices in both hemispheres. Parameters diff --git a/mne/report/report.py b/mne/report/report.py index 574688e63a2..719714c6296 100644 --- a/mne/report/report.py +++ b/mne/report/report.py @@ -3877,7 +3877,7 @@ def _recursive_search(path, pattern): _FA_FILE_CODE = '' # noqa: E501 -class _ReportScraper(object): +class _ReportScraper: """Scrape Report outputs. Only works properly if conf.py is configured properly and the file diff --git a/mne/simulation/raw.py b/mne/simulation/raw.py index 19875910d38..1d2b8bcce0d 100644 --- a/mne/simulation/raw.py +++ b/mne/simulation/raw.py @@ -586,7 +586,7 @@ def add_chpi(raw, head_pos=None, interp='cos2', n_jobs=None, verbose=None): return raw -class _HPIForwards(object): +class _HPIForwards: def __init__(self, offsets, dev_head_ts, megcoils, hpi_rrs, hpi_nns): self.offsets = offsets @@ -656,7 +656,7 @@ def _stc_data_event(stc_counted, head_idx, sfreq, src=None, verts=None): return stc_data, stim_data, verts_ -class _SimForwards(object): +class _SimForwards: def __init__(self, dev_head_ts, offsets, info, trans, src, bem, mindist, n_jobs, meeg_picks, forward=None, use_cps=True): diff --git a/mne/simulation/source.py b/mne/simulation/source.py index df7dc736a19..425985ebf10 100644 --- a/mne/simulation/source.py +++ b/mne/simulation/source.py @@ -316,7 +316,7 @@ def simulate_stc(src, labels, stc_data, tmin, tstep, value_fun=None, return stc -class SourceSimulator(object): +class SourceSimulator: """Class to generate simulated Source Estimates. Parameters diff --git a/mne/surface.py b/mne/surface.py index ea106eae7f0..ddfc4d61496 100644 --- a/mne/surface.py +++ b/mne/surface.py @@ -456,7 +456,7 @@ def _normalize_vectors(rr): return size -class _CDist(object): +class _CDist: """Wrapper for cdist that uses a Tree-like pattern.""" def __init__(self, xhs): @@ -513,7 +513,7 @@ def _safe_query(rr, func, reduce=False, **kwargs): return out -class _DistanceQuery(object): +class _DistanceQuery: """Wrapper for fast distance queries.""" def __init__(self, xhs, method='BallTree', allow_kdtree=False): @@ -596,7 +596,7 @@ def _polydata_to_surface(pd, normals=True): return out -class _CheckInside(object): +class _CheckInside: """Efficiently check if points are inside a surface.""" @verbose diff --git a/mne/time_frequency/csd.py b/mne/time_frequency/csd.py index b7cc09c5e5e..d8680df0047 100644 --- a/mne/time_frequency/csd.py +++ b/mne/time_frequency/csd.py @@ -65,7 +65,7 @@ def pick_channels_csd(csd, include=[], exclude=[], ordered=False, copy=True): return csd -class CrossSpectralDensity(object): +class CrossSpectralDensity: """Cross-spectral density. Given a list of time series, the CSD matrix denotes for each pair of time diff --git a/mne/transforms.py b/mne/transforms.py index d6c4c63ce5f..d568dba14cf 100644 --- a/mne/transforms.py +++ b/mne/transforms.py @@ -928,7 +928,7 @@ def _compute_sph_harm(order, az, pol): # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. -class _TPSWarp(object): +class _TPSWarp: """Transform points using thin-plate spline (TPS) warping. Notes @@ -1005,7 +1005,7 @@ def _tps(distsq): ############################################################################### # Spherical harmonic approximation + TPS warp -class _SphericalSurfaceWarp(object): +class _SphericalSurfaceWarp: """Warp surfaces via spherical harmonic smoothing and thin-plate splines. Notes diff --git a/mne/utils/_bunch.py b/mne/utils/_bunch.py index 103a9574461..13c6c6f1e02 100644 --- a/mne/utils/_bunch.py +++ b/mne/utils/_bunch.py @@ -52,7 +52,7 @@ def __setattr__(self, attr, val): # noqa: D105 super().__setattr__(attr, val) -class _Named(object): +class _Named: """Provide shared methods for giving named-representation subclasses.""" def __new__(cls, name, val): # noqa: D102,D105 diff --git a/mne/utils/_logging.py b/mne/utils/_logging.py index 80d07e0e285..33f33d72c8b 100644 --- a/mne/utils/_logging.py +++ b/mne/utils/_logging.py @@ -295,7 +295,7 @@ def getvalue(self, close=True): return out -class catch_logging(object): +class catch_logging: """Store logging. This will remove all other logging handlers, and return the handler to @@ -334,7 +334,7 @@ def _record_warnings(): yield w -class WrapStdOut(object): +class WrapStdOut: """Dynamically wrap to sys.stdout. This makes packages that monkey-patch sys.stdout (e.g.doctest, diff --git a/mne/utils/_testing.py b/mne/utils/_testing.py index acd6c1764f6..1417b9c5c13 100644 --- a/mne/utils/_testing.py +++ b/mne/utils/_testing.py @@ -158,7 +158,7 @@ def run_command_if_main(): local_vars['run']() -class ArgvSetter(object): +class ArgvSetter: """Temporarily set sys.argv.""" def __init__(self, args=(), disable_stdout=True, @@ -182,7 +182,7 @@ def __exit__(self, *args): # noqa: D105 sys.stderr = self.orig_stderr -class SilenceStdout(object): +class SilenceStdout: """Silence stdout.""" def __init__(self, close=True): diff --git a/mne/utils/check.py b/mne/utils/check.py index 52f096450c7..91de46d4e43 100644 --- a/mne/utils/check.py +++ b/mne/utils/check.py @@ -469,7 +469,7 @@ def _is_numeric(n): return isinstance(n, numbers.Number) -class _IntLike(object): +class _IntLike: @classmethod def __instancecheck__(cls, other): try: @@ -484,7 +484,7 @@ def __instancecheck__(cls, other): path_like = (str, Path, os.PathLike) -class _Callable(object): +class _Callable: @classmethod def __instancecheck__(cls, other): return callable(other) diff --git a/mne/utils/mixin.py b/mne/utils/mixin.py index 8eb14085d38..4828129b64e 100644 --- a/mne/utils/mixin.py +++ b/mne/utils/mixin.py @@ -20,7 +20,7 @@ logger.propagate = False # don't propagate (in case of multiple imports) -class SizeMixin(object): +class SizeMixin: """Estimate MNE object sizes.""" def __eq__(self, other): @@ -72,7 +72,7 @@ def __hash__(self): raise RuntimeError('Hashing unknown object type: %s' % type(self)) -class GetEpochsMixin(object): +class GetEpochsMixin: """Class to add epoch selection and metadata to certain classes.""" def __getitem__(self, item): @@ -448,7 +448,7 @@ def _check_decim(info, decim, offset, check_filter=True): return decim, offset, new_sfreq -class TimeMixin(object): +class TimeMixin: """Class to handle operations on time for MNE objects.""" @property @@ -709,7 +709,7 @@ def _prepare_read_metadata(metadata): return metadata -class _FakeNoPandas(object): # noqa: D101 +class _FakeNoPandas: # noqa: D101 def __enter__(self): # noqa: D105 def _check(strict=True): diff --git a/mne/utils/numerics.py b/mne/utils/numerics.py index a702eba6b37..a6c4a7fa734 100644 --- a/mne/utils/numerics.py +++ b/mne/utils/numerics.py @@ -833,7 +833,7 @@ def object_diff(a, b, pre='', *, allclose=False): return out -class _PCA(object): +class _PCA: """Principal component analysis (PCA).""" # Adapted from sklearn and stripped down to just use linalg.svd @@ -1055,7 +1055,7 @@ def _stamp_to_dt(utc_stamp): timedelta(seconds=stamp[0], microseconds=stamp[1])) -class _ReuseCycle(object): +class _ReuseCycle: """Cycle over a variable, preferring to reuse earlier indices. Requires the values in ``x`` to be hashable and unique. This holds diff --git a/mne/utils/progressbar.py b/mne/utils/progressbar.py index dd6c73991be..20a14e3b169 100644 --- a/mne/utils/progressbar.py +++ b/mne/utils/progressbar.py @@ -19,7 +19,7 @@ from ._logging import logger -class ProgressBar(object): +class ProgressBar: """Generate a command-line progressbar. Parameters @@ -181,7 +181,7 @@ def run(self): time.sleep(1. / 30.) # 30 Hz refresh is plenty -class _PBSubsetUpdater(object): +class _PBSubsetUpdater: def __init__(self, pb, idx): self.mmap = pb._mmap diff --git a/mne/viz/_3d_overlay.py b/mne/viz/_3d_overlay.py index 819d9a6a30b..12c36c4ec73 100644 --- a/mne/viz/_3d_overlay.py +++ b/mne/viz/_3d_overlay.py @@ -13,7 +13,7 @@ from ..utils import logger -class _Overlay(object): +class _Overlay: def __init__(self, scalars, colormap, rng, opacity, name): self._scalars = scalars self._colormap = colormap @@ -54,7 +54,7 @@ def _norm(self, rng): return (self._scalars - rng[0]) / factor -class _LayeredMesh(object): +class _LayeredMesh: def __init__(self, renderer, vertices, triangles, normals): self._renderer = renderer self._vertices = vertices diff --git a/mne/viz/_brain/_brain.py b/mne/viz/_brain/_brain.py index f72c9364b42..78d28470fc2 100644 --- a/mne/viz/_brain/_brain.py +++ b/mne/viz/_brain/_brain.py @@ -51,7 +51,7 @@ @fill_doc -class Brain(object): +class Brain: """Class for visualizing a brain. .. warning:: diff --git a/mne/viz/_brain/_linkviewer.py b/mne/viz/_brain/_linkviewer.py index a2d7c34b51d..3be8b118384 100644 --- a/mne/viz/_brain/_linkviewer.py +++ b/mne/viz/_brain/_linkviewer.py @@ -7,7 +7,7 @@ from ...utils import warn -class _LinkViewer(object): +class _LinkViewer: """Class to link multiple Brain objects.""" def __init__(self, brains, time=True, camera=False, colorbar=True, diff --git a/mne/viz/_brain/_scraper.py b/mne/viz/_brain/_scraper.py index feb0b726631..08defc1b894 100644 --- a/mne/viz/_brain/_scraper.py +++ b/mne/viz/_brain/_scraper.py @@ -4,7 +4,7 @@ from ._brain import Brain -class _BrainScraper(object): +class _BrainScraper: """Scrape Brain objects.""" def __repr__(self): diff --git a/mne/viz/_brain/callback.py b/mne/viz/_brain/callback.py index 3e180e91677..831569e4aaf 100644 --- a/mne/viz/_brain/callback.py +++ b/mne/viz/_brain/callback.py @@ -9,7 +9,7 @@ from ...utils import logger -class TimeCallBack(object): +class TimeCallBack: """Callback to update the time.""" def __init__(self, brain=None, callback=None): @@ -36,7 +36,7 @@ def __call__(self, value, update_widget=False, time_as_index=True): self.widget.set_value(int(value)) -class UpdateColorbarScale(object): +class UpdateColorbarScale: """Class to update the values of the colorbar sliders.""" def __init__(self, brain, factor): @@ -53,7 +53,7 @@ def __call__(self): self.widgets[key].set_value(self.brain._data[key]) -class UpdateLUT(object): +class UpdateLUT: """Update the LUT.""" def __init__(self, brain=None): @@ -74,7 +74,7 @@ def __call__(self, fmin=None, fmid=None, fmax=None): widget.set_value(value) -class ShowView(object): +class ShowView: """Class that selects the correct view.""" def __init__(self, brain=None, data=None): @@ -100,7 +100,7 @@ def __call__(self, value, update_widget=False): self.widget.set_value(value) -class SmartCallBack(object): +class SmartCallBack: """Class to manage smart slider. It stores it's own slider representation for efficiency diff --git a/mne/viz/_brain/surface.py b/mne/viz/_brain/surface.py index d3820da5a96..4362b64baed 100644 --- a/mne/viz/_brain/surface.py +++ b/mne/viz/_brain/surface.py @@ -15,7 +15,7 @@ _read_patch) -class _Surface(object): +class _Surface: """Container for a brain surface. It is used for storing vertices, faces and morphometric data diff --git a/mne/viz/_brain/tests/test_brain.py b/mne/viz/_brain/tests/test_brain.py index 93cc72d644a..230b99a98d9 100644 --- a/mne/viz/_brain/tests/test_brain.py +++ b/mne/viz/_brain/tests/test_brain.py @@ -52,7 +52,7 @@ pytest.importorskip("nibabel") -class _Collection(object): +class _Collection: def __init__(self, actors): self._actors = actors @@ -63,7 +63,7 @@ def GetItemAsObject(self, ii): return self._actors[ii] -class TstVTKPicker(object): +class TstVTKPicker: """Class to test cell picking.""" def __init__(self, mesh, cell_id, hemi, brain): diff --git a/mne/viz/backends/_notebook.py b/mne/viz/backends/_notebook.py index f2d830d1b62..c239aa9e42c 100644 --- a/mne/viz/backends/_notebook.py +++ b/mne/viz/backends/_notebook.py @@ -304,7 +304,7 @@ def _set_enabled(self, value): # modified from: # https://gist.github.com/elkhadiy/284900b3ea8a13ed7b777ab93a691719 -class _FilePicker(object): +class _FilePicker: def __init__(self, rows=20, directory_only=False, ignore_dotfiles=True): self._callback = None self._directory_only = directory_only @@ -562,7 +562,7 @@ def _click(self, value): self._buttons[value].click() -class _BoxLayout(object): +class _BoxLayout: def _handle_scroll(self, scroll=None): kwargs = _BASE_KWARGS.copy() diff --git a/mne/viz/backends/_pyvista.py b/mne/viz/backends/_pyvista.py index aa4493430cc..b4fe3b69b7f 100644 --- a/mne/viz/backends/_pyvista.py +++ b/mne/viz/backends/_pyvista.py @@ -136,7 +136,7 @@ def _is_active(self): return hasattr(self.plotter, 'ren_win') -class _Projection(object): +class _Projection: """Class storing projection information. Attributes diff --git a/mne/viz/topomap.py b/mne/viz/topomap.py index 3221ff03e1d..be10dbe9502 100644 --- a/mne/viz/topomap.py +++ b/mne/viz/topomap.py @@ -626,7 +626,7 @@ def _get_extra_points(pos, extrapolate, origin, radii): return new_pos, mask_pos, tri -class _GridData(object): +class _GridData: """Unstructured (x,y) data interpolator. This class allows optimized interpolation by computing parameters diff --git a/mne/viz/utils.py b/mne/viz/utils.py index 57930e771ee..6a6c353b321 100644 --- a/mne/viz/utils.py +++ b/mne/viz/utils.py @@ -654,7 +654,7 @@ def _key_press(event): plt.close(event.canvas.figure) -class ClickableImage(object): +class ClickableImage: """Display an image so you can click on it and store x/y positions. Takes as input an image array (can be any array that works with imshow, @@ -1371,7 +1371,7 @@ def _prepare_joint_axes(n_maps, figsize=None): return fig, main_ax, map_ax, cbar_ax -class DraggableColorbar(object): +class DraggableColorbar: """Enable interactive colorbar. See http://www.ster.kuleuven.be/~pieterd/python/html/plotting/interactive_colorbar.html @@ -1689,7 +1689,7 @@ def _connection_line(x, fig, sourceax, targetax, y=1., clip_on=False) -class DraggableLine(object): +class DraggableLine: """Custom matplotlib line for moving around by drag and drop. Parameters