Skip to content
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
3 changes: 1 addition & 2 deletions chaco/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,5 @@
'traitsui',
'pyface',
'numpy',
'enable',
'six'
'enable'
]
4 changes: 1 addition & 3 deletions chaco/array_plot_data.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
""" Defines ArrayPlotData.
"""
import six
import six.moves as sm
from numpy import array, ndarray

# Enthought library imports
Expand Down Expand Up @@ -63,7 +61,7 @@ def __init__(self, *data, **kw):
"""
super(AbstractPlotData, self).__init__()
self._update_data(kw)
data = dict(sm.zip(self._generate_names(len(data)), data))
data = dict(zip(self._generate_names(len(data)), data))
self._update_data(data)


Expand Down
3 changes: 0 additions & 3 deletions chaco/axis.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
""" Defines the PlotAxis class, and associated validator and UI.
"""

from __future__ import with_statement

# Major library import
from numpy import array, around, absolute, cos, dot, float64, inf, pi, \
sqrt, sin, transpose
Expand Down
9 changes: 1 addition & 8 deletions chaco/axis_view.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
""" Defines the Traits UI view for a PlotAxis """

import six

from traits.api import TraitError
from traitsui.api import View, HGroup, Group, VGroup, Item, TextEditor

Expand All @@ -14,7 +11,7 @@ def float_or_auto(val):
try:
return float(val)
except:
if isinstance(val, six.string_types) and val == "auto":
if isinstance(val, str) and val == "auto":
return val
raise TraitError("Tick interval must be a number or 'auto'.")

Expand All @@ -32,11 +29,8 @@ def float_or_auto(val):
label="Main"),
Group(
Item("tick_color", label="Color", style="custom"),
#editor=EnableRGBAColorEditor()),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'm happy when dead code is removed - but it'd be nice to mention this in the PR description.

Item("tick_weight", label="Thickness"),
#Item("tick_label_font", label="Font"),
Item("tick_label_color", label="Label color", style="custom"),
#editor=EnableRGBAColorEditor()),
HGroup(
Item("tick_in", label="Tick in"),
Item("tick_out", label="Tick out"),
Expand All @@ -45,7 +39,6 @@ def float_or_auto(val):
label="Ticks"),
Group(
Item("axis_line_color", label="Color", style="custom"),
#editor=EnableRGBAColorEditor()),
Item("axis_line_weight", label="Thickness"),
Item("axis_line_visible", label="Visible"),
label="Line"),
Expand Down
3 changes: 0 additions & 3 deletions chaco/barplot.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
""" Defines the BarPlot class.
"""

from __future__ import with_statement

import logging

from numpy import array, compress, column_stack, invert, isnan, transpose, zeros
Expand Down
3 changes: 0 additions & 3 deletions chaco/base_1d_plot.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
"""
Abstract base class for 1-D plots which only use one axis
"""

from __future__ import absolute_import

# Standard library imports
from numpy import argsort, asarray

Expand Down
3 changes: 0 additions & 3 deletions chaco/base_candle_plot.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@

from __future__ import with_statement

# Major library imports
from numpy import array, column_stack

Expand Down
4 changes: 1 addition & 3 deletions chaco/base_contour_plot.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import six

from numpy import array, isscalar, issubsctype, linspace, number

# Enthought library imports
Expand Down Expand Up @@ -101,7 +99,7 @@ def _update_colors(self, numcolors=None):
self._colors = [self._color_map_trait_] * numcolors

# If we are given a single color, apply it to all levels
elif isinstance(colors, six.string_types):
elif isinstance(colors, str):
self._color_map_trait = colors
self._colors = [self._color_map_trait_] * numcolors

Expand Down
4 changes: 0 additions & 4 deletions chaco/base_plot_frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@
#
#################################################################################

from __future__ import with_statement

import six
import six.moves as sm
# Enthought library imports
from enable.api import Container
from traits.api import Enum
Expand Down
3 changes: 0 additions & 3 deletions chaco/base_xy_plot.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
""" Defines the base class for XY plots.
"""

from __future__ import with_statement

from math import sqrt
from numpy import around, array, isnan, transpose

Expand Down
3 changes: 0 additions & 3 deletions chaco/candle_plot.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@

from __future__ import with_statement

# Major library imports
from numpy import array, compress, concatenate, searchsorted

Expand Down
2 changes: 0 additions & 2 deletions chaco/chaco_plot_editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
Traits UI editor for WX, based on the Chaco1 PlotEditor in
traits.ui.wx.plot_editor.
"""
import six
import six.moves as sm
# Enthought library imports
from traits.etsconfig.api import ETSConfig
from enable.api import black_color_trait, LineStyle, ColorTrait,\
Expand Down
3 changes: 0 additions & 3 deletions chaco/color_bar.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
""" Defines the ColorBar class.
"""

