[yt-svn] commit/yt: chummels: Merged in ngoldbaum/yt (pull request #1704)

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Thu Aug 20 09:39:07 PDT 2015


1 new commit in yt:

https://bitbucket.org/yt_analysis/yt/commits/deeb92e93357/
Changeset:   deeb92e93357
Branch:      yt
User:        chummels
Date:        2015-08-20 16:38:55+00:00
Summary:     Merged in ngoldbaum/yt (pull request #1704)

Linting yt.visualization, removing some unused code
Affected #:  27 files

diff -r 5f98bb340f15ac0d73ba37156dba9ed24d0691d6 -r deeb92e93357a433dd56e83a339a2192ca42e9e1 doc/source/reference/api/api.rst
--- a/doc/source/reference/api/api.rst
+++ b/doc/source/reference/api/api.rst
@@ -610,10 +610,8 @@
 .. autosummary::
    :toctree: generated/
 
-   ~yt.visualization.volume_rendering.camera.MosaicFisheyeCamera
    ~yt.visualization.volume_rendering.camera.FisheyeCamera
    ~yt.visualization.volume_rendering.camera.MosaicCamera
-   ~yt.visualization.volume_rendering.camera.plot_allsky_healpix
    ~yt.visualization.volume_rendering.camera.PerspectiveCamera
    ~yt.utilities.amr_kdtree.amr_kdtree.AMRKDTree
    ~yt.visualization.volume_rendering.camera.StereoPairCamera

diff -r 5f98bb340f15ac0d73ba37156dba9ed24d0691d6 -r deeb92e93357a433dd56e83a339a2192ca42e9e1 yt/visualization/api.py
--- a/yt/visualization/api.py
+++ b/yt/visualization/api.py
@@ -43,9 +43,6 @@
     PlotCallback, \
     callback_registry
 
-from .easy_plots import \
-    plot_type_registry
-
 from .streamlines import \
     Streamlines
 

diff -r 5f98bb340f15ac0d73ba37156dba9ed24d0691d6 -r deeb92e93357a433dd56e83a339a2192ca42e9e1 yt/visualization/color_maps.py
--- a/yt/visualization/color_maps.py
+++ b/yt/visualization/color_maps.py
@@ -22,7 +22,7 @@
 
 def check_color(name):
     try:
-        ss = cc.colorConverter.to_rgb(name)
+        cc.colorConverter.to_rgb(name)
         return True
     except ValueError:
         return False

diff -r 5f98bb340f15ac0d73ba37156dba9ed24d0691d6 -r deeb92e93357a433dd56e83a339a2192ca42e9e1 yt/visualization/easy_plots.py
--- a/yt/visualization/easy_plots.py
+++ /dev/null
@@ -1,61 +0,0 @@
-"""
-Easy plotting.
-
-
-
-"""
-
-#-----------------------------------------------------------------------------
-# Copyright (c) 2013, yt Development Team.
-#
-# Distributed under the terms of the Modified BSD License.
-#
-# The full license is in the file COPYING.txt, distributed with this software.
-#-----------------------------------------------------------------------------
-
-from ._mpl_imports import *
-from yt.data_objects.profiles import BinnedProfile1D
-
-plot_type_registry = {}
-
-class EasyPlot(object):
-    class __metaclass__(type):
-        def __init__(cls, name, b, d):
-            type.__init__(cls, name, b, d)
-            if hasattr(cls, "_type_name"):
-                plot_type_registry[cls._type_name] = cls
-
-    def __init__(self):
-        pass
-
-    def save(self, fn):
-        canvas = FigureCanvasAgg(self.figure)
-        canvas.print_figure(fn)
-
-class EasyPDFPlot(EasyPlot):
-    _type_name = "PDF"
-
-    def __init__(self, data_source, x_field, x_log = True,
-                 n_bins = 128, y_log = True,
-                 plot_args = None,
-                 figure_args = None):
-        if plot_args is None: plot_args = {}
-        if figure_args is None: figure_args = {}
-        self.x_field = x_field
-        self.data_source = data_source
-        # Now we just make the plot
-        x_min, x_max = self.data_source.quantities["Extrema"](
-                x_field, non_zero = x_log)[0]
-        self.profile = BinnedProfile1D(self.data_source,
-            n_bins, self.x_field, x_min, x_max, x_log)
-        self.profile.add_fields(["CellMassMsun"], weight=None)
-        self.profile["CellMassMsun"] /= self.profile["CellMassMsun"].sum()
-        self.figure = matplotlib.figure.Figure(**figure_args)
-        self.axes = self.figure.add_subplot(1,1,1)
-        if y_log and x_log: f = self.axes.loglog
-        elif y_log: f = self.axes.semilogy
-        elif x_log: f = self.axes.semilogx
-        else: f = self.axes.plot
-        self.plot = f(self.profile[x_field], self.profile["CellMassMsun"],
-                      **plot_args)
-        self.axes.set_xlabel(data_source.ds.field_info[x_field].get_label())

diff -r 5f98bb340f15ac0d73ba37156dba9ed24d0691d6 -r deeb92e93357a433dd56e83a339a2192ca42e9e1 yt/visualization/eps_writer.py
--- a/yt/visualization/eps_writer.py
+++ b/yt/visualization/eps_writer.py
@@ -22,7 +22,7 @@
 from yt.utilities.logger import ytLogger as mylog
 from .plot_window import PlotWindow
 from .profile_plotter import PhasePlot, ProfilePlot
-from yt.units.yt_array import YTArray, YTQuantity
+from yt.units.yt_array import YTQuantity
 from yt.units.unit_object import Unit
 
 def convert_frac_to_tex(string):
@@ -271,7 +271,7 @@
                           (width=psize[0], height=psize[1],
                            x=xaxis, y=yaxis, x2=xaxis2, y2=yaxis2,
                            xpos=pos[0], ypos=pos[1])
-            if xdata == None:
+            if xdata is None:
                 self.canvas.plot(blank_data)
             else:
                 data = pyx.graph.data.points(np.array([xdata, ydata]).T, x=1, y=2)
@@ -281,7 +281,7 @@
                    (width=psize[0], height=psize[1],
                     x=xaxis, y=yaxis, x2=xaxis2, y2=yaxis2,
                     xpos=pos[0], ypos=pos[1])
-            if xdata == None:
+            if xdata is None:
                 plot.plot(blank_data)
             else:
                 data = pyx.graph.data.points(np.array([xdata, ydata]).T, x=1, y=2)
@@ -322,7 +322,7 @@
         if isinstance(plot, PlotWindow):
             data = plot.frb
             width = plot.width[0]
-            if units == None:
+            if units is None:
                 units = plot.ds.get_smallest_appropriate_unit(width)
             width = width.in_units(str(units))
             xc = 0.5*(plot.xlim[0] + plot.xlim[1])
@@ -335,7 +335,7 @@
                 _xlabel = ""
                 _ylabel = ""
             else:
-                if xlabel != None:
+                if xlabel is not None:
                     _xlabel = xlabel
                 else:
                     if data.axis != 4:
@@ -344,7 +344,7 @@
                         _xlabel = '%s (%s)' % (x_name, units)
                     else:
                         _xlabel = 'x (%s)' % (units)
-                if ylabel != None:
+                if ylabel is not None:
                     _ylabel = ylabel
                 else:
                     if data.axis != 4:
@@ -353,7 +353,7 @@
                         _ylabel = '%s (%s)' % (y_name, units)
                     else:
                         _ylabel = 'y (%s)' % (units)
-            if tickcolor == None:
+            if tickcolor is None:
                 _tickcolor = pyx.color.cmyk.white
         elif isinstance(plot, ProfilePlot):
             subplot = plot.axes.values()[0]
@@ -390,17 +390,17 @@
                 _xlabel = ""
                 _ylabel = ""
             else:
-                if xlabel != None:
+                if xlabel is not None:
                     _xlabel = xlabel
                 else:
                     _xlabel = plot[k].axes.get_xlabel()
-                if ylabel != None:
+                if ylabel is not None:
                     _ylabel = ylabel
                 else:
                     _ylabel = plot[k].axes.get_ylabel()
                 _xlabel = pyxize_label(_xlabel)
                 _ylabel = pyxize_label(_ylabel)
-            if tickcolor == None:
+            if tickcolor is None:
                 _tickcolor = None
         elif isinstance(plot, np.ndarray):
             ax = plt.gca()
@@ -412,15 +412,15 @@
                 _xlabel = ""
                 _ylabel = ""
             else:
-                if xlabel != None:
+                if xlabel is not None:
                     _xlabel = xlabel
                 else:
                     _xlabel = ax.get_xlabel()
-                if ylabel != None:
+                if ylabel is not None:
                     _ylabel = ylabel
                 else:
                     _ylabel = ax.get_ylabel()
-            if tickcolor == None:
+            if tickcolor is None:
                 _tickcolor = None
         else:
             _xrange = plot._axes.get_xlim()
@@ -431,17 +431,17 @@
                 _xlabel = ""
                 _ylabel = ""
             else:
-                if xlabel != None:
+                if xlabel is not None:
                     _xlabel = xlabel
                 else:
                     _xlabel = plot._x_label
-                if ylabel != None:
+                if ylabel is not None:
                     _ylabel = ylabel
                 else:
                     _ylabel = plot._y_label
-            if tickcolor == None:
+            if tickcolor is None:
                 _tickcolor = None
-        if tickcolor != None:
+        if tickcolor is not None:
             _tickcolor = tickcolor
         self.axis_box(xrange=_xrange, yrange=_yrange, xlabel=_xlabel,
                       ylabel=_ylabel, tickcolor=_tickcolor, xlog=_xlog,
@@ -468,7 +468,7 @@
         >>> d.insert_image("image.jpg")
         >>> d.save_fig()
         """
-        if size != None:
+        if size is not None:
             width = size[0]*self.figsize[0]
             height = size[1]*self.figsize[1]
         else:
@@ -514,7 +514,7 @@
         if self.canvas is None:
             self.canvas = pyx.canvas.canvas()
         if isinstance(plot, (PlotWindow, PhasePlot)):
-            if field == None:
+            if field is None:
                 self.field = plot.plots.keys()[0]
                 mylog.warning("No field specified.  Choosing first field (%s)" % \
                               str(self.field))
@@ -529,11 +529,11 @@
         elif isinstance(plot, ProfilePlot):
             _p1 = plot.figures.items()[0][1]
         elif isinstance(plot, np.ndarray):
-            fig = plt.figure()
+            plt.figure()
             iplot = plt.figimage(plot)
-            _p1 =  iplot.figure
+            _p1 = iplot.figure
             _p1.set_size_inches(self.figsize[0], self.figsize[1])
-            ax = plt.gca();
+            ax = plt.gca()
             _p1.add_axes(ax)
         else:
             raise RuntimeError("Unknown plot type")
@@ -646,14 +646,13 @@
                                                  width=size[0], height=size[1]))
 
         if tickcolor is None:
-            c1 = pyx.graph.axis.painter.regular\
-                 (tickattrs=[pyx.color.cmyk.black])
-            c2 = pyx.graph.axis.painter.regular\
-                 (tickattrs=[pyx.color.cmyk.black], labelattrs=None)
+            c1 = pyx.graph.axis.painter.regular(tickattrs=[pyx.color.cmyk.black])
+            pyx.graph.axis.painter.regular(tickattrs=[pyx.color.cmyk.black],
+                                           labelattrs=None)
         else:
             c1 = pyx.graph.axis.painter.regular(tickattrs=[tickcolor])
-            c2 = pyx.graph.axis.painter.regular(tickattrs=[tickcolor],
-                                                labelattrs=None)
+            pyx.graph.axis.painter.regular(tickattrs=[tickcolor],
+                                           labelattrs=None)
         if log:
             yaxis = pyx.graph.axis.log(min=zrange[0],max=zrange[1],
                                        title=label, painter=c1)
@@ -715,18 +714,16 @@
         if isinstance(plot, ProfilePlot):
             raise RuntimeError("When using ProfilePlots you must either set yt_nocbar=True or provide colorbar flags so that the profiles don't have colorbars")
         _cmap = None
-        if field != None:
+        if field is not None:
             self.field = plot.data_source._determine_fields(field)[0]
         if isinstance(plot, (PlotWindow, PhasePlot)):
             _cmap = plot._colormaps[self.field]
         else:
-            if plot.cmap != None:
+            if plot.cmap is not None:
                 _cmap = plot.cmap.name
-        if _cmap == None:
+        if _cmap is None:
             _cmap = 'algae'
         if isinstance(plot, (PlotWindow, PhasePlot)):
-            proj = plot._plot_type.endswith("Projection") and \
-                plot.data_source.weight_field == None
             if isinstance(plot, PlotWindow):
                 try:
                     _zlabel = plot.frb[self.field].info["label"]
@@ -743,11 +740,11 @@
                 _zlabel = pyxize_label(plot.z_title)
             _zlabel = _zlabel.replace("_","\;")
             _zlog = plot.get_log(self.field)[self.field]
-            if plot.plots[self.field].zmin == None:
+            if plot.plots[self.field].zmin is None:
                 zmin = plot.plots[self.field].image._A.min()
             else:
                 zmin = plot.plots[self.field].zmin
-            if plot.plots[self.field].zmax == None:
+            if plot.plots[self.field].zmax is None:
                 zmax = plot.plots[self.field].image._A.max()
             else:
                 zmax = plot.plots[self.field].zmax
@@ -756,7 +753,7 @@
             _zlabel = plot._z_label.replace("_","\;")
             _zlog = plot._log_z
             _zrange = (plot.norm.vmin, plot.norm.vmax)
-        if cb_labels != None:  #Overrides deduced labels
+        if cb_labels is not None:  #Overrides deduced labels
             _zlabel = cb_labels.pop()
         self.colorbar(_cmap, zrange=_zrange, label=_zlabel, log=_zlog, **kwargs)
 
@@ -940,7 +937,7 @@
         tbox = self.canvas.text(self.figsize[0]*loc[0],
                                 self.figsize[1]*loc[1],
                                 text, [color, valign, halign] + text_opts)
-        if bgcolor != None:
+        if bgcolor is not None:
             tpath = tbox.bbox().enlarged(2*pyx.unit.x_pt).path()
             self.canvas.draw(tpath, [pyx.deco.filled([bgcolor]),
                                      pyx.deco.stroked()])
@@ -1060,10 +1057,10 @@
     """
     # Error check
     npanels = ncol*nrow
-    if(cb_labels != None):
+    if(cb_labels is not None):
         cb_labels.reverse()   #Because I pop the list
     
-    if images != None:
+    if images is not None:
         if len(images) != npanels:
             raise RuntimeError("Number of images (%d) doesn't match nrow(%d)"\
                                " x ncol(%d)." % (len(images), nrow, ncol))
@@ -1071,13 +1068,13 @@
     if yt_plots is None and images is None:
         raise RuntimeError("Must supply either yt_plots or image filenames.")
         return
-    if yt_plots != None and images != None:
+    if yt_plots is not None and images is not None:
         mylog.warning("Given both images and yt plots.  Ignoring images.")
-    if yt_plots != None:
+    if yt_plots is not None:
         _yt = True
     else:
         _yt = False
-    if fields == None:
+    if fields is None:
         fields = [None] * npanels
 
     # If no ranges or labels given and given only images, fill them in.
@@ -1118,27 +1115,27 @@
                 yaxis = 1
             else:
                 yaxis = -1
-            if xdata == None:
+            if xdata is None:
                 _xdata = None
             else:
                 _xdata = xdata[index]
-            if ydata == None:
+            if ydata is None:
                 _ydata = None
             else:
                 _ydata = ydata[index]
-            if xaxis_flags != None:
-                if xaxis_flags[index] != None:
+            if xaxis_flags is not None:
+                if xaxis_flags[index] is not None:
                     xaxis = xaxis_flags[index]
-            if yaxis_flags != None:
-                if yaxis_flags[index] != None:
+            if yaxis_flags is not None:
+                if yaxis_flags[index] is not None:
                     yaxis = yaxis_flags[index]
             if _yt:
                 this_plot._setup_plots()
-                if xlabels != None:
+                if xlabels is not None:
                     xlabel = xlabels[i]
                 else:
                     xlabel = None
-                if ylabels != None:
+                if ylabels is not None:
                     ylabel = ylabels[j]
                 else:
                     ylabel = None
@@ -1156,8 +1153,8 @@
                            xlabel=xlabels[i], ylabel=ylabels[j],
                            bare_axes=bare_axes, xaxis_side=xaxis, yaxis_side=yaxis,
                            xdata=_xdata, ydata=_ydata)
-            if titles != None:
-                if titles[index] != None:
+            if titles is not None:
+                if titles[index] is not None:
                     d.title_box(titles[index],
                                 loc=(i+0.05+i*margins[0]/figsize[0],
                                      j+0.98+j*margins[1]/figsize[1]))
@@ -1174,11 +1171,11 @@
         for i in range(ncol):
             xpos0 = i*(figsize[0] + margins[0])
             index = j*ncol + i
-            if (not _yt and colorbars != None) or (_yt and not yt_nocbar):
-                if cb_flags != None:
-                    if cb_flags[index] == False:
+            if (not _yt and colorbars is not None) or (_yt and not yt_nocbar):
+                if cb_flags is not None:
+                    if not cb_flags[index]:
                         continue
-                if cb_location == None:
+                if cb_location is None:
                     if ncol == 1:
                         orientation = "right"
                     elif i == 0:
@@ -1219,10 +1216,10 @@
                                   "No colorbar displayed." % orientation)
                     orientation = None  # Marker for interior plot
 
-                if orientation != None:
+                if orientation is not None:
                     if _yt:
                         # Set field if undefined
-                        if fields[index] == None:
+                        if fields[index] is None:
                             fields[index] = d.return_field(yt_plots[index])
                                               
                         d.colorbar_yt(yt_plots[index],
@@ -1240,7 +1237,7 @@
                                    pos=[xpos,ypos],
                                    shrink=shrink_cb)
 
-    if savefig != None:
+    if savefig is not None:
         d.save_fig(savefig, format=format)
 
     return d
@@ -1281,7 +1278,7 @@
     # Determine whether the plots are organized in a PlotWindow, or list 
     # of PlotWindows
     if isinstance(plots, (PlotWindow, PhasePlot)):
-        if fields == None:
+        if fields is None:
             fields = plots.fields
         if len(fields) < nrow*ncol:
             raise RuntimeError("Number of plots is less "\
@@ -1338,7 +1335,7 @@
     d.axis_box_yt(plot, bare_axes=bare_axes, **kwargs)
     if colorbar:
         d.colorbar_yt(plot, orientation=cb_orient)
-    if savefig != None:
+    if savefig is not None:
         d.save_fig(savefig, format=file_format)
     return d
 

diff -r 5f98bb340f15ac0d73ba37156dba9ed24d0691d6 -r deeb92e93357a433dd56e83a339a2192ca42e9e1 yt/visualization/fixed_resolution.py
--- a/yt/visualization/fixed_resolution.py
+++ b/yt/visualization/fixed_resolution.py
@@ -13,7 +13,7 @@
 # The full license is in the file COPYING.txt, distributed with this software.
 #-----------------------------------------------------------------------------
 
-from yt.funcs import *
+from yt.funcs import mylog
 from yt.units.unit_object import Unit
 from .volume_rendering.api import off_axis_projection
 from .fixed_resolution_filters import apply_filter, filter_registry
@@ -27,6 +27,7 @@
 import numpy as np
 import weakref
 import re
+import types
 
 class FixedResolutionBuffer(object):
     r"""
@@ -160,7 +161,7 @@
     def _is_ion( self, fname ):
         p = re.compile("_p[0-9]+_")
         result = False
-        if p.search( fname ) != None:
+        if p.search( fname ) is not None:
             result = True
         return result
 
@@ -173,7 +174,7 @@
 
         p = re.compile("_p[0-9]+_")
         m = p.search( fname )
-        if m != None:
+        if m is not None:
             pstr = m.string[m.start()+1:m.end()-1]
             segments = fname.split("_")
             for i,s in enumerate(segments):

diff -r 5f98bb340f15ac0d73ba37156dba9ed24d0691d6 -r deeb92e93357a433dd56e83a339a2192ca42e9e1 yt/visualization/image_panner/pan_and_scan_widget.py
--- a/yt/visualization/image_panner/pan_and_scan_widget.py
+++ /dev/null
@@ -1,324 +0,0 @@
-"""
-
-
-"""
-from __future__ import print_function
-from __future__ import absolute_import
-
-#-----------------------------------------------------------------------------
-# Copyright (c) 2013, yt Development Team.
-#
-# Distributed under the terms of the Modified BSD License.
-#
-# The full license is in the file COPYING.txt, distributed with this software.
-#-----------------------------------------------------------------------------
-
-# Major library imports
-from .vm_panner import VariableMeshPanner
-from numpy import linspace, meshgrid, pi, sin, mgrid, zeros
-
-# Enthought library imports
-from enthought.enable.api import Component, ComponentEditor, Window
-from enthought.traits.api import HasTraits, Instance, Button, Any, Callable, \
-        on_trait_change, Bool, DelegatesTo, List, Enum, Int, Property, Str, \
-        cached_property
-from enthought.traits.ui.api import \
-        Group, View, Item, VGroup, InstanceEditor
-
-# Chaco imports
-from enthought.chaco.api import ArrayPlotData, jet, Plot, HPlotContainer, \
-        ColorBar, DataRange1D, DataRange2D, LinearMapper, ImageData, \
-        CMapImagePlot, OverlayPlotContainer
-from enthought.chaco.tools.api import PanTool, ZoomTool, RangeSelection, \
-        RangeSelectionOverlay, RangeSelection
-from enthought.chaco.tools.image_inspector_tool import ImageInspectorTool, \
-     ImageInspectorOverlay
-
-if not hasattr(DataRange2D, "_subranges_updated"):
-    print ("You'll need to add _subranges updated to enthought/chaco/data_range_2d.py")
-    print ('Add this at the correct indentation level:')
-    print ()
-    print ('    @on_trait_change("_xrange.updated,_yrange.updated")')
-    print ('    def _subranges_updated(self):')
-    print ('        self.updated = True')
-    print ()
-    raise RuntimeError
-
-# We like the algae colormap; for now we re-implement it here.
-
-from enthought.chaco.api import \
-    ColorMapper, \
-    color_map_functions, color_map_dict, color_map_name_dict
-
-def algae(range, **traits):
-    _data = {'red':   ((0.0, 80/256., 80/256.),
-                       (0.2, 0.0, 0.0),
-                       (0.4, 0.0, 0.0),
-                       (0.6, 256/256., 256/256.),
-                       (0.95, 256/256., 256/256.),
-                       (1.0, 150/256., 150/256.)),
-             'green': ((0.0, 0/256., 0/256.),
-                       (0.2, 0/256., 0/256.),
-                       (0.4, 130/256., 130/256.),
-                       (0.6, 256/256., 256/256.),
-                       (1.0, 0.0, 0.0)),
-             'blue':  ((0.0, 80/256., 80/256.),
-                       (0.2, 220/256., 220/256.),
-                       (0.4, 0.0, 0.0),
-                       (0.6, 20/256., 20/256.),
-                       (1.0, 0.0, 0.0))}
-    return ColorMapper.from_segment_map(_data, range=range, **traits)
-color_map_functions.append(algae)
-color_map_dict[algae] = "algae"
-color_map_name_dict["algae"] = algae
-
-class FunctionImageData(ImageData):
-    # The function to call with the low and high values of the range.
-    # It should return an array of values.
-    func = Callable
-
-    # A reference to a datarange
-    data_range = Instance(DataRange2D)
-
-    def __init__(self, **kw):
-        # Explicitly call the AbstractDataSource constructor because
-        # the ArrayDataSource ctor wants a data array
-        ImageData.__init__(self, **kw)
-        self.recalculate()
-
-    @on_trait_change('data_range.updated')
-    def recalculate(self):
-        if self.func is not None and self.data_range is not None:
-            newarray = self.func(self.data_range.low, self.data_range.high)
-            ImageData.set_data(self, newarray)
-        else:
-            self._data = zeros((512,512),dtype=float)
-
-    def set_data(self, *args, **kw):
-        raise RuntimeError("Cannot set numerical data on a FunctionDataSource")
-
-    def set_mask(self, mask):
-        raise NotImplementedError
-
-    def remove_mask(self):
-        raise NotImplementedError
-
-class ImagePixelizerHelper(object):
-    index = None
-    def __init__(self, panner, run_callbacks = False):
-        self.panner = panner
-        self.run_callbacks = run_callbacks
-
-    def __call__(self, low, high):
-        b = self.panner.set_low_high(low, high)
-        if self.run_callbacks:
-            self.panner._run_callbacks()
-        if self.index is not None:
-            num_x_ticks = b.shape[0] + 1
-            num_y_ticks = b.shape[1] + 1
-            xs = mgrid[low[0]:high[0]:num_x_ticks*1j]
-            ys = mgrid[low[1]:high[1]:num_y_ticks*1j]
-            self.index.set_data( xs, ys )
-        return b
-
-class ZoomedPlotUpdater(object):
-    fid = None
-    def __init__(self, panner, zoom_factor=4):
-        """
-        Supply this an a viewport_callback argument to a panner if you want to
-        update a second panner in a smaller portion at higher resolution.  If
-        you then set the *fid* property, you can also have it update a
-        FunctionImageData datarange.  *panner* is the panner to update (not the
-        one this is a callback to) and *zoom_factor* is how much to zoom in by.
-        """
-        self.panner = panner
-        self.zoom_factor = zoom_factor
-
-    def __call__(self, xlim, ylim):
-        self.panner.xlim = xlim
-        self.panner.ylim = ylim
-        self.panner.zoom(self.zoom_factor)
-        nxlim = self.panner.xlim
-        nylim = self.panner.ylim
-        if self.fid is not None:
-            self.fid.data_range.set_bounds(
-                (nxlim[0], nylim[0]), (nxlim[1], nylim[1]))
-
-class VMImagePlot(HasTraits):
-    plot = Instance(Plot)
-    fid = Instance(FunctionImageData)
-    img_plot = Instance(CMapImagePlot)
-    panner = Instance(VariableMeshPanner)
-    helper = Instance(ImagePixelizerHelper)
-    fields = List
-
-    def __init__(self, *args, **kwargs):
-        super(VMImagePlot, self).__init__(**kwargs)
-        self.add_trait("field", Enum(*self.fields))
-        self.field = self.panner.field
-
-    def _plot_default(self):
-        pd = ArrayPlotData()
-        plot = Plot(pd, padding = 0)
-        self.fid._data = self.panner.buffer
-
-        pd.set_data("imagedata", self.fid)
-
-        img_plot = plot.img_plot("imagedata", colormap=algae,
-                                 interpolation='nearest',
-                                 xbounds=(0.0, 1.0),
-                                 ybounds=(0.0, 1.0))[0]
-        self.fid.data_range = plot.range2d
-        self.helper.index = img_plot.index
-        self.img_plot = img_plot
-        return plot
-
-    def _field_changed(self, old, new):
-        self.panner.field = new
-        self.fid.recalculate()
-
-    def _fid_default(self):
-        return FunctionImageData(func = self.helper)
-
-    def _helper_default(self):
-        return ImagePixelizerHelper(self.panner)
-
-    def _panner_changed(self, old, new):
-        index = self.helper.index
-        self.helper = ImagePixelizerHelper(new)
-        self.helper.index = index
-        self.fid.func = self.helper
-        self.fid.recalculate()
-
-    def _fields_default(self):
-        keys = []
-        for field in self.panner.source.keys():
-            if field not in ['px','py','pdx','pdy',
-                             'pz','pdz','weight_field']:
-                keys.append(field)
-        return keys
-
-class VariableMeshPannerView(HasTraits):
-
-    plot = Instance(Plot)
-    spawn_zoom = Button
-    vm_plot = Instance(VMImagePlot)
-    use_tools = Bool(True)
-    full_container = Instance(HPlotContainer)
-    container = Instance(OverlayPlotContainer)
-    
-    traits_view = View(
-                    Group(
-                        Item('full_container',
-                             editor=ComponentEditor(size=(512,512)), 
-                             show_label=False),
-                        Item('field', show_label=False),
-                        orientation = "vertical"),
-                    width = 800, height=800,
-                    resizable=True, title="Pan and Scan",
-                    )
-
-    def _vm_plot_default(self):
-        return VMImagePlot(panner=self.panner)
-    
-    def __init__(self, **kwargs):
-        super(VariableMeshPannerView, self).__init__(**kwargs)
-        # Create the plot
-        self.add_trait("field", DelegatesTo("vm_plot"))
-
-        plot = self.vm_plot.plot
-        img_plot = self.vm_plot.img_plot
-
-        if self.use_tools:
-            plot.tools.append(PanTool(img_plot))
-            zoom = ZoomTool(component=img_plot, tool_mode="box", always_on=False)
-            plot.overlays.append(zoom)
-            imgtool = ImageInspectorTool(img_plot)
-            img_plot.tools.append(imgtool)
-            overlay = ImageInspectorOverlay(component=img_plot, image_inspector=imgtool,
-                                            bgcolor="white", border_visible=True)
-            img_plot.overlays.append(overlay)
-
-
-        image_value_range = DataRange1D(self.vm_plot.fid)
-        cbar_index_mapper = LinearMapper(range=image_value_range)
-        self.colorbar = ColorBar(index_mapper=cbar_index_mapper,
-                                 plot=img_plot,
-                                 padding_right=40,
-                                 resizable='v',
-                                 width=30)
-
-        self.colorbar.tools.append(
-            PanTool(self.colorbar, constrain_direction="y", constrain=True))
-        zoom_overlay = ZoomTool(self.colorbar, axis="index", tool_mode="range",
-                                always_on=True, drag_button="right")
-        self.colorbar.overlays.append(zoom_overlay)
-
-        # create a range selection for the colorbar
-        range_selection = RangeSelection(component=self.colorbar)
-        self.colorbar.tools.append(range_selection)
-        self.colorbar.overlays.append(
-                RangeSelectionOverlay(component=self.colorbar,
-                                      border_color="white",
-                                      alpha=0.8, fill_color="lightgray"))
-
-        # we also want to the range selection to inform the cmap plot of
-        # the selection, so set that up as well
-        range_selection.listeners.append(img_plot)
-
-        self.full_container = HPlotContainer(padding=30)
-        self.container = OverlayPlotContainer(padding=0)
-        self.full_container.add(self.colorbar)
-        self.full_container.add(self.container)
-        self.container.add(self.vm_plot.plot)
-
-class OutputSelector(HasTraits):
-    outputs = List
-    main_plot = Instance(VariableMeshPannerView)
-    main_panner = Property(depends_on = "ds")
-    weight_field = Str("Density")
-
-    ds = Any
-    source = Any
-    axis = Int(0)
-
-    traits_view = View(VGroup(
-                        Item('output'),
-                        Item('main_plot'),
-                        )
-                      )
-
-    def __init__(self, **kwargs):
-        super(OutputSelector, self).__init__(**kwargs)
-        self.add_trait("output", Enum(*self.outputs))
-        self.output = self.outputs[-1]
-        self.main_plot
-
-    def _output_default(self):
-        return self.outputs[0]
-
-    def _output_changed(self, old, new):
-        # We get a string here
-        import yt.mods
-        self.ds = yt.mods.load(new, dataset_type="enzo_packed_3d")
-        self.source = yt.mods.projload(self.ds, self.axis, "Density")
-        self.main_panner.field = self.main_plot.vm_plot.field
-        self.main_plot.panner = self.main_plot.vm_plot.panner = \
-            self.main_plot.vm_plot.helper.panner = self.main_panner
-        self.main_plot.vm_plot.field = self.main_panner.field
-
-    def _main_plot_default(self):
-        vmpv = VariableMeshPannerView(panner = self.main_panner)
-        vmpv.vm_plot.helper.run_callbacks = True
-        return vmpv
-
-    @cached_property
-    def _get_main_panner(self):
-        return self.ds.image_panner(self.source, (512, 512), "Density")
-
-def pan_and_scan_directory(dir_name):
-    import glob, os
-    fns = [ fn[:-10] for fn in
-            glob.glob(os.path.join(dir_name, "**", "*.index")) ]
-    selector = OutputSelector(outputs = fns)
-    return selector

diff -r 5f98bb340f15ac0d73ba37156dba9ed24d0691d6 -r deeb92e93357a433dd56e83a339a2192ca42e9e1 yt/visualization/image_panner/setup.py
--- a/yt/visualization/image_panner/setup.py
+++ b/yt/visualization/image_panner/setup.py
@@ -1,8 +1,4 @@
 #!/usr/bin/env python
-import setuptools
-import os
-import sys
-import os.path
 
 
 def configuration(parent_package='', top_path=None):

diff -r 5f98bb340f15ac0d73ba37156dba9ed24d0691d6 -r deeb92e93357a433dd56e83a339a2192ca42e9e1 yt/visualization/image_panner/vm_panner.py
--- a/yt/visualization/image_panner/vm_panner.py
+++ b/yt/visualization/image_panner/vm_panner.py
@@ -11,15 +11,14 @@
 # The full license is in the file COPYING.txt, distributed with this software.
 #-----------------------------------------------------------------------------
 
+import base64
+
 import numpy as np
-import types, os
-from yt.data_objects.construction_data_containers import YTOverlapProjBase
-from yt.data_objects.selection_data_containers import YTSliceBase
 from yt.visualization.fixed_resolution import \
-    FixedResolutionBuffer, ObliqueFixedResolutionBuffer
+    FixedResolutionBuffer
 from yt.data_objects.data_containers import \
     data_object_registry
-from yt.funcs import *
+from yt.funcs import iterable
 
 class VariableMeshPanner(object):
     _buffer = None
@@ -235,7 +234,7 @@
         for w in self.windows: w.zoom(factor)
 
     def pan(self, deltas):
-        for w in self.windows: w.pan(factor)
+        for w in self.windows: w.pan(deltas)
 
     def pan_x(self, delta):
         for w in self.windows: w.pan_x(delta)
@@ -264,7 +263,9 @@
         """
         self.tile_id = tile_id
 
-        import matplotlib;matplotlib.use("Agg");import pylab
+        import matplotlib
+        matplotlib.use("Agg")
+        import pylab
         self.pylab = pylab
         self.pylab.clf()
         fig = pylab.gcf()
@@ -299,6 +300,4 @@
         to_plot = np.clip(to_plot, 0, 255)
         s = write_png_to_string(to_plot)
         response_body = "data:image/png;base64," + base64.encodestring(s)
-        tf.close()
         self.transport.append(response_body)
-

diff -r 5f98bb340f15ac0d73ba37156dba9ed24d0691d6 -r deeb92e93357a433dd56e83a339a2192ca42e9e1 yt/visualization/image_writer.py
--- a/yt/visualization/image_writer.py
+++ b/yt/visualization/image_writer.py
@@ -13,12 +13,10 @@
 # The full license is in the file COPYING.txt, distributed with this software.
 #-----------------------------------------------------------------------------
 
-import types
-import imp
-import os
 import numpy as np
 
-from yt.funcs import *
+from yt.funcs import mylog, get_image_suffix
+from yt.units.yt_array import YTQuantity
 from yt.utilities.exceptions import YTNotInsideNotebook
 from .color_maps import mcm
 from . import _colormap_data as cmd
@@ -277,7 +275,7 @@
                 cmap = bmap.get_mpl_colormap(N=cmap_name[2])
             else:
                 cmap = mcm.get_cmap(cmap_name)
-            dummy = cmap(0.0)
+            cmap(0.0)
             lut = cmap._lut.T
         except ValueError:
             print("Your color map was not found in either the extracted" +\

diff -r 5f98bb340f15ac0d73ba37156dba9ed24d0691d6 -r deeb92e93357a433dd56e83a339a2192ca42e9e1 yt/visualization/plot_modifications.py
--- a/yt/visualization/plot_modifications.py
+++ b/yt/visualization/plot_modifications.py
@@ -5,9 +5,6 @@
 
 
 """
-from __future__ import absolute_import
-from yt.extern.six import string_types
-
 #-----------------------------------------------------------------------------
 # Copyright (c) 2013, yt Development Team.
 #
@@ -16,8 +13,12 @@
 # The full license is in the file COPYING.txt, distributed with this software.
 #-----------------------------------------------------------------------------
 
+from __future__ import absolute_import
+
+import warnings
+
+import matplotlib
 import numpy as np
-import h5py
 
 from distutils.version import LooseVersion
 
@@ -26,22 +27,19 @@
 from matplotlib import cm
 from mpl_toolkits.axes_grid1.anchored_artists import AnchoredSizeBar
 
-from yt.funcs import *
+from yt.funcs import \
+    mylog, iterable
 from yt.extern.six import add_metaclass
-from ._mpl_imports import *
-from yt.utilities.physical_constants import \
-    sec_per_Gyr, sec_per_Myr, \
-    sec_per_kyr, sec_per_year, \
-    sec_per_day, sec_per_hr
 from yt.units.yt_array import YTQuantity, YTArray
 from yt.visualization.image_writer import apply_colormap
 from yt.utilities.lib.geometry_utils import triangle_plane_intersect
 from yt.analysis_modules.cosmological_observation.light_ray.light_ray \
      import periodic_ray
-from yt.utilities.lib.line_integral_convolution \
-     import line_integral_convolution_2d
+from yt.utilities.lib.line_integral_convolution import \
+    line_integral_convolution_2d
 import warnings
 
+
 from . import _MPL
 
 callback_registry = {}
@@ -116,13 +114,11 @@
 
         x0 = np.array(np.tile(plot.xlim[0],ncoord))
         x1 = np.array(np.tile(plot.xlim[1],ncoord))
-        x2 = np.array([0, 1])
         xx0 = np.tile(plot._axes.get_xlim()[0],ncoord)
         xx1 = np.tile(plot._axes.get_xlim()[1],ncoord)
 
         y0 = np.array(np.tile(plot.ylim[0],ncoord))
         y1 = np.array(np.tile(plot.ylim[1],ncoord))
-        y2 = np.array([0, 1])
         yy0 = np.tile(plot._axes.get_ylim()[0],ncoord)
         yy1 = np.tile(plot._axes.get_ylim()[1],ncoord)
 
@@ -232,7 +228,7 @@
         # For each label, set the font properties and color to the figure
         # defaults if not already set in the callback itself
         for label in labels:
-            if plot.font_color is not None and not 'color' in kwargs:
+            if plot.font_color is not None and 'color' not in kwargs:
                 label.set_color(plot.font_color)
             label.set_fontproperties(local_font_properties)
 
@@ -373,7 +369,7 @@
                              int(nx), int(ny),
                              (x0, x1, y0, y1), 0, # bounds, antialias
                              (period_x, period_y), periodic,
-                           ).transpose()
+                             ).transpose()
         pixY = _MPL.Pixelize(plot.data['px'],
                              plot.data['py'],
                              plot.data['pdx'],
@@ -382,7 +378,7 @@
                              int(nx), int(ny),
                              (x0, x1, y0, y1), 0, # bounds, antialias
                              (period_x, period_y), periodic,
-                           ).transpose()
+                             ).transpose()
         X,Y = np.meshgrid(np.linspace(xx0,xx1,nx,endpoint=True),
                           np.linspace(yy0,yy1,ny,endpoint=True))
         if self.normalize:

diff -r 5f98bb340f15ac0d73ba37156dba9ed24d0691d6 -r deeb92e93357a433dd56e83a339a2192ca42e9e1 yt/visualization/plot_window.py
--- a/yt/visualization/plot_window.py
+++ b/yt/visualization/plot_window.py
@@ -48,8 +48,7 @@
 from yt.extern.six import string_types
 from yt.funcs import \
     mylog, iterable, ensure_list, \
-    fix_axis, validate_width_tuple, \
-    fix_unitary
+    fix_axis, fix_unitary
 from yt.units.unit_object import \
     Unit
 from yt.units.unit_registry import \
@@ -68,7 +67,6 @@
     Orientation
 from yt.utilities.exceptions import \
     YTUnitNotRecognized, \
-    YTInvalidWidthError, \
     YTCannotParseUnitDisplayName, \
     YTUnitConversionError, \
     YTPlotCallbackError
@@ -231,7 +229,7 @@
         super(PlotWindow, self).__init__(data_source, window_size, fontsize)
         self._set_window(bounds) # this automatically updates the data and plot
         self.origin = origin
-        if self.data_source.center is not None and oblique == False:
+        if self.data_source.center is not None and oblique is False:
             ax = self.data_source.axis
             xax = self.ds.coordinates.x_axis[ax]
             yax = self.ds.coordinates.y_axis[ax]

diff -r 5f98bb340f15ac0d73ba37156dba9ed24d0691d6 -r deeb92e93357a433dd56e83a339a2192ca42e9e1 yt/visualization/profile_plotter.py
--- a/yt/visualization/profile_plotter.py
+++ b/yt/visualization/profile_plotter.py
@@ -20,28 +20,24 @@
 import base64
 import os
 
-from functools import wraps
 import matplotlib
 import numpy as np
 from io import BytesIO
 
 
 from .base_plot_types import ImagePlotMPL
-from yt.units.yt_array import YTArray
 from .plot_container import \
     ImagePlotContainer, \
     log_transform, linear_transform, get_log_minorticks, \
     validate_plot, invalidate_plot
 from yt.data_objects.profiles import \
-    create_profile, \
-    sanitize_field_tuple_keys
+    create_profile
 from yt.utilities.exceptions import \
     YTNotInsideNotebook
 from yt.utilities.logger import ytLogger as mylog
 from . import _mpl_imports as mpl
 from yt.funcs import \
     ensure_list, \
-    iterable, \
     get_image_suffix, \
     get_ipython_api_version
 

diff -r 5f98bb340f15ac0d73ba37156dba9ed24d0691d6 -r deeb92e93357a433dd56e83a339a2192ca42e9e1 yt/visualization/setup.py
--- a/yt/visualization/setup.py
+++ b/yt/visualization/setup.py
@@ -1,5 +1,4 @@
 #!/usr/bin/env python
-import setuptools
 
 
 def configuration(parent_package='', top_path=None):

diff -r 5f98bb340f15ac0d73ba37156dba9ed24d0691d6 -r deeb92e93357a433dd56e83a339a2192ca42e9e1 yt/visualization/streamlines.py
--- a/yt/visualization/streamlines.py
+++ b/yt/visualization/streamlines.py
@@ -15,7 +15,8 @@
 
 import numpy as np
 from yt.data_objects.construction_data_containers import YTStreamlineBase
-from yt.funcs import *
+from yt.funcs import get_pbar
+from yt.units.yt_array import YTArray
 from yt.utilities.parallel_tools.parallel_analysis_interface import \
     ParallelAnalysisInterface, parallel_passthrough
 from yt.utilities.amr_kdtree.api import AMRKDTree

diff -r 5f98bb340f15ac0d73ba37156dba9ed24d0691d6 -r deeb92e93357a433dd56e83a339a2192ca42e9e1 yt/visualization/tests/test_callbacks.py
--- a/yt/visualization/tests/test_callbacks.py
+++ b/yt/visualization/tests/test_callbacks.py
@@ -13,7 +13,9 @@
 #
 # The full license is in the file COPYING.txt, distributed with this software.
 #-----------------------------------------------------------------------------
-import os, tempfile, shutil
+import tempfile
+import shutil
+
 from yt.testing import \
     fake_amr_ds
 import yt.units as u

diff -r 5f98bb340f15ac0d73ba37156dba9ed24d0691d6 -r deeb92e93357a433dd56e83a339a2192ca42e9e1 yt/visualization/tests/test_plotwindow.py
--- a/yt/visualization/tests/test_plotwindow.py
+++ b/yt/visualization/tests/test_plotwindow.py
@@ -288,11 +288,6 @@
         self._assert_05_075cm()
         assert_true(self.slc._axes_unit_names == ('cm', 'cm'))
 
-    def test_tuple_of_tuples_neq(self):
-        self.slc.set_width(((0.5, 'cm'), (0.0075, 'm')))
-        self._assert_05_075cm()
-        assert_true(self.slc._axes_unit_names == ('cm', 'm'))
-
 
 class TestPlotWindowSave(unittest.TestCase):
 

diff -r 5f98bb340f15ac0d73ba37156dba9ed24d0691d6 -r deeb92e93357a433dd56e83a339a2192ca42e9e1 yt/visualization/tests/test_profile_plots.py
--- a/yt/visualization/tests/test_profile_plots.py
+++ b/yt/visualization/tests/test_profile_plots.py
@@ -12,7 +12,6 @@
 #
 # The full license is in the file COPYING.txt, distributed with this software.
 #-----------------------------------------------------------------------------
-import itertools
 import os
 import tempfile
 import shutil

diff -r 5f98bb340f15ac0d73ba37156dba9ed24d0691d6 -r deeb92e93357a433dd56e83a339a2192ca42e9e1 yt/visualization/volume_rendering/CUDARayCast.py
--- a/yt/visualization/volume_rendering/CUDARayCast.py
+++ /dev/null
@@ -1,161 +0,0 @@
-"""
-An attempt at putting the ray-casting operation into CUDA
-
-
-
-"""
-from __future__ import print_function
-
-#-----------------------------------------------------------------------------
-# Copyright (c) 2013, yt Development Team.
-#
-# Distributed under the terms of the Modified BSD License.
-#
-# The full license is in the file COPYING.txt, distributed with this software.
-#-----------------------------------------------------------------------------
-
-import sys;sys.path.insert(0,'.')
-
-from yt.mods import *
-import yt.extensions.HierarchySubset as hs
-import numpy as np
-import h5py, time
-from yt.utilities.physical_constants import \
-    mass_hydrogen_cgs
-
-import matplotlib;matplotlib.use("Agg");import pylab
-
-from yt.extensions.volume_rendering.TransferFunction import ColorTransferFunction
-
-if __name__ == "__main__":
-
-    # This is boilerplate code for setting up pycuda
-    import pycuda.driver as cuda
-    import pycuda.compiler as compiler
-    import pycuda.autoinit
-    import pycuda.gpuarray as gpuarray
-    cuda.init()
-    assert (cuda.Device.count() >= 1)
-
-    print ("Extracting hierarchy.")
-    ods = load("/u/ki/mturk/ki05/MSM96-SIM3-restart-J64/DataDump0081.dir/DataDump0081")
-    ds = hs.ExtractedParameterFile(ods, 20)
-
-    cpu = {}
-    gpu = {}
-
-    print ("Reading data.")
-    #fn = "DataDump0081_partitioned.h5"
-    fn = "RedshiftOutput0005_partitioned.h5"
-    f = h5py.File("/u/ki/mturk/ki05/%s" % fn)
-    cpu['grid_data'] = f["/PGrids/Data"][:].astype("float32")
-    cpu['dims'] = f["/PGrids/Dims"][:].astype("int32") - 1
-    cpu['left_edge'] = f["/PGrids/LeftEdges"][:].astype("float32")
-    cpu['right_edge'] = f["/PGrids/RightEdges"][:].astype("float32")
-
-    print ("Constructing transfer function.")
-    if "Data" in fn:
-        mh = np.log10(mass_hydrogen_cgs)
-        tf = ColorTransferFunction((7.5+mh, 14.0+mh))
-        tf.add_gaussian( 8.25+mh, 0.002, [0.2, 0.2, 0.4, 0.1])
-        tf.add_gaussian( 9.75+mh, 0.002, [0.0, 0.0, 0.3, 0.1])
-        tf.add_gaussian(10.25+mh, 0.004, [0.0, 0.3, 0.0, 0.1])
-        tf.add_gaussian(11.50+mh, 0.005, [1.0, 0.0, 0.0, 0.7])
-        tf.add_gaussian(12.75+mh, 0.010, [1.0, 1.0, 1.0, 1.0])
-    elif "Red" in fn:
-        tf = ColorTransferFunction((-31, -27))
-        tf.add_gaussian(-30.0, 0.05, [1.0, 0.0, 0.0, 0.1])
-        tf.add_gaussian(-29.5, 0.03, [0.0, 1.0, 0.0, 0.3])
-        tf.add_gaussian(-29.0, 0.05, [0.0, 0.0, 1.0, 0.5])
-        tf.add_gaussian(-28.5, 0.05, [1.0, 1.0, 1.0, 1.0])
-    else: raise RuntimeError
-
-    cpu['ngrids'] = np.array([cpu['dims'].shape[0]], dtype='int32')
-    cpu['tf_r'] = tf.red.y.astype("float32")
-    cpu['tf_g'] = tf.green.y.astype("float32")
-    cpu['tf_b'] = tf.blue.y.astype("float32")
-    cpu['tf_a'] = tf.alpha.y.astype("float32")
-
-    cpu['tf_bounds'] = np.array(tf.x_bounds, dtype='float32')
-
-    cpu['v_dir'] = np.array([0.3, 0.5, 0.6], dtype='float32')
-
-    c = np.array([0.47284317, 0.48062515, 0.58282089], dtype='float32')
-
-    print ("Getting cutting plane.")
-    cp = ds.cutting(cpu['v_dir'], c)
-
-    W = 2000.0/ds['au']
-    W = 0.25
-    Nvec = 128
-    back_c = c - cp._norm_vec * W
-    front_c = c + cp._norm_vec * W
-
-    px, py = np.mgrid[-W:W:Nvec*1j,-W:W:Nvec*1j]
-    xv = cp._inv_mat[0,0]*px + cp._inv_mat[0,1]*py + cp.center[0]
-    yv = cp._inv_mat[1,0]*px + cp._inv_mat[1,1]*py + cp.center[1]
-    zv = cp._inv_mat[2,0]*px + cp._inv_mat[2,1]*py + cp.center[2]
-    cpu['v_pos'] = np.array([xv, yv, zv], dtype='float32').transpose()
-
-    cpu['image_r'] = np.zeros((Nvec, Nvec), dtype='float32').ravel()
-    cpu['image_g'] = np.zeros((Nvec, Nvec), dtype='float32').ravel()
-    cpu['image_b'] = np.zeros((Nvec, Nvec), dtype='float32').ravel()
-    cpu['image_a'] = np.zeros((Nvec, Nvec), dtype='float32').ravel()
-
-    print ("Generating module")
-    source = open("yt/extensions/volume_rendering/_cuda_caster.cu").read()
-    mod = compiler.SourceModule(source)
-    func = mod.get_function("ray_cast")
-
-    for n, a in cpu.items():
-        ss = a.size * a.dtype.itemsize
-        print ("Allocating %0.3e megabytes for %s" % (ss/(1024*1024.), n))
-        gpu[n] = cuda.to_device(a.ravel('F'))
-        #pycuda.autoinit.context.synchronize()
-
-    BLOCK_SIZE = 8
-    grid_size = Nvec / BLOCK_SIZE
-
-    print ("Running ray_cast function.")
-    t1 = time.time()
-    ret = func(gpu['ngrids'],
-               gpu['grid_data'],
-               gpu['dims'],
-               gpu['left_edge'],
-               gpu['right_edge'],
-               gpu['tf_r'],
-               gpu['tf_g'],
-               gpu['tf_b'],
-               gpu['tf_a'],
-               gpu['tf_bounds'],
-               gpu['v_dir'],
-               gpu['v_pos'],
-               gpu['image_r'],
-               gpu['image_g'],
-               gpu['image_b'],
-               gpu['image_a'],
-         block=(BLOCK_SIZE,BLOCK_SIZE,1),
-         grid=(grid_size, grid_size), time_kernel=True)
-    t2 = time.time()
-    print ("BACK: %0.3e" % (t2-t1))
-
-    mi, ma = 1e300, -1e300
-    image = []
-    for im in 'rgb':
-        ii = 'image_%s' % im
-        sh, dtype = cpu[ii].shape, cpu[ii].dtype
-        del cpu[ii]
-        cpu[ii] = cuda.from_device(gpu[ii], sh, dtype).reshape((Nvec,Nvec))
-        mi, ma = min(cpu[ii].min(),mi), max(cpu[ii].max(), ma)
-        image.append(cpu[ii])
-        print ("Min/max of %s %0.3e %0.3e" % (
-                im, image[-1].min(), image[-1].max()))
-        pylab.clf()
-        pylab.imshow(image[-1], interpolation='nearest')
-        pylab.savefig("/u/ki/mturk/public_html/vr6/%s.png" % (ii))
-
-    image = np.array(image).transpose()
-    image = (image - mi) / (ma - mi)
-    pylab.clf()
-    pylab.imshow(image, interpolation='nearest')
-    pylab.savefig("/u/ki/mturk/public_html/vr6/image_rgb.png")

diff -r 5f98bb340f15ac0d73ba37156dba9ed24d0691d6 -r deeb92e93357a433dd56e83a339a2192ca42e9e1 yt/visualization/volume_rendering/api.py
--- a/yt/visualization/volume_rendering/api.py
+++ b/yt/visualization/volume_rendering/api.py
@@ -21,8 +21,8 @@
                            plot_channel, plot_rgb
 
 from .camera import Camera, PerspectiveCamera, StereoPairCamera, \
-    off_axis_projection, FisheyeCamera, MosaicFisheyeCamera, \
-    HEALpixCamera, InteractiveCamera, ProjectionCamera, \
+    off_axis_projection, FisheyeCamera, \
+    InteractiveCamera, ProjectionCamera, \
     SphericalCamera, StereoSphericalCamera
 
 from .transfer_function_helper import TransferFunctionHelper

This diff is so big that we needed to truncate the remainder.

Repository URL: https://bitbucket.org/yt_analysis/yt/

--

This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.


More information about the yt-svn mailing list