diff --git a/chaco/abstract_controller.py b/chaco/abstract_controller.py index 46cf28268..3ffaa9190 100644 --- a/chaco/abstract_controller.py +++ b/chaco/abstract_controller.py @@ -15,7 +15,7 @@ class AbstractController(Interactor): def __init__(self, component, *args, **kw): self.component = component - super(AbstractController, self).__init__(*args, **kw) + super().__init__(*args, **kw) def deactivate(self, component): """This method is called by the component when this controller is no diff --git a/chaco/abstract_data_range.py b/chaco/abstract_data_range.py index 925c58ba3..ec0d19340 100644 --- a/chaco/abstract_data_range.py +++ b/chaco/abstract_data_range.py @@ -54,7 +54,7 @@ def __init__(self, *sources, **kwargs): ) else: kwargs["sources"] = list(sources) - super(AbstractDataRange, self).__init__(**kwargs) + super().__init__(**kwargs) # ------------------------------------------------------------------------ # Abstract methods that subclasses must implement diff --git a/chaco/abstract_overlay.py b/chaco/abstract_overlay.py index 3d0807c8d..f44479887 100644 --- a/chaco/abstract_overlay.py +++ b/chaco/abstract_overlay.py @@ -33,7 +33,7 @@ class AbstractOverlay(PlotComponent): def __init__(self, component=None, *args, **kw): if component is not None: self.component = component - super(AbstractOverlay, self).__init__(*args, **kw) + super().__init__(*args, **kw) def overlay(self, other_component, gc, view_bounds=None, mode="normal"): """Draws this component overlaid on another component.""" @@ -49,10 +49,10 @@ def _draw(self, gc, view_bounds=None, mode="normal"): if self.component is not None: self.overlay(self.component, gc, view_bounds, mode) else: - super(AbstractOverlay, self)._draw(gc, view_bounds, mode) + super()._draw(gc, view_bounds, mode) def _request_redraw(self): """Overrides Enable Component.""" if self.component is not None: self.component.request_redraw() - super(AbstractOverlay, self)._request_redraw() + super()._request_redraw() diff --git a/chaco/array_data_source.py b/chaco/array_data_source.py index 19858c428..bda9a8b08 100644 --- a/chaco/array_data_source.py +++ b/chaco/array_data_source.py @@ -294,7 +294,7 @@ def _metadata_items_changed(self, event): # ------------------------------------------------------------------------ def __getstate__(self): - state = super(ArrayDataSource, self).__getstate__() + state = super().__getstate__() if not self.persist_data: state.pop("_data", None) state.pop("_cached_mask", None) @@ -304,6 +304,6 @@ def __getstate__(self): return state def _post_load(self): - super(ArrayDataSource, self)._post_load() + super()._post_load() self._cached_bounds = () self._cached_mask = None diff --git a/chaco/axis.py b/chaco/axis.py index 1b4042494..81ceb3c56 100644 --- a/chaco/axis.py +++ b/chaco/axis.py @@ -205,7 +205,7 @@ def __init__(self, component=None, **kwargs): self.tick_generator = DefaultTickGenerator() # Override init so that our component gets set last. We want the # _component_changed() event handler to get run last. - super(PlotAxis, self).__init__(**kwargs) + super().__init__(**kwargs) if component is not None: self.component = component @@ -235,7 +235,7 @@ def _do_layout(self, *args, **kw): if self.component is not None: self._layout_as_overlay(*args, **kw) else: - super(PlotAxis, self)._do_layout(*args, **kw) + super()._do_layout(*args, **kw) def overlay(self, component, gc, view_bounds=None, mode="normal"): """Draws this component overlaid on another component. @@ -686,12 +686,12 @@ def _calculate_geometry_overlay(self, overlay_component=None): # ------------------------------------------------------------------------ def _bounds_changed(self, old, new): - super(PlotAxis, self)._bounds_changed(old, new) + super()._bounds_changed(old, new) self._layout_needed = True self._invalidate() def _bounds_items_changed(self, event): - super(PlotAxis, self)._bounds_items_changed(event) + super()._bounds_items_changed(event) self._layout_needed = True self._invalidate() @@ -709,11 +709,11 @@ def mapper_updated(self, event=None): self._invalidate() def _position_changed(self, old, new): - super(PlotAxis, self)._position_changed(old, new) + super()._position_changed(old, new) self._cache_valid = False def _position_items_changed(self, event): - super(PlotAxis, self)._position_items_changed(event) + super()._position_items_changed(event) self._cache_valid = False def _position_changed_for_component(self): @@ -832,7 +832,7 @@ def _title_angle_default(self): # ------------------------------------------------------------------------ def __setstate__(self, state): - super(PlotAxis, self).__setstate__(state) + super().__setstate__(state) self._mapper_changed(None, self.mapper) self._reset_cache() self._cache_valid = False @@ -845,7 +845,7 @@ class MinorPlotAxis(PlotAxis): """ def __init__(self, *args, **kwargs): - super(MinorPlotAxis, self).__init__(*args, **kwargs) + super().__init__(*args, **kwargs) if "tick_generator" not in kwargs: self.tick_generator = MinorTickGenerator() diff --git a/chaco/barplot.py b/chaco/barplot.py index de73c9624..5749f5bf9 100644 --- a/chaco/barplot.py +++ b/chaco/barplot.py @@ -155,7 +155,7 @@ def __init__(self, *args, **kw): if name in kw: postponed[name] = kw.pop(name) - super(BarPlot, self).__init__(*args, **kw) + super().__init__(*args, **kw) # Set any keyword Traits that were postponed. self.trait_set(**postponed) @@ -354,7 +354,7 @@ def _render_icon(self, gc, x, y, width, height): gc.draw_path(FILL_STROKE) def _post_load(self): - super(BarPlot, self)._post_load() + super()._post_load() # ------------------------------------------------------------------------ # Properties @@ -438,11 +438,11 @@ def _update_mappers(self): self._cache_valid = False def _bounds_changed(self, old, new): - super(BarPlot, self)._bounds_changed(old, new) + super()._bounds_changed(old, new) self._update_mappers() def _bounds_items_changed(self, event): - super(BarPlot, self)._bounds_items_changed(event) + super()._bounds_items_changed(event) self._update_mappers() def _orientation_changed(self): diff --git a/chaco/base_1d_plot.py b/chaco/base_1d_plot.py index 71315f698..8fbb8f237 100644 --- a/chaco/base_1d_plot.py +++ b/chaco/base_1d_plot.py @@ -330,19 +330,19 @@ def _invalidate_screen(self, event): self._screen_cache_valid = False def _bounds_changed(self, old, new): - super(Base1DPlot, self)._bounds_changed(old, new) + super()._bounds_changed(old, new) self._update_mappers() def _bounds_items_changed(self, event): - super(Base1DPlot, self)._bounds_items_changed(event) + super()._bounds_items_changed(event) self._update_mappers() def _position_changed(self, old, new): - super(Base1DPlot, self)._position_changed(old, new) + super()._position_changed(old, new) self._update_mappers() def _position_items_changed(self, event): - super(Base1DPlot, self)._position_items_changed(event) + super()._position_items_changed(event) self._update_mappers() def _updated_changed_for_index_mapper(self): diff --git a/chaco/base_2d_plot.py b/chaco/base_2d_plot.py index 81c01939d..469b3a43c 100644 --- a/chaco/base_2d_plot.py +++ b/chaco/base_2d_plot.py @@ -87,7 +87,7 @@ def __init__(self, **kwargs): if trait_name in kwargs: kwargs_tmp[trait_name] = kwargs.pop(trait_name) self.trait_set(**kwargs_tmp) - super(Base2DPlot, self).__init__(**kwargs) + super().__init__(**kwargs) if self.index is not None: self.index.observe(self._update_index_data, "data_changed") if self.index_mapper: @@ -315,11 +315,11 @@ def _update_value_data(self, event=None): # ------------------------------------------------------------------------ def _bounds_changed(self, old, new): - super(Base2DPlot, self)._bounds_changed(old, new) + super()._bounds_changed(old, new) self._update_index_mapper() def _bounds_items_changed(self, event): - super(Base2DPlot, self)._bounds_items_changed(event) + super()._bounds_items_changed(event) self._update_index_mapper() def _orientation_changed(self): diff --git a/chaco/base_contour_plot.py b/chaco/base_contour_plot.py index c2181f8ee..2099c6a15 100644 --- a/chaco/base_contour_plot.py +++ b/chaco/base_contour_plot.py @@ -71,7 +71,7 @@ class BaseContourPlot(Base2DPlot): _color_map_trait = ColorTrait def __init__(self, *args, **kwargs): - super(BaseContourPlot, self).__init__(*args, **kwargs) + super().__init__(*args, **kwargs) if self.color_mapper: self.color_mapper.observe(self._update_color_mapper, "updated") diff --git a/chaco/base_xy_plot.py b/chaco/base_xy_plot.py index cfe77b4f4..d73571132 100644 --- a/chaco/base_xy_plot.py +++ b/chaco/base_xy_plot.py @@ -508,7 +508,7 @@ def _draw_default_axes(self, gc): gc.stroke_path() def _post_load(self): - super(BaseXYPlot, self)._post_load() + super()._post_load() self._update_mappers() self.invalidate_draw() self._cache_valid = False @@ -617,11 +617,11 @@ def _update_mappers(self): self._screen_cache_valid = False def _bounds_changed(self, old, new): - super(BaseXYPlot, self)._bounds_changed(old, new) + super()._bounds_changed(old, new) self._update_mappers() def _bounds_items_changed(self, event): - super(BaseXYPlot, self)._bounds_items_changed(event) + super()._bounds_items_changed(event) self._update_mappers() def _position_changed(self): @@ -722,7 +722,7 @@ def _use_subdivision_changed(self, old, new): # ------------------------------------------------------------------------ def __setstate__(self, state): - super(BaseXYPlot, self).__setstate__(state) + super().__setstate__(state) if self.index is not None: self.index.observe(self._either_data_updated, "data_changed") if self.value is not None: diff --git a/chaco/cmap_image_plot.py b/chaco/cmap_image_plot.py index 8306d9378..4c72088dc 100644 --- a/chaco/cmap_image_plot.py +++ b/chaco/cmap_image_plot.py @@ -62,7 +62,7 @@ class CMapImagePlot(ImagePlot): # ------------------------------------------------------------------------ def __init__(self, **kwargs): - super(CMapImagePlot, self).__init__(**kwargs) + super().__init__(**kwargs) if self.value_mapper: self.value_mapper.observe(self._update_value_mapper, "updated") if self.value: @@ -181,11 +181,11 @@ def _value_mapper_changed(self, old, new): self._update_value_mapper() def _value_data_changed_fired(self): - super(CMapImagePlot, self)._value_data_changed_fired() + super()._value_data_changed_fired() self._mapped_image_cache_valid = False def _index_data_changed_fired(self): - super(CMapImagePlot, self)._index_data_changed_fired() + super()._index_data_changed_fired() self._mapped_image_cache_valid = False def _cache_full_map_changed(self): diff --git a/chaco/color_bar.py b/chaco/color_bar.py index bcdd7416e..f4cef7910 100644 --- a/chaco/color_bar.py +++ b/chaco/color_bar.py @@ -98,7 +98,7 @@ def __init__(self, *args, **kw): grid_visible = kw.pop("grid_visible", True) axis_visible = kw.pop("axis_visible", True) - super(ColorBar, self).__init__(*args, **kw) + super().__init__(*args, **kw) if self.orientation == "h": if self.direction == "normal": @@ -212,19 +212,19 @@ def _update_mappers(self): self.index_mapper.range = self.color_mapper.range def _bounds_changed(self, old, new): - super(ColorBar, self)._bounds_changed(old, new) + super()._bounds_changed(old, new) self._update_mappers() def _bounds_items_changed(self, event): - super(ColorBar, self)._bounds_items_changed(event) + super()._bounds_items_changed(event) self._update_mappers() def _position_changed(self, old, new): - super(ColorBar, self)._position_changed(old, new) + super()._position_changed(old, new) self._update_mappers() def _position_items_changed(self, event): - super(ColorBar, self)._position_items_changed(event) + super()._position_items_changed(event) self._update_mappers() def _updated_changed_for_index_mapper(self): diff --git a/chaco/color_mapper.py b/chaco/color_mapper.py index 8dc1380a7..1cd3b3edb 100644 --- a/chaco/color_mapper.py +++ b/chaco/color_mapper.py @@ -263,7 +263,7 @@ def __init__(self, segmentdata, **kwtraits): the transitions. """ self._segmentdata = segmentdata - super(ColorMapper, self).__init__(**kwtraits) + super().__init__(**kwtraits) def map_screen(self, data_array): """Maps an array of data values to an array of colors.""" diff --git a/chaco/colormapped_scatterplot.py b/chaco/colormapped_scatterplot.py index 085cd8a13..2b4f59ce4 100644 --- a/chaco/colormapped_scatterplot.py +++ b/chaco/colormapped_scatterplot.py @@ -32,7 +32,7 @@ class ColormappedScatterPlotView(ScatterPlotView): """TraitsUI View for customizing a color-mapped scatter plot.""" def __init__(self): - super(ColormappedScatterPlotView, self).__init__() + super().__init__() vgroup = self.content vgroup.content[0].content.append( Item( @@ -106,7 +106,7 @@ def map_screen(self, data_array): if len(data_array) > 0: if data_array.shape[1] == 3: data_array = data_array[:, :2] - return super(ColormappedScatterPlot, self).map_screen(data_array) + return super().map_screen(data_array) def _draw_plot(self, gc, view_bounds=None, mode="normal"): """Draws the 'plot' layer. @@ -121,9 +121,7 @@ def _draw_plot(self, gc, view_bounds=None, mode="normal"): # Take into account fill_alpha even if we are rendering with only two values old_color = self.color self.color = tuple(self.fill_alpha * array(self.color_)) - super(ColormappedScatterPlot, self)._draw_component( - gc, view_bounds, mode - ) + super()._draw_component(gc, view_bounds, mode) self.color = old_color else: colors = self._cached_data_pts[:, 2] @@ -188,7 +186,7 @@ def _render(self, gc, points): """ # If we don't have a color data set, then use the base class to render if (self.color_mapper is None) or (self.color_data is None): - return super(ColormappedScatterPlot, self)._render(gc, points) + return super()._render(gc, points) # If the GC doesn't have draw_*_at_points, then use bruteforce if hasattr(gc, "draw_marker_at_points") or hasattr( diff --git a/chaco/colormapped_selection_overlay.py b/chaco/colormapped_selection_overlay.py index 8e12e69ad..74c7adc54 100644 --- a/chaco/colormapped_selection_overlay.py +++ b/chaco/colormapped_selection_overlay.py @@ -47,7 +47,7 @@ class ColormappedSelectionOverlay(AbstractOverlay): _old_line_width = Float(0.0) def __init__(self, component=None, **kw): - super(ColormappedSelectionOverlay, self).__init__(**kw) + super().__init__(**kw) self.component = component def overlay(self, component, gc, view_bounds=None, mode="normal"): diff --git a/chaco/contour_line_plot.py b/chaco/contour_line_plot.py index fc9ccb767..57df0fcc3 100644 --- a/chaco/contour_line_plot.py +++ b/chaco/contour_line_plot.py @@ -137,7 +137,7 @@ def _update_contours(self): def _update_levels(self): """ Extends the parent method to also invalidate some other things """ - super(ContourLinePlot, self)._update_levels() + super()._update_levels() self._contour_cache_valid = False self._widths_cache_valid = False self._styles_cache_valid = False diff --git a/chaco/contour_poly_plot.py b/chaco/contour_poly_plot.py index 9b82f31bf..f19a81221 100644 --- a/chaco/contour_poly_plot.py +++ b/chaco/contour_poly_plot.py @@ -95,7 +95,7 @@ def _update_polys(self): def _update_levels(self): """ Extends the parent method to also invalidate some other things """ - super(ContourPolyPlot, self)._update_levels() + super()._update_levels() self._poly_cache_valid = False def _update_colors(self): diff --git a/chaco/data_range_2d.py b/chaco/data_range_2d.py index d58d50525..83748b7d5 100644 --- a/chaco/data_range_2d.py +++ b/chaco/data_range_2d.py @@ -116,7 +116,7 @@ def set_bounds(self, low, high): # ------------------------------------------------------------------------ def __init__(self, *args, **kwargs): - super(DataRange2D, self).__init__(*args, **kwargs) + super().__init__(*args, **kwargs) def reset(self): """Resets the bounds of this range.""" diff --git a/chaco/data_view.py b/chaco/data_view.py index 5bba1a8d3..53c300fef 100644 --- a/chaco/data_view.py +++ b/chaco/data_view.py @@ -220,7 +220,7 @@ class DataView(OverlayPlotContainer): # ------------------------------------------------------------------------ def __init__(self, **kwtraits): - super(DataView, self).__init__(**kwtraits) + super().__init__(**kwtraits) self._init_components() # If we are not resizable, we will not get a bounds update upon layout, @@ -344,19 +344,19 @@ def _update_mappers(self): self.invalidate_draw() def _bounds_changed(self, old, new): - super(DataView, self)._bounds_changed(old, new) + super()._bounds_changed(old, new) self._update_mappers() def _bounds_items_changed(self, event): - super(DataView, self)._bounds_items_changed(event) + super()._bounds_items_changed(event) self._update_mappers() def _position_changed(self, old, new): - super(DataView, self)._position_changed(old, new) + super()._position_changed(old, new) self._update_mappers() def _position_items_changed(self, event): - super(DataView, self)._position_items_changed(event) + super()._position_items_changed(event) self._update_mappers() def _origin_changed(self): diff --git a/chaco/function_image_data.py b/chaco/function_image_data.py index 1796aee4d..195c76819 100644 --- a/chaco/function_image_data.py +++ b/chaco/function_image_data.py @@ -28,7 +28,7 @@ class FunctionImageData(ImageData): data_range = Instance(DataRange2D) def __init__(self, **kw): - super(FunctionImageData, self).__init__(**kw) + super().__init__(**kw) # Explicitly construct the initial data set for ImageData self.recalculate() diff --git a/chaco/grid.py b/chaco/grid.py index df6d1ba90..1b4db84b9 100644 --- a/chaco/grid.py +++ b/chaco/grid.py @@ -181,7 +181,7 @@ class PlotGrid(AbstractOverlay): def __init__(self, **traits): # TODO: change this back to a factory in the instance trait some day self.tick_generator = DefaultTickGenerator() - super(PlotGrid, self).__init__(**traits) + super().__init__(**traits) self.bgcolor = "none" # make sure we're transparent @observe("bounds.items,position.items") @@ -201,7 +201,7 @@ def do_layout(self, *args, **kw): if self.component is not None: self._layout_as_overlay(*args, **kw) else: - super(PlotGrid, self).do_layout(*args, **kw) + super().do_layout(*args, **kw) # ------------------------------------------------------------------------ # Private methods @@ -445,7 +445,7 @@ def _orientation_changed(self): ### Persistence ########################################################### def _post_load(self): - super(PlotGrid, self)._post_load() + super()._post_load() self._mapper_changed(None, self.mapper) self._reset_cache() self._cache_valid = False diff --git a/chaco/grid_data_source.py b/chaco/grid_data_source.py index d4f71013a..0e2c35d5a 100644 --- a/chaco/grid_data_source.py +++ b/chaco/grid_data_source.py @@ -60,7 +60,7 @@ def __init__( sort_order=("none", "none"), **kwargs ): - super(GridDataSource, self).__init__(**kwargs) + super().__init__(**kwargs) self.set_data(xdata, ydata, sort_order) def set_data(self, xdata, ydata, sort_order=None): diff --git a/chaco/grid_mapper.py b/chaco/grid_mapper.py index 0f8a0259f..9a810a03e 100644 --- a/chaco/grid_mapper.py +++ b/chaco/grid_mapper.py @@ -109,7 +109,7 @@ def __init__(self, x_type="linear", y_type="linear", range=None, **kwargs): # Now that the mappers are created, we can go to the normal HasTraits # constructor, which might set values that depend on us having a valid # range and mappers. - super(GridMapper, self).__init__(**kwargs) + super().__init__(**kwargs) def map_screen(self, data_pts): """map_screen(data_pts) -> screen_array diff --git a/chaco/label.py b/chaco/label.py index 19b4ed9f3..1d4c109b6 100644 --- a/chaco/label.py +++ b/chaco/label.py @@ -79,7 +79,7 @@ class Label(HasTraits): _rot_matrix = Any() def __init__(self, **traits): - super(Label, self).__init__(**traits) + super().__init__(**traits) self._bounding_box = [0, 0] def get_width_height(self, gc): diff --git a/chaco/layers/status_layer.py b/chaco/layers/status_layer.py index 377929f57..cc0e599c3 100644 --- a/chaco/layers/status_layer.py +++ b/chaco/layers/status_layer.py @@ -46,7 +46,7 @@ class StatusLayer(AbstractOverlay): fade_out_steps = Int(10) def __init__(self, component, *args, **kw): - super(StatusLayer, self).__init__(component, *args, **kw) + super().__init__(component, *args, **kw) if self.document is None: if self.filename == "": diff --git a/chaco/multi_array_data_source.py b/chaco/multi_array_data_source.py index d1f9d2a54..229f75a7a 100644 --- a/chaco/multi_array_data_source.py +++ b/chaco/multi_array_data_source.py @@ -62,7 +62,7 @@ class MultiArrayDataSource(AbstractDataSource): _max_index = Int def __init__(self, data=array([]), sort_order="ascending", **traits): - super(MultiArrayDataSource, self).__init__(**traits) + super().__init__(**traits) self._set_data(data) self.sort_order = sort_order self.data_changed = True diff --git a/chaco/overlays/container_overlay.py b/chaco/overlays/container_overlay.py index 178a6b4e9..f0bd8aed0 100644 --- a/chaco/overlays/container_overlay.py +++ b/chaco/overlays/container_overlay.py @@ -39,4 +39,4 @@ def overlay(self, other, gc, view_bounds, mode): def _request_redraw(self): if self.component is not None: self.component.request_redraw() - super(ContainerOverlay, self)._request_redraw() + super()._request_redraw() diff --git a/chaco/overlays/databox.py b/chaco/overlays/databox.py index a8daeb27d..429319e99 100644 --- a/chaco/overlays/databox.py +++ b/chaco/overlays/databox.py @@ -56,7 +56,7 @@ class DataBox(AbstractOverlay): _updating = Bool(False) def __init__(self, *args, **kw): - super(DataBox, self).__init__(*args, **kw) + super().__init__(*args, **kw) if hasattr(self.component, "range2d"): self.component.range2d._xrange.observe( self.my_component_moved, "updated" diff --git a/chaco/plot.py b/chaco/plot.py index e0f69367b..dcc8d124b 100644 --- a/chaco/plot.py +++ b/chaco/plot.py @@ -185,7 +185,7 @@ def __init__(self, data=None, **kwtraits): title = kwtraits.pop("title") else: title = None - super(Plot, self).__init__(**kwtraits) + super().__init__(**kwtraits) if data is not None: if isinstance(data, AbstractPlotData): self.data = data diff --git a/chaco/plot_canvas_toolbar.py b/chaco/plot_canvas_toolbar.py index 9ed14b74e..5716767f0 100644 --- a/chaco/plot_canvas_toolbar.py +++ b/chaco/plot_canvas_toolbar.py @@ -62,7 +62,7 @@ def _request_redraw(self): # redraw event up to our overlaid component if self.component is not None: self.component.request_redraw() - super(PlotCanvasToolbar, self)._request_redraw() + super()._request_redraw() class PlotToolbarButton(PlotComponent, ToolbarButton): diff --git a/chaco/plot_containers.py b/chaco/plot_containers.py index 7b8bcada7..c9e6216ee 100644 --- a/chaco/plot_containers.py +++ b/chaco/plot_containers.py @@ -280,7 +280,7 @@ def _do_stack_layout(self, components, align): # PICKLE FIXME: blocked with _pickles, but not sure that was correct. def __getstate__(self): - state = super(StackedPlotContainer, self).__getstate__() + state = super().__getstate__() if "stack_index" in state: del state["stack_index"] return state diff --git a/chaco/plot_graphics_context.py b/chaco/plot_graphics_context.py index 9572748ea..e124c3031 100644 --- a/chaco/plot_graphics_context.py +++ b/chaco/plot_graphics_context.py @@ -28,7 +28,7 @@ def __init__(self, size_or_ary, *args, **kw): size_or_ary[1] * scale + 1, ) - super(PlotGraphicsContextMixin, self).__init__( + super().__init__( size_or_ary, *args, **kw ) self.translate_ctm(0.5, 0.5) @@ -70,7 +70,7 @@ def clip_to_rect(self, x, y, width, height): Overrides Kiva GraphicsContext. """ - super(PlotGraphicsContextMixin, self).clip_to_rect( + super().clip_to_rect( x - 0.5, y - 0.5, width + 1, height + 1 ) diff --git a/chaco/plot_label.py b/chaco/plot_label.py index 736ed7ea3..b7c3949a2 100644 --- a/chaco/plot_label.py +++ b/chaco/plot_label.py @@ -76,7 +76,7 @@ class PlotLabel(AbstractOverlay): _label = Instance(Label, args=()) def __init__(self, text="", *args, **kw): - super(PlotLabel, self).__init__(*args, **kw) + super().__init__(*args, **kw) self.text = text def overlay(self, component, gc, view_bounds=None, mode="normal"): diff --git a/chaco/plotscrollbar.py b/chaco/plotscrollbar.py index 6c266a337..7e818b470 100644 --- a/chaco/plotscrollbar.py +++ b/chaco/plotscrollbar.py @@ -112,7 +112,7 @@ def _handle_dataspace_update(self): self.request_redraw() def _scroll_position_changed(self): - super(PlotScrollBar, self)._scroll_position_changed() + super()._scroll_position_changed() # Notify our range that we've changed range = self.mapper.range diff --git a/chaco/point_data_source.py b/chaco/point_data_source.py index de5d00594..261791510 100644 --- a/chaco/point_data_source.py +++ b/chaco/point_data_source.py @@ -76,7 +76,7 @@ def __init__(self, data=transpose(array([[], []])), **kw): + str(shape) + " instead." ) - super(PointDataSource, self).__init__(data, **kw) + super().__init__(data, **kw) def get_data(self): """Returns the data for this data source, or (0.0, 0.0) if it has no diff --git a/chaco/polar_line_renderer.py b/chaco/polar_line_renderer.py index 6b18daded..b34cd5b64 100644 --- a/chaco/polar_line_renderer.py +++ b/chaco/polar_line_renderer.py @@ -131,11 +131,11 @@ def _draw_component(self, gc, view_bounds=None, mode="normal"): self._render(gc, self._cached_data_pts) def _bounds_changed(self, old, new): - super(PolarLineRenderer, self)._bounds_changed(old, new) + super()._bounds_changed(old, new) self._update_mappers() def _bounds_items_changed(self, event): - super(PolarLineRenderer, self)._bounds_items_changed(event) + super()._bounds_items_changed(event) self._update_mappers() def _draw_default_axes(self, gc): diff --git a/chaco/quiverplot.py b/chaco/quiverplot.py index 3a8646436..01618df6c 100644 --- a/chaco/quiverplot.py +++ b/chaco/quiverplot.py @@ -46,7 +46,7 @@ class QuiverPlot(ScatterPlot): def _gather_points_old(self): # In addition to the standard scatterplot _gather_points, we need # to also grab the vectors that fall inside the view range - super(QuiverPlot, self)._gather_points_old() + super()._gather_points_old() if not self.index or not self.value: return diff --git a/chaco/scales/time_scale.py b/chaco/scales/time_scale.py index 40a428526..5fa2fa288 100644 --- a/chaco/scales/time_scale.py +++ b/chaco/scales/time_scale.py @@ -427,7 +427,7 @@ def __init__(self, *scales, **kw): """ if len(scales) == 0: scales = HMSScales + MDYScales - super(CalendarScaleSystem, self).__init__(*scales, **kw) + super().__init__(*scales, **kw) def _get_scale(self, start, end, numticks): if len(self.scales) == 0: diff --git a/chaco/scatterplot.py b/chaco/scatterplot.py index 5a3001d42..e3cb16f03 100644 --- a/chaco/scatterplot.py +++ b/chaco/scatterplot.py @@ -64,7 +64,7 @@ def __init__(self): Item("marker_size", label="Size"), Item("color", label="Color", style="custom"), ) - super(ScatterPlotView, self).__init__(vgroup) + super().__init__(vgroup) self.buttons = ["OK", "Cancel"] diff --git a/chaco/scatterplot_1d.py b/chaco/scatterplot_1d.py index 68e0c00c1..773763e23 100644 --- a/chaco/scatterplot_1d.py +++ b/chaco/scatterplot_1d.py @@ -171,15 +171,15 @@ def _get_marker_position(self): return position def _bounds_changed(self, old, new): - super(ScatterPlot1D, self)._bounds_changed(old, new) + super()._bounds_changed(old, new) self._marker_position = self._get_marker_position() def _bounds_items_changed(self, event): - super(ScatterPlot1D, self)._bounds_items_changed(event) + super()._bounds_items_changed(event) self._marker_position = self._get_marker_position() def _orientation_changed(self): - super(ScatterPlot1D, self)._orientation_changed() + super()._orientation_changed() self._marker_position = self._get_marker_position() def _alignment_changed(self): diff --git a/chaco/svg_graphics_context.py b/chaco/svg_graphics_context.py index 0ec1c0373..5a1afaf34 100644 --- a/chaco/svg_graphics_context.py +++ b/chaco/svg_graphics_context.py @@ -27,7 +27,7 @@ def __init__(self, size_or_ary, dpi=72.0, *args, **kw): size_or_ary[1] * scale + 1, ) - super(SVGGraphicsContext, self).__init__(size_or_ary, *args, **kw) + super().__init__(size_or_ary, *args, **kw) self.translate_ctm(0.5, 0.5) self.scale_ctm(scale, scale) diff --git a/chaco/text_plot_1d.py b/chaco/text_plot_1d.py index 430437059..9cf2880ab 100644 --- a/chaco/text_plot_1d.py +++ b/chaco/text_plot_1d.py @@ -177,19 +177,19 @@ def _invalidate_labels(self, event): self._label_cache_valid = False def _bounds_changed(self, old, new): - super(TextPlot1D, self)._bounds_changed(old, new) + super()._bounds_changed(old, new) self._text_position = self._get_text_position() def _bounds_items_changed(self, event): - super(TextPlot1D, self)._bounds_items_changed(event) + super()._bounds_items_changed(event) self._text_position = self._get_text_position() def _orientation_changed(self): - super(TextPlot1D, self)._orientation_changed() + super()._orientation_changed() self._text_position = self._get_text_position() def _direction_changed(self): - super(TextPlot1D, self)._direction_changed() + super()._direction_changed() self._text_position = self._get_text_position() def _alignment_changed(self): diff --git a/chaco/ticks.py b/chaco/ticks.py index 99320a7b7..dd0fcb4a4 100644 --- a/chaco/ticks.py +++ b/chaco/ticks.py @@ -184,7 +184,7 @@ def get_ticks( 0, auto_interval(data_low, data_high), max_ticks=5 ) - return super(MinorTickGenerator, self).get_ticks( + return super().get_ticks( data_low, data_high, bounds_low, diff --git a/chaco/toolbar_plot.py b/chaco/toolbar_plot.py index a868310be..03b1d5e4f 100644 --- a/chaco/toolbar_plot.py +++ b/chaco/toolbar_plot.py @@ -27,7 +27,7 @@ def __init__(self, *args, **kw): if "toolbar_class" in kw: self.toolbar_class = kw.pop("toolbar_class") - super(ToolbarPlot, self).__init__(*args, **kw) + super().__init__(*args, **kw) self.toolbar.component = self self.add_toolbar() @@ -49,7 +49,7 @@ def remove_toolbar(self): def _bounds_changed(self, old, new): self.toolbar.do_layout(force=True) - super(ToolbarPlot, self)._bounds_changed(old, new) + super()._bounds_changed(old, new) @observe("toolbar") def _update_toolbar(self, event): diff --git a/chaco/tools/better_selecting_zoom.py b/chaco/tools/better_selecting_zoom.py index b58918171..a612246e5 100644 --- a/chaco/tools/better_selecting_zoom.py +++ b/chaco/tools/better_selecting_zoom.py @@ -128,7 +128,7 @@ def normal_key_pressed(self, event): event.handled = True if not event.handled: - super(BetterSelectingZoom, self).normal_key_pressed(event) + super().normal_key_pressed(event) def normal_left_down(self, event): """Handles the left mouse button being pressed while the tool is @@ -443,12 +443,12 @@ def _reset_range_settings(self): # -------------------------------------------------------------------------- def _prev_state_pressed(self): - super(BetterSelectingZoom, self)._prev_state_pressed() + super()._prev_state_pressed() # Reset the range settings if self._history_index == 0: self._reset_range_settings() def _reset_state_pressed(self): - super(BetterSelectingZoom, self)._reset_state_pressed() + super()._reset_state_pressed() # Reset the range settings self._reset_range_settings() diff --git a/chaco/tools/drag_zoom.py b/chaco/tools/drag_zoom.py index 00ec18c5a..2663b42c7 100644 --- a/chaco/tools/drag_zoom.py +++ b/chaco/tools/drag_zoom.py @@ -71,7 +71,7 @@ class DragZoom(DragTool, BetterZoom): _prev_y = Float() def __init__(self, component=None, *args, **kw): - super(DragZoom, self).__init__(component, *args, **kw) + super().__init__(component, *args, **kw) c = component if c is not None: self._orig_screen_bounds = ((c.x, c.y), (c.x2, c.y2)) diff --git a/chaco/tools/line_segment_tool.py b/chaco/tools/line_segment_tool.py index fb0e62e4f..9f1c328de 100644 --- a/chaco/tools/line_segment_tool.py +++ b/chaco/tools/line_segment_tool.py @@ -85,7 +85,7 @@ class LineSegmentTool(AbstractOverlay): def __init__(self, component=None, **kwtraits): if "component" in kwtraits: component = kwtraits["component"] - super(LineSegmentTool, self).__init__(**kwtraits) + super().__init__(**kwtraits) self.component = component self.reset() self.line.line_dash = (4.0, 2.0) diff --git a/chaco/tools/rectangular_selection.py b/chaco/tools/rectangular_selection.py index d38857050..eaf500ca1 100644 --- a/chaco/tools/rectangular_selection.py +++ b/chaco/tools/rectangular_selection.py @@ -32,7 +32,7 @@ def selecting_mouse_move(self, event): self.trait_property_changed("disjoint_selections", None) def selecting_mouse_up(self, event): - super(RectangularSelection, self).selecting_mouse_up(event) + super().selecting_mouse_up(event) # Clear the first click self.first_corner = None diff --git a/chaco/tools/toolbars/plot_toolbar.py b/chaco/tools/toolbars/plot_toolbar.py index c95613af1..2db1ae485 100644 --- a/chaco/tools/toolbars/plot_toolbar.py +++ b/chaco/tools/toolbars/plot_toolbar.py @@ -23,7 +23,7 @@ def _is_in(self, x, y): def normal_mouse_move(self, event): self._last_xy = (event.x, event.y) - super(PlotToolbarHover, self).normal_mouse_move(event) + super().normal_mouse_move(event) def on_hover(self): """This gets called when all the conditions of the hover action have @@ -76,7 +76,7 @@ class PlotToolbar(Container, AbstractOverlay): ############################################################ def __init__(self, component=None, *args, **kw): - super(PlotToolbar, self).__init__(*args, **kw) + super().__init__(*args, **kw) self.component = component if component is not None and hasattr(component, "toolbar_location"): diff --git a/chaco/tools/toolbars/toolbar_buttons.py b/chaco/tools/toolbars/toolbar_buttons.py index 4a49d8dfe..ac07c2146 100644 --- a/chaco/tools/toolbars/toolbar_buttons.py +++ b/chaco/tools/toolbars/toolbar_buttons.py @@ -31,7 +31,7 @@ class ToolbarButton(Button): bounds = Property(List, observe="label, image") def __init__(self, *args, **kw): - super(ToolbarButton, self).__init__(*args, **kw) + super().__init__(*args, **kw) image_resource = ImageResource(self.image) self._image = Image(image_resource.absolute_path) diff --git a/chaco/ui/popupable_plot.py b/chaco/ui/popupable_plot.py index 4e08e6fe0..6c6e42425 100644 --- a/chaco/ui/popupable_plot.py +++ b/chaco/ui/popupable_plot.py @@ -32,4 +32,4 @@ def normal_left_dclick(self, event): def plot(self, data, **kw): """Queue up the plot commands""" self.command_queue.append((data, kw)) - super(PopupablePlot, self).plot(data, **kw) + super().plot(data, **kw)