from __future__ import with_statement

# Major library imports
from numpy import array, arange, ascontiguousarray, ones, transpose, uint8

Expand Down
6 changes: 2 additions & 4 deletions chaco/color_mapper.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
""" Defines the ColorMapper and ColorMapTemplate classes.
"""
import six
import six.moves as sm

# Major library imports
from numpy import arange, array, asarray, clip, divide, float32, int8, isinf, \
Expand Down Expand Up @@ -135,7 +133,7 @@ def from_palette_array(cls, palette, **traits):
# From the offsets and the color data, generate a segment map.
segment_map = {}
red_values = palette[:,0]
segment_map['red'] = list(sm.zip(offsets, red_values, red_values))
segment_map['red'] = list(zip(offsets, red_values, red_values))
green_values = palette[:,1]
segment_map['green'] = list(zip(offsets, green_values, green_values))
blue_values = palette[:,2]
Expand Down Expand Up @@ -305,7 +303,7 @@ def _get_color_bands(self):
if self.color_depth is 'rgba':
luts.append(self._alpha_lut)

result = list(sm.zip(*luts))
result = list(zip(*luts))

return result

Expand Down
2 changes: 0 additions & 2 deletions chaco/colormapped_scatterplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@

from __future__ import with_statement

import six
import six.moves as sm
# Major library imports
from numpy import argsort, array, concatenate, nonzero, invert, take, \
isnan, transpose, newaxis, zeros, ndarray
Expand Down
4 changes: 2 additions & 2 deletions chaco/colormapped_selection_overlay.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
""" Defines the ColormappedSelectionOverlay class.
"""
import six.moves as sm
import functools

from numpy import logical_and

Expand Down Expand Up @@ -76,7 +76,7 @@ def overlay(self, component, gc, view_bounds=None, mode="normal"):
mask = (data_pts >= low) & (data_pts <= high)

elif self.selection_type == 'mask':
mask = sm.reduce(logical_and, datasource.metadata["selection_masks"])
mask = functools.reduce(logical_and, datasource.metadata["selection_masks"])
if sum(mask)<2:
return

Expand Down
2 changes: 0 additions & 2 deletions chaco/contour_line_plot.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
""" Defines the ContourLinePlot class.
"""

from __future__ import with_statement

# Major library imports
from numpy import array, isfinite, meshgrid, transpose

Expand Down
2 changes: 1 addition & 1 deletion chaco/contour_poly_plot.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
""" Defines the ContourPolyPlot class.
"""

from __future__ import with_statement


# Major library imports
from numpy import array, isfinite, meshgrid, transpose
Expand Down
3 changes: 0 additions & 3 deletions chaco/cross_plot_frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@
#
#################################################################################

from __future__ import with_statement

import six
import six.moves as sm

# Enthought library imports
from traits.api import Bool, Float
Expand Down
5 changes: 1 addition & 4 deletions chaco/data_range_1d.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
# Major library imports
from math import ceil, floor, log

import six
import six.moves as sm

from numpy import compress, inf, isinf, isnan, ndarray

# Enthought library imports
Expand Down Expand Up @@ -342,7 +339,7 @@ def _refresh_bounds(self):
self._high_value = self._high_setting
return
else:
mins, maxes = sm.zip(*bounds_list)
mins, maxes = zip(*bounds_list)

low_start, high_start = \
calc_bounds(self._low_setting, self._high_setting,
Expand Down
5 changes: 1 addition & 4 deletions chaco/errorbar_plot.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@

from __future__ import with_statement

import six
import six.moves as sm

# Major library imports
from numpy import column_stack, compress, invert, isnan, transpose
Expand Down Expand Up @@ -74,7 +71,7 @@ def _gather_points(self):
value_high, value_high_mask = self.value_high.get_data_mask()
value_mask = value_low_mask & value_high_mask

l1, l2, l3 = sm.map(len, (index, value_low, value_high))
l1, l2, l3 = map(len, (index, value_low, value_high))
if 0 in (l1, l2, l3) or not (l1 == l2 == l3):
logger.warning(
"Chaco: using empty dataset; index_len=%d, "
Expand Down
2 changes: 1 addition & 1 deletion chaco/example_support.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from __future__ import print_function


doc = \
"""
Expand Down
2 changes: 1 addition & 1 deletion chaco/filled_line_plot.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

from __future__ import with_statement


from numpy import empty
from traits.api import Property, Enum
Expand Down
4 changes: 1 addition & 3 deletions chaco/grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
function.
"""

from __future__ import with_statement

import six

from numpy import around, array, asarray, column_stack, float64, inf, zeros, zeros_like

Expand All @@ -30,7 +28,7 @@ def float_or_auto(val):
try:
return float(val)
except:
if isinstance(val, six.string_types) and val == "auto":
if isinstance(val, str) and val == "auto":
return val
raise TraitError("Tick interval must be a number or 'auto'.")

Expand Down
2 changes: 1 addition & 1 deletion chaco/horizon_plot.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from __future__ import with_statement


from numpy import array, float64, full_like, ndarray, transpose
from traits.api import Instance, DelegatesTo, Bool, Int
Expand Down
7 changes: 2 additions & 5 deletions chaco/image_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,12 @@
""" Defines the ImagePlot class.
"""

from __future__ import with_statement


# Standard library imports
from math import ceil, floor, pi
from contextlib import contextmanager

import six
import six.moves as sm

import numpy as np

# Enthought library imports.
Expand Down Expand Up @@ -329,7 +326,7 @@ def _calc_zoom_coords(self, image_rect):
col_max = array_width - col_max
col_min, col_max = col_max, col_min

index_bounds = list(sm.map(int, [col_min, col_max, row_min, row_max]))
index_bounds = list(map(int, [col_min, col_max, row_min, row_max]))
screen_rect = [x_min, y_min, x_max - x_min, y_max - y_min]
return index_bounds, screen_rect

Expand Down
8 changes: 2 additions & 6 deletions chaco/jitterplot.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
from __future__ import absolute_import

from math import sqrt

import six.moves as sm

import numpy as np

from traits.api import Any, Int
Expand Down Expand Up @@ -123,9 +119,9 @@ def get_screen_points(self):
self._gather_points()
pts = self.map_screen(self._cached_data)
if self.orientation == "h":
self._cached_screen_map = dict((x,y) for x,y in sm.zip(pts[:,0], pts[:,1]))
self._cached_screen_map = dict((x,y) for x,y in zip(pts[:,0], pts[:,1]))
else:
self._cached_screen_map = dict((y,x) for x,y in sm.zip(pts[:,0], pts[:,1]))
self._cached_screen_map = dict((y,x) for x,y in zip(pts[:,0], pts[:,1]))
self._cached_screen_pts = pts
self._screen_cache_valid = True
self._cached_data_pts_sorted = None
Expand Down
2 changes: 1 addition & 1 deletion chaco/label.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
""" Defines the Label class.
"""

from __future__ import with_statement


# Major library imports
from math import cos, sin, pi
Expand Down
2 changes: 1 addition & 1 deletion chaco/lasso_overlay.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
""" Defines the LassoOverlay class.
"""

from __future__ import with_statement


from numpy import concatenate, newaxis

Expand Down
2 changes: 1 addition & 1 deletion chaco/layers/status_layer.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

from __future__ import with_statement


import os.path
import xml.etree.cElementTree as etree
Expand Down
2 changes: 1 addition & 1 deletion chaco/layers/svg_range_selection_overlay.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

from __future__ import with_statement


import os
import numpy
Expand Down
Loading