[yt-svn] commit/yt: 10 new changesets

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Fri Jun 17 06:00:12 PDT 2016


10 new commits in yt:

https://bitbucket.org/yt_analysis/yt/commits/e87c1bb1c8d4/
Changeset:   e87c1bb1c8d4
Branch:      yt
User:        MatthewTurk
Date:        2016-01-30 22:06:09+00:00
Summary:     Replace calls to _MPL.Pixelize with pixelize_cartesian.
Affected #:  3 files

diff -r e1341764121a45280be5b5c15e0e652901b9340d -r e87c1bb1c8d4d9c8f5565c66c87f5fa936991015 yt/geometry/coordinates/cartesian_coordinates.py
--- a/yt/geometry/coordinates/cartesian_coordinates.py
+++ b/yt/geometry/coordinates/cartesian_coordinates.py
@@ -23,9 +23,9 @@
     cylindrical_to_cartesian
 from yt.funcs import mylog
 from yt.utilities.lib.pixelization_routines import \
-    pixelize_element_mesh, pixelize_off_axis_cartesian
+    pixelize_element_mesh, pixelize_off_axis_cartesian, \
+    pixelize_cartesian
 from yt.data_objects.unstructured_mesh import SemiStructuredMesh
-import yt.visualization._MPL as _MPL
 
 
 class CartesianCoordinateHandler(CoordinateHandler):
@@ -125,7 +125,7 @@
         period[1] = self.period[self.y_axis[dim]]
         if hasattr(period, 'in_units'):
             period = period.in_units("code_length").d
-        buff = _MPL.Pixelize(data_source['px'], data_source['py'],
+        buff = pixelize_cartesian(data_source['px'], data_source['py'],
                              data_source['pdx'], data_source['pdy'],
                              data_source[field], size[0], size[1],
                              bounds, int(antialias),

diff -r e1341764121a45280be5b5c15e0e652901b9340d -r e87c1bb1c8d4d9c8f5565c66c87f5fa936991015 yt/geometry/coordinates/cylindrical_coordinates.py
--- a/yt/geometry/coordinates/cylindrical_coordinates.py
+++ b/yt/geometry/coordinates/cylindrical_coordinates.py
@@ -21,9 +21,8 @@
     _get_coord_fields, \
     cylindrical_to_cartesian, \
     cartesian_to_cylindrical
-import yt.visualization._MPL as _MPL
 from yt.utilities.lib.pixelization_routines import \
-    pixelize_cylinder
+    pixelize_cartesian, pixelize_cylinder
 #
 # Cylindrical fields
 #
@@ -113,11 +112,11 @@
         period[1] = self.period[self.y_axis[dim]]
         if hasattr(period, 'in_units'):
             period = period.in_units("code_length").d
-        buff = _MPL.Pixelize(data_source['px'], data_source['py'],
-                             data_source['pdx'], data_source['pdy'],
-                             data_source[field], size[0], size[1],
-                             bounds, int(antialias),
-                             period, int(periodic)).transpose()
+        buff = pixelize_cartesian(data_source['px'], data_source['py'],
+                                  data_source['pdx'], data_source['pdy'],
+                                  data_source[field], size[0], size[1],
+                                  bounds, int(antialias),
+                                  period, int(periodic)).transpose()
         return buff
 
     def _cyl_pixelize(self, data_source, field, bounds, size, antialias):

diff -r e1341764121a45280be5b5c15e0e652901b9340d -r e87c1bb1c8d4d9c8f5565c66c87f5fa936991015 yt/visualization/plot_modifications.py
--- a/yt/visualization/plot_modifications.py
+++ b/yt/visualization/plot_modifications.py
@@ -34,15 +34,13 @@
 from yt.visualization.image_writer import apply_colormap
 from yt.utilities.lib.geometry_utils import triangle_plane_intersect
 from yt.utilities.lib.pixelization_routines import \
-    pixelize_element_mesh, pixelize_off_axis_cartesian
+    pixelize_element_mesh, pixelize_off_axis_cartesian, \
+    pixelize_cartesian
 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 . import _MPL
-
 callback_registry = {}
 
 class RegisteredCallback(type):
@@ -362,24 +360,18 @@
         if self.bv_y != 0.0:
             # Workaround for 0.0 without units
             fv_y -= self.bv_y
-        pixX = _MPL.Pixelize(plot.data['px'],
-                             plot.data['py'],
-                             plot.data['pdx'],
-                             plot.data['pdy'],
-                             fv_x,
-                             int(nx), int(ny),
-                             (x0, x1, y0, y1), 0, # bounds, antialias
-                             (period_x, period_y), periodic,
-                             ).transpose()
-        pixY = _MPL.Pixelize(plot.data['px'],
-                             plot.data['py'],
-                             plot.data['pdx'],
-                             plot.data['pdy'],
-                             fv_y,
-                             int(nx), int(ny),
-                             (x0, x1, y0, y1), 0, # bounds, antialias
-                             (period_x, period_y), periodic,
-                             ).transpose()
+        pixX = pixelize_cartesian(plot.data['px'], plot.data['py'],
+                                  plot.data['pdx'], plot.data['pdy'],
+                                  fv_x, int(nx), int(ny),
+                                  (x0, x1, y0, y1), 0, # bounds, antialias
+                                  (period_x, period_y), periodic,
+                                  ).transpose()
+        pixY = pixelize_cartesian(plot.data['px'], plot.data['py'],
+                                  plot.data['pdx'], plot.data['pdy'],
+                                  fv_y, int(nx), int(ny),
+                                  (x0, x1, y0, y1), 0, # bounds, antialias
+                                  (period_x, period_y), periodic,
+                                  ).transpose()
         X,Y = np.meshgrid(np.linspace(xx0,xx1,nx,endpoint=True),
                           np.linspace(yy0,yy1,ny,endpoint=True))
         if self.normalize:
@@ -670,28 +662,22 @@
         plot._axes.hold(True)
         nx = plot.image._A.shape[0] / self.factor
         ny = plot.image._A.shape[1] / self.factor
-        pixX = _MPL.Pixelize(plot.data['px'],
-                             plot.data['py'],
-                             plot.data['pdx'],
-                             plot.data['pdy'],
-                             plot.data[self.field_x],
-                             int(nx), int(ny),
-                             (x0, x1, y0, y1),).transpose()
-        pixY = _MPL.Pixelize(plot.data['px'],
-                             plot.data['py'],
-                             plot.data['pdx'],
-                             plot.data['pdy'],
-                             plot.data[self.field_y],
-                             int(nx), int(ny),
-                             (x0, x1, y0, y1),).transpose()
+        pixX = pixelize_cartesian(plot.data['px'], plot.data['py'],
+                                  plot.data['pdx'], plot.data['pdy'],
+                                  plot.data[self.field_x],
+                                  int(nx), int(ny),
+                                  (x0, x1, y0, y1),).transpose()
+        pixY = pixelize_cartesian(plot.data['px'], plot.data['py'],
+                                  plot.data['pdx'], plot.data['pdy'],
+                                  plot.data[self.field_y],
+                                  int(nx), int(ny),
+                                  (x0, x1, y0, y1),).transpose()
         if self.field_color:
-            self.field_color = _MPL.Pixelize(plot.data['px'],
-                                             plot.data['py'],
-                                             plot.data['pdx'],
-                                             plot.data['pdy'],
-                                             plot.data[self.field_color],
-                                             int(nx), int(ny),
-                                             (x0, x1, y0, y1),).transpose()
+            self.field_color = pixelize_cartesian(
+                        plot.data['px'], plot.data['py'],
+                        plot.data['pdx'], plot.data['pdy'],
+                        plot.data[self.field_color], int(nx), int(ny),
+                        (x0, x1, y0, y1),).transpose()
 
         X,Y = (np.linspace(xx0,xx1,nx,endpoint=True),
                np.linspace(yy0,yy1,ny,endpoint=True))
@@ -892,7 +878,7 @@
             xf_copy = clump[xf].copy().in_units("code_length")
             yf_copy = clump[yf].copy().in_units("code_length")
 
-            temp = _MPL.Pixelize(xf_copy, yf_copy,
+            temp = pixelize_cartesian(xf_copy, yf_copy,
                                  clump[dxf].in_units("code_length")/2.0,
                                  clump[dyf].in_units("code_length")/2.0,
                                  clump[dxf].d*0.0+i+1, # inits inside Pixelize


https://bitbucket.org/yt_analysis/yt/commits/8ab64d38bc0a/
Changeset:   8ab64d38bc0a
Branch:      yt
User:        MatthewTurk
Date:        2016-01-30 22:06:14+00:00
Summary:     Remove _MPL.c
Affected #:  2 files

diff -r e87c1bb1c8d4d9c8f5565c66c87f5fa936991015 -r 8ab64d38bc0a2a9ea09f119b965fc148b1f9d8ba setup.py
--- a/setup.py
+++ b/setup.py
@@ -227,9 +227,6 @@
                "yt/geometry/particle_deposit.pxd"]),
     Extension("yt.utilities.spatial._distance_wrap",
               glob.glob("yt/utilities/spatial/src/*.c")),
-    Extension("yt.visualization._MPL",
-              ["yt/visualization/_MPL.c"],
-              libraries=["m"]),
     Extension("yt.utilities.data_point_utilities",
               ["yt/utilities/data_point_utilities.c"],
               libraries=["m"]),

diff -r e87c1bb1c8d4d9c8f5565c66c87f5fa936991015 -r 8ab64d38bc0a2a9ea09f119b965fc148b1f9d8ba yt/visualization/_MPL.c
--- a/yt/visualization/_MPL.c
+++ /dev/null
@@ -1,465 +0,0 @@
-/*******************************************************************************
-# 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.
-*******************************************************************************/
-//
-// _MPL
-//   A module for making static-resolution arrays representing
-//   AMR data.
-//
-
-#include "Python.h"
-
-#include <stdio.h>
-#include <math.h>
-#include <signal.h>
-#include <ctype.h>
-
-#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
-#include "numpy/ndarrayobject.h"
-
-#define min(X,Y) ((X) < (Y) ? (X) : (Y))
-#define max(X,Y) ((X) > (Y) ? (X) : (Y))
-
-static PyObject *_pixelizeError;
-
-char _pixelizeDocstring[] =
-"Returns a static-resolution pixelized version of AMR data.\n\n"
-"@parameter xp: ndarray of x centers\n"
-"@Parameter yp: ndarray of y centers\n"
-"@parameter dxp: ndarray of x half-widths\n"
-"@parameter dyp: ndarray of y half-widths\n"
-"@parameter dp: ndarray of data\n"
-"@parameter rows: number of pixel rows\n"
-"@parameter cols: number of pixel columns\n"
-"@parameter bounds: (x_min, x_max, y_min, y_max)";
-
-static PyObject* Py_Pixelize(PyObject *obj, PyObject *args) {
-
-  PyObject *xp, *yp, *dxp, *dyp, *dp;
-  PyArrayObject *x, *y, *dx, *dy, *d;
-  xp = yp = dxp = dyp = dp = NULL;
-  x = y = dx = dy = d = NULL;
-  unsigned int rows, cols;
-  int antialias = 1;
-  double x_min, x_max, y_min, y_max;
-  double period_x, period_y;
-  period_x = period_y = 0;
-  int check_period = 1;
-
-  if (!PyArg_ParseTuple(args, "OOOOOII(dddd)|i(dd)i",
-      &xp, &yp, &dxp, &dyp, &dp, &cols, &rows,
-      &x_min, &x_max, &y_min, &y_max,
-      &antialias, &period_x, &period_y, &check_period))
-      return PyErr_Format(_pixelizeError, "Pixelize: Invalid Parameters.");
-
-  double width = x_max - x_min;
-  double height = y_max - y_min;
-  double px_dx = width / ((double) rows);
-  double px_dy = height / ((double) cols);
-  double ipx_dx = 1.0 / px_dx;
-  double ipx_dy = 1.0 / px_dy;
-
-  // Check we have something to output to
-  if (rows == 0 || cols ==0)
-      PyErr_Format( _pixelizeError, "Cannot scale to zero size.");
-
-  // Get numeric arrays
-  x = (PyArrayObject *) PyArray_FromAny(xp,
-            PyArray_DescrFromType(NPY_FLOAT64), 1, 1, 0, NULL);
-  if (x == NULL) {
-      PyErr_Format( _pixelizeError, "x is of incorrect type (wanted 1D float)");
-      goto _fail;
-  }
-
-  y = (PyArrayObject *) PyArray_FromAny(yp,
-            PyArray_DescrFromType(NPY_FLOAT64), 1, 1, 0, NULL);
-  if ((y == NULL) || (PyArray_SIZE(y) != PyArray_SIZE(x))) {
-      PyErr_Format( _pixelizeError, "y is of incorrect type (wanted 1D float)");
-      goto _fail;
-  }
-
-  d = (PyArrayObject *) PyArray_FromAny(dp,
-            PyArray_DescrFromType(NPY_FLOAT64), 1, 1, 0, NULL);
-  if ((d == NULL) || (PyArray_SIZE(d) != PyArray_SIZE(x))) {
-      PyErr_Format( _pixelizeError, "data is of incorrect type (wanted 1D float)");
-      goto _fail;
-  }
-
-  dx = (PyArrayObject *) PyArray_FromAny(dxp,
-            PyArray_DescrFromType(NPY_FLOAT64), 1, 1, 0, NULL);
-  if ((dx == NULL) || (PyArray_SIZE(dx) != PyArray_SIZE(x))) {
-      PyErr_Format( _pixelizeError, "dx is of incorrect type (wanted 1D float)");
-      goto _fail;
-  }
-  dy = (PyArrayObject *) PyArray_FromAny(dyp,
-            PyArray_DescrFromType(NPY_FLOAT64), 1, 1, 0, NULL);
-  if ((dy == NULL) || (PyArray_SIZE(dy) != PyArray_SIZE(x))) {
-      PyErr_Format( _pixelizeError, "dy is of incorrect type (wanted 1D float)");
-      goto _fail;
-  }
-
-  // Check dimensions match
-  int nx = PyArray_DIMS(x)[0];
-
-  // Calculate the pointer arrays to map input x to output x
-  int i, j, p, xi, yi;
-  double lc, lr, rc, rr;
-  double lypx, rypx, lxpx, rxpx, overlap1, overlap2;
-  npy_float64 oxsp, oysp, xsp, ysp, dxsp, dysp, dsp;
-  int xiter[2], yiter[2];
-  double xiterv[2], yiterv[2];
-
-  
-
-  npy_intp dims[] = {rows, cols};
-  PyArrayObject *my_array =
-    (PyArrayObject *) PyArray_SimpleNewFromDescr(2, dims,
-              PyArray_DescrFromType(NPY_FLOAT64));
-  //npy_float64 *gridded = (npy_float64 *) my_array->data;
-
-  xiter[0] = yiter[0] = 0;
-  xiterv[0] = yiterv[0] = 0.0;
-
-  Py_BEGIN_ALLOW_THREADS
-  for(i=0;i<rows;i++)for(j=0;j<cols;j++)
-      *(npy_float64*) PyArray_GETPTR2(my_array, i, j) = 0.0;
-  for(p=0;p<nx;p++)
-  {
-    // these are cell-centered
-    oxsp = *((npy_float64 *)PyArray_GETPTR1(x, p));
-    oysp = *((npy_float64 *)PyArray_GETPTR1(y, p));
-    // half-width
-    dxsp = *((npy_float64 *)PyArray_GETPTR1(dx, p));
-    dysp = *((npy_float64 *)PyArray_GETPTR1(dy, p));
-    dsp = *((npy_float64 *)PyArray_GETPTR1(d, p));
-    xiter[1] = yiter[1] = 999;
-    if(check_period == 1) {
-      if (oxsp - dxsp < x_min) {xiter[1] = +1; xiterv[1] = period_x;}
-      else if (oxsp + dxsp > x_max) {xiter[1] = -1; xiterv[1] = -period_x;}
-      if (oysp - dysp < y_min) {yiter[1] = +1; yiterv[1] = period_y;}
-      else if (oysp + dysp > y_max) {yiter[1] = -1; yiterv[1] = -period_y;}
-    }
-    overlap1 = overlap2 = 1.0;
-    for(xi = 0; xi < 2; xi++) {
-      if(xiter[xi] == 999)continue;
-      xsp = oxsp + xiterv[xi];
-      if((xsp+dxsp<x_min) || (xsp-dxsp>x_max)) continue;
-      for(yi = 0; yi < 2; yi++) {
-        if(yiter[yi] == 999)continue;
-        ysp = oysp + yiterv[yi];
-        if((ysp+dysp<y_min) || (ysp-dysp>y_max)) continue;
-        lc = max(((xsp-dxsp-x_min)*ipx_dx),0);
-        lr = max(((ysp-dysp-y_min)*ipx_dy),0);
-        rc = min(((xsp+dxsp-x_min)*ipx_dx), rows);
-        rr = min(((ysp+dysp-y_min)*ipx_dy), cols);
-        for (i=lr;i<rr;i++) {
-          lypx = px_dy * i + y_min;
-          rypx = px_dy * (i+1) + y_min;
-          if (antialias == 1) {
-              overlap2 = ((min(rypx, ysp+dysp) - max(lypx, (ysp-dysp)))*ipx_dy);
-          }
-          if (overlap2 < 0.0) continue;
-          for (j=lc;j<rc;j++) {
-            lxpx = px_dx * j + x_min;
-            rxpx = px_dx * (j+1) + x_min;
-            if (antialias == 1) {
-                overlap1 = ((min(rxpx, xsp+dxsp) - max(lxpx, (xsp-dxsp)))*ipx_dx);
-            }
-            if (overlap1 < 0.0) continue;
-            if (antialias == 1)
-              *(npy_float64*) PyArray_GETPTR2(my_array, j, i) +=
-                    (dsp*overlap1)*overlap2;
-            else *(npy_float64*) PyArray_GETPTR2(my_array, j, i) = dsp;
-          }
-        }
-      }
-    }
-  }
-  Py_END_ALLOW_THREADS
-
-  // Attatch output buffer to output buffer
-
-  Py_DECREF(x);
-  Py_DECREF(y);
-  Py_DECREF(d);
-  Py_DECREF(dx);
-  Py_DECREF(dy);
-
-  PyObject *return_value = Py_BuildValue("N", my_array);
-
-  return return_value;
-
-  _fail:
-
-    if(x!=NULL)Py_XDECREF(x);
-    if(y!=NULL)Py_XDECREF(y);
-    if(d!=NULL)Py_XDECREF(d);
-    if(dx!=NULL)Py_XDECREF(dx);
-    if(dy!=NULL)Py_XDECREF(dy);
-    return NULL;
-
-}
-
-static PyObject* Py_CPixelize(PyObject *obj, PyObject *args) {
-
-  PyObject *xp, *yp, *zp, *pxp, *pyp,
-           *dxp, *dyp, *dzp, *dp,
-           *centerp, *inv_matp, *indicesp;
-
-  xp = yp = zp = pxp = pyp = dxp = dyp = dzp = dp = NULL;
-  centerp = inv_matp = indicesp = NULL;
-
-  PyArrayObject *x, *y, *z, *px, *py, *d,
-                *dx, *dy, *dz, *center, *inv_mat, *indices;
-
-  x = y = z = px = py = dx = dy = dz = d = NULL;
-  center = inv_mat = indices = NULL;
-
-  unsigned int rows, cols;
-  double px_min, px_max, py_min, py_max;
-
-    if (!PyArg_ParseTuple(args, "OOOOOOOOOOOOII(dddd)",
-        &xp, &yp, &zp, &pxp, &pyp, &dxp, &dyp, &dzp, &centerp, &inv_matp,
-        &indicesp, &dp, &cols, &rows, &px_min, &px_max, &py_min, &py_max))
-        return PyErr_Format(_pixelizeError, "CPixelize: Invalid Parameters.");
-
-  double width = px_max - px_min;
-  double height = py_max - py_min;
-  long double px_dx = width / ((double) rows);
-  long double px_dy = height / ((double) cols);
-
-  // Check we have something to output to
-  if (rows == 0 || cols ==0)
-      PyErr_Format( _pixelizeError, "Cannot scale to zero size.");
-
-  // Get numeric arrays
-  x = (PyArrayObject *) PyArray_FromAny(xp,
-            PyArray_DescrFromType(NPY_FLOAT64), 1, 1, 0, NULL);
-  if (x == NULL) {
-      PyErr_Format( _pixelizeError, "x is of incorrect type (wanted 1D float)");
-      goto _fail;
-  }
-
-  y = (PyArrayObject *) PyArray_FromAny(yp,
-            PyArray_DescrFromType(NPY_FLOAT64), 1, 1, 0, NULL);
-  if ((y == NULL) || (PyArray_SIZE(y) != PyArray_SIZE(x))) {
-      PyErr_Format( _pixelizeError, "y is of incorrect type (wanted 1D float)");
-      goto _fail;
-  }
-
-  z = (PyArrayObject *) PyArray_FromAny(zp,
-            PyArray_DescrFromType(NPY_FLOAT64), 1, 1, 0, NULL);
-  if ((z == NULL) || (PyArray_SIZE(y) != PyArray_SIZE(x))) {
-      PyErr_Format( _pixelizeError, "z is of incorrect type (wanted 1D float)");
-      goto _fail;
-  }
-
-  px = (PyArrayObject *) PyArray_FromAny(pxp,
-            PyArray_DescrFromType(NPY_FLOAT64), 1, 1, 0, NULL);
-  if ((px == NULL) || (PyArray_SIZE(y) != PyArray_SIZE(x))) {
-      PyErr_Format( _pixelizeError, "px is of incorrect type (wanted 1D float)");
-      goto _fail;
-  }
-
-  py = (PyArrayObject *) PyArray_FromAny(pyp,
-            PyArray_DescrFromType(NPY_FLOAT64), 1, 1, 0, NULL);
-  if ((py == NULL) || (PyArray_SIZE(y) != PyArray_SIZE(x))) {
-      PyErr_Format( _pixelizeError, "py is of incorrect type (wanted 1D float)");
-      goto _fail;
-  }
-
-  d = (PyArrayObject *) PyArray_FromAny(dp,
-            PyArray_DescrFromType(NPY_FLOAT64), 1, 1, 0, NULL);
-  if ((d == NULL) || (PyArray_SIZE(d) != PyArray_SIZE(x))) {
-      PyErr_Format( _pixelizeError, "data is of incorrect type (wanted 1D float)");
-      goto _fail;
-  }
-
-  dx = (PyArrayObject *) PyArray_FromAny(dxp,
-            PyArray_DescrFromType(NPY_FLOAT64), 1, 1, 0, NULL);
-  if ((dx == NULL) || (PyArray_SIZE(dx) != PyArray_SIZE(x))) {
-      PyErr_Format( _pixelizeError, "dx is of incorrect type (wanted 1D float)");
-      goto _fail;
-  }
-  dy = (PyArrayObject *) PyArray_FromAny(dyp,
-            PyArray_DescrFromType(NPY_FLOAT64), 1, 1, 0, NULL);
-  if ((dy == NULL) || (PyArray_SIZE(dy) != PyArray_SIZE(x))) {
-      PyErr_Format( _pixelizeError, "dy is of incorrect type (wanted 1D float)");
-      goto _fail;
-  }
-  dz = (PyArrayObject *) PyArray_FromAny(dzp,
-            PyArray_DescrFromType(NPY_FLOAT64), 1, 1, 0, NULL);
-  if ((dz == NULL) || (PyArray_SIZE(dz) != PyArray_SIZE(x))) {
-      PyErr_Format( _pixelizeError, "dz is of incorrect type (wanted 1D float)");
-      goto _fail;
-  }
-  center = (PyArrayObject *) PyArray_FromAny(centerp,
-            PyArray_DescrFromType(NPY_FLOAT64), 1, 1, NPY_ARRAY_C_CONTIGUOUS, NULL);
-  if ((dz == NULL) || (PyArray_SIZE(center) != 3)) {
-      PyErr_Format( _pixelizeError, "Center must have three points");
-      goto _fail;
-  }
-  inv_mat = (PyArrayObject *) PyArray_FromAny(inv_matp,
-            PyArray_DescrFromType(NPY_FLOAT64), 2, 2, 0, NULL);
-  if ((inv_mat == NULL) || (PyArray_SIZE(inv_mat) != 9)) {
-      PyErr_Format( _pixelizeError, "inv_mat must be three by three");
-      goto _fail;
-  }
-  indices = (PyArrayObject *) PyArray_FromAny(indicesp,
-            PyArray_DescrFromType(NPY_INT64), 1, 1, 0, NULL);
-  if ((indices == NULL) || (PyArray_SIZE(indices) != PyArray_SIZE(dx))) {
-      PyErr_Format( _pixelizeError, "indices must be same length as dx");
-      goto _fail;
-  }
-
-  // Check dimensions match
-  int nx = PyArray_DIMS(x)[0];
-
-  // Calculate the pointer arrays to map input x to output x
-  int i, j, p;
-  int lc, lr, rc, rr;
-  long double md, cxpx, cypx;
-  long double cx, cy, cz;
-
-  npy_float64 *centers = (npy_float64 *) PyArray_GETPTR1(center,0);
-
-  npy_intp dims[] = {rows, cols};
-  PyArrayObject *my_array =
-    (PyArrayObject *) PyArray_SimpleNewFromDescr(2, dims,
-              PyArray_DescrFromType(NPY_FLOAT64));
-  npy_float64 *gridded = (npy_float64 *) PyArray_DATA(my_array);
-  npy_float64 *mask = malloc(sizeof(npy_float64)*rows*cols);
-
-  npy_float64 inv_mats[3][3];
-  for(i=0;i<3;i++)for(j=0;j<3;j++)
-      inv_mats[i][j]=*(npy_float64*)PyArray_GETPTR2(inv_mat,i,j);
-
-  int pp;
-  for(p=0;p<cols*rows;p++)gridded[p]=mask[p]=0.0;
-  for(pp=0; pp<nx; pp++)
-  {
-    p = *((npy_int64 *) PyArray_GETPTR1(indices, pp));
-    npy_float64 xsp = *((npy_float64 *) PyArray_GETPTR1(x, p));
-    npy_float64 ysp = *((npy_float64 *) PyArray_GETPTR1(y, p));
-    npy_float64 zsp = *((npy_float64 *) PyArray_GETPTR1(z, p));
-    npy_float64 pxsp = *((npy_float64 *) PyArray_GETPTR1(px, p));
-    npy_float64 pysp = *((npy_float64 *) PyArray_GETPTR1(py, p));
-    npy_float64 dxsp = *((npy_float64 *) PyArray_GETPTR1(dx, p));
-    npy_float64 dysp = *((npy_float64 *) PyArray_GETPTR1(dy, p));
-    npy_float64 dzsp = *((npy_float64 *) PyArray_GETPTR1(dz, p));
-    npy_float64 dsp = *((npy_float64 *) PyArray_GETPTR1(d, p)); // We check this above
-    // Any point we want to plot is at most this far from the center
-    md = 2.0*sqrtl(dxsp*dxsp + dysp*dysp + dzsp*dzsp);
-    if(((pxsp+md<px_min) ||
-        (pxsp-md>px_max)) ||
-       ((pysp+md<py_min) ||
-        (pysp-md>py_max))) continue;
-    lc = max(floorl((pxsp-md-px_min)/px_dx),0);
-    lr = max(floorl((pysp-md-py_min)/px_dy),0);
-    rc = min(ceill((pxsp+md-px_min)/px_dx),rows);
-    rr = min(ceill((pysp+md-py_min)/px_dy),cols);
-    for (i=lr;i<rr;i++) {
-      cypx = px_dy * (i+0.5) + py_min;
-      for (j=lc;j<rc;j++) {
-        cxpx = px_dx * (j+0.5) + px_min;
-        cx = inv_mats[0][0]*cxpx + inv_mats[0][1]*cypx + centers[0];
-        cy = inv_mats[1][0]*cxpx + inv_mats[1][1]*cypx + centers[1];
-        cz = inv_mats[2][0]*cxpx + inv_mats[2][1]*cypx + centers[2];
-        if( (fabs(xsp-cx)*0.95>dxsp) || 
-            (fabs(ysp-cy)*0.95>dysp) ||
-            (fabs(zsp-cz)*0.95>dzsp)) continue;
-        mask[j*cols+i] += 1;
-        gridded[j*cols+i] += dsp;
-      }
-    }
-  }
-  for(p=0;p<cols*rows;p++)gridded[p]=gridded[p]/mask[p];
-
-  // Attatch output buffer to output buffer
-
-  Py_DECREF(x);
-  Py_DECREF(y);
-  Py_DECREF(z);
-  Py_DECREF(px);
-  Py_DECREF(py);
-  Py_DECREF(d);
-  Py_DECREF(dx);
-  Py_DECREF(dy);
-  Py_DECREF(dz);
-  Py_DECREF(center);
-  Py_DECREF(indices);
-  Py_DECREF(inv_mat);
-  free(mask);
-
-  PyObject *return_value = Py_BuildValue("N", my_array);
-
-  return return_value;
-
-  _fail:
-
-    Py_XDECREF(x);
-    Py_XDECREF(y);
-    Py_XDECREF(z);
-    Py_XDECREF(px);
-    Py_XDECREF(py);
-    Py_XDECREF(d);
-    Py_XDECREF(dx);
-    Py_XDECREF(dy);
-    Py_XDECREF(dz);
-    Py_XDECREF(center);
-    Py_XDECREF(indices);
-    Py_XDECREF(inv_mat);
-
-    return NULL;
-
-}
-
-static PyMethodDef __MPLMethods[] = {
-    {"Pixelize", Py_Pixelize, METH_VARARGS, _pixelizeDocstring},
-    {"CPixelize", Py_CPixelize, METH_VARARGS, NULL},
-    {NULL, NULL} /* Sentinel */
-};
-
-/* platform independent*/
-#ifdef MS_WIN32
-__declspec(dllexport)
-#endif
-
-
-PyMODINIT_FUNC
-#if PY_MAJOR_VERSION >= 3
-#define _RETVAL m
-PyInit__MPL(void)
-#else
-#define _RETVAL 
-init_MPL(void)
-#endif
-{
-    PyObject *m, *d;
-#if PY_MAJOR_VERSION >= 3
-    static struct PyModuleDef moduledef = {
-        PyModuleDef_HEAD_INIT,
-        "_MPL",           /* m_name */
-        "Pixelization routines\n",
-                             /* m_doc */
-        -1,                  /* m_size */
-        __MPLMethods,    /* m_methods */
-        NULL,                /* m_reload */
-        NULL,                /* m_traverse */
-        NULL,                /* m_clear */
-        NULL,                /* m_free */
-    };
-    m = PyModule_Create(&moduledef); 
-#else
-    m = Py_InitModule("_MPL", __MPLMethods);
-#endif
-    d = PyModule_GetDict(m);
-    _pixelizeError = PyErr_NewException("_MPL.error", NULL, NULL);
-    PyDict_SetItemString(d, "error", _pixelizeError);
-    import_array();
-    return _RETVAL;
-}


https://bitbucket.org/yt_analysis/yt/commits/4eeb12e5205b/
Changeset:   4eeb12e5205b
Branch:      yt
User:        MatthewTurk
Date:        2016-03-28 16:47:54+00:00
Summary:     Merging with upstream
Affected #:  16 files

diff -r 8ab64d38bc0a2a9ea09f119b965fc148b1f9d8ba -r 4eeb12e5205ba4ac8ffbd9544ccfc3a6481be3c4 doc/source/analyzing/analysis_modules/cosmology_calculator.rst
--- /dev/null
+++ b/doc/source/analyzing/analysis_modules/cosmology_calculator.rst
@@ -0,0 +1,75 @@
+.. _cosmology-calculator:
+
+Cosmology Calculator
+====================
+
+The cosmology calculator can be used to calculate cosmological distances and
+times given a set of cosmological parameters.  A cosmological dataset, `ds`,
+will automatically have a cosmology calculator configured with the correct
+parameters associated with it as `ds.cosmology`.  A standalone
+:class:`~yt.utilities.cosmology.Cosmology` calculator object can be created
+in the following way:
+
+.. code-block:: python
+
+   from yt.utilities.cosmology import Cosmology
+
+   co = Cosmology(hubble_constant=0.7, omega_matter=0.3,
+                  omega_lambda=0.7, omega_curvature=0.0)
+
+Once created, various distance calculations as well as conversions between
+redshift and time are available:
+
+.. notebook-cell::
+
+   from yt.utilities.cosmology import Cosmology
+
+   co = Cosmology(hubble_constant=0.7, omega_matter=0.3,
+                  omega_lambda=0.7, omega_curvature=0.0)
+
+   # Hubble distance (c / h)
+   print("hubble distance", co.hubble_distance())
+
+   # distance from z = 0 to 0.5
+   print("comoving radial distance", co.comoving_radial_distance(0, 0.5).in_units("Mpc/h"))
+
+   # transverse distance
+   print("transverse distance", co.comoving_transverse_distance(0, 0.5).in_units("Mpc/h"))
+
+   # comoving volume
+   print("comoving volume", co.comoving_volume(0, 0.5).in_units("Gpc**3"))
+
+   # angulare diameter distance
+   print("angular diameter distance", co.angular_diameter_distance(0, 0.5).in_units("Mpc/h"))
+
+   # angular scale
+   print("angular scale", co.angular_scale(0, 0.5).in_units("Mpc/degree"))
+
+   # luminosity distance
+   print("luminosity distance", co.luminosity_distance(0, 0.5).in_units("Mpc/h"))
+
+   # time between two redshifts
+   print("lookback time", co.lookback_time(0, 0.5).in_units("Gyr"))
+
+   # age of the Universe at a given redshift
+   print("hubble time", co.hubble_time(0).in_units("Gyr"))
+
+   # critical density
+   print("critical density", co.critical_density(0))
+
+   # Hubble parameter at a given redshift
+   print("hubble parameter", co.hubble_parameter(0).in_units("km/s/Mpc"))
+
+   # convert time after Big Bang to redshift
+   my_t = co.quan(8, "Gyr")
+   print("z from t", co.z_from_t(my_t))
+
+   # convert redshift to time after Big Bang (same as Hubble time)
+   print("t from z", co.t_from_z(0.5).in_units("Gyr"))
+
+Note, that all distances returned are comoving distances.  All of the above
+functions accept scalar values and arrays.  The helper functions, `co.quan`
+and `co.arr` exist to create unitful `YTQuantities` and `YTArray` with the
+unit registry of the cosmology calculator.  For more information on the usage
+and meaning of each calculation, consult the reference documentation at
+:ref:`cosmology-calculator-ref`.

diff -r 8ab64d38bc0a2a9ea09f119b965fc148b1f9d8ba -r 4eeb12e5205ba4ac8ffbd9544ccfc3a6481be3c4 doc/source/analyzing/analysis_modules/index.rst
--- a/doc/source/analyzing/analysis_modules/index.rst
+++ b/doc/source/analyzing/analysis_modules/index.rst
@@ -12,6 +12,7 @@
 .. toctree::
    :maxdepth: 2
 
+   cosmology_calculator
    halo_analysis
    synthetic_observation
    exporting

diff -r 8ab64d38bc0a2a9ea09f119b965fc148b1f9d8ba -r 4eeb12e5205ba4ac8ffbd9544ccfc3a6481be3c4 doc/source/reference/api/api.rst
--- a/doc/source/reference/api/api.rst
+++ b/doc/source/reference/api/api.rst
@@ -791,6 +791,7 @@
    ~yt.data_objects.static_output.Dataset.box
    ~yt.funcs.deprecate
    ~yt.funcs.ensure_list
+   ~yt.funcs.enable_plugins
    ~yt.funcs.get_pbar
    ~yt.funcs.humanize_time
    ~yt.funcs.insert_ipython
@@ -861,6 +862,29 @@
    ~yt.utilities.parallel_tools.parallel_analysis_interface.ParallelAnalysisInterface
    ~yt.utilities.parallel_tools.parallel_analysis_interface.ParallelObjectIterator
 
+.. _cosmology-calculator-ref:
+
+Cosmology Calculator
+--------------------
+
+.. autosummary::
+   :toctree: generated/
+
+   ~yt.utilities.cosmology.Cosmology
+   ~yt.utilities.cosmology.Cosmology.hubble_distance
+   ~yt.utilities.cosmology.Cosmology.comoving_radial_distance
+   ~yt.utilities.cosmology.Cosmology.comoving_transverse_distance
+   ~yt.utilities.cosmology.Cosmology.comoving_volume
+   ~yt.utilities.cosmology.Cosmology.angular_diameter_distance
+   ~yt.utilities.cosmology.Cosmology.angular_scale
+   ~yt.utilities.cosmology.Cosmology.luminosity_distance
+   ~yt.utilities.cosmology.Cosmology.lookback_time
+   ~yt.utilities.cosmology.Cosmology.hubble_time
+   ~yt.utilities.cosmology.Cosmology.critical_density
+   ~yt.utilities.cosmology.Cosmology.hubble_parameter
+   ~yt.utilities.cosmology.Cosmology.expansion_factor
+   ~yt.utilities.cosmology.Cosmology.z_from_t
+   ~yt.utilities.cosmology.Cosmology.t_from_z
 
 Testing Infrastructure
 ----------------------

diff -r 8ab64d38bc0a2a9ea09f119b965fc148b1f9d8ba -r 4eeb12e5205ba4ac8ffbd9544ccfc3a6481be3c4 doc/source/reference/code_support.rst
--- a/doc/source/reference/code_support.rst
+++ b/doc/source/reference/code_support.rst
@@ -36,7 +36,7 @@
 +-----------------------+------------+-----------+------------+-------+----------+----------+------------+----------+ 
 | Gasoline              |     Y      |     Y     |      Y     |   Y   | Y [#f2]_ |    Y     |     Y      |   Full   |
 +-----------------------+------------+-----------+------------+-------+----------+----------+------------+----------+ 
-| Grid Data Format (GDF)|     Y      |    N/A    |      Y     |   Y   |    Y     |    Y     |     N      |   Full   |
+| Grid Data Format (GDF)|     Y      |    N/A    |      Y     |   Y   |    Y     |    Y     |     Y      |   Full   |
 +-----------------------+------------+-----------+------------+-------+----------+----------+------------+----------+ 
 | Maestro               |   Y [#f1]_ |     N     |      Y     |   Y   |    Y     |    Y     |     N      | Partial  |
 +-----------------------+------------+-----------+------------+-------+----------+----------+------------+----------+ 
@@ -48,7 +48,7 @@
 +-----------------------+------------+-----------+------------+-------+----------+----------+------------+----------+ 
 | OWLS/EAGLE            |     Y      |     Y     |      Y     |   Y   | Y [#f2]_ |    Y     |     Y      |   Full   |
 +-----------------------+------------+-----------+------------+-------+----------+----------+------------+----------+ 
-| Piernik               |     Y      |    N/A    |      Y     |   Y   |    Y     |    Y     |     N      |   Full   |
+| Piernik               |     Y      |    N/A    |      Y     |   Y   |    Y     |    Y     |     Y      |   Full   |
 +-----------------------+------------+-----------+------------+-------+----------+----------+------------+----------+ 
 | Pluto                 |     Y      |     N     |      Y     |   Y   |    Y     |    Y     |     Y      | Partial  |
 +-----------------------+------------+-----------+------------+-------+----------+----------+------------+----------+ 

diff -r 8ab64d38bc0a2a9ea09f119b965fc148b1f9d8ba -r 4eeb12e5205ba4ac8ffbd9544ccfc3a6481be3c4 doc/source/reference/configuration.rst
--- a/doc/source/reference/configuration.rst
+++ b/doc/source/reference/configuration.rst
@@ -124,25 +124,22 @@
 objects, colormaps, and other code classes and objects to be used in future
 yt sessions without modifying the source code directly.  
 
+To force the plugin file to be parsed, call the function
+:func:`~yt.funcs.enable_plugins` at the top of your script.
 
 .. note::
 
-   The ``my_plugins.py`` is only parsed inside of ``yt.mods``, so in order
-   to use it, you must load yt with either: ``import yt.mods as yt``
-   or ``from yt.mods import *``.  You can tell that your
-   plugins file is being parsed by watching for a logging message when you
-   import yt.  Note that both the ``yt load`` and ``iyt`` command line entry
-   points invoke ``from yt.mods import *``, so the ``my_plugins.py`` file
-   will be parsed if you enter yt that way.
+   You can tell that your plugins file is being parsed by watching for a logging
+   message when you import yt.  Note that both the ``yt load`` and ``iyt``
+   command line entry points parse the plugin file, so the ``my_plugins.py``
+   file will be parsed if you enter yt that way.
 
 Plugin File Format
 ^^^^^^^^^^^^^^^^^^
 
-yt will look for and recognize the file ``$HOME/.yt/my_plugins`` as a plugin
+yt will look for and recognize the file ``$HOME/.yt/my_plugins.py`` as a plugin
 file, which should contain python code.  If accessing yt functions and classes
 they will not require the ``yt.`` prefix, because of how they are loaded.
-It is executed at the bottom of ``yt.mods``, and so
-it is provided with the entire namespace available in the module ``yt.mods``.
 
 For example, if I created a plugin file containing:
 
@@ -152,7 +149,7 @@
        return np.random.random(data["density"].shape)
    add_field("random", function=_myfunc, units='auto')
 
-then all of my data objects would have access to the field ``some_quantity``.
+then all of my data objects would have access to the field ``random``.
 
 You can also define other convenience functions in your plugin file.  For
 instance, you could define some variables or functions, and even import common
@@ -176,13 +173,19 @@
 
 .. code-block:: python
 
-   import yt.mods as yt
+   import yt
+   yt.enable_plugins()
 
    my_run = yt.load_run("hotgasflow/DD0040/DD0040")
 
-And because we have imported from ``yt.mods`` we have access to the
+And because we have used ``yt.enable_plugins`` we have access to the
 ``load_run`` function defined in our plugin file.
 
+Note that using the plugins file implies that your script is no longer fully
+reproducible. If you share your script with someone else and use some of the
+functionality if your plugins file, you will also need to share your plugins
+file for someone else to re-run your script properly.
+
 Adding Custom Colormaps
 ^^^^^^^^^^^^^^^^^^^^^^^
 

diff -r 8ab64d38bc0a2a9ea09f119b965fc148b1f9d8ba -r 4eeb12e5205ba4ac8ffbd9544ccfc3a6481be3c4 doc/source/visualizing/unstructured_mesh_rendering.rst
--- a/doc/source/visualizing/unstructured_mesh_rendering.rst
+++ b/doc/source/visualizing/unstructured_mesh_rendering.rst
@@ -14,7 +14,7 @@
 
 .. code-block:: bash
 
-    conda install -c http://use.yt/with_conda/ yt=3.3_dev
+    conda install -c http://use.yt/with_conda/ yt
 
 If you want to install from source, you can use the ``get_yt.sh`` script.
 Be sure to set the INST_YT_SOURCE and INST_UNSTRUCTURED flags to 1 at the 
@@ -73,7 +73,13 @@
 
 as usual. Finally, if you create a file called embree.cfg in the yt-hg directory with
 the location of the embree installation, the setup script will find this and use it, 
-provided EMBREE_DIR is not set. We recommend one of the later two methods, especially
+provided EMBREE_DIR is not set. An example embree.cfg file could like this:
+
+.. code-block:: bash
+
+   /opt/local/
+
+We recommend one of the later two methods, especially
 if you plan on re-compiling the cython extensions regularly. Note that none of this is
 neccessary if you installed embree into a location that is in your default path, such
 as /usr/local.

diff -r 8ab64d38bc0a2a9ea09f119b965fc148b1f9d8ba -r 4eeb12e5205ba4ac8ffbd9544ccfc3a6481be3c4 setupext.py
--- a/setupext.py
+++ b/setupext.py
@@ -76,17 +76,58 @@
     '''
 
     rd = os.environ.get('EMBREE_DIR')
-    if rd is not None:
-        return rd
-    print("EMBREE_DIR not set. Attempting to read embree.cfg")
+    if rd is None:
+        try:
+            rd = open("embree.cfg").read().strip()
+        except IOError:
+            rd = '/usr/local'
+
+    fail_msg = ("Pyembree is installed, but I could not compile Embree test code. \n"
+               "I attempted to find Embree headers in %s. \n"
+               "If this is not correct, please set your correct embree location \n"
+               "using EMBREE_DIR environment variable or your embree.cfg file. \n"
+               "Please see http://yt-project.org/docs/dev/visualizing/unstructured_mesh_rendering.html "
+                "for more information." % rd)
+
+    # Create a temporary directory
+    tmpdir = tempfile.mkdtemp()
+    curdir = os.getcwd()
+
     try:
-        rd = open("embree.cfg").read().strip()
-        return rd
-    except IOError:
-        print("Reading Embree location from embree.cfg failed.")
-        print("If compilation fails, please place the base directory")
-        print("of your Embree install in embree.cfg and restart.")
-        return '/usr/local'
+        os.chdir(tmpdir)
+
+        # Get compiler invocation
+        compiler = os.getenv('CXX', 'c++')
+        compiler = compiler.split(' ')
+
+        # Attempt to compile a test script.
+        filename = r'test.cpp'
+        file = open(filename, 'wt', 1)
+        file.write(
+            '#include "embree2/rtcore.h"\n'
+            'int main() {\n'
+            'return 0;\n'
+            '}'
+        )
+        file.flush()
+        with open(os.devnull, 'w') as fnull:
+            exit_code = subprocess.call(compiler + ['-I%s/include/' % rd, filename],
+                             stdout=fnull, stderr=fnull)
+
+        # Clean up
+        file.close()
+
+    except OSError:
+        print(fail_msg)
+
+    finally:
+        os.chdir(curdir)
+        shutil.rmtree(tmpdir)
+
+    if exit_code != 0:
+        print(fail_msg)
+
+    return rd
 
 
 def get_mercurial_changeset_id(target_dir):

diff -r 8ab64d38bc0a2a9ea09f119b965fc148b1f9d8ba -r 4eeb12e5205ba4ac8ffbd9544ccfc3a6481be3c4 tests/tests_2.7.yaml
--- a/tests/tests_2.7.yaml
+++ b/tests/tests_2.7.yaml
@@ -20,6 +20,9 @@
   local_gadget_270:
     - yt/frontends/gadget/tests/test_outputs.py
 
+  local_gdf_270:
+    - yt/frontends/gdf/tests/test_outputs.py
+
   local_halos_270:
     - yt/analysis_modules/halo_analysis/tests/test_halo_finders.py
     - yt/analysis_modules/halo_finding/tests/test_rockstar.py

diff -r 8ab64d38bc0a2a9ea09f119b965fc148b1f9d8ba -r 4eeb12e5205ba4ac8ffbd9544ccfc3a6481be3c4 yt/data_objects/static_output.py
--- a/yt/data_objects/static_output.py
+++ b/yt/data_objects/static_output.py
@@ -523,7 +523,9 @@
         fields = [ (union.name, field) for field in fields]
         new_fields = [_ for _ in fields if _ not in self.field_list]
         self.field_list.extend(new_fields)
-        self.field_info.field_list.extend(new_fields)
+        new_field_info_fields = [
+            _ for _ in fields if _ not in self.field_info.field_list]
+        self.field_info.field_list.extend(new_field_info_fields)
         self.index.field_list = sorted(self.field_list)
         # Give ourselves a chance to add them here, first, then...
         # ...if we can't find them, we set them up as defaults.

diff -r 8ab64d38bc0a2a9ea09f119b965fc148b1f9d8ba -r 4eeb12e5205ba4ac8ffbd9544ccfc3a6481be3c4 yt/frontends/gdf/tests/test_outputs.py
--- /dev/null
+++ b/yt/frontends/gdf/tests/test_outputs.py
@@ -0,0 +1,47 @@
+"""
+GDF frontend tests
+
+
+
+"""
+
+#-----------------------------------------------------------------------------
+# Copyright (c) 2016, 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 yt.testing import \
+    assert_equal, \
+    requires_file, \
+    units_override_check
+from yt.utilities.answer_testing.framework import \
+    requires_ds, \
+    small_patch_amr, \
+    data_dir_load
+from yt.frontends.gdf.api import GDFDataset
+
+_fields = ("density", "velocity_x")
+
+sedov = "sedov/sedov_tst_0004.h5"
+
+ at requires_ds(sedov)
+def test_sedov_tunnel():
+    ds = data_dir_load(sedov)
+    yield assert_equal, str(ds), "sedov_tst_0004"
+    for test in small_patch_amr(ds, _fields):
+        test_sedov_tunnel.__name__ = test.description
+        yield test
+
+
+ at requires_file(sedov)
+def test_GDFDataset():
+    assert isinstance(data_dir_load(sedov), GDFDataset)
+
+
+ at requires_file(sedov)
+def test_units_override():
+    for test in units_override_check(sedov):
+        yield test

diff -r 8ab64d38bc0a2a9ea09f119b965fc148b1f9d8ba -r 4eeb12e5205ba4ac8ffbd9544ccfc3a6481be3c4 yt/funcs.py
--- a/yt/funcs.py
+++ b/yt/funcs.py
@@ -838,6 +838,17 @@
     return _func
 
 def enable_plugins():
+    """Forces the plugins file to be parsed.
+
+    This plugin file is a means of creating custom fields, quantities,
+    data objects, colormaps, and other code classes and objects to be used
+    in yt scripts without modifying the yt source directly.
+
+    The file must be located at ``$HOME/.yt/my_plugins.py``.
+
+    Warning: when you use this function, your script will only be reproducible
+    if you also provide the ``my_plugins.py`` file.
+    """
     import yt
     from yt.fields.my_plugin_fields import my_plugins_fields
     from yt.config import ytcfg

diff -r 8ab64d38bc0a2a9ea09f119b965fc148b1f9d8ba -r 4eeb12e5205ba4ac8ffbd9544ccfc3a6481be3c4 yt/geometry/particle_geometry_handler.py
--- a/yt/geometry/particle_geometry_handler.py
+++ b/yt/geometry/particle_geometry_handler.py
@@ -77,6 +77,7 @@
         self._initialize_indices()
         self.oct_handler.finalize()
         self.max_level = self.oct_handler.max_level
+        self.dataset.max_level = self.max_level
         tot = sum(self.oct_handler.recursively_count().values())
         only_on_root(mylog.info, "Identified %0.3e octs", tot)
 

diff -r 8ab64d38bc0a2a9ea09f119b965fc148b1f9d8ba -r 4eeb12e5205ba4ac8ffbd9544ccfc3a6481be3c4 yt/utilities/cosmology.py
--- a/yt/utilities/cosmology.py
+++ b/yt/utilities/cosmology.py
@@ -4,7 +4,6 @@
 and featuring time and redshift conversion functions from Enzo.
 
 """
-from __future__ import print_function
 
 #-----------------------------------------------------------------------------
 # Copyright (c) 2013-2014, yt Development Team.
@@ -58,7 +57,7 @@
 
     >>> from yt.utilities.cosmology import Cosmology
     >>> co = Cosmology()
-    >>> print co.hubble_time(0.0).in_units("Gyr")
+    >>> print(co.hubble_time(0.0).in_units("Gyr"))
     
     """
     def __init__(self, hubble_constant = 0.71,
@@ -104,8 +103,9 @@
         Examples
         --------
 
+        >>> from yt.utilities.cosmology import Cosmology
         >>> co = Cosmology()
-        >>> print co.comoving_radial_distance(0., 1.).in_units("Mpccm")
+        >>> print(co.comoving_radial_distance(0., 1.).in_units("Mpccm"))
         
         """
         return (self.hubble_distance() *
@@ -127,8 +127,9 @@
         Examples
         --------
 
+        >>> from yt.utilities.cosmology import Cosmology
         >>> co = Cosmology()
-        >>> print co.comoving_transverse_distance(0., 1.).in_units("Mpccm")
+        >>> print(co.comoving_transverse_distance(0., 1.).in_units("Mpccm"))
         
         """
         if (self.omega_curvature > 0):
@@ -161,8 +162,9 @@
         Examples
         --------
 
+        >>> from yt.utilities.cosmology import Cosmology
         >>> co = Cosmology()
-        >>> print co.comoving_volume(0., 1.).in_units("Gpccm**3")
+        >>> print(co.comoving_volume(0., 1.).in_units("Gpccm**3"))
 
         """
         if (self.omega_curvature > 0):
@@ -209,8 +211,9 @@
         Examples
         --------
 
+        >>> from yt.utilities.cosmology import Cosmology
         >>> co = Cosmology()
-        >>> print co.angular_diameter_distance(0., 1.).in_units("Mpc")
+        >>> print(co.angular_diameter_distance(0., 1.).in_units("Mpc"))
         
         """
         
@@ -232,8 +235,9 @@
         Examples
         --------
 
+        >>> from yt.utilities.cosmology import Cosmology
         >>> co = Cosmology()
-        >>> print co.angular_scale(0., 1.).in_units("kpc / arcsec")
+        >>> print(co.angular_scale(0., 1.).in_units("kpc / arcsec"))
         
         """
 
@@ -256,8 +260,9 @@
         Examples
         --------
 
+        >>> from yt.utilities.cosmology import Cosmology
         >>> co = Cosmology()
-        >>> print co.luminosity_distance(0., 1.).in_units("Mpc")
+        >>> print(co.luminosity_distance(0., 1.).in_units("Mpc"))
         
         """
 
@@ -279,8 +284,9 @@
         Examples
         --------
 
+        >>> from yt.utilities.cosmology import Cosmology
         >>> co = Cosmology()
-        >>> print co.lookback_time(0., 1.).in_units("Gyr")
+        >>> print(co.lookback_time(0., 1.).in_units("Gyr"))
 
         """
         return (trapzint(self.age_integrand, z_i, z_f) / \
@@ -301,8 +307,9 @@
         Examples
         --------
 
+        >>> from yt.utilities.cosmology import Cosmology
         >>> co = Cosmology()
-        >>> print co.hubble_time(0.).in_units("Gyr")
+        >>> print(co.hubble_time(0.).in_units("Gyr"))
 
         See Also
         --------
@@ -326,9 +333,10 @@
         Examples
         --------
 
+        >>> from yt.utilities.cosmology import Cosmology
         >>> co = Cosmology()
-        >>> print co.critical_density(0.).in_units("g/cm**3")
-        >>> print co.critical_density(0).in_units("Msun/Mpc**3")
+        >>> print(co.critical_density(0.).in_units("g/cm**3"))
+        >>> print(co.critical_density(0).in_units("Msun/Mpc**3"))
         
         """
         return (3.0 / 8.0 / np.pi * 
@@ -348,8 +356,9 @@
         Examples
         --------
 
+        >>> from yt.utilities.cosmology import Cosmology
         >>> co = Cosmology()
-        >>> print co.hubble_parameter(1.0).in_units("km/s/Mpc")
+        >>> print(co.hubble_parameter(1.0).in_units("km/s/Mpc"))
 
         """
         return self.hubble_constant.in_base(self.unit_system) * self.expansion_factor(z)
@@ -393,8 +402,9 @@
         Examples
         --------
 
+        >>> from yt.utilities.cosmology import Cosmology
         >>> co = Cosmology()
-        >>> print co.z_from_t(4.e17)
+        >>> print(co.z_from_t(4.e17))
 
         """
 
@@ -484,8 +494,9 @@
         Examples
         --------
 
+        >>> from yt.utilities.cosmology import Cosmology
         >>> co = Cosmology()
-        >>> print co.t_from_z(0.).in_units("Gyr")
+        >>> print(co.t_from_z(0.).in_units("Gyr"))
 
         See Also
         --------

diff -r 8ab64d38bc0a2a9ea09f119b965fc148b1f9d8ba -r 4eeb12e5205ba4ac8ffbd9544ccfc3a6481be3c4 yt/visualization/plot_modifications.py
--- a/yt/visualization/plot_modifications.py
+++ b/yt/visualization/plot_modifications.py
@@ -156,6 +156,9 @@
                                   "need to be in 3D")
             coord = self.project_coords(plot, coord)
             coord = self.convert_to_plot(plot, coord)
+            # Convert coordinates from a tuple of ndarray to a tuple of floats
+            # since not all callbacks are OK with ndarrays as coords (eg arrow)
+            coord = (coord[0][0], coord[1][0])
         # if in plot coords, define the transform correctly
         if coord_system == "data" or coord_system == "plot":
             self.transform = plot._axes.transData
@@ -891,11 +894,23 @@
 
 class ArrowCallback(PlotCallback):
     """
-    annotate_arrow(pos, length=0.03, coord_system='data', plot_args=None):
+    annotate_arrow(pos, length=0.03, width=0.003, head_length=None,
+                   head_width=0.02, starting_pos=None,
+                   coord_system='data', plot_args=None):
 
     Overplot an arrow pointing at a position for highlighting a specific
-    feature.  Arrow points from lower left to the designated position with
-    arrow length "length".
+    feature.  By default, arrow points from lower left to the designated
+    position "pos" with arrow length "length".  Alternatively, if
+    "starting_pos" is set, arrow will stretch from "starting_pos" to "pos"
+    and "length" will be disregarded.
+
+    "coord_system" keyword refers to positions set in "pos" arg and
+    "starting_pos" keyword, which by default are in data coordinates.
+
+    "length", "width", "head_length", and "head_width" keywords for the arrow
+    are all in axis units, ie relative to the size of the plot axes as 1,
+    even if the position of the arrow is set relative to another coordinate
+    system.
 
     Parameters
     ----------
@@ -904,6 +919,24 @@
 
     length : float, optional
         The length, in axis units, of the arrow.
+        Default: 0.03
+
+    width : float, optional
+        The width, in axis units, of the tail line of the arrow.
+        Default: 0.003
+
+    head_length : float, optional
+        The length, in axis units, of the head of the arrow.  If set
+        to None, use 1.5*head_width
+        Default: None
+
+    head_width : float, optional
+        The width, in axis units, of the head of the arrow.
+        Default: 0.02
+
+    starting_pos : 2- or 3-element tuple, list, or array, optional
+        These are the coordinates from which the arrow starts towards its
+        point.  Not compatible with 'length' kwarg.
 
     coord_system : string, optional
         This string defines the coordinate system of the coordinates of pos
@@ -921,7 +954,7 @@
 
     plot_args : dictionary, optional
         This dictionary is passed to the MPL arrow function for generating
-        the arrow.  By default, it is: {'color':'white', 'linewidth':2}
+        the arrow.  By default, it is: {'color':'white'}
 
     Examples
     --------
@@ -938,18 +971,23 @@
     >>> import yt
     >>> ds = yt.load('IsolatedGalaxy/galaxy0030/galaxy0030')
     >>> s = yt.SlicePlot(ds, 'z', 'density')
-    >>> s.annotate_arrow([0.1, -0.1, length=0.06, coord_system='plot',
+    >>> s.annotate_arrow([0.1, -0.1], length=0.06, coord_system='plot',
     ...                  plot_args={'color':'red'})
     >>> s.save()
 
     """
     _type_name = "arrow"
-    def __init__(self, pos, code_size=None, length=0.03, coord_system='data',
-                 plot_args=None):
-        def_plot_args = {'color':'white', 'linewidth':2}
+    def __init__(self, pos, code_size=None, length=0.03, width=0.0001,
+                 head_width=0.01, head_length=0.01,
+                 starting_pos=None, coord_system='data', plot_args=None):
+        def_plot_args = {'color':'white'}
         self.pos = pos
         self.code_size = code_size
         self.length = length
+        self.width = width
+        self.head_width = head_width
+        self.head_length = head_length
+        self.starting_pos = starting_pos
         self.coord_system = coord_system
         self.transform = None
         if plot_args is None: plot_args = def_plot_args
@@ -960,7 +998,13 @@
                                coord_system=self.coord_system)
         xx0, xx1 = plot._axes.get_xlim()
         yy0, yy1 = plot._axes.get_ylim()
-
+        # normalize all of the kwarg lengths to the plot size
+        plot_diag = ((yy1-yy0)**2 + (xx1-xx0)**2)**(0.5)
+        self.length *= plot_diag
+        self.width *= plot_diag
+        self.head_width *= plot_diag
+        if self.head_length is not None:
+            self.head_length *= plot_diag
         if self.code_size is not None:
             warnings.warn("The code_size keyword is deprecated.  Please use "
                           "the length keyword in 'axis' units instead. "
@@ -971,13 +1015,25 @@
             self.code_size = self.code_size * self.pixel_scale(plot)[0]
             dx = dy = self.code_size
         else:
-            dx = (xx1-xx0) * self.length
-            dy = (yy1-yy0) * self.length
+            if self.starting_pos is not None:
+                start_x,start_y = self.sanitize_coord_system(plot,
+                                       self.starting_pos,
+                                       coord_system=self.coord_system)
+                dx = x - start_x
+                dy = y - start_y
+            else:
+                dx = (xx1-xx0) * 2**(0.5) * self.length
+                dy = (yy1-yy0) * 2**(0.5) * self.length
+        # If the arrow is 0 length
+        if dx == dy == 0:
+            warnings.warn("The arrow has zero length.  Not annotating.")
+            return
         plot._axes.hold(True)
-        from matplotlib.patches import Arrow
-        arrow = Arrow(x-dx, y-dy, dx, dy, width=dx,
-                      transform=self.transform, **self.plot_args)
-        plot._axes.add_patch(arrow)
+        plot._axes.arrow(x-dx, y-dy, dx, dy, width=self.width,
+                         head_width=self.head_width,
+                         head_length=self.head_length,
+                         transform=self.transform,
+                         length_includes_head=True, **self.plot_args)
         plot._axes.set_xlim(xx0,xx1)
         plot._axes.set_ylim(yy0,yy1)
         plot._axes.hold(False)
@@ -1823,8 +1879,8 @@
     axis length.  Additional customization of the scale bar is possible by
     adjusting the text_args and size_bar_args dictionaries.  The text_args
     dictionary accepts matplotlib's font_properties arguments to override
-    the default font_properties for the current plot.  The size_bar_args 
-    dictionary accepts keyword arguments for the AnchoredSizeBar class in 
+    the default font_properties for the current plot.  The size_bar_args
+    dictionary accepts keyword arguments for the AnchoredSizeBar class in
     matplotlib's axes_grid toolkit.
 
     Parameters
@@ -1904,7 +1960,7 @@
     _type_name = "scale"
     def __init__(self, corner='lower_right', coeff=None, unit=None, pos=None,
                  max_frac=0.16, min_frac=0.015, coord_system='axis',
-                 text_args=None, size_bar_args=None, draw_inset_box=False, 
+                 text_args=None, size_bar_args=None, draw_inset_box=False,
                  inset_box_args=None):
 
         def_size_bar_args = {
@@ -1997,7 +2053,7 @@
         # FontProperties instances use set_<property>() setter functions
         for key, val in self.text_args.items():
             setter_func = "set_"+key
-            try: 
+            try:
                 getattr(fontproperties, setter_func)(val)
             except AttributeError:
                 raise AttributeError("Cannot set text_args keyword " \
@@ -2028,6 +2084,9 @@
     Adds a line representing the projected path of a ray across the plot.
     The ray can be either a YTOrthoRay, YTRay, or a LightRay object.
     annotate_ray() will properly account for periodic rays across the volume.
+    If arrow is set to True, uses the MPL.pyplot.arrow function, otherwise
+    uses the MPL.pyplot.plot function to plot a normal line.  Adjust
+    plot_args accordingly.
 
     Parameters
     ----------
@@ -2039,6 +2098,11 @@
         object, it will only plot the segment of the LightRay that intersects
         the dataset currently displayed.
 
+    arrow : boolean, optional
+        Whether or not to place an arrowhead on the front of the ray to denote
+        direction
+        Default: False
+
     plot_args : dictionary, optional
         A dictionary of any arbitrary parameters to be passed to the Matplotlib
         line object.  Defaults: {'color':'white', 'linewidth':2}.
@@ -2069,10 +2133,11 @@
 
     """
     _type_name = "ray"
-    def __init__(self, ray, plot_args=None):
+    def __init__(self, ray, arrow=False, plot_args=None):
         PlotCallback.__init__(self)
         def_plot_args = {'color':'white', 'linewidth':2}
         self.ray = ray
+        self.arrow = arrow
         if plot_args is None: plot_args = def_plot_args
         self.plot_args = plot_args
 
@@ -2142,12 +2207,23 @@
         else:
             segments = [[start_coord, end_coord]]
 
-        for segment in segments:
-            lcb = LinePlotCallback(segment[0], segment[1],
-                                   coord_system='data',
-                                   plot_args=self.plot_args)
-            lcb(plot)
-
+        # To assure that the last ray segment has an arrow if so desired
+        # and all other ray segments are lines
+        for segment in segments[:-1]:
+            cb = LinePlotCallback(segment[0], segment[1],
+                                  coord_system='data',
+                                  plot_args=self.plot_args)
+            cb(plot)
+        segment = segments[-1]
+        if self.arrow:
+            cb = ArrowCallback(segment[1], starting_pos=segment[0],
+                               coord_system='data',
+                               plot_args=self.plot_args)
+        else:
+           cb = LinePlotCallback(segment[0], segment[1],
+                               coord_system='data',
+                               plot_args=self.plot_args)
+        cb(plot)
         return plot
 
 class LineIntegralConvolutionCallback(PlotCallback):
@@ -2157,7 +2233,7 @@
                                        cmap='binary', alpha=0.8,
                                        const_alpha=False):
 
-    Add the line integral convolution to the plot for vector fields 
+    Add the line integral convolution to the plot for vector fields
     visualization. Two component of vector fields needed to be provided
     (i.e., velocity_x and velocity_y, magentic_field_x and magnetic_field_y).
 
@@ -2254,7 +2330,7 @@
         lic_data_clip = np.clip(lic_data,self.lim[0],self.lim[1])
 
         if self.const_alpha:
-            plot._axes.imshow(lic_data_clip, extent=extent, cmap=self.cmap, 
+            plot._axes.imshow(lic_data_clip, extent=extent, cmap=self.cmap,
                               alpha=self.alpha)
         else:
             lic_data_rgba = cm.ScalarMappable(norm=None, cmap=self.cmap).\


https://bitbucket.org/yt_analysis/yt/commits/068d09108046/
Changeset:   068d09108046
Branch:      yt
User:        MatthewTurk
Date:        2016-06-02 16:49:11+00:00
Summary:     Merging from upstream
Affected #:  346 files

diff -r 4eeb12e5205ba4ac8ffbd9544ccfc3a6481be3c4 -r 068d091080460de4e890c9d3dcc492f1706c5d92 .hgchurn
--- a/.hgchurn
+++ b/.hgchurn
@@ -1,6 +1,6 @@
 stephenskory at yahoo.com = s at skory.us
 "Stephen Skory stephenskory at yahoo.com" = s at skory.us
-yuan at astro.columbia.edu = bear0980 at gmail.com
+bear0980 at gmail.com = yuan at astro.columbia.edu
 juxtaposicion at gmail.com = cemoody at ucsc.edu
 chummels at gmail.com = chummels at astro.columbia.edu
 jwise at astro.princeton.edu = jwise at physics.gatech.edu
@@ -19,7 +19,6 @@
 sername=kayleanelson = kaylea.nelson at yale.edu
 kayleanelson = kaylea.nelson at yale.edu
 jcforbes at ucsc.edu = jforbes at ucolick.org
-ngoldbau at ucsc.edu = goldbaum at ucolick.org
 biondo at wisc.edu = Biondo at wisc.edu
 samgeen at googlemail.com = samgeen at gmail.com
 fbogert = fbogert at ucsc.edu
@@ -39,4 +38,12 @@
 jnaiman at ucolick.org = jnaiman
 migueld.deval = miguel at archlinux.net
 slevy at ncsa.illinois.edu = salevy at illinois.edu
-malzraa at gmail.com = kellerbw at mcmaster.ca
\ No newline at end of file
+malzraa at gmail.com = kellerbw at mcmaster.ca
+None = convert-repo
+dfenn = df11c at my.fsu.edu
+langmm = langmm.astro at gmail.com
+jmt354 = jmtomlinson95 at gmail.com
+desika = dnarayan at haverford.edu
+Ben Thompson = bthompson2090 at gmail.com
+goldbaum at ucolick.org = ngoldbau at illinois.edu
+ngoldbau at ucsc.edu = ngoldbau at illinois.edu

diff -r 4eeb12e5205ba4ac8ffbd9544ccfc3a6481be3c4 -r 068d091080460de4e890c9d3dcc492f1706c5d92 .hgignore
--- a/.hgignore
+++ b/.hgignore
@@ -62,6 +62,7 @@
 yt/utilities/lib/write_array.c
 syntax: glob
 *.pyc
+*.pyd
 .*.swp
 *.so
 .idea/*

diff -r 4eeb12e5205ba4ac8ffbd9544ccfc3a6481be3c4 -r 068d091080460de4e890c9d3dcc492f1706c5d92 CREDITS
--- a/CREDITS
+++ b/CREDITS
@@ -10,6 +10,7 @@
                 Alex Bogert (fbogert at ucsc.edu)
                 André-Patrick Bubel (code at andre-bubel.de)
                 Pengfei Chen (madcpf at gmail.com)
+                Yi-Hao Chen (yihaochentw at gmail.com)
                 David Collins (dcollins4096 at gmail.com)
                 Brian Crosby (crosby.bd at gmail.com)
                 Andrew Cunningham (ajcunn at gmail.com)
@@ -25,10 +26,12 @@
                 William Gray (graywilliamj at gmail.com)
                 Markus Haider (markus.haider at uibk.ac.at)
                 Eric Hallman (hallman13 at gmail.com)
+                David Hannasch (David.A.Hannasch at gmail.com)
                 Cameron Hummels (chummels at gmail.com)
                 Anni Järvenpää (anni.jarvenpaa at gmail.com)
                 Allyson Julian (astrohckr at gmail.com)
                 Christian Karch (chiffre at posteo.de)
+                Maximilian Katz (maximilian.katz at stonybrook.edu)
                 Ben W. Keller (kellerbw at mcmaster.ca)
                 Ji-hoon Kim (me at jihoonkim.org)
                 Steffen Klemer (sklemer at phys.uni-goettingen.de)
@@ -60,6 +63,7 @@
                 Anna Rosen (rosen at ucolick.org)
                 Chuck Rozhon (rozhon2 at illinois.edu)
                 Douglas Rudd (drudd at uchicago.edu)
+                Hsi-Yu Schive (hyschive at gmail.com)
                 Anthony Scopatz (scopatz at gmail.com)
                 Noel Scudder (noel.scudder at stonybrook.edu)
                 Pat Shriwise (shriwise at wisc.edu)
@@ -75,6 +79,7 @@
                 Elizabeth Tasker (tasker at astro1.sci.hokudai.ac.jp)
                 Benjamin Thompson (bthompson2090 at gmail.com)
                 Robert Thompson (rthompsonj at gmail.com)
+                Joseph Tomlinson (jmtomlinson95 at gmail.com)
                 Stephanie Tonnesen (stonnes at gmail.com)
                 Matthew Turk (matthewturk at gmail.com)
                 Rich Wagner (rwagner at physics.ucsd.edu)

diff -r 4eeb12e5205ba4ac8ffbd9544ccfc3a6481be3c4 -r 068d091080460de4e890c9d3dcc492f1706c5d92 MANIFEST.in
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -1,4 +1,4 @@
-include README* CREDITS COPYING.txt CITATION requirements.txt optional-requirements.txt setupext.py
+include README* CREDITS COPYING.txt CITATION requirements.txt optional-requirements.txt setupext.py CONTRIBUTING.rst
 include yt/visualization/mapserver/html/map_index.html
 include yt/visualization/mapserver/html/leaflet/*.css
 include yt/visualization/mapserver/html/leaflet/*.js
@@ -12,4 +12,5 @@
 prune doc/source/reference/api/generated
 prune doc/build
 recursive-include yt/analysis_modules/halo_finding/rockstar *.py *.pyx
+recursive-include yt/visualization/volume_rendering/shaders *.fragmentshader *.vertexshader
 prune yt/frontends/_skeleton

diff -r 4eeb12e5205ba4ac8ffbd9544ccfc3a6481be3c4 -r 068d091080460de4e890c9d3dcc492f1706c5d92 appveyor.yml
--- /dev/null
+++ b/appveyor.yml
@@ -0,0 +1,38 @@
+# AppVeyor.com is a Continuous Integration service to build and run tests under
+# Windows
+
+environment:
+
+  global:
+      PYTHON: "C:\\Miniconda-x64"
+
+  matrix:
+
+      - PYTHON_VERSION: "2.7"
+
+      - PYTHON_VERSION: "3.5"
+
+
+platform:
+    -x64
+
+install:
+    - "SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%"
+
+    # Install the build and runtime dependencies of the project.
+    # Create a conda environment
+    - "conda create -q --yes -n test python=%PYTHON_VERSION%"
+    - "activate test"
+
+    # Check that we have the expected version of Python
+    - "python --version"
+
+    # Install specified version of numpy and dependencies
+    - "conda install -q --yes numpy nose setuptools ipython Cython sympy h5py matplotlib"
+    - "python setup.py develop"
+
+# Not a .NET project
+build: false
+
+test_script:
+  - "nosetests -e test_all_fields ."

diff -r 4eeb12e5205ba4ac8ffbd9544ccfc3a6481be3c4 -r 068d091080460de4e890c9d3dcc492f1706c5d92 doc/cheatsheet.tex
--- a/doc/cheatsheet.tex
+++ b/doc/cheatsheet.tex
@@ -7,12 +7,12 @@
 
 % To make this come out properly in landscape mode, do one of the following
 % 1.
-%  pdflatex latexsheet.tex
+%  pdflatex cheatsheet.tex
 %
 % 2.
-%  latex latexsheet.tex
-%  dvips -P pdf  -t landscape latexsheet.dvi
-%  ps2pdf latexsheet.ps
+%  latex cheatsheet.tex
+%  dvips -P pdf  -t landscape cheatsheet.dvi
+%  ps2pdf cheatsheet.ps
 
 
 % If you're reading this, be prepared for confusion.  Making this was
@@ -45,7 +45,7 @@
 
 % Turn off header and footer
 \pagestyle{empty}
- 
+
 
 % Redefine section commands to use less space
 \makeatletter
@@ -117,26 +117,26 @@
 including a list of the available flags.
 
 \texttt{iyt}\textemdash\ Load yt and IPython. \\
-\texttt{yt load} {\it dataset}   \textemdash\ Load a single dataset.  \\
+\texttt{yt load} \textit{dataset}   \textemdash\ Load a single dataset.  \\
 \texttt{yt help} \textemdash\ Print yt help information. \\
-\texttt{yt stats} {\it dataset} \textemdash\ Print stats of a dataset. \\
+\texttt{yt stats} \textit{dataset} \textemdash\ Print stats of a dataset. \\
 \texttt{yt update} \textemdash\ Update yt to most recent version.\\
 \texttt{yt update --all} \textemdash\ Update yt and dependencies to most recent version. \\
 \texttt{yt version} \textemdash\ yt installation information. \\
 \texttt{yt notebook} \textemdash\ Run the IPython notebook server. \\
-\texttt{yt upload\_image} {\it image.png} \textemdash\ Upload PNG image to imgur.com. \\
-\texttt{yt upload\_notebook} {\it notebook.nb} \textemdash\ Upload IPython notebook to hub.yt-project.org.\\
-\texttt{yt plot} {\it dataset} \textemdash\ Create a set of images.\\
-\texttt{yt render} {\it dataset} \textemdash\ Create a simple
+\texttt{yt upload\_image} \textit{image.png} \textemdash\ Upload PNG image to imgur.com. \\
+\texttt{yt upload\_notebook} \textit{notebook.nb} \textemdash\ Upload IPython notebook to hub.yt-project.org.\\
+\texttt{yt plot} \textit{dataset} \textemdash\ Create a set of images.\\
+\texttt{yt render} \textit{dataset} \textemdash\ Create a simple
  volume rendering. \\
-\texttt{yt mapserver} {\it dataset} \textemdash\ View a plot/projection in a Gmaps-like
+\texttt{yt mapserver} \textit{dataset} \textemdash\ View a plot/projection in a Gmaps-like
  interface. \\
-\texttt{yt pastebin} {\it text.out} \textemdash\ Post text to the pastebin at
- paste.yt-project.org. \\ 
-\texttt{yt pastebin\_grab} {\it identifier} \textemdash\ Print content of pastebin to
+\texttt{yt pastebin} \textit{text.out} \textemdash\ Post text to the pastebin at
+ paste.yt-project.org. \\
+\texttt{yt pastebin\_grab} \textit{identifier} \textemdash\ Print content of pastebin to
  STDOUT. \\
 \texttt{yt bugreport} \textemdash\ Report a yt bug. \\
-\texttt{yt hop} {\it dataset} \textemdash\  Run hop on a dataset. \\
+\texttt{yt hop} \textit{dataset} \textemdash\  Run hop on a dataset. \\
 
 \subsection{yt Imports}
 In order to use yt, Python must load the relevant yt modules into memory.
@@ -144,15 +144,15 @@
 used as part of a script.
 \newlength{\MyLen}
 \settowidth{\MyLen}{\texttt{letterpaper}/\texttt{a4paper} \ }
-\texttt{import yt}  \textemdash\ 
+\texttt{import yt}  \textemdash\
 Load yt. \\
-\texttt{from yt.config import ytcfg}  \textemdash\ 
+\texttt{from yt.config import ytcfg}  \textemdash\
 Used to set yt configuration options.
 If used, must be called before importing any other module.\\
-\texttt{from yt.analysis\_modules.\emph{halo\_finding}.api import \textasteriskcentered}  \textemdash\ 
+\texttt{from yt.analysis\_modules.\emph{halo\_finding}.api import \textasteriskcentered}  \textemdash\
 Load halo finding modules. Other modules
-are loaded in a similar way by swapping the 
-{\em emphasized} text.
+are loaded in a similar way by swapping the
+\emph{emphasized} text.
 See the \textbf{Analysis Modules} section for a listing and short descriptions of each.
 
 \subsection{YTArray}
@@ -163,32 +163,32 @@
 very brief list of some useful ones.
 \settowidth{\MyLen}{\texttt{multicol} }\\
 \texttt{v = a.in\_cgs()} \textemdash\ Return the array in CGS units \\
-\texttt{v = a.in\_units('Msun/pc**3')} \textemdash\ Return the array in solar masses per cubic parsec \\ 
+\texttt{v = a.in\_units('Msun/pc**3')} \textemdash\ Return the array in solar masses per cubic parsec \\
 \texttt{v = a.max(), a.min()} \textemdash\ Return maximum, minimum of \texttt{a}. \\
 \texttt{index = a.argmax(), a.argmin()} \textemdash\ Return index of max,
 min value of \texttt{a}.\\
-\texttt{v = a[}{\it index}\texttt{]} \textemdash\ Select a single value from \texttt{a} at location {\it index}.\\
-\texttt{b = a[}{\it i:j}\texttt{]} \textemdash\ Select the slice of values from
+\texttt{v = a[}\textit{index}\texttt{]} \textemdash\ Select a single value from \texttt{a} at location \textit{index}.\\
+\texttt{b = a[}\textit{i:j}\texttt{]} \textemdash\ Select the slice of values from
 \texttt{a} between
-locations {\it i} to {\it j-1} saved to a new Numpy array \texttt{b} with length {\it j-i}. \\
+locations \textit{i} to \textit{j-1} saved to a new Numpy array \texttt{b} with length \textit{j-i}. \\
 \texttt{sel = (a > const)} \textemdash\ Create a new boolean Numpy array
 \texttt{sel}, of the same shape as \texttt{a},
 that marks which values of \texttt{a > const}. Other operators (e.g. \textless, !=, \%) work as well.\\
 \texttt{b = a[sel]} \textemdash\ Create a new Numpy array \texttt{b} made up of
 elements from \texttt{a} that correspond to elements of \texttt{sel}
-that are {\it True}. In the above example \texttt{b} would be all elements of \texttt{a} that are greater than \texttt{const}.\\
-\texttt{a.write\_hdf5({\it filename.h5})} \textemdash\ Save \texttt{a} to the hdf5 file {\it filename.h5}.\\
+that are \textit{True}. In the above example \texttt{b} would be all elements of \texttt{a} that are greater than \texttt{const}.\\
+\texttt{a.write\_hdf5(\textit{filename.h5})} \textemdash\ Save \texttt{a} to the hdf5 file \textit{filename.h5}.\\
 
 \subsection{IPython Tips}
 \settowidth{\MyLen}{\texttt{multicol} }
 These tips work if IPython has been loaded, typically either by invoking
 \texttt{iyt} or \texttt{yt load} on the command line, or using the IPython notebook (\texttt{yt notebook}).
 \texttt{Tab complete} \textemdash\ IPython will attempt to auto-complete a
-variable or function name when the \texttt{Tab} key is pressed, e.g. {\it HaloFi}\textendash\texttt{Tab} would auto-complete
-to {\it HaloFinder}. This also works with imports, e.g. {\it from numpy.random.}\textendash\texttt{Tab}
+variable or function name when the \texttt{Tab} key is pressed, e.g. \textit{HaloFi}\textendash\texttt{Tab} would auto-complete
+to \textit{HaloFinder}. This also works with imports, e.g. \textit{from numpy.random.}\textendash\texttt{Tab}
 would give you a list of random functions (note the trailing period before hitting \texttt{Tab}).\\
 \texttt{?, ??} \textemdash\ Appending one or two question marks at the end of any object gives you
-detailed information about it, e.g. {\it variable\_name}?.\\
+detailed information about it, e.g. \textit{variable\_name}?.\\
 Below a few IPython ``magics'' are listed, which are IPython-specific shortcut commands.\\
 \texttt{\%paste} \textemdash\ Paste content from the system clipboard into the IPython shell.\\
 \texttt{\%hist} \textemdash\ Print recent command history.\\
@@ -204,40 +204,40 @@
 
 \subsection{Load and Access Data}
 The first step in using yt is to reference a simulation snapshot.
-After that, simulation data is generally accessed in yt using {\it Data Containers} which are Python objects
+After that, simulation data is generally accessed in yt using \textit{Data Containers} which are Python objects
 that define a region of simulation space from which data should be selected.
 \settowidth{\MyLen}{\texttt{multicol} }
-\texttt{ds = yt.load(}{\it dataset}\texttt{)} \textemdash\   Reference a single snapshot.\\
+\texttt{ds = yt.load(}\textit{dataset}\texttt{)} \textemdash\   Reference a single snapshot.\\
 \texttt{dd = ds.all\_data()} \textemdash\ Select the entire volume.\\
-\texttt{a = dd[}{\it field\_name}\texttt{]} \textemdash\ Copies the contents of {\it field} into the
+\texttt{a = dd[}\textit{field\_name}\texttt{]} \textemdash\ Copies the contents of \textit{field} into the
 YTArray \texttt{a}. Similarly for other data containers.\\
 \texttt{ds.field\_list} \textemdash\ A list of available fields in the snapshot. \\
 \texttt{ds.derived\_field\_list} \textemdash\ A list of available derived fields
 in the snapshot. \\
 \texttt{val, loc = ds.find\_max("Density")} \textemdash\ Find the \texttt{val}ue of
 the maximum of the field \texttt{Density} and its \texttt{loc}ation. \\
-\texttt{sp = ds.sphere(}{\it cen}\texttt{,}{\it radius}\texttt{)} \textemdash\   Create a spherical data 
-container. {\it cen} may be a coordinate, or ``max'' which 
-centers on the max density point. {\it radius} may be a float in 
-code units or a tuple of ({\it length, unit}).\\
+\texttt{sp = ds.sphere(}\textit{cen}\texttt{,}\textit{radius}\texttt{)} \textemdash\   Create a spherical data
+container. \textit{cen} may be a coordinate, or ``max'' which
+centers on the max density point. \textit{radius} may be a float in
+code units or a tuple of (\textit{length, unit}).\\
 
-\texttt{re = ds.region({\it cen}, {\it left edge}, {\it right edge})} \textemdash\ Create a
-rectilinear data container. {\it cen} is required but not used.
-{\it left} and {\it right edge} are coordinate values that define the region.
+\texttt{re = ds.region(\textit{cen}, \textit{left edge}, \textit{right edge})} \textemdash\ Create a
+rectilinear data container. \textit{cen} is required but not used.
+\textit{left} and \textit{right edge} are coordinate values that define the region.
 
-\texttt{di = ds.disk({\it cen}, {\it normal}, {\it radius}, {\it height})} \textemdash\ 
-Create a cylindrical data container centered at {\it cen} along the 
-direction set by {\it normal},with total length
- 2$\times${\it height} and with radius {\it radius}. \\
- 
-\texttt{ds.save\_object(sp, {\it ``sp\_for\_later''})} \textemdash\ Save an object (\texttt{sp}) for later use.\\
-\texttt{sp = ds.load\_object({\it ``sp\_for\_later''})} \textemdash\ Recover a saved object.\\
+\texttt{di = ds.disk(\textit{cen}, \textit{normal}, \textit{radius}, \textit{height})} \textemdash\
+Create a cylindrical data container centered at \textit{cen} along the
+direction set by \textit{normal},with total length
+ 2$\times$\textit{height} and with radius \textit{radius}. \\
+
+\texttt{ds.save\_object(sp, \textit{``sp\_for\_later''})} \textemdash\ Save an object (\texttt{sp}) for later use.\\
+\texttt{sp = ds.load\_object(\textit{``sp\_for\_later''})} \textemdash\ Recover a saved object.\\
 
 
 \subsection{Defining New Fields}
-\texttt{yt} expects on-disk fields, fields generated on-demand and in-memory. 
+\texttt{yt} expects on-disk fields, fields generated on-demand and in-memory.
 Field can either be created before a dataset is loaded using \texttt{add\_field}:
-\texttt{def \_metal\_mass({\it field},{\it data})}\\
+\texttt{def \_metal\_mass(\textit{field},\textit{data})}\\
 \texttt{\hspace{4 mm} return data["metallicity"]*data["cell\_mass"]}\\
 \texttt{add\_field("metal\_mass", units='g', function=\_metal\_mass)}\\
 Or added to an existing dataset using \texttt{ds.add\_field}:
@@ -245,34 +245,34 @@
 
 \subsection{Slices and Projections}
 \settowidth{\MyLen}{\texttt{multicol} }
-\texttt{slc = yt.SlicePlot(ds, {\it axis or normal vector}, {\it field}, {\it center=}, {\it width=}, {\it weight\_field=}, {\it additional parameters})} \textemdash\ Make a slice plot
-perpendicular to {\it axis} (specified via 'x', 'y', or 'z') or a normal vector for an off-axis slice of {\it field} weighted by {\it weight\_field} at (code-units) {\it center} with 
-{\it width} in code units or a (value, unit) tuple. Hint: try {\it yt.SlicePlot?} in IPython to see additional parameters.\\
-\texttt{slc.save({\it file\_prefix})} \textemdash\ Save the slice to a png with name prefix {\it file\_prefix}.
+\texttt{slc = yt.SlicePlot(ds, \textit{axis or normal vector}, \textit{field}, \textit{center=}, \textit{width=}, \textit{weight\_field=}, \textit{additional parameters})} \textemdash\ Make a slice plot
+perpendicular to \textit{axis} (specified via 'x', 'y', or 'z') or a normal vector for an off-axis slice of \textit{field} weighted by \textit{weight\_field} at (code-units) \textit{center} with
+\textit{width} in code units or a (value, unit) tuple. Hint: try \textit{yt.SlicePlot?} in IPython to see additional parameters.\\
+\texttt{slc.save(\textit{file\_prefix})} \textemdash\ Save the slice to a png with name prefix \textit{file\_prefix}.
 \texttt{.save()} works similarly for the commands below.\\
 
-\texttt{prj = yt.ProjectionPlot(ds, {\it axis}, {\it field}, {\it addit. params})} \textemdash\ Make a projection. \\
-\texttt{prj = yt.OffAxisProjectionPlot(ds, {\it normal}, {\it fields}, {\it center=}, {\it width=}, {\it depth=},{\it north\_vector=},{\it weight\_field=})} \textemdash Make an off axis projection. Note this takes an array of fields. \\
+\texttt{prj = yt.ProjectionPlot(ds, \textit{axis}, \textit{field}, \textit{addit. params})} \textemdash\ Make a projection. \\
+\texttt{prj = yt.OffAxisProjectionPlot(ds, \textit{normal}, \textit{fields}, \textit{center=}, \textit{width=}, \textit{depth=},\textit{north\_vector=},\textit{weight\_field=})} \textemdash Make an off axis projection. Note this takes an array of fields. \\
 
 \subsection{Plot Annotations}
 \settowidth{\MyLen}{\texttt{multicol} }
-Plot callbacks are functions itemized in a registry that is attached to every plot object. They can be accessed and then called like \texttt{ prj.annotate\_velocity(factor=16, normalize=False)}. Most callbacks also accept a {\it plot\_args} dict that is fed to matplotlib annotator. \\
-\texttt{velocity({\it factor=},{\it scale=},{\it scale\_units=}, {\it normalize=})} \textemdash\ Uses field "x-velocity" to draw quivers\\
-\texttt{magnetic\_field({\it factor=},{\it scale=},{\it scale\_units=}, {\it normalize=})} \textemdash\ Uses field "Bx" to draw quivers\\
-\texttt{quiver({\it field\_x},{\it field\_y},{\it factor=},{\it scale=},{\it scale\_units=}, {\it normalize=})} \\
-\texttt{contour({\it field=},{\it ncont=},{\it factor=},{\it clim=},{\it take\_log=}, {\it additional parameters})} \textemdash Plots a number of contours {\it ncont} to interpolate {\it field} optionally using {\it take\_log}, upper and lower {\it c}ontour{\it lim}its and {\it factor} number of points in the interpolation.\\
-\texttt{grids({\it alpha=}, {\it draw\_ids=}, {\it periodic=}, {\it min\_level=}, {\it max\_level=})} \textemdash Add grid boundaries. \\
-\texttt{streamlines({\it field\_x},{\it field\_y},{\it factor=},{\it density=})}\\
-\texttt{clumps({\it clumplist})} \textemdash\ Generate {\it clumplist} using the clump finder and plot. \\
-\texttt{arrow({\it pos}, {\it code\_size})} Add an arrow at a {\it pos}ition. \\
-\texttt{point({\it pos}, {\it text})} \textemdash\ Add text at a {\it pos}ition. \\
-\texttt{marker({\it pos}, {\it marker=})} \textemdash\ Add a matplotlib-defined marker at a {\it pos}ition. \\
-\texttt{sphere({\it center}, {\it radius}, {\it text=})} \textemdash\ Draw a circle and append {\it text}.\\
-\texttt{hop\_circles({\it hop\_output}, {\it max\_number=}, {\it annotate=}, {\it min\_size=}, {\it max\_size=}, {\it font\_size=}, {\it print\_halo\_size=}, {\it fixed\_radius=}, {\it min\_mass=}, {\it print\_halo\_mass=}, {\it width=})} \textemdash\ Draw a halo, printing it's ID, mass, clipping halos depending on number of particles ({\it size}) and optionally fixing the drawn circle radius to be constant for all halos.\\
-\texttt{hop\_particles({\it hop\_output},{\it max\_number=},{\it p\_size=},\\
-{\it min\_size},{\it alpha=})} \textemdash\ Draw particle positions for member halos with a certain number of pixels per particle.\\
-\texttt{particles({\it width},{\it p\_size=},{\it col=}, {\it marker=}, {\it stride=}, {\it ptype=}, {\it stars\_only=}, {\it dm\_only=}, {\it minimum\_mass=}, {\it alpha=})}  \textemdash\  Draw particles of {\it p\_size} pixels in a slab of {\it width} with {\it col}or using a matplotlib {\it marker} plotting only every {\it stride} number of particles.\\
-\texttt{title({\it text})}\\
+Plot callbacks are functions itemized in a registry that is attached to every plot object. They can be accessed and then called like \texttt{ prj.annotate\_velocity(factor=16, normalize=False)}. Most callbacks also accept a \textit{plot\_args} dict that is fed to matplotlib annotator. \\
+\texttt{velocity(\textit{factor=},\textit{scale=},\textit{scale\_units=}, \textit{normalize=})} \textemdash\ Uses field "x-velocity" to draw quivers\\
+\texttt{magnetic\_field(\textit{factor=},\textit{scale=},\textit{scale\_units=}, \textit{normalize=})} \textemdash\ Uses field "Bx" to draw quivers\\
+\texttt{quiver(\textit{field\_x},\textit{field\_y},\textit{factor=},\textit{scale=},\textit{scale\_units=}, \textit{normalize=})} \\
+\texttt{contour(\textit{field=},\textit{ncont=},\textit{factor=},\textit{clim=},\textit{take\_log=}, \textit{additional parameters})} \textemdash Plots a number of contours \textit{ncont} to interpolate \textit{field} optionally using \textit{take\_log}, upper and lower \textit{c}ontour\textit{lim}its and \textit{factor} number of points in the interpolation.\\
+\texttt{grids(\textit{alpha=}, \textit{draw\_ids=}, \textit{periodic=}, \textit{min\_level=}, \textit{max\_level=})} \textemdash Add grid boundaries. \\
+\texttt{streamlines(\textit{field\_x},\textit{field\_y},\textit{factor=},\textit{density=})}\\
+\texttt{clumps(\textit{clumplist})} \textemdash\ Generate \textit{clumplist} using the clump finder and plot. \\
+\texttt{arrow(\textit{pos}, \textit{code\_size})} Add an arrow at a \textit{pos}ition. \\
+\texttt{point(\textit{pos}, \textit{text})} \textemdash\ Add text at a \textit{pos}ition. \\
+\texttt{marker(\textit{pos}, \textit{marker=})} \textemdash\ Add a matplotlib-defined marker at a \textit{pos}ition. \\
+\texttt{sphere(\textit{center}, \textit{radius}, \textit{text=})} \textemdash\ Draw a circle and append \textit{text}.\\
+\texttt{hop\_circles(\textit{hop\_output}, \textit{max\_number=}, \textit{annotate=}, \textit{min\_size=}, \textit{max\_size=}, \textit{font\_size=}, \textit{print\_halo\_size=}, \textit{fixed\_radius=}, \textit{min\_mass=}, \textit{print\_halo\_mass=}, \textit{width=})} \textemdash\ Draw a halo, printing it's ID, mass, clipping halos depending on number of particles (\textit{size}) and optionally fixing the drawn circle radius to be constant for all halos.\\
+\texttt{hop\_particles(\textit{hop\_output},\textit{max\_number=},\textit{p\_size=},\\
+\textit{min\_size},\textit{alpha=})} \textemdash\ Draw particle positions for member halos with a certain number of pixels per particle.\\
+\texttt{particles(\textit{width},\textit{p\_size=},\textit{col=}, \textit{marker=}, \textit{stride=}, \textit{ptype=}, \textit{stars\_only=}, \textit{dm\_only=}, \textit{minimum\_mass=}, \textit{alpha=})}  \textemdash\  Draw particles of \textit{p\_size} pixels in a slab of \textit{width} with \textit{col}or using a matplotlib \textit{marker} plotting only every \textit{stride} number of particles.\\
+\texttt{title(\textit{text})}\\
 
 \subsection{The $\sim$/.yt/ Directory}
 \settowidth{\MyLen}{\texttt{multicol} }
@@ -297,12 +297,12 @@
 
 
 \subsection{Parallel Analysis}
-\settowidth{\MyLen}{\texttt{multicol}} 
+\settowidth{\MyLen}{\texttt{multicol}}
 Nearly all of yt is parallelized using
-MPI.  The {\it mpi4py} package must be installed for parallelism in yt.  To
-install {\it pip install mpi4py} on the command line usually works.
+MPI\@.  The \textit{mpi4py} package must be installed for parallelism in yt.  To
+install \textit{pip install mpi4py} on the command line usually works.
 Execute python in parallel similar to this:\\
-{\it mpirun -n 12 python script.py}\\
+\textit{mpirun -n 12 python script.py}\\
 The file \texttt{script.py} must call the \texttt{yt.enable\_parallelism()} to
 turn on yt's parallelism.  If this doesn't happen, all cores will execute the
 same serial yt script.  This command may differ for each system on which you use
@@ -320,12 +320,12 @@
 \texttt{hg clone https://bitbucket.org/yt\_analysis/yt} \textemdash\ Clone a copy of yt. \\
 \texttt{hg status} \textemdash\ Files changed in working directory.\\
 \texttt{hg diff} \textemdash\ Print diff of all changed files in working directory. \\
-\texttt{hg diff -r{\it RevX} -r{\it RevY}} \textemdash\ Print diff of all changes between revision {\it RevX} and {\it RevY}.\\
+\texttt{hg diff -r\textit{RevX} -r\textit{RevY}} \textemdash\ Print diff of all changes between revision \textit{RevX} and \textit{RevY}.\\
 \texttt{hg log} \textemdash\ History of changes.\\
-\texttt{hg cat -r{\it RevX file}} \textemdash\ Print the contents of {\it file} from revision {\it RevX}.\\
+\texttt{hg cat -r\textit{RevX file}} \textemdash\ Print the contents of \textit{file} from revision \textit{RevX}.\\
 \texttt{hg heads} \textemdash\ Print all the current heads. \\
-\texttt{hg revert -r{\it RevX file}} \textemdash\ Revert {\it file} to revision {\it RevX}. On-disk changed version is
-moved to {\it file.orig}. \\
+\texttt{hg revert -r\textit{RevX file}} \textemdash\ Revert \textit{file} to revision \textit{RevX}. On-disk changed version is
+moved to \textit{file.orig}. \\
 \texttt{hg commit} \textemdash\ Commit changes to repository. \\
 \texttt{hg push} \textemdash\ Push changes to default remote repository. \\
 \texttt{hg pull} \textemdash\ Pull changes from default remote repository. \\

diff -r 4eeb12e5205ba4ac8ffbd9544ccfc3a6481be3c4 -r 068d091080460de4e890c9d3dcc492f1706c5d92 doc/get_yt.sh
--- a/doc/get_yt.sh
+++ b/doc/get_yt.sh
@@ -1,394 +1,4 @@
-#
-# Hi there!  Welcome to the yt installation script.
-#
-# This script is designed to create a fully isolated Python installation
-# with the dependencies you need to run yt.
-#
-# This script is based on Conda, a distribution mechanism from Continuum
-# Analytics.  The process is as follows:
-#
-#  1. Download the appropriate Conda installation package
-#  2. Install Conda into the specified directory
-#  3. Install yt-specific dependencies
-#  4. Install yt
-#
-# There are a few options listed below, but by default, this will install
-# everything.  At the end, it will tell you what to do to use yt.
-#
-# By default this will install yt from source.
-#
-# If you experience problems, please visit the Help section at 
-# http://yt-project.org.
-#
-DEST_SUFFIX="yt-conda"
-DEST_DIR="`pwd`/${DEST_SUFFIX/ /}"   # Installation location
-BRANCH="yt" # This is the branch to which we will forcibly update.
-INST_YT_SOURCE=1 # Do we do a source install of yt?
-INST_UNSTRUCTURED=1 # Do we want to build with unstructured mesh support?
-
-##################################################################
-#                                                                #
-# You will likely not have to modify anything below this region. #
-#                                                                #
-##################################################################
-
-LOG_FILE="`pwd`/yt_install.log"
-
-# Here is the idiom for redirecting to the log file:
-# ( SOMECOMMAND 2>&1 ) 1>> ${LOG_FILE} || do_exit
-
-MINICONDA_URLBASE="http://repo.continuum.io/miniconda"
-MINICONDA_VERSION="latest"
-YT_RECIPE_REPO="https://bitbucket.org/yt_analysis/yt_conda/raw/default"
-
-if [ $INST_UNSTRUCTURED -eq 1 ]
-then
-  if [ $INST_YT_SOURCE -eq 0 ]
-  then
-      echo "yt must be compiled from source to use the unstructured mesh support."
-      echo "Please set INST_YT_SOURCE to 1 and re-run."
-      exit 1
-  fi
-  if [ `uname` = "Darwin" ]
-  then
-      EMBREE="embree-2.8.0.x86_64.macosx"
-      EMBREE_URL="https://github.com/embree/embree/releases/download/v2.8.0/$EMBREE.tar.gz"
-  else
-      EMBREE="embree-2.8.0.x86_64.linux"
-      EMBREE_URL="https://github.com/embree/embree/releases/download/v2.8.0/$EMBREE.tar.gz"
-  fi
-  PYEMBREE_URL="https://github.com/scopatz/pyembree/archive/master.zip"
-fi
-
-function do_exit
-{
-    echo "********************************************"
-    echo "        FAILURE REPORT:"
-    echo "********************************************"
-    echo
-    tail -n 10 ${LOG_FILE}
-    echo
-    echo "********************************************"
-    echo "********************************************"
-    echo "Failure.  Check ${LOG_FILE}.  The last 10 lines are above."
-    exit 1
-}
-
-function log_cmd
-{
-    echo "EXECUTING:" >> ${LOG_FILE}
-    echo "  $*" >> ${LOG_FILE}
-    ( $* 2>&1 ) 1>> ${LOG_FILE} || do_exit
-}
-
-# These are needed to prevent pushd and popd from printing to stdout
-
-function pushd () {
-    command pushd "$@" > /dev/null
-}
-
-function popd () {
-    command popd "$@" > /dev/null
-}
-
-function get_ytdata
-{
-    echo "Downloading $1 from yt-project.org"
-    [ -e $1 ] && return
-    ${GETFILE} "http://yt-project.org/data/$1" || do_exit
-    ( ${SHASUM} -c $1.sha512 2>&1 ) 1>> ${LOG_FILE} || do_exit
-}
-
-function get_ytrecipe {
-    RDIR=${DEST_DIR}/src/yt-recipes/$1
-    mkdir -p ${RDIR}
-    pushd ${RDIR}
-    log_cmd ${GETFILE} ${YT_RECIPE_REPO}/$1/meta.yaml
-    log_cmd ${GETFILE} ${YT_RECIPE_REPO}/$1/build.sh
-    NEW_PKG=`conda build --output ${RDIR}`
-    log_cmd conda build --no-binstar-upload ${RDIR}
-    log_cmd conda install ${NEW_PKG}
-    popd
-}
-
-
-echo
-echo
-echo "========================================================================"
-echo
-echo "Hi there!  This is the yt installation script.  We're going to download"
-echo "some stuff and install it to create a self-contained, isolated"
-echo "environment for yt to run within."
-echo
-echo "This will install Miniconda from Continuum Analytics, the necessary"
-echo "packages to run yt, and create a self-contained environment for you to"
-echo "use yt.  Additionally, Conda itself provides the ability to install"
-echo "many other packages that can be used for other purposes using the"
-echo "'conda install' command."
-echo
-MYOS=`uname -s`       # A guess at the OS
-if [ $INST_YT_SOURCE -ne 0 ]
-then
-    if [ "${MYOS##Darwin}" != "${MYOS}" ]
-    then
-        echo "Looks like you're running on Mac OSX."
-        echo
-        echo "NOTE: you must have the Xcode command line tools installed."
-        echo
-        echo "The instructions for obtaining these tools varies according"
-        echo "to your exact OS version.  On older versions of OS X, you"
-        echo "must register for an account on the apple developer tools"
-        echo "website: https://developer.apple.com/downloads to obtain the"
-        echo "download link."
-        echo
-        echo "We have gathered some additional instructions for each"
-        echo "version of OS X below. If you have trouble installing yt"
-        echo "after following these instructions, don't hesitate to contact"
-        echo "the yt user's e-mail list."
-        echo
-        echo "You can see which version of OSX you are running by clicking"
-        echo "'About This Mac' in the apple menu on the left hand side of"
-        echo "menu bar.  We're assuming that you've installed all operating"
-        echo "system updates; if you have an older version, we suggest"
-        echo "running software update and installing all available updates."
-        echo
-        echo "OS X 10.5.8: search for and download Xcode 3.1.4 from the"
-        echo "Apple developer tools website."
-        echo
-        echo "OS X 10.6.8: search for and download Xcode 3.2 from the Apple"
-        echo "developer tools website.  You can either download the"
-        echo "Xcode 3.2.2 Developer Tools package (744 MB) and then use"
-        echo "Software Update to update to XCode 3.2.6 or"
-        echo "alternatively, you can download the Xcode 3.2.6/iOS SDK"
-        echo "bundle (4.1 GB)."
-        echo
-        echo "OS X 10.7.5: download Xcode 4.2 from the mac app store"
-        echo "(search for Xcode)."
-        echo "Alternatively, download the Xcode command line tools from"
-        echo "the Apple developer tools website."
-        echo
-        echo "OS X 10.8.4, 10.9, 10.10, and 10.11:"
-        echo "download the appropriate version of Xcode from the"
-        echo "mac app store (search for Xcode)."
-        echo
-        echo "Additionally, you will have to manually install the Xcode"
-        echo "command line tools."
-        echo
-        echo "For OS X 10.8, see:"
-        echo "http://stackoverflow.com/questions/9353444"
-        echo
-        echo "For OS X 10.9 and newer the command line tools can be installed"
-        echo "with the following command:"
-        echo "    xcode-select --install"
-    fi
-    if [ "${MYOS##Linux}" != "${MYOS}" ]
-    then
-        echo "Looks like you're on Linux."
-        echo
-        echo "Please make sure you have the developer tools for your OS "
-        echo "installed."
-        echo
-        if [ -f /etc/SuSE-release ] && [ `grep --count SUSE /etc/SuSE-release` -gt 0 ]
-        then
-            echo "Looks like you're on an OpenSUSE-compatible machine."
-            echo
-            echo "You need to have these packages installed:"
-            echo
-            echo "  * devel_C_C++"
-            echo "  * libuuid-devel"
-            echo "  * gcc-c++"
-            echo "  * chrpath"
-            echo
-            echo "You can accomplish this by executing:"
-            echo
-            echo "$ sudo zypper install -t pattern devel_C_C++"
-            echo "$ sudo zypper install gcc-c++ libuuid-devel zip"
-            echo "$ sudo zypper install chrpath"
-        fi
-        if [ -f /etc/lsb-release ] && [ `grep --count buntu /etc/lsb-release` -gt 0 ]
-        then
-            echo "Looks like you're on an Ubuntu-compatible machine."
-            echo
-            echo "You need to have these packages installed:"
-            echo
-            echo "  * libssl-dev"
-            echo "  * build-essential"
-            echo "  * libncurses5"
-            echo "  * libncurses5-dev"
-            echo "  * uuid-dev"
-            echo "  * chrpath"
-            echo
-            echo "You can accomplish this by executing:"
-            echo
-            echo "$ sudo apt-get install libssl-dev build-essential libncurses5 libncurses5-dev zip uuid-dev chrpath"
-            echo
-        fi
-        echo
-        echo "If you are running on a supercomputer or other module-enabled"
-        echo "system, please make sure that the GNU module has been loaded."
-        echo
-    fi
-fi
-if [ "${MYOS##x86_64}" != "${MYOS}" ]
-then
-    MINICONDA_OS="Linux-x86_64"
-elif [ "${MYOS##i386}" != "${MYOS}" ]
-then
-    MINICONDA_OS="Linux-x86"
-elif [ "${MYOS##Darwin}" != "${MYOS}" ]
-then
-     MINICONDA_OS="MacOSX-x86_64"
-else
-    echo "Not sure which Linux distro you are running."
-    echo "Going with x86_64 architecture."
-    MINICONDA_OS="Linux-x86_64"
-fi
-echo
-echo "If you'd rather not continue, hit Ctrl-C."
-echo
-echo "========================================================================"
-echo
-read -p "[hit enter] "
-echo
-echo "Awesome!  Here we go."
-echo
-
-MINICONDA_PKG=Miniconda-${MINICONDA_VERSION}-${MINICONDA_OS}.sh
-
-if type -P wget &>/dev/null
-then
-    echo "Using wget"
-    export GETFILE="wget -nv -nc"
-else
-    echo "Using curl"
-    export GETFILE="curl -sSO"
-fi
-
-echo
-echo "Downloading ${MINICONDA_URLBASE}/${MINICONDA_PKG}"
-echo "Downloading ${MINICONDA_URLBASE}/${MINICONDA_PKG}" >> ${LOG_FILE}
-echo
-
-${GETFILE} ${MINICONDA_URLBASE}/${MINICONDA_PKG} || do_exit
-
-echo "Installing the Miniconda python environment."
-
-log_cmd bash ./${MINICONDA_PKG} -b -p $DEST_DIR
-
-# This we *do* need.
-export PATH=${DEST_DIR}/bin:$PATH
-
-echo "Installing the necessary packages for yt."
-echo "This may take a while, but don't worry.  yt loves you."
-
-declare -a YT_DEPS
-YT_DEPS+=('python')
-YT_DEPS+=('setuptools')
-YT_DEPS+=('numpy')
-YT_DEPS+=('jupyter')
-YT_DEPS+=('ipython')
-YT_DEPS+=('sphinx')
-YT_DEPS+=('h5py')
-YT_DEPS+=('matplotlib')
-YT_DEPS+=('cython')
-YT_DEPS+=('nose')
-YT_DEPS+=('conda-build')
-YT_DEPS+=('mercurial')
-YT_DEPS+=('sympy')
-
-if [ $INST_UNSTRUCTURED -eq 1 ]
-then
-  YT_DEPS+=('netcdf4')   
-fi
-
-# Here is our dependency list for yt
-log_cmd conda update --yes conda
-
-log_cmd echo "DEPENDENCIES" ${YT_DEPS[@]}
-for YT_DEP in "${YT_DEPS[@]}"; do
-    echo "Installing $YT_DEP"
-    log_cmd conda install --yes ${YT_DEP}
-done
-
-if [ $INST_UNSTRUCTURED -eq 1 ]
-then
-
-  echo "Installing embree"
-  mkdir ${DEST_DIR}/src
-  cd ${DEST_DIR}/src
-  ( ${GETFILE} "$EMBREE_URL" 2>&1 ) 1>> ${LOG_FILE} || do_exit
-  log_cmd tar xfz ${EMBREE}.tar.gz
-  log_cmd mv ${DEST_DIR}/src/${EMBREE}/include/embree2 ${DEST_DIR}/include
-  log_cmd mv ${DEST_DIR}/src/${EMBREE}/lib/lib*.* ${DEST_DIR}/lib
-  if [ `uname` = "Darwin" ]
-  then
-    ln -s ${DEST_DIR}/lib/libembree.2.dylib ${DEST_DIR}/lib/libembree.dylib
-    install_name_tool -id ${DEST_DIR}/lib/libembree.2.dylib ${DEST_DIR}/lib/libembree.2.dylib
-  else
-    ln -s ${DEST_DIR}/lib/libembree.so.2 ${DEST_DIR}/lib/libembree.so
-  fi
-
-  echo "Installing pyembree from source"
-  ( ${GETFILE} "$PYEMBREE_URL" 2>&1 ) 1>> ${LOG_FILE} || do_exit
-  log_cmd unzip ${DEST_DIR}/src/master.zip
-  pushd ${DEST_DIR}/src/pyembree-master
-  log_cmd python setup.py install build_ext -I${DEST_DIR}/include -L${DEST_DIR}/lib
-  popd
-fi
-
-if [ $INST_YT_SOURCE -eq 0 ]
-then
-  echo "Installing yt"
-  log_cmd conda install --yes yt
-else
-    # We do a source install.
-    echo "Installing yt from source"
-    YT_DIR="${DEST_DIR}/src/yt-hg"
-    log_cmd hg clone -r ${BRANCH} https://bitbucket.org/yt_analysis/yt ${YT_DIR}
-if [ $INST_UNSTRUCTURED -eq 1 ]
-then
-    echo $DEST_DIR > ${YT_DIR}/embree.cfg
-fi
-    pushd ${YT_DIR}
-    log_cmd python setup.py develop
-    popd
-fi
-
-echo
-echo
-echo "========================================================================"
-echo
-echo "yt and the Conda system are now installed in $DEST_DIR ."
-echo
-echo "You must now modify your PATH variable by prepending:"
-echo 
-echo "   $DEST_DIR/bin"
-echo
-echo "On Bash-style shells you can copy/paste the following command to "
-echo "temporarily activate the yt installation:"
-echo
-echo "    export PATH=$DEST_DIR/bin:\$PATH"
-echo
-echo "and on csh-style shells:"
-echo
-echo "    setenv PATH $DEST_DIR/bin:\$PATH"
-echo
-echo "You can also update the init file appropriate for your shell to include"
-echo "the same command."
-echo
-echo "To get started with yt, check out the orientation:"
-echo
-echo "    http://yt-project.org/doc/orientation/"
-echo
-echo "For support, see the website and join the mailing list:"
-echo
-echo "    http://yt-project.org/"
-echo "    http://yt-project.org/data/      (Sample data)"
-echo "    http://yt-project.org/doc/       (Docs)"
-echo
-echo "    http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org"
-echo
-echo "========================================================================"
-echo
-echo "Oh, look at me, still talking when there's science to do!"
-echo "Good luck, and email the user list if you run into any problems."
+echo "This script has been deprecated."
+echo "You can now create a conda-based build using install_script.sh"
+echo "Please download that script and run it"
+exit 0

diff -r 4eeb12e5205ba4ac8ffbd9544ccfc3a6481be3c4 -r 068d091080460de4e890c9d3dcc492f1706c5d92 doc/helper_scripts/code_support.py
--- a/doc/helper_scripts/code_support.py
+++ b/doc/helper_scripts/code_support.py
@@ -85,7 +85,7 @@
 print("|| . ||", end=' ')
 for c in code_names:
     print("%s || " % (c), end=' ')
-print() 
+print()
 
 for vn in vals:
     print("|| !%s ||" % (vn), end=' ')

diff -r 4eeb12e5205ba4ac8ffbd9544ccfc3a6481be3c4 -r 068d091080460de4e890c9d3dcc492f1706c5d92 doc/helper_scripts/run_recipes.py
--- a/doc/helper_scripts/run_recipes.py
+++ b/doc/helper_scripts/run_recipes.py
@@ -19,7 +19,7 @@
 CWD = os.getcwd()
 ytcfg["yt", "serialize"] = "False"
 PARALLEL_TEST = {"rockstar_nest": "3"}
-BLACKLIST = []
+BLACKLIST = ["opengl_ipython", "opengl_vr"]
 
 
 def prep_dirs():

diff -r 4eeb12e5205ba4ac8ffbd9544ccfc3a6481be3c4 -r 068d091080460de4e890c9d3dcc492f1706c5d92 doc/helper_scripts/table.py
--- a/doc/helper_scripts/table.py
+++ b/doc/helper_scripts/table.py
@@ -44,7 +44,7 @@
       "A bunch of illustrated examples of how to do things"),
      ("reference/index.html", "Reference Materials",
       "A list of all bundled fields, API documentation, the Change Log..."),
-     ("faq/index.html", "FAQ", 
+     ("faq/index.html", "FAQ",
       "Frequently Asked Questions: answered for you!")
   ]),
 ]

diff -r 4eeb12e5205ba4ac8ffbd9544ccfc3a6481be3c4 -r 068d091080460de4e890c9d3dcc492f1706c5d92 doc/helper_scripts/update_recipes.py
--- a/doc/helper_scripts/update_recipes.py
+++ b/doc/helper_scripts/update_recipes.py
@@ -66,7 +66,7 @@
             written = cond_output(output, written)
             ofn = "%s/%s_%s" % (ndir, fn, os.path.basename(ifn))
             open(ofn, "wb").write(open(ifn, "rb").read())
-            output.write(".. image:: _%s/%s_%s\n" % (fn, fn, os.path.basename(ifn)) + 
+            output.write(".. image:: _%s/%s_%s\n" % (fn, fn, os.path.basename(ifn)) +
                          "   :width: 240\n" +
                          "   :target: ../_images/%s_%s\n" % (fn, os.path.basename(ifn))
                         )

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

https://bitbucket.org/yt_analysis/yt/commits/d68d21553795/
Changeset:   d68d21553795
Branch:      yt
User:        MatthewTurk
Date:        2016-06-06 20:24:28+00:00
Summary:     Adding a check for overlap==0.0.
Affected #:  1 file

diff -r 068d091080460de4e890c9d3dcc492f1706c5d92 -r d68d2155379521fd527c0424a694c3111e4a5079 yt/utilities/lib/pixelization_routines.pyx
--- a/yt/utilities/lib/pixelization_routines.pyx
+++ b/yt/utilities/lib/pixelization_routines.pyx
@@ -191,6 +191,7 @@
                                 overlap1 = ((fmin(rxpx, xsp+dxsp)
                                            - fmax(lxpx, (xsp-dxsp)))*ipx_dx)
                                 if overlap1 < 0.0: continue
+                                if overlap1 * overlap2 == 0.0: continue
                                 my_array[j,i] += (dsp * overlap1) * overlap2
                             else:
                                 my_array[j,i] = dsp


https://bitbucket.org/yt_analysis/yt/commits/a6bfc511f4c1/
Changeset:   a6bfc511f4c1
Branch:      yt
User:        MatthewTurk
Date:        2016-06-13 21:24:50+00:00
Summary:     Adding comment and updating tipsy test numbers.
Affected #:  2 files

diff -r d68d2155379521fd527c0424a694c3111e4a5079 -r a6bfc511f4c12f67dbcc9d67c110457a225e5ae9 tests/tests.yaml
--- a/tests/tests.yaml
+++ b/tests/tests.yaml
@@ -47,7 +47,7 @@
     - yt/visualization/tests/test_particle_plot.py:test_particle_projection_filter
     - yt/visualization/tests/test_particle_plot.py:test_particle_phase_answers
   
-  local_tipsy_000:
+  local_tipsy_001:
     - yt/frontends/tipsy/tests/test_outputs.py
   
   local_varia_001:

diff -r d68d2155379521fd527c0424a694c3111e4a5079 -r a6bfc511f4c12f67dbcc9d67c110457a225e5ae9 yt/utilities/lib/pixelization_routines.pyx
--- a/yt/utilities/lib/pixelization_routines.pyx
+++ b/yt/utilities/lib/pixelization_routines.pyx
@@ -191,6 +191,13 @@
                                 overlap1 = ((fmin(rxpx, xsp+dxsp)
                                            - fmax(lxpx, (xsp-dxsp)))*ipx_dx)
                                 if overlap1 < 0.0: continue
+                                # This next line is not commented out because
+                                # it's an oddity; we actually want to skip
+                                # depositing if the overlap is zero, and that's
+                                # how it used to work when we were more
+                                # conservative about the iteration indices.
+                                # This will reduce artifacts if we ever move to
+                                # compositing instead of replacing bitmaps.
                                 if overlap1 * overlap2 == 0.0: continue
                                 my_array[j,i] += (dsp * overlap1) * overlap2
                             else:


https://bitbucket.org/yt_analysis/yt/commits/6d24922b28bd/
Changeset:   6d24922b28bd
Branch:      yt
User:        MatthewTurk
Date:        2016-06-15 18:47:20+00:00
Summary:     Merging
Affected #:  58 files

diff -r a6bfc511f4c12f67dbcc9d67c110457a225e5ae9 -r 6d24922b28bd90561c464b69f1982d3d94fbe8e1 .hgignore
--- a/.hgignore
+++ b/.hgignore
@@ -45,9 +45,11 @@
 yt/utilities/lib/mesh_intersection.cpp
 yt/utilities/lib/mesh_samplers.cpp
 yt/utilities/lib/mesh_traversal.cpp
+yt/utilities/lib/mesh_triangulation.c
 yt/utilities/lib/mesh_utilities.c
 yt/utilities/lib/misc_utilities.c
 yt/utilities/lib/particle_mesh_operations.c
+yt/utilities/lib/primitives.c
 yt/utilities/lib/origami.c
 yt/utilities/lib/particle_mesh_operations.c
 yt/utilities/lib/pixelization_routines.c

diff -r a6bfc511f4c12f67dbcc9d67c110457a225e5ae9 -r 6d24922b28bd90561c464b69f1982d3d94fbe8e1 CONTRIBUTING.rst
--- a/CONTRIBUTING.rst
+++ b/CONTRIBUTING.rst
@@ -651,7 +651,7 @@
 .. _multiple-PRs:
 
 Working with Multiple BitBucket Pull Requests
-+++++++++++++++++++++++++++++++++++++++++++++
+---------------------------------------------
 
 Once you become active developing for yt, you may be working on
 various aspects of the code or bugfixes at the same time.  Currently,

diff -r a6bfc511f4c12f67dbcc9d67c110457a225e5ae9 -r 6d24922b28bd90561c464b69f1982d3d94fbe8e1 doc/install_script.sh
--- a/doc/install_script.sh
+++ b/doc/install_script.sh
@@ -704,7 +704,7 @@
 if type -P curl &>/dev/null
 then
     echo "Using curl"
-    export GETFILE="curl -sSO"
+    export GETFILE="curl -sSOL"
 else
     echo "Using wget"
     export GETFILE="wget -nv"

diff -r a6bfc511f4c12f67dbcc9d67c110457a225e5ae9 -r 6d24922b28bd90561c464b69f1982d3d94fbe8e1 doc/source/analyzing/fields.rst
--- a/doc/source/analyzing/fields.rst
+++ b/doc/source/analyzing/fields.rst
@@ -98,22 +98,31 @@
 .. code-block:: python
 
     ad = ds.all_data()
+
+    # just a field name
     density = ad['density']
+
+    # field tuple with no parentheses
     density = ad['gas', 'density']
+
+    # full field tuple
     density = ad[('gas', 'density')]
-    dnesity = ad[ds.fields.gas.density]
+
+    # through the ds.fields object
+    density = ad[ds.fields.gas.density]
 
 The first data access example is the simplest. In that example, the field type
 is inferred from the name of the field. The next two examples use the field type
 explicitly, this might be necessary if there is more than one field type with a
-"density" field defined in the same simulation. The third example is a slightly
-more verbose and is syntactically identical to the second example due to the way
-indexing functions in Python. The final example uses the ``ds.fields` object
-described above. This way of accessing fields lends itself to interactive use,
-especially if you make heavy use of IPython's tab completion features. Any of
-these ways of denoting the ``('gas', 'density')`` field can be used when
-supplying a field name to a yt data object, analysis routines, or plotting and
-visualization function.
+"density" field defined in the same dataset. The third example is slightly more
+verbose but is syntactically identical to the second example due to the way
+indexing works in the Python language.
+
+The final example uses the ``ds.fields`` object described above. This way of
+accessing fields lends itself to interactive use, especially if you make heavy
+use of IPython's tab completion features. Any of these ways of denoting the
+``('gas', 'density')`` field can be used when supplying a field name to a yt
+data object, analysis routines, or plotting and visualization function.
 
 Accessing Fields without a Field Type
 -------------------------------------

diff -r a6bfc511f4c12f67dbcc9d67c110457a225e5ae9 -r 6d24922b28bd90561c464b69f1982d3d94fbe8e1 setup.py
--- a/setup.py
+++ b/setup.py
@@ -83,114 +83,70 @@
     Extension("yt.geometry.grid_visitors",
               ["yt/geometry/grid_visitors.pyx"],
               include_dirs=["yt/utilities/lib"],
-              libraries=std_libs,
-              depends=["yt/utilities/lib/fp_utils.pxd",
-                       "yt/geometry/grid_visitors.pxd"]),
+              libraries=std_libs),
     Extension("yt.geometry.grid_container",
               ["yt/geometry/grid_container.pyx"],
               include_dirs=["yt/utilities/lib/"],
-              libraries=std_libs,
-              depends=["yt/utilities/lib/fp_utils.pxd",
-                       "yt/geometry/grid_container.pxd",
-                       "yt/geometry/grid_visitors.pxd"]),
+              libraries=std_libs),
     Extension("yt.geometry.oct_container",
               ["yt/geometry/oct_container.pyx",
                "yt/utilities/lib/tsearch.c"],
               include_dirs=["yt/utilities/lib"],
-              libraries=std_libs,
-              depends=["yt/utilities/lib/fp_utils.pxd",
-                       "yt/geometry/oct_container.pxd",
-                       "yt/geometry/selection_routines.pxd"]),
+              libraries=std_libs),
     Extension("yt.geometry.oct_visitors",
               ["yt/geometry/oct_visitors.pyx"],
               include_dirs=["yt/utilities/lib/"],
-              libraries=std_libs,
-              depends=["yt/utilities/lib/fp_utils.pxd",
-                       "yt/geometry/oct_container.pxd",
-                       "yt/geometry/selection_routines.pxd"]),
+              libraries=std_libs),
     Extension("yt.geometry.particle_oct_container",
               ["yt/geometry/particle_oct_container.pyx"],
               include_dirs=["yt/utilities/lib/"],
-              libraries=std_libs,
-              depends=["yt/utilities/lib/fp_utils.pxd",
-                       "yt/geometry/oct_container.pxd",
-                       "yt/geometry/selection_routines.pxd"]),
+              libraries=std_libs),
     Extension("yt.geometry.selection_routines",
               ["yt/geometry/selection_routines.pyx"],
               include_dirs=["yt/utilities/lib/"],
-              libraries=std_libs,
-              depends=["yt/utilities/lib/fp_utils.pxd",
-                       "yt/utilities/lib/grid_traversal.pxd",
-                       "yt/geometry/oct_container.pxd",
-                       "yt/geometry/oct_visitors.pxd",
-                       "yt/geometry/grid_container.pxd",
-                       "yt/geometry/grid_visitors.pxd",
-                       "yt/geometry/selection_routines.pxd"]),
+              libraries=std_libs),
     Extension("yt.geometry.particle_deposit",
               ["yt/geometry/particle_deposit.pyx"],
               include_dirs=["yt/utilities/lib/"],
-              libraries=std_libs,
-              depends=["yt/utilities/lib/fp_utils.pxd",
-                       "yt/geometry/oct_container.pxd",
-                       "yt/geometry/selection_routines.pxd",
-                       "yt/geometry/particle_deposit.pxd"]),
+              libraries=std_libs),
     Extension("yt.geometry.particle_smooth",
               ["yt/geometry/particle_smooth.pyx"],
               include_dirs=["yt/utilities/lib/"],
-              libraries=std_libs,
-              depends=["yt/utilities/lib/fp_utils.pxd",
-                       "yt/geometry/oct_container.pxd",
-                       "yt/geometry/selection_routines.pxd",
-                       "yt/geometry/particle_deposit.pxd",
-                       "yt/geometry/particle_smooth.pxd"]),
+              libraries=std_libs),
     Extension("yt.geometry.fake_octree",
               ["yt/geometry/fake_octree.pyx"],
               include_dirs=["yt/utilities/lib/"],
-              libraries=std_libs,
-              depends=["yt/utilities/lib/fp_utils.pxd",
-                       "yt/geometry/oct_container.pxd",
-                       "yt/geometry/selection_routines.pxd"]),
+              libraries=std_libs),
     Extension("yt.utilities.spatial.ckdtree",
               ["yt/utilities/spatial/ckdtree.pyx"],
               include_dirs=["yt/utilities/lib/"],
               libraries=std_libs),
     Extension("yt.utilities.lib.bitarray",
               ["yt/utilities/lib/bitarray.pyx"],
-              libraries=std_libs, depends=["yt/utilities/lib/bitarray.pxd"]),
+              libraries=std_libs),
     Extension("yt.utilities.lib.bounding_volume_hierarchy",
               ["yt/utilities/lib/bounding_volume_hierarchy.pyx"],
               include_dirs=["yt/utilities/lib/"],
               extra_compile_args=omp_args,
               extra_link_args=omp_args,
               libraries=std_libs,
-              depends=["yt/utilities/lib/element_mappings.pxd",
-                       "yt/utilities/lib/mesh_triangulation.h",
-                       "yt/utilities/lib/vec3_ops.pxd",
-                       "yt/utilities/lib/primitives.pxd"]),
+              depends=["yt/utilities/lib/mesh_triangulation.h"]),
     Extension("yt.utilities.lib.contour_finding",
               ["yt/utilities/lib/contour_finding.pyx"],
               include_dirs=["yt/utilities/lib/",
                             "yt/geometry/"],
-              libraries=std_libs,
-              depends=["yt/utilities/lib/fp_utils.pxd",
-                       "yt/utilities/lib/amr_kdtools.pxd",
-                       "yt/utilities/lib/grid_traversal.pxd",
-                       "yt/utilities/lib/contour_finding.pxd",
-                       "yt/geometry/oct_container.pxd"]),
+              libraries=std_libs),
     Extension("yt.utilities.lib.geometry_utils",
               ["yt/utilities/lib/geometry_utils.pyx"],
               extra_compile_args=omp_args,
               extra_link_args=omp_args,
-              libraries=std_libs, depends=["yt/utilities/lib/fp_utils.pxd"]),
+              libraries=std_libs),
     Extension("yt.utilities.lib.marching_cubes",
               ["yt/utilities/lib/marching_cubes.pyx",
                "yt/utilities/lib/fixed_interpolator.c"],
               include_dirs=["yt/utilities/lib/"],
               libraries=std_libs,
-              depends=["yt/utilities/lib/fp_utils.pxd",
-                       "yt/utilities/lib/fixed_interpolator.pxd",
-                       "yt/utilities/lib/fixed_interpolator.h",
-                       ]),
+              depends=["yt/utilities/lib/fixed_interpolator.h"]),
     Extension("yt.utilities.lib.mesh_triangulation",
               ["yt/utilities/lib/mesh_triangulation.pyx"],
               depends=["yt/utilities/lib/mesh_triangulation.h"]),
@@ -198,15 +154,11 @@
               ["yt/utilities/lib/pixelization_routines.pyx",
                "yt/utilities/lib/pixelization_constants.c"],
               include_dirs=["yt/utilities/lib/"],
-              libraries=std_libs, depends=["yt/utilities/lib/fp_utils.pxd",
-                                        "yt/utilities/lib/pixelization_constants.h",
-                                        "yt/utilities/lib/element_mappings.pxd"]),
+              libraries=std_libs,
+              depends=["yt/utilities/lib/pixelization_constants.h"]),
     Extension("yt.utilities.lib.primitives",
               ["yt/utilities/lib/primitives.pyx"],
-              libraries=std_libs, 
-              depends=["yt/utilities/lib/primitives.pxd",
-                       "yt/utilities/lib/vec3_ops.pxd",
-                       "yt/utilities/lib/bounding_volume_hierarchy.pxd"]),
+              libraries=std_libs),
     Extension("yt.utilities.lib.origami",
               ["yt/utilities/lib/origami.pyx",
                "yt/utilities/lib/origami_tags.c"],
@@ -220,15 +172,11 @@
               libraries=std_libs,
               extra_compile_args=omp_args,
               extra_link_args=omp_args,
-              depends=["yt/utilities/lib/fp_utils.pxd",
-                       "yt/utilities/lib/kdtree.h",
-                       "yt/utilities/lib/fixed_interpolator.h",
-                       "yt/utilities/lib/fixed_interpolator.pxd",
-                       "yt/utilities/lib/field_interpolation_tables.pxd",
-                       "yt/utilities/lib/vec3_ops.pxd"]),
+              depends=["yt/utilities/lib/kdtree.h",
+                       "yt/utilities/lib/fixed_interpolator.h"]),
     Extension("yt.utilities.lib.element_mappings",
               ["yt/utilities/lib/element_mappings.pyx"],
-              libraries=std_libs, depends=["yt/utilities/lib/element_mappings.pxd"]),
+              libraries=std_libs),
     Extension("yt.utilities.lib.alt_ray_tracers",
               ["yt/utilities/lib/alt_ray_tracers.pyx"],
               libraries=std_libs),
@@ -244,7 +192,7 @@
     cython_extensions.append(
         Extension("yt.utilities.lib.{}".format(ext_name),
                   ["yt/utilities/lib/{}.pyx".format(ext_name)],
-                  libraries=std_libs, depends=["yt/utilities/lib/fp_utils.pxd"]))
+                  libraries=std_libs))
 
 lib_exts = ["write_array", "ragged_arrays", "line_integral_convolution"]
 for ext_name in lib_exts:
@@ -265,15 +213,11 @@
               include_dirs=["yt/frontends/artio/artio_headers/",
                             "yt/geometry/",
                             "yt/utilities/lib/"],
-              depends=glob.glob("yt/frontends/artio/artio_headers/*.c") +
-              ["yt/utilities/lib/fp_utils.pxd",
-               "yt/geometry/oct_container.pxd",
-               "yt/geometry/selection_routines.pxd",
-               "yt/geometry/particle_deposit.pxd"]),
+              depends=glob.glob("yt/frontends/artio/artio_headers/*.c")),
     Extension("yt.utilities.spatial._distance_wrap",
               glob.glob("yt/utilities/spatial/src/*.c")),
-    Extension("yt.utilities.data_point_utilities",
-              ["yt/utilities/data_point_utilities.c"],
+    Extension("yt.visualization._MPL",
+              ["yt/visualization/_MPL.c"],
               libraries=std_libs),
 ]
 
@@ -282,31 +226,13 @@
     embree_extensions = [
         Extension("yt.utilities.lib.mesh_construction",
                   ["yt/utilities/lib/mesh_construction.pyx"],
-                  depends=["yt/utilities/lib/mesh_construction.pxd",
-                           "yt/utilities/lib/mesh_triangulation.h",
-                           "yt/utilities/lib/mesh_intersection.pxd",
-                           "yt/utlilites/lib/mesh_samplers.pxd",
-                           "yt/utlilites/lib/mesh_traversal.pxd"]),
+                  depends=["yt/utilities/lib/mesh_triangulation.h"]),
         Extension("yt.utilities.lib.mesh_traversal",
-                  ["yt/utilities/lib/mesh_traversal.pyx"],
-                  depends=["yt/utilities/lib/mesh_traversal.pxd",
-                           "yt/utilities/lib/grid_traversal.pxd",
-                           "yt/utilities/lib/bounding_volume_hierarchy.pxd"]),
+                  ["yt/utilities/lib/mesh_traversal.pyx"]),
         Extension("yt.utilities.lib.mesh_samplers",
-                  ["yt/utilities/lib/mesh_samplers.pyx"],
-                  depends=["yt/utilities/lib/mesh_samplers.pxd",
-                           "yt/utilities/lib/element_mappings.pxd",
-                           "yt/utilities/lib/mesh_construction.pxd",
-                           "yt/utilities/lib/bounding_volume_hierarchy.pxd",
-                           "yt/utilities/lib/primitives.pxd"]),
+                  ["yt/utilities/lib/mesh_samplers.pyx"]),
         Extension("yt.utilities.lib.mesh_intersection",
-                  ["yt/utilities/lib/mesh_intersection.pyx"],
-                  depends=["yt/utilities/lib/mesh_intersection.pxd",
-                           "yt/utilities/lib/mesh_construction.pxd",
-                           "yt/utilities/lib/bounding_volume_hierarchy.pxd",
-                           "yt/utilities/lib/mesh_samplers.pxd",
-                           "yt/utilities/lib/primitives.pxd",
-                           "yt/utilities/lib/vec3_ops.pxd"]),
+                  ["yt/utilities/lib/mesh_intersection.pyx"]),
     ]
 
     embree_prefix = os.path.abspath(read_embree_location())
@@ -382,9 +308,12 @@
         _build_py.run(self)
 
 class build_ext(_build_ext):
-    # subclass setuptools extension builder to avoid importing numpy
+    # subclass setuptools extension builder to avoid importing cython and numpy
     # at top level in setup.py. See http://stackoverflow.com/a/21621689/1382869
     def finalize_options(self):
+        from Cython.Build import cythonize
+        self.distribution.ext_modules[:] = cythonize(
+                self.distribution.ext_modules)
         _build_ext.finalize_options(self)
         # Prevent numpy from thinking it is still in its setup process
         # see http://stackoverflow.com/a/21621493/1382869

diff -r a6bfc511f4c12f67dbcc9d67c110457a225e5ae9 -r 6d24922b28bd90561c464b69f1982d3d94fbe8e1 tests/tests.yaml
--- a/tests/tests.yaml
+++ b/tests/tests.yaml
@@ -26,7 +26,7 @@
   local_gdf_000:
     - yt/frontends/gdf/tests/test_outputs.py
 
-  local_gizmo_000:
+  local_gizmo_001:
     - yt/frontends/gizmo/tests/test_outputs.py
 
   local_halos_000:

diff -r a6bfc511f4c12f67dbcc9d67c110457a225e5ae9 -r 6d24922b28bd90561c464b69f1982d3d94fbe8e1 yt/analysis_modules/level_sets/clump_handling.py
--- a/yt/analysis_modules/level_sets/clump_handling.py
+++ b/yt/analysis_modules/level_sets/clump_handling.py
@@ -57,6 +57,9 @@
         self.min_val = self.data[field].min()
         self.max_val = self.data[field].max()
 
+        if parent is not None:
+            self.data.parent = self.parent.data
+
         # List containing characteristics about clumps that are to be written 
         # out by the write routines.
         if clump_info is None:

diff -r a6bfc511f4c12f67dbcc9d67c110457a225e5ae9 -r 6d24922b28bd90561c464b69f1982d3d94fbe8e1 yt/analysis_modules/level_sets/tests/test_clump_finding.py
--- /dev/null
+++ b/yt/analysis_modules/level_sets/tests/test_clump_finding.py
@@ -0,0 +1,74 @@
+"""
+Clump finder tests
+
+
+
+
+"""
+
+#-----------------------------------------------------------------------------
+# Copyright (c) 2016, 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 numpy as np
+
+from yt.analysis_modules.level_sets.api import \
+    Clump, \
+    find_clumps, \
+    get_lowest_clumps
+from yt.frontends.stream.api import \
+    load_uniform_grid
+from yt.testing import \
+    assert_array_equal, \
+    assert_equal
+
+def test_clump_finding():
+    n_c = 8
+    n_p = 1
+    dims = (n_c, n_c, n_c)
+
+    density = np.ones(dims)
+    high_rho = 10.
+    # add a couple disconnected density enhancements
+    density[2, 2, 2] = high_rho
+    density[6, 6, 6] = high_rho
+
+    # put a particle at the center of one of them
+    dx = 1. / n_c
+    px = 2.5 * dx * np.ones(n_p)
+    
+    data = {"density": density,
+            "particle_mass": np.ones(n_p),
+            "particle_position_x": px,
+            "particle_position_y": px,
+            "particle_position_z": px,
+            "number_of_particles": n_p}
+
+    ds = load_uniform_grid(data, dims)
+
+    ad = ds.all_data()
+    master_clump = Clump(ad, ("gas", "density"))
+    master_clump.add_validator("min_cells", 1)
+
+    find_clumps(master_clump, 0.5, 2. * high_rho, 10.)
+
+    # there should be two children
+    assert_equal(len(master_clump.children), 2)
+
+    leaf_clumps = get_lowest_clumps(master_clump)
+    # two leaf clumps
+    assert_equal(len(leaf_clumps), 2)
+
+
+    # check some clump fields
+    assert_equal(master_clump.children[0]["density"][0].size, 1)
+    assert_equal(master_clump.children[0]["density"][0], ad["density"].max())
+    assert_equal(master_clump.children[0]["particle_mass"].size, 1)
+    assert_array_equal(master_clump.children[0]["particle_mass"], ad["particle_mass"])
+    assert_equal(master_clump.children[1]["density"][0].size, 1)
+    assert_equal(master_clump.children[1]["density"][0], ad["density"].max())
+    assert_equal(master_clump.children[1]["particle_mass"].size, 0)

diff -r a6bfc511f4c12f67dbcc9d67c110457a225e5ae9 -r 6d24922b28bd90561c464b69f1982d3d94fbe8e1 yt/analysis_modules/photon_simulator/photon_simulator.py
--- a/yt/analysis_modules/photon_simulator/photon_simulator.py
+++ b/yt/analysis_modules/photon_simulator/photon_simulator.py
@@ -1194,8 +1194,9 @@
         col6 = pyfits.Column(name='FLUX', format='D', array=np.array([flux.value]))
         col7 = pyfits.Column(name='SPECTRUM', format='80A', array=np.array([phfile+"[PHLIST,1]"]))
         col8 = pyfits.Column(name='IMAGE', format='80A', array=np.array([phfile+"[PHLIST,1]"]))
+        col9 = pyfits.Column(name='SRC_NAME', format='80A', array=np.array(["yt_src"]))
 
-        coldefs = pyfits.ColDefs([col1, col2, col3, col4, col5, col6, col7, col8])
+        coldefs = pyfits.ColDefs([col1, col2, col3, col4, col5, col6, col7, col8, col9])
 
         wrhdu = pyfits.BinTableHDU.from_columns(coldefs)
         wrhdu.update_ext_name("SRC_CAT")
@@ -1350,13 +1351,17 @@
             f = pyfits.open(self.parameters["RMF"])
             nchan = int(f["EBOUNDS"].header["DETCHANS"])
             num = 0
-            for i in range(1,len(f["EBOUNDS"].columns)+1):
-                if f["EBOUNDS"].header["TTYPE%d" % i] == "CHANNEL":
+            if "MATRIX" in f:
+                mat_key = "MATRIX"
+            elif "SPECRESP MATRIX" in f:
+                mat_key = "SPECRESP MATRIX"
+            for i in range(1,len(f[mat_key].columns)+1):
+                if f[mat_key].header["TTYPE%d" % i] == "F_CHAN":
                     num = i
                     break
             if num > 0:
                 tlmin = "TLMIN%d" % num
-                cmin = int(f["EBOUNDS"].header[tlmin])
+                cmin = int(f[mat_key].header[tlmin])
             else:
                 mylog.warning("Cannot determine minimum allowed value for channel. " +
                               "Setting to 0, which may be wrong.")

diff -r a6bfc511f4c12f67dbcc9d67c110457a225e5ae9 -r 6d24922b28bd90561c464b69f1982d3d94fbe8e1 yt/analysis_modules/photon_simulator/spectral_models.py
--- a/yt/analysis_modules/photon_simulator/spectral_models.py
+++ b/yt/analysis_modules/photon_simulator/spectral_models.py
@@ -264,7 +264,7 @@
         emid = self.emid.d
         if self.thermal_broad:
             sigma = E0*np.sqrt(2.*kT*erg_per_keV/(self.A[element]*amu_grams))/cl
-            vec = broaden_lines(E0, sigma, amp, emid)*de
+            vec = broaden_lines(E0, sigma, amp, ebins)
         else:
             vec = np.histogram(E0, ebins, weights=amp)[0]
         tmpspec += vec

diff -r a6bfc511f4c12f67dbcc9d67c110457a225e5ae9 -r 6d24922b28bd90561c464b69f1982d3d94fbe8e1 yt/analysis_modules/photon_simulator/utils.pyx
--- a/yt/analysis_modules/photon_simulator/utils.pyx
+++ b/yt/analysis_modules/photon_simulator/utils.pyx
@@ -1,31 +1,30 @@
 import numpy as np
 cimport numpy as np
 cimport cython
-from libc.math cimport exp
-
-cdef double gfac = 1.0/np.sqrt(np.pi)
-
+from libc.math cimport erf
+    
 @cython.cdivision(True)
 @cython.boundscheck(False)
 @cython.wraparound(False)
 def broaden_lines(np.ndarray[np.float64_t, ndim=1] E0,
                   np.ndarray[np.float64_t, ndim=1] sigma,
                   np.ndarray[np.float64_t, ndim=1] amp,
-                  np.ndarray[np.float64_t, ndim=1] E):
+                  np.ndarray[np.float64_t, ndim=1] ebins):
 
-    cdef int i, j, n
-    cdef double x, isigma, iamp
-    cdef np.ndarray[np.float64_t, ndim=1] lines
+    cdef int i, j, n, m
+    cdef double x, isigma
+    cdef np.ndarray[np.float64_t, ndim=1] cdf, vec
 
     n = E0.shape[0]
-    m = E.shape[0]
-    lines = np.zeros(m)
-
+    m = ebins.shape[0]
+    cdf = np.zeros(m)
+    vec = np.zeros(m-1)
+    
     for i in range(n):
         isigma = 1.0/sigma[i]
-        iamp = gfac*amp[i]*isigma
         for j in range(m):
-            x = (E[j]-E0[i])*isigma
-            lines[j] += iamp*exp(-x*x)
-
-    return lines
+            x = (ebins[j]-E0[i])*isigma
+            cdf[j] = 0.5*(1+erf(x))
+        for j in range(m-1):
+            vec[j] = vec[j] + (cdf[j+1] - cdf[j])*amp[i]
+    return vec

diff -r a6bfc511f4c12f67dbcc9d67c110457a225e5ae9 -r 6d24922b28bd90561c464b69f1982d3d94fbe8e1 yt/data_objects/selection_data_containers.py
--- a/yt/data_objects/selection_data_containers.py
+++ b/yt/data_objects/selection_data_containers.py
@@ -24,12 +24,13 @@
     iterable, \
     validate_width_tuple, \
     fix_length
+from yt.geometry.selection_routines import \
+    points_in_cells
 from yt.units.yt_array import \
     YTArray
 from yt.utilities.exceptions import \
     YTSphereTooSmall, \
     YTIllDefinedCutRegion, \
-    YTMixedCutRegion, \
     YTEllipsoidOrdering
 from yt.utilities.minimal_representation import \
     MinimalSliceData
@@ -793,8 +794,10 @@
         for field in fields:
             f = self.base_object[field]
             if f.shape != ind.shape:
-                raise YTMixedCutRegion(self.conditionals, field)
-            self.field_data[field] = self.base_object[field][ind]
+                parent = getattr(self, "parent", self.base_object)
+                self.field_data[field] = parent[field][self._part_ind]
+            else:
+                self.field_data[field] = self.base_object[field][ind]
 
     @property
     def blocks(self):
@@ -822,6 +825,22 @@
                 np.logical_and(res, ind, ind)
         return ind
 
+    _particle_mask = None
+    @property
+    def _part_ind(self):
+        if self._particle_mask is None:
+            parent = getattr(self, "parent", self.base_object)
+            units = "code_length"
+            mask = points_in_cells(
+                self["x"].to(units), self["y"].to(units),
+                self["z"].to(units), self["dx"].to(units),
+                self["dy"].to(units), self["dz"].to(units),
+                parent["particle_position_x"].to(units),
+                parent["particle_position_y"].to(units),
+                parent["particle_position_z"].to(units))
+            self._particle_mask = mask
+        return self._particle_mask
+
     @property
     def icoords(self):
         return self.base_object.icoords[self._cond_ind,:]

diff -r a6bfc511f4c12f67dbcc9d67c110457a225e5ae9 -r 6d24922b28bd90561c464b69f1982d3d94fbe8e1 yt/fields/astro_fields.py
--- a/yt/fields/astro_fields.py
+++ b/yt/fields/astro_fields.py
@@ -136,7 +136,8 @@
     registry.add_field((ftype, "sz_kinetic"),
                        function=_sz_kinetic,
                        units=unit_system["length"]**-1,
-                       validators=[ValidateParameter("axis")])
+                       validators=[
+                           ValidateParameter("axis", {'axis': [0, 1, 2]})])
 
     def _szy(field, data):
         scale = 0.88 / mh * kboltz / (me * clight*clight) * sigma_thompson

diff -r a6bfc511f4c12f67dbcc9d67c110457a225e5ae9 -r 6d24922b28bd90561c464b69f1982d3d94fbe8e1 yt/fields/derived_field.py
--- a/yt/fields/derived_field.py
+++ b/yt/fields/derived_field.py
@@ -23,6 +23,7 @@
     NeedsDataField, \
     NeedsProperty, \
     NeedsParameter, \
+    NeedsParameterValue, \
     FieldUnitsError
 from .field_detector import \
     FieldDetector
@@ -256,14 +257,21 @@
     pass
 
 class ValidateParameter(FieldValidator):
-    def __init__(self, parameters):
+    def __init__(self, parameters, parameter_values=None):
         """
         This validator ensures that the dataset has a given parameter.
+
+        If *parameter_values* is supplied, this will also ensure that the field
+        is available for all permutations of the field parameter.
         """
         FieldValidator.__init__(self)
         self.parameters = ensure_list(parameters)
+        self.parameter_values = parameter_values
     def __call__(self, data):
         doesnt_have = []
+        if self.parameter_values is not None:
+            if isinstance(data, FieldDetector):
+                raise NeedsParameterValue(self.parameter_values)
         for p in self.parameters:
             if not data.has_field_parameter(p):
                 doesnt_have.append(p)

diff -r a6bfc511f4c12f67dbcc9d67c110457a225e5ae9 -r 6d24922b28bd90561c464b69f1982d3d94fbe8e1 yt/fields/field_detector.py
--- a/yt/fields/field_detector.py
+++ b/yt/fields/field_detector.py
@@ -17,7 +17,8 @@
 from collections import defaultdict
 from yt.units.yt_array import YTArray
 from .field_exceptions import \
-    NeedsGridType
+    NeedsGridType, \
+    NeedsParameterValue
 
 class FieldDetector(defaultdict):
     Level = 1
@@ -26,7 +27,7 @@
     _id_offset = 0
     domain_id = 0
 
-    def __init__(self, nd = 16, ds = None, flat = False):
+    def __init__(self, nd = 16, ds = None, flat = False, field_parameters=None):
         self.nd = nd
         self.flat = flat
         self._spatial = not flat
@@ -36,6 +37,7 @@
         self.LeftEdge = [0.0, 0.0, 0.0]
         self.RightEdge = [1.0, 1.0, 1.0]
         self.dds = np.ones(3, "float64")
+        self.field_parameters = field_parameters
         class fake_dataset(defaultdict):
             pass
 
@@ -106,6 +108,32 @@
                 for i in nfd.requested_parameters:
                     if i not in self.requested_parameters:
                         self.requested_parameters.append(i)
+            except NeedsParameterValue as npv:
+                # redo field detection with a new FieldDetector, ensuring
+                # all needed field parameter values are set
+                for param in npv.parameter_values:
+                    # temporarily remove any ValidateParameter instances for
+                    # this field to avoid infinitely re-raising
+                    # NeedsParameterValue exceptions
+                    saved_validators = []
+                    for i, validator in enumerate(finfo.validators):
+                        params = getattr(validator, 'parameters', [])
+                        if param in params:
+                            saved_validators.append(validator)
+                            del finfo.validators[i]
+
+                    for pv in npv.parameter_values[param]:
+                        nfd = FieldDetector(self.nd, ds=self.ds,
+                                            field_parameters={param: pv})
+                        vv = finfo(nfd)
+                        for i in nfd.requested:
+                            if i not in self.requested:
+                                self.requested.append(i)
+                        for i in nfd.requested_parameters:
+                            if i not in self.requested_parameters:
+                                self.requested_parameters.append(i)
+
+                    finfo.validators.extend(saved_validators)
             if vv is not None:
                 if not self.flat: self[item] = vv
                 else: self[item] = vv.ravel()
@@ -176,6 +204,8 @@
         }
 
     def get_field_parameter(self, param, default = 0.0):
+        if self.field_parameters and param in self.field_parameters:
+            return self.field_parameters[param]
         self.requested_parameters.append(param)
         if param in ['bulk_velocity', 'center', 'normal']:
             return self.ds.arr(np.random.random(3) * 1e-2, self.fp_units[param])

diff -r a6bfc511f4c12f67dbcc9d67c110457a225e5ae9 -r 6d24922b28bd90561c464b69f1982d3d94fbe8e1 yt/fields/field_exceptions.py
--- a/yt/fields/field_exceptions.py
+++ b/yt/fields/field_exceptions.py
@@ -46,6 +46,10 @@
     def __str__(self):
         return "(%s)" % (self.missing_parameters)
 
+class NeedsParameterValue(ValidationException):
+    def __init__(self, parameter_values):
+        self.parameter_values = parameter_values
+
 class NeedsConfiguration(ValidationException):
     def __init__(self, parameter, value):
         self.parameter = parameter

diff -r a6bfc511f4c12f67dbcc9d67c110457a225e5ae9 -r 6d24922b28bd90561c464b69f1982d3d94fbe8e1 yt/fields/species_fields.py
--- a/yt/fields/species_fields.py
+++ b/yt/fields/species_fields.py
@@ -90,6 +90,10 @@
                        particle_type = particle_type,
                        units = unit_system["number_density"])
 
+    return [(ftype, "%s_number_density" % species),
+            (ftype, "%s_density" % species),
+            (ftype, "%s_mass" % species)]
+
 def add_species_field_by_fraction(registry, ftype, species, 
                                   particle_type = False):
     """
@@ -114,6 +118,10 @@
                        particle_type = particle_type,
                        units = unit_system["number_density"])
 
+    return [(ftype, "%s_number_density" % species),
+            (ftype, "%s_density" % species),
+            (ftype, "%s_mass" % species)]
+
 def add_species_aliases(registry, ftype, alias_species, species):
     """
     This takes a field registry, a fluid type, and two species names.  

diff -r a6bfc511f4c12f67dbcc9d67c110457a225e5ae9 -r 6d24922b28bd90561c464b69f1982d3d94fbe8e1 yt/frontends/art/api.py
--- a/yt/frontends/art/api.py
+++ b/yt/frontends/art/api.py
@@ -17,7 +17,8 @@
       ARTDomainFile,\
       ARTDomainSubset,\
       ARTIndex,\
-      ARTDataset
+      ARTDataset, \
+      DarkMatterARTDataset
 
 from .fields import \
       ARTFieldInfo

diff -r a6bfc511f4c12f67dbcc9d67c110457a225e5ae9 -r 6d24922b28bd90561c464b69f1982d3d94fbe8e1 yt/frontends/art/data_structures.py
--- a/yt/frontends/art/data_structures.py
+++ b/yt/frontends/art/data_structures.py
@@ -633,6 +633,10 @@
             return False
         if not f.endswith(suffix):
             return False
+        if "s0" not in f:
+            # ATOMIC.DAT, for instance, passes the other tests, but then dies
+            # during _find_files because it can't be split.
+            return False
         with open(f, 'rb') as fh:
             try:
                 amr_prefix, amr_suffix = filename_pattern['amr']

diff -r a6bfc511f4c12f67dbcc9d67c110457a225e5ae9 -r 6d24922b28bd90561c464b69f1982d3d94fbe8e1 yt/frontends/eagle/tests/test_outputs.py
--- a/yt/frontends/eagle/tests/test_outputs.py
+++ b/yt/frontends/eagle/tests/test_outputs.py
@@ -24,3 +24,10 @@
 @requires_file(s28)
 def test_EagleDataset():
     assert isinstance(data_dir_load(s28), EagleDataset)
+
+s399 = "snipshot_399_z000p000/snip_399_z000p000.0.hdf5"
+ at requires_file(s399)
+def test_Snipshot():
+    ds = data_dir_load(s399)
+    ds.index
+    assert isinstance(ds, EagleDataset)

diff -r a6bfc511f4c12f67dbcc9d67c110457a225e5ae9 -r 6d24922b28bd90561c464b69f1982d3d94fbe8e1 yt/frontends/gadget/tests/test_outputs.py
--- a/yt/frontends/gadget/tests/test_outputs.py
+++ b/yt/frontends/gadget/tests/test_outputs.py
@@ -25,7 +25,6 @@
 
 isothermal_h5 = "IsothermalCollapse/snap_505.hdf5"
 isothermal_bin = "IsothermalCollapse/snap_505"
-g64 = "gizmo_64/output/snap_N64L16_135.hdf5"
 
 # This maps from field names to weight field names to use for projections
 iso_fields = OrderedDict(
@@ -42,11 +41,6 @@
 )
 iso_kwargs = dict(bounding_box=[[-3, 3], [-3, 3], [-3, 3]])
 
-g64_fields = iso_fields.copy()
-g64_fields["deposit", "PartType4_density"] = None
-g64_kwargs = dict(bounding_box=[[-1e5, 1e5], [-1e5, 1e5], [-1e5, 1e5]])
-
-
 @requires_file(isothermal_h5)
 @requires_file(isothermal_bin)
 def test_GadgetDataset():
@@ -62,10 +56,3 @@
     for test in sph_answer(ds, 'snap_505', 2**17, iso_fields):
         test_iso_collapse.__name__ = test.description
         yield test
-
- at requires_ds(g64, big_data=True)
-def test_gizmo_64():
-    ds = data_dir_load(g64, kwargs=g64_kwargs)
-    for test in sph_answer(ds, 'snap_N64L16_135', 524288, g64_fields):
-        test_gizmo_64.__name__ = test.description
-        yield test

diff -r a6bfc511f4c12f67dbcc9d67c110457a225e5ae9 -r 6d24922b28bd90561c464b69f1982d3d94fbe8e1 yt/frontends/gdf/api.py
--- a/yt/frontends/gdf/api.py
+++ b/yt/frontends/gdf/api.py
@@ -23,3 +23,5 @@
 
 from .io import \
       IOHandlerGDFHDF5
+
+from . import tests

diff -r a6bfc511f4c12f67dbcc9d67c110457a225e5ae9 -r 6d24922b28bd90561c464b69f1982d3d94fbe8e1 yt/frontends/gizmo/fields.py
--- a/yt/frontends/gizmo/fields.py
+++ b/yt/frontends/gizmo/fields.py
@@ -99,6 +99,15 @@
               data[ptype, "%s_metallicity" % species]
 
         num_neighbors = 64
+        for species in ['H', 'H_p0', 'H_p1']:
+            for suf in ["_density", "_number_density"]:
+                field = "%s%s" % (species, suf)
+                fn = add_volume_weighted_smoothed_field(
+                    ptype, "particle_position", "particle_mass",
+                    "smoothing_length", "density", field,
+                    self, num_neighbors)
+                self.alias(("gas", field), fn[0])
+
         for species in self.nuclei_names:
             self.add_field(
                 (ptype, "%s_nuclei_mass_density" % species),

diff -r a6bfc511f4c12f67dbcc9d67c110457a225e5ae9 -r 6d24922b28bd90561c464b69f1982d3d94fbe8e1 yt/frontends/gizmo/tests/test_outputs.py
--- a/yt/frontends/gizmo/tests/test_outputs.py
+++ b/yt/frontends/gizmo/tests/test_outputs.py
@@ -34,13 +34,16 @@
         (('gas', 'velocity_magnitude'), None),
         (("deposit", "all_count"), None),
         (("deposit", "all_cic"), None),
+        (("deposit", "PartType0_density"), None),
     ]
 )
 
- at requires_ds(FIRE_m12i)
-def test_GizmoDataset():
-    ds = data_dir_load(FIRE_m12i)
+g64 = "gizmo_64/output/snap_N64L16_135.hdf5"
+
+ at requires_ds(g64, big_data=True)
+def test_gizmo_64():
+    ds = data_dir_load(g64)
     assert isinstance(ds, GizmoDataset)
-    for test in sph_answer(ds, 'snapshot_600', 4786950, fields):
-        test_GizmoDataset.__name__ = test.description
+    for test in sph_answer(ds, 'snap_N64L16_135', 524288, fields):
+        test_gizmo_64.__name__ = test.description
         yield test

diff -r a6bfc511f4c12f67dbcc9d67c110457a225e5ae9 -r 6d24922b28bd90561c464b69f1982d3d94fbe8e1 yt/frontends/owls/fields.py
--- a/yt/frontends/owls/fields.py
+++ b/yt/frontends/owls/fields.py
@@ -76,8 +76,6 @@
 
         smoothed_suffixes = ("_number_density", "_density", "_mass")
 
-
-
         # we add particle element fields for stars and gas
         #-----------------------------------------------------
         if ptype in self._add_elements:
@@ -144,6 +142,9 @@
                     symbol = ion[0:1].capitalize()
                     roman = int(ion[1:])
 
+                if (ptype, symbol + "_fraction") not in self.field_aliases:
+                    continue
+
                 pstr = "_p" + str(roman-1)
                 yt_ion = symbol + pstr
 
@@ -166,6 +167,9 @@
                     symbol = ion[0:1].capitalize()
                     roman = int(ion[1:])
 
+                if (ptype, symbol + "_fraction") not in self.field_aliases:
+                    continue
+
                 pstr = "_p" + str(roman-1)
                 yt_ion = symbol + pstr
 
@@ -201,6 +205,9 @@
                 symbol = ion[0:1].capitalize()
                 roman = int(ion[1:])
 
+            if (ptype, symbol + "_fraction") not in self.field_aliases:
+                continue
+
             pstr = "_p" + str(roman-1)
             yt_ion = symbol + pstr
             ftype = ptype

diff -r a6bfc511f4c12f67dbcc9d67c110457a225e5ae9 -r 6d24922b28bd90561c464b69f1982d3d94fbe8e1 yt/funcs.py
--- a/yt/funcs.py
+++ b/yt/funcs.py
@@ -963,3 +963,24 @@
     except ImportError:
         requests = None
     return requests
+
+ at contextlib.contextmanager
+def dummy_context_manager(*args, **kwargs):
+    yield
+
+def matplotlib_style_context(style_name=None, after_reset=True):
+    """Returns a context manager for controlling matplotlib style.
+
+    Arguments are passed to matplotlib.style.context() if specified. Defaults
+    to setting "classic" style, after resetting to the default config parameters.
+
+    On older matplotlib versions (<=1.5.0) where matplotlib.style isn't
+    available, returns a dummy context manager.
+    """
+    if style_name is None:
+        style_name = 'classic'
+    try:
+        import matplotlib.style
+        return matplotlib.style.context(style_name, after_reset=after_reset)
+    except ImportError:
+        return dummy_context_manager()

diff -r a6bfc511f4c12f67dbcc9d67c110457a225e5ae9 -r 6d24922b28bd90561c464b69f1982d3d94fbe8e1 yt/geometry/coordinates/cartesian_coordinates.py
--- a/yt/geometry/coordinates/cartesian_coordinates.py
+++ b/yt/geometry/coordinates/cartesian_coordinates.py
@@ -29,6 +29,7 @@
 
 
 class CartesianCoordinateHandler(CoordinateHandler):
+    name = "cartesian"
 
     def __init__(self, ds, ordering = ('x','y','z')):
         super(CartesianCoordinateHandler, self).__init__(ds, ordering)

diff -r a6bfc511f4c12f67dbcc9d67c110457a225e5ae9 -r 6d24922b28bd90561c464b69f1982d3d94fbe8e1 yt/geometry/coordinates/coordinate_handler.py
--- a/yt/geometry/coordinates/coordinate_handler.py
+++ b/yt/geometry/coordinates/coordinate_handler.py
@@ -71,6 +71,7 @@
                     ds.quan(width[0], fix_unitary(width[1])))
 
 class CoordinateHandler(object):
+    name = None
     
     def __init__(self, ds, ordering):
         self.ds = weakref.proxy(ds)
@@ -132,10 +133,13 @@
         self._axis_id = ai
         return ai
 
+    _image_axis_name = None
     @property
     def image_axis_name(self):
         # Default
-        rv = {}
+        if self._image_axis_name is not None:
+            return self._image_axis_name
+        self._image_axis_name = rv = {}
         for i in range(3):
             rv[i] = (self.axis_name[self.x_axis[i]],
                      self.axis_name[self.y_axis[i]])

diff -r a6bfc511f4c12f67dbcc9d67c110457a225e5ae9 -r 6d24922b28bd90561c464b69f1982d3d94fbe8e1 yt/geometry/coordinates/cylindrical_coordinates.py
--- a/yt/geometry/coordinates/cylindrical_coordinates.py
+++ b/yt/geometry/coordinates/cylindrical_coordinates.py
@@ -28,6 +28,7 @@
 #
 
 class CylindricalCoordinateHandler(CoordinateHandler):
+    name = "cylindrical"
 
     def __init__(self, ds, ordering = ('r', 'z', 'theta')):
         super(CylindricalCoordinateHandler, self).__init__(ds, ordering)

diff -r a6bfc511f4c12f67dbcc9d67c110457a225e5ae9 -r 6d24922b28bd90561c464b69f1982d3d94fbe8e1 yt/geometry/coordinates/geographic_coordinates.py
--- a/yt/geometry/coordinates/geographic_coordinates.py
+++ b/yt/geometry/coordinates/geographic_coordinates.py
@@ -23,6 +23,7 @@
     pixelize_cylinder, pixelize_aitoff
 
 class GeographicCoordinateHandler(CoordinateHandler):
+    name = "geographic"
 
     def __init__(self, ds, ordering = ('latitude', 'longitude', 'altitude')):
         super(GeographicCoordinateHandler, self).__init__(ds, ordering)

diff -r a6bfc511f4c12f67dbcc9d67c110457a225e5ae9 -r 6d24922b28bd90561c464b69f1982d3d94fbe8e1 yt/geometry/coordinates/polar_coordinates.py
--- a/yt/geometry/coordinates/polar_coordinates.py
+++ b/yt/geometry/coordinates/polar_coordinates.py
@@ -18,6 +18,7 @@
 
 
 class PolarCoordinateHandler(CylindricalCoordinateHandler):
+    name = "polar"
 
     def __init__(self, ds, ordering = ('r', 'theta', 'z')):
         super(PolarCoordinateHandler, self).__init__(ds, ordering)

diff -r a6bfc511f4c12f67dbcc9d67c110457a225e5ae9 -r 6d24922b28bd90561c464b69f1982d3d94fbe8e1 yt/geometry/coordinates/spec_cube_coordinates.py
--- a/yt/geometry/coordinates/spec_cube_coordinates.py
+++ b/yt/geometry/coordinates/spec_cube_coordinates.py
@@ -20,6 +20,7 @@
     _get_coord_fields
 
 class SpectralCubeCoordinateHandler(CartesianCoordinateHandler):
+    name = "spectral_cube"
 
     def __init__(self, ds, ordering = ('x', 'y', 'z')):
         ordering = tuple("xyz"[axis] for axis in

diff -r a6bfc511f4c12f67dbcc9d67c110457a225e5ae9 -r 6d24922b28bd90561c464b69f1982d3d94fbe8e1 yt/geometry/coordinates/spherical_coordinates.py
--- a/yt/geometry/coordinates/spherical_coordinates.py
+++ b/yt/geometry/coordinates/spherical_coordinates.py
@@ -23,6 +23,7 @@
     pixelize_cylinder, pixelize_aitoff
 
 class SphericalCoordinateHandler(CoordinateHandler):
+    name = "spherical"
 
     def __init__(self, ds, ordering = ('r', 'theta', 'phi')):
         super(SphericalCoordinateHandler, self).__init__(ds, ordering)

diff -r a6bfc511f4c12f67dbcc9d67c110457a225e5ae9 -r 6d24922b28bd90561c464b69f1982d3d94fbe8e1 yt/geometry/selection_routines.pyx
--- a/yt/geometry/selection_routines.pyx
+++ b/yt/geometry/selection_routines.pyx
@@ -2046,3 +2046,42 @@
         return ("halo_particles", self.halo_id)
 
 halo_particles_selector = HaloParticlesSelector
+
+ at cython.cdivision(True)
+ at cython.boundscheck(False)
+ at cython.wraparound(False)
+def points_in_cells(
+        np.float64_t[:] cx,
+        np.float64_t[:] cy,
+        np.float64_t[:] cz,
+        np.float64_t[:] dx,
+        np.float64_t[:] dy,
+        np.float64_t[:] dz,
+        np.float64_t[:] px,
+        np.float64_t[:] py,
+        np.float64_t[:] pz):
+    # Take a list of cells and particles and calculate which particles
+    # are enclosed within one of the cells.  This is used for querying
+    # particle fields on clump/contour objects.
+    # We use brute force since the cells are a relatively unordered collection.
+
+    cdef int p, c, n_p, n_c
+
+    n_p = px.size
+    n_c = cx.size
+    mask = np.ones(n_p, dtype="bool")
+
+    for p in range(n_p):
+        for c in range(n_c):
+            if fabs(px[p] - cx[c]) > 0.5 * dx[c]:
+                mask[p] = False
+                continue
+            if fabs(py[p] - cy[c]) > 0.5 * dy[c]:
+                mask[p] = False
+                continue
+            if fabs(pz[p] - cz[c]) > 0.5 * dz[c]:
+                mask[p] = False
+                continue
+            if mask[p]: break
+
+    return mask

diff -r a6bfc511f4c12f67dbcc9d67c110457a225e5ae9 -r 6d24922b28bd90561c464b69f1982d3d94fbe8e1 yt/units/tests/test_units.py
--- a/yt/units/tests/test_units.py
+++ b/yt/units/tests/test_units.py
@@ -477,6 +477,9 @@
     test_unit = Unit('cm**-3', base_value=1.0, registry=ds.unit_registry)
     assert_equal(test_unit.latex_repr, '\\frac{1}{\\rm{cm}^{3}}')
 
+    test_unit = Unit('m_geom/l_geom**3')
+    assert_equal(test_unit.latex_repr, '\\frac{1}{M_\\odot^{2}}')
+
 def test_latitude_longitude():
     lat = unit_symbols.lat
     lon = unit_symbols.lon

diff -r a6bfc511f4c12f67dbcc9d67c110457a225e5ae9 -r 6d24922b28bd90561c464b69f1982d3d94fbe8e1 yt/units/tests/test_ytarray.py
--- a/yt/units/tests/test_ytarray.py
+++ b/yt/units/tests/test_ytarray.py
@@ -626,6 +626,29 @@
     new_length = fix_length(length, ds=ds)
     yield assert_equal, YTQuantity(10, 'cm'), new_length
 
+def test_code_unit_combinations():
+    """
+    Test comparing code units coming from different datasets
+    """
+    ds1 = fake_random_ds(64, nprocs=1, length_unit=1)
+    ds2 = fake_random_ds(64, nprocs=1, length_unit=10)
+
+    q1 = ds1.quan(1, 'code_length')
+    q2 = ds2.quan(1, 'code_length')
+
+    assert_equal(10*q1, q2)
+    assert_equal(q1/q2, 0.1)
+    assert_true(q1 < q2)
+    assert_true(q2 > q1)
+    assert_true(not bool(q1 > q2))
+    assert_true(not bool(q2 < q1))
+    assert_true(q1 != q2)
+    assert_true(not bool(q1 == q2))
+
+    assert_equal((q1 + q2).in_cgs().value, 11)
+    assert_equal((q2 + q1).in_cgs().value, 11)
+    assert_equal((q1 - q2).in_cgs().value, -9)
+    assert_equal((q2 - q1).in_cgs().value, 9)
 
 def test_ytarray_pickle():
     ds = fake_random_ds(64, nprocs=1)

diff -r a6bfc511f4c12f67dbcc9d67c110457a225e5ae9 -r 6d24922b28bd90561c464b69f1982d3d94fbe8e1 yt/units/unit_lookup_table.py
--- a/yt/units/unit_lookup_table.py
+++ b/yt/units/unit_lookup_table.py
@@ -23,7 +23,7 @@
     planck_charge_esu, planck_energy_erg, planck_mass_grams, \
     planck_temperature_K, planck_time_s, mass_hydrogen_grams, \
     grams_per_pound, standard_gravity_cm_per_s2, pascal_per_atm, \
-    newton_cgs
+    newton_cgs, cm_per_rearth, cm_per_rjup
 import numpy as np
 
 # Lookup a unit symbol with the symbol string, and provide a tuple with the
@@ -87,6 +87,8 @@
     "msun": (mass_sun_grams, dimensions.mass, 0.0, r"M_\odot"),
     "Rsun": (cm_per_rsun, dimensions.length, 0.0, r"R_\odot"),
     "rsun": (cm_per_rsun, dimensions.length, 0.0, r"R_\odot"),
+    "R_sun": (cm_per_rsun, dimensions.length, 0.0, r"R_\odot"),
+    "r_sun": (cm_per_rsun, dimensions.length, 0.0, r"R_\odot"),
     "Lsun": (luminosity_sun_ergs_per_sec, dimensions.power, 0.0, r"L_\odot"),
     "Tsun": (temp_sun_kelvin, dimensions.temperature, 0.0, r"T_\odot"),
     "Zsun": (metallicity_sun, dimensions.dimensionless, 0.0, r"Z_\odot"),
@@ -151,6 +153,12 @@
     "m_geom": (mass_sun_grams, dimensions.mass, 0.0, r"M_\odot"),
     "l_geom": (newton_cgs*mass_sun_grams/speed_of_light_cm_per_s**2, dimensions.length, 0.0, r"M_\odot"),
     "t_geom": (newton_cgs*mass_sun_grams/speed_of_light_cm_per_s**3, dimensions.time, 0.0, r"M_\odot"),
+
+    # Some Solar System units
+    "R_earth": (cm_per_rearth, dimensions.length, 0.0, r"R_\oplus"),
+    "r_earth": (cm_per_rearth, dimensions.length, 0.0, r"R_\oplus"),
+    "R_jup": (cm_per_rjup, dimensions.length, 0.0, r"R_\mathrm{Jup}"),
+    "r_jup": (cm_per_rjup, dimensions.length, 0.0, r"R_\mathrm{Jup}"),
 }
 
 # This dictionary formatting from magnitude package, credit to Juan Reyero.

diff -r a6bfc511f4c12f67dbcc9d67c110457a225e5ae9 -r 6d24922b28bd90561c464b69f1982d3d94fbe8e1 yt/units/unit_object.py
--- a/yt/units/unit_object.py
+++ b/yt/units/unit_object.py
@@ -110,8 +110,25 @@
             symbol_table[ex] = registry.lut[str(ex)][3]
         except:
             symbol_table[ex] = r"\rm{" + str(ex).replace('_', '\ ') + "}"
+
+    # invert the symbol table dict to look for keys with identical values
+    invert_symbols = {}
+    for key, value in symbol_table.items():
+        if value not in invert_symbols:
+            invert_symbols[value] = [key]
+        else:
+            invert_symbols[value].append(key)
+
+    # if there are any units with identical latex representations, substitute
+    # units to avoid  uncanceled terms in the final latex expresion.
+    for val in invert_symbols:
+        symbols = invert_symbols[val]
+        for i in range(1, len(symbols)):
+            expr = expr.subs(symbols[i], symbols[0])
+
     latex_repr = latex(expr, symbol_names=symbol_table, mul_symbol="dot",
                        fold_frac_powers=True, fold_short_frac=True)
+
     if latex_repr == '1':
         return ''
     else:
@@ -258,7 +275,11 @@
     def latex_repr(self):
         if self._latex_repr is not None:
             return self._latex_repr
-        self._latex_repr = get_latex_representation(self.expr, self.registry)
+        if self.expr.is_Atom:
+            expr = self.expr
+        else:
+            expr = self.expr.copy()
+        self._latex_repr = get_latex_representation(expr, self.registry)
         return self._latex_repr
 
     ### Some sympy conventions

diff -r a6bfc511f4c12f67dbcc9d67c110457a225e5ae9 -r 6d24922b28bd90561c464b69f1982d3d94fbe8e1 yt/units/unit_symbols.py
--- a/yt/units/unit_symbols.py
+++ b/yt/units/unit_symbols.py
@@ -116,11 +116,11 @@
 
 Msun = solar_mass = quan(1.0, "Msun")
 msun = quan(1.0, "msun")
-Rsun = solar_radius = quan(1.0, "Rsun")
-rsun = quan(1.0, "rsun")
-Lsun = lsun = solar_luminosity = quan(1.0, "Lsun")
-Tsun = solar_temperature = quan(1.0, "Tsun")
-Zsun = solar_metallicity = quan(1.0, "Zsun")
+Rsun = R_sun = solar_radius = quan(1.0, "Rsun")
+rsun = r_sun = quan(1.0, "rsun")
+Lsun = lsun = l_sun = solar_luminosity = quan(1.0, "Lsun")
+Tsun = T_sun = solar_temperature = quan(1.0, "Tsun")
+Zsun = Z_sun = solar_metallicity = quan(1.0, "Zsun")
 
 #
 # Misc Astronomical units
@@ -129,6 +129,10 @@
 AU = astronomical_unit = quan(1.0, "AU")
 au = quan(1.0, "au")
 ly = light_year = quan(1.0, "ly")
+Rearth = R_earth = earth_radius = quan(1.0, 'R_earth')
+rearth = r_earth = quan(1.0, 'r_earth')
+Rjup = R_jup = jupiter_radius = quan(1.0, 'R_jup')
+rjup = r_jup = quan(1.0, 'r_jup')
 
 #
 # Physical units

diff -r a6bfc511f4c12f67dbcc9d67c110457a225e5ae9 -r 6d24922b28bd90561c464b69f1982d3d94fbe8e1 yt/units/yt_array.py
--- a/yt/units/yt_array.py
+++ b/yt/units/yt_array.py
@@ -167,7 +167,8 @@
     # Check that other is a YTArray.
     if hasattr(other, 'units'):
         if this.units.expr is other.units.expr:
-            return other
+            if this.units.base_value == other.units.base_value:
+                return other
         if not this.units.same_dimensions_as(other.units):
             raise YTUnitOperationError(op_string, this.units, other.units)
         return other.in_units(this.units)

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

https://bitbucket.org/yt_analysis/yt/commits/4dba2f98fb2a/
Changeset:   4dba2f98fb2a
Branch:      yt
User:        MatthewTurk
Date:        2016-06-15 19:13:08+00:00
Summary:     Removing _MPL.c
Affected #:  1 file

diff -r 6d24922b28bd90561c464b69f1982d3d94fbe8e1 -r 4dba2f98fb2acee3bde29f47a3088183c6728fd3 setup.py
--- a/setup.py
+++ b/setup.py
@@ -216,9 +216,6 @@
               depends=glob.glob("yt/frontends/artio/artio_headers/*.c")),
     Extension("yt.utilities.spatial._distance_wrap",
               glob.glob("yt/utilities/spatial/src/*.c")),
-    Extension("yt.visualization._MPL",
-              ["yt/visualization/_MPL.c"],
-              libraries=std_libs),
 ]
 
 # EMBREE


https://bitbucket.org/yt_analysis/yt/commits/7a3d3b66ed4d/
Changeset:   7a3d3b66ed4d
Branch:      yt
User:        MatthewTurk
Date:        2016-06-15 21:57:22+00:00
Summary:     Re-generating tests for flash and plotwindow.
Affected #:  1 file

diff -r 4dba2f98fb2acee3bde29f47a3088183c6728fd3 -r 7a3d3b66ed4deaaf357e05cce9f4c493ab446091 tests/tests.yaml
--- a/tests/tests.yaml
+++ b/tests/tests.yaml
@@ -14,7 +14,7 @@
   local_fits_000:
     - yt/frontends/fits/tests/test_outputs.py
 
-  local_flash_001:
+  local_flash_002:
     - yt/frontends/flash/tests/test_outputs.py
 
   local_gadget_000:
@@ -39,7 +39,7 @@
   local_owls_000:
     - yt/frontends/owls/tests/test_outputs.py
   
-  local_pw_000:
+  local_pw_001:
     - yt/visualization/tests/test_plotwindow.py:test_attributes
     - yt/visualization/tests/test_plotwindow.py:test_attributes_wt
     - yt/visualization/tests/test_profile_plots.py:test_phase_plot_attributes


https://bitbucket.org/yt_analysis/yt/commits/5da31254f065/
Changeset:   5da31254f065
Branch:      yt
User:        xarthisius
Date:        2016-06-17 12:59:37+00:00
Summary:     Merged in MatthewTurk/yt (pull request #1973)

Switch to Cython version of pixelize_cartesian
Affected #:  7 files

diff -r 92004fd9fd3311c20db06616f206d0939a186abb -r 5da31254f065d004d45d5e182f674f1cce9ea57f setup.py
--- a/setup.py
+++ b/setup.py
@@ -216,9 +216,6 @@
               depends=glob.glob("yt/frontends/artio/artio_headers/*.c")),
     Extension("yt.utilities.spatial._distance_wrap",
               glob.glob("yt/utilities/spatial/src/*.c")),
-    Extension("yt.visualization._MPL",
-              ["yt/visualization/_MPL.c"],
-              libraries=std_libs),
 ]
 
 # EMBREE

diff -r 92004fd9fd3311c20db06616f206d0939a186abb -r 5da31254f065d004d45d5e182f674f1cce9ea57f tests/tests.yaml
--- a/tests/tests.yaml
+++ b/tests/tests.yaml
@@ -14,7 +14,7 @@
   local_fits_000:
     - yt/frontends/fits/tests/test_outputs.py
 
-  local_flash_001:
+  local_flash_002:
     - yt/frontends/flash/tests/test_outputs.py
 
   local_gadget_000:
@@ -39,7 +39,7 @@
   local_owls_000:
     - yt/frontends/owls/tests/test_outputs.py
   
-  local_pw_000:
+  local_pw_001:
     - yt/visualization/tests/test_plotwindow.py:test_attributes
     - yt/visualization/tests/test_plotwindow.py:test_attributes_wt
     - yt/visualization/tests/test_profile_plots.py:test_phase_plot_attributes
@@ -47,7 +47,7 @@
     - yt/visualization/tests/test_particle_plot.py:test_particle_projection_filter
     - yt/visualization/tests/test_particle_plot.py:test_particle_phase_answers
   
-  local_tipsy_000:
+  local_tipsy_001:
     - yt/frontends/tipsy/tests/test_outputs.py
   
   local_varia_001:

diff -r 92004fd9fd3311c20db06616f206d0939a186abb -r 5da31254f065d004d45d5e182f674f1cce9ea57f yt/geometry/coordinates/cartesian_coordinates.py
--- a/yt/geometry/coordinates/cartesian_coordinates.py
+++ b/yt/geometry/coordinates/cartesian_coordinates.py
@@ -23,9 +23,9 @@
     cylindrical_to_cartesian
 from yt.funcs import mylog
 from yt.utilities.lib.pixelization_routines import \
-    pixelize_element_mesh, pixelize_off_axis_cartesian
+    pixelize_element_mesh, pixelize_off_axis_cartesian, \
+    pixelize_cartesian
 from yt.data_objects.unstructured_mesh import SemiStructuredMesh
-import yt.visualization._MPL as _MPL
 
 
 class CartesianCoordinateHandler(CoordinateHandler):
@@ -128,7 +128,7 @@
         period[1] = self.period[self.y_axis[dim]]
         if hasattr(period, 'in_units'):
             period = period.in_units("code_length").d
-        buff = _MPL.Pixelize(data_source['px'], data_source['py'],
+        buff = pixelize_cartesian(data_source['px'], data_source['py'],
                              data_source['pdx'], data_source['pdy'],
                              data_source[field], size[0], size[1],
                              bounds, int(antialias),

diff -r 92004fd9fd3311c20db06616f206d0939a186abb -r 5da31254f065d004d45d5e182f674f1cce9ea57f yt/geometry/coordinates/cylindrical_coordinates.py
--- a/yt/geometry/coordinates/cylindrical_coordinates.py
+++ b/yt/geometry/coordinates/cylindrical_coordinates.py
@@ -21,9 +21,8 @@
     _get_coord_fields, \
     cylindrical_to_cartesian, \
     cartesian_to_cylindrical
-import yt.visualization._MPL as _MPL
 from yt.utilities.lib.pixelization_routines import \
-    pixelize_cylinder
+    pixelize_cartesian, pixelize_cylinder
 #
 # Cylindrical fields
 #
@@ -114,11 +113,11 @@
         period[1] = self.period[self.y_axis[dim]]
         if hasattr(period, 'in_units'):
             period = period.in_units("code_length").d
-        buff = _MPL.Pixelize(data_source['px'], data_source['py'],
-                             data_source['pdx'], data_source['pdy'],
-                             data_source[field], size[0], size[1],
-                             bounds, int(antialias),
-                             period, int(periodic)).transpose()
+        buff = pixelize_cartesian(data_source['px'], data_source['py'],
+                                  data_source['pdx'], data_source['pdy'],
+                                  data_source[field], size[0], size[1],
+                                  bounds, int(antialias),
+                                  period, int(periodic)).transpose()
         return buff
 
     def _cyl_pixelize(self, data_source, field, bounds, size, antialias):

diff -r 92004fd9fd3311c20db06616f206d0939a186abb -r 5da31254f065d004d45d5e182f674f1cce9ea57f yt/utilities/lib/pixelization_routines.pyx
--- a/yt/utilities/lib/pixelization_routines.pyx
+++ b/yt/utilities/lib/pixelization_routines.pyx
@@ -191,6 +191,14 @@
                                 overlap1 = ((fmin(rxpx, xsp+dxsp)
                                            - fmax(lxpx, (xsp-dxsp)))*ipx_dx)
                                 if overlap1 < 0.0: continue
+                                # This next line is not commented out because
+                                # it's an oddity; we actually want to skip
+                                # depositing if the overlap is zero, and that's
+                                # how it used to work when we were more
+                                # conservative about the iteration indices.
+                                # This will reduce artifacts if we ever move to
+                                # compositing instead of replacing bitmaps.
+                                if overlap1 * overlap2 == 0.0: continue
                                 my_array[j,i] += (dsp * overlap1) * overlap2
                             else:
                                 my_array[j,i] = dsp

diff -r 92004fd9fd3311c20db06616f206d0939a186abb -r 5da31254f065d004d45d5e182f674f1cce9ea57f yt/visualization/_MPL.c
--- a/yt/visualization/_MPL.c
+++ /dev/null
@@ -1,491 +0,0 @@
-/*******************************************************************************
-# 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.
-*******************************************************************************/
-//
-// _MPL
-//   A module for making static-resolution arrays representing
-//   AMR data.
-//
-
-#include "Python.h"
-
-#include <stdio.h>
-#include <math.h>
-#include <signal.h>
-#include <ctype.h>
-
-#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
-#include "numpy/ndarrayobject.h"
-
-#define min(X,Y) ((X) < (Y) ? (X) : (Y))
-#define max(X,Y) ((X) > (Y) ? (X) : (Y))
-
-static PyObject *_pixelizeError;
-
-char _pixelizeDocstring[] =
-"Returns a static-resolution pixelized version of AMR data.\n\n"
-"@parameter xp: ndarray of x centers\n"
-"@Parameter yp: ndarray of y centers\n"
-"@parameter dxp: ndarray of x half-widths\n"
-"@parameter dyp: ndarray of y half-widths\n"
-"@parameter dp: ndarray of data\n"
-"@parameter rows: number of pixel rows\n"
-"@parameter cols: number of pixel columns\n"
-"@parameter bounds: (x_min, x_max, y_min, y_max)";
-
-static PyObject* Py_Pixelize(PyObject *obj, PyObject *args) {
-
-  PyObject *xp, *yp, *dxp, *dyp, *dp;
-  PyArrayObject *x, *y, *dx, *dy, *d;
-  unsigned int rows, cols;
-  int antialias = 1;
-  double x_min, x_max, y_min, y_max;
-  double period_x, period_y;
-  int check_period = 1, nx;
-  int i, j, p, xi, yi;
-  double lc, lr, rc, rr;
-  double lypx, rypx, lxpx, rxpx, overlap1, overlap2;
-  npy_float64 oxsp, oysp, xsp, ysp, dxsp, dysp, dsp;
-  int xiter[2], yiter[2];
-  double xiterv[2], yiterv[2];
-  npy_intp dims[2];
-  PyArrayObject *my_array;
-  double width, height, px_dx, px_dy, ipx_dx, ipx_dy;
-  PyObject *return_value;
-
-  xp = yp = dxp = dyp = dp = NULL;
-  x = y = dx = dy = d = NULL;
-
-  period_x = period_y = 0;
-
-  if (!PyArg_ParseTuple(args, "OOOOOII(dddd)|i(dd)i",
-      &xp, &yp, &dxp, &dyp, &dp, &cols, &rows,
-      &x_min, &x_max, &y_min, &y_max,
-      &antialias, &period_x, &period_y, &check_period))
-      return PyErr_Format(_pixelizeError, "Pixelize: Invalid Parameters.");
-
-  width = x_max - x_min;
-  height = y_max - y_min;
-  px_dx = width / ((double) rows);
-  px_dy = height / ((double) cols);
-  ipx_dx = 1.0 / px_dx;
-  ipx_dy = 1.0 / px_dy;
-
-  // Check we have something to output to
-  if (rows == 0 || cols ==0)
-      PyErr_Format( _pixelizeError, "Cannot scale to zero size.");
-
-  // Get numeric arrays
-  x = (PyArrayObject *) PyArray_FromAny(xp,
-            PyArray_DescrFromType(NPY_FLOAT64), 1, 1, 0, NULL);
-  if (x == NULL) {
-      PyErr_Format( _pixelizeError, "x is of incorrect type (wanted 1D float)");
-      goto _fail;
-  }
-
-  y = (PyArrayObject *) PyArray_FromAny(yp,
-            PyArray_DescrFromType(NPY_FLOAT64), 1, 1, 0, NULL);
-  if ((y == NULL) || (PyArray_SIZE(y) != PyArray_SIZE(x))) {
-      PyErr_Format( _pixelizeError, "y is of incorrect type (wanted 1D float)");
-      goto _fail;
-  }
-
-  d = (PyArrayObject *) PyArray_FromAny(dp,
-            PyArray_DescrFromType(NPY_FLOAT64), 1, 1, 0, NULL);
-  if ((d == NULL) || (PyArray_SIZE(d) != PyArray_SIZE(x))) {
-      PyErr_Format( _pixelizeError, "data is of incorrect type (wanted 1D float)");
-      goto _fail;
-  }
-
-  dx = (PyArrayObject *) PyArray_FromAny(dxp,
-            PyArray_DescrFromType(NPY_FLOAT64), 1, 1, 0, NULL);
-  if ((dx == NULL) || (PyArray_SIZE(dx) != PyArray_SIZE(x))) {
-      PyErr_Format( _pixelizeError, "dx is of incorrect type (wanted 1D float)");
-      goto _fail;
-  }
-  dy = (PyArrayObject *) PyArray_FromAny(dyp,
-            PyArray_DescrFromType(NPY_FLOAT64), 1, 1, 0, NULL);
-  if ((dy == NULL) || (PyArray_SIZE(dy) != PyArray_SIZE(x))) {
-      PyErr_Format( _pixelizeError, "dy is of incorrect type (wanted 1D float)");
-      goto _fail;
-  }
-
-  // Check dimensions match
-  nx = PyArray_DIMS(x)[0];
-
-  // Calculate the pointer arrays to map input x to output x
-
-  dims[0] = rows;
-  dims[1] = cols;
-  my_array =
-    (PyArrayObject *) PyArray_SimpleNewFromDescr(2, dims,
-              PyArray_DescrFromType(NPY_FLOAT64));
-  //npy_float64 *gridded = (npy_float64 *) my_array->data;
-
-  xiter[0] = yiter[0] = 0;
-  xiterv[0] = yiterv[0] = 0.0;
-
-  Py_BEGIN_ALLOW_THREADS
-  for(i=0;i<rows;i++)for(j=0;j<cols;j++)
-      *(npy_float64*) PyArray_GETPTR2(my_array, i, j) = 0.0;
-  for(p=0;p<nx;p++)
-  {
-    // these are cell-centered
-    oxsp = *((npy_float64 *)PyArray_GETPTR1(x, p));
-    oysp = *((npy_float64 *)PyArray_GETPTR1(y, p));
-    // half-width
-    dxsp = *((npy_float64 *)PyArray_GETPTR1(dx, p));
-    dysp = *((npy_float64 *)PyArray_GETPTR1(dy, p));
-    dsp = *((npy_float64 *)PyArray_GETPTR1(d, p));
-    xiter[1] = yiter[1] = 999;
-    if(check_period == 1) {
-      if (oxsp - dxsp < x_min) {xiter[1] = +1; xiterv[1] = period_x;}
-      else if (oxsp + dxsp > x_max) {xiter[1] = -1; xiterv[1] = -period_x;}
-      if (oysp - dysp < y_min) {yiter[1] = +1; yiterv[1] = period_y;}
-      else if (oysp + dysp > y_max) {yiter[1] = -1; yiterv[1] = -period_y;}
-    }
-    overlap1 = overlap2 = 1.0;
-    for(xi = 0; xi < 2; xi++) {
-      if(xiter[xi] == 999)continue;
-      xsp = oxsp + xiterv[xi];
-      if((xsp+dxsp<x_min) || (xsp-dxsp>x_max)) continue;
-      for(yi = 0; yi < 2; yi++) {
-        if(yiter[yi] == 999)continue;
-        ysp = oysp + yiterv[yi];
-        if((ysp+dysp<y_min) || (ysp-dysp>y_max)) continue;
-        lc = max(((xsp-dxsp-x_min)*ipx_dx),0);
-        lr = max(((ysp-dysp-y_min)*ipx_dy),0);
-        rc = min(((xsp+dxsp-x_min)*ipx_dx), rows);
-        rr = min(((ysp+dysp-y_min)*ipx_dy), cols);
-        for (i=lr;i<rr;i++) {
-          lypx = px_dy * i + y_min;
-          rypx = px_dy * (i+1) + y_min;
-          if (antialias == 1) {
-              overlap2 = ((min(rypx, ysp+dysp) - max(lypx, (ysp-dysp)))*ipx_dy);
-          }
-          if (overlap2 < 0.0) continue;
-          for (j=lc;j<rc;j++) {
-            lxpx = px_dx * j + x_min;
-            rxpx = px_dx * (j+1) + x_min;
-            if (antialias == 1) {
-                overlap1 = ((min(rxpx, xsp+dxsp) - max(lxpx, (xsp-dxsp)))*ipx_dx);
-            }
-            if (overlap1 < 0.0) continue;
-            if (antialias == 1)
-              *(npy_float64*) PyArray_GETPTR2(my_array, j, i) +=
-                    (dsp*overlap1)*overlap2;
-            else *(npy_float64*) PyArray_GETPTR2(my_array, j, i) = dsp;
-          }
-        }
-      }
-    }
-  }
-  Py_END_ALLOW_THREADS
-
-  // Attatch output buffer to output buffer
-
-  Py_DECREF(x);
-  Py_DECREF(y);
-  Py_DECREF(d);
-  Py_DECREF(dx);
-  Py_DECREF(dy);
-
-  return_value = Py_BuildValue("N", my_array);
-
-  return return_value;
-
-  _fail:
-
-    if(x!=NULL)Py_XDECREF(x);
-    if(y!=NULL)Py_XDECREF(y);
-    if(d!=NULL)Py_XDECREF(d);
-    if(dx!=NULL)Py_XDECREF(dx);
-    if(dy!=NULL)Py_XDECREF(dy);
-    return NULL;
-
-}
-
-static PyObject* Py_CPixelize(PyObject *obj, PyObject *args) {
-
-  PyObject *xp, *yp, *zp, *pxp, *pyp,
-           *dxp, *dyp, *dzp, *dp,
-           *centerp, *inv_matp, *indicesp;
-  PyArrayObject *x, *y, *z, *px, *py, *d,
-                *dx, *dy, *dz, *center, *inv_mat, *indices;
-  unsigned int rows, cols;
-  double px_min, px_max, py_min, py_max;
-  double width, height;
-  long double px_dx, px_dy;
-  int i, j, p, nx;
-  int lc, lr, rc, rr;
-  long double md, cxpx, cypx;
-  long double cx, cy, cz;
-  npy_float64 *centers;
-  npy_intp *dims;
-
-  PyArrayObject *my_array;
-  npy_float64 *gridded;
-  npy_float64 *mask;
-
-  int pp;
-
-  npy_float64 inv_mats[3][3];
-
-  npy_float64 xsp;
-  npy_float64 ysp;
-  npy_float64 zsp;
-  npy_float64 pxsp;
-  npy_float64 pysp;
-  npy_float64 dxsp;
-  npy_float64 dysp;
-  npy_float64 dzsp;
-  npy_float64 dsp;
-
-  PyObject *return_value;
-
-  xp = yp = zp = pxp = pyp = dxp = dyp = dzp = dp = NULL;
-  centerp = inv_matp = indicesp = NULL;
-
-  x = y = z = px = py = dx = dy = dz = d = NULL;
-  center = inv_mat = indices = NULL;
-
-    if (!PyArg_ParseTuple(args, "OOOOOOOOOOOOII(dddd)",
-        &xp, &yp, &zp, &pxp, &pyp, &dxp, &dyp, &dzp, &centerp, &inv_matp,
-        &indicesp, &dp, &cols, &rows, &px_min, &px_max, &py_min, &py_max))
-        return PyErr_Format(_pixelizeError, "CPixelize: Invalid Parameters.");
-
-  width = px_max - px_min;
-  height = py_max - py_min;
-  px_dx = width / ((double) rows);
-  px_dy = height / ((double) cols);
-
-  // Check we have something to output to
-  if (rows == 0 || cols ==0)
-      PyErr_Format( _pixelizeError, "Cannot scale to zero size.");
-
-  // Get numeric arrays
-  x = (PyArrayObject *) PyArray_FromAny(xp,
-            PyArray_DescrFromType(NPY_FLOAT64), 1, 1, 0, NULL);
-  if (x == NULL) {
-      PyErr_Format( _pixelizeError, "x is of incorrect type (wanted 1D float)");
-      goto _fail;
-  }
-
-  y = (PyArrayObject *) PyArray_FromAny(yp,
-            PyArray_DescrFromType(NPY_FLOAT64), 1, 1, 0, NULL);
-  if ((y == NULL) || (PyArray_SIZE(y) != PyArray_SIZE(x))) {
-      PyErr_Format( _pixelizeError, "y is of incorrect type (wanted 1D float)");
-      goto _fail;
-  }
-
-  z = (PyArrayObject *) PyArray_FromAny(zp,
-            PyArray_DescrFromType(NPY_FLOAT64), 1, 1, 0, NULL);
-  if ((z == NULL) || (PyArray_SIZE(y) != PyArray_SIZE(x))) {
-      PyErr_Format( _pixelizeError, "z is of incorrect type (wanted 1D float)");
-      goto _fail;
-  }
-
-  px = (PyArrayObject *) PyArray_FromAny(pxp,
-            PyArray_DescrFromType(NPY_FLOAT64), 1, 1, 0, NULL);
-  if ((px == NULL) || (PyArray_SIZE(y) != PyArray_SIZE(x))) {
-      PyErr_Format( _pixelizeError, "px is of incorrect type (wanted 1D float)");
-      goto _fail;
-  }
-
-  py = (PyArrayObject *) PyArray_FromAny(pyp,
-            PyArray_DescrFromType(NPY_FLOAT64), 1, 1, 0, NULL);
-  if ((py == NULL) || (PyArray_SIZE(y) != PyArray_SIZE(x))) {
-      PyErr_Format( _pixelizeError, "py is of incorrect type (wanted 1D float)");
-      goto _fail;
-  }
-
-  d = (PyArrayObject *) PyArray_FromAny(dp,
-            PyArray_DescrFromType(NPY_FLOAT64), 1, 1, 0, NULL);
-  if ((d == NULL) || (PyArray_SIZE(d) != PyArray_SIZE(x))) {
-      PyErr_Format( _pixelizeError, "data is of incorrect type (wanted 1D float)");
-      goto _fail;
-  }
-
-  dx = (PyArrayObject *) PyArray_FromAny(dxp,
-            PyArray_DescrFromType(NPY_FLOAT64), 1, 1, 0, NULL);
-  if ((dx == NULL) || (PyArray_SIZE(dx) != PyArray_SIZE(x))) {
-      PyErr_Format( _pixelizeError, "dx is of incorrect type (wanted 1D float)");
-      goto _fail;
-  }
-  dy = (PyArrayObject *) PyArray_FromAny(dyp,
-            PyArray_DescrFromType(NPY_FLOAT64), 1, 1, 0, NULL);
-  if ((dy == NULL) || (PyArray_SIZE(dy) != PyArray_SIZE(x))) {
-      PyErr_Format( _pixelizeError, "dy is of incorrect type (wanted 1D float)");
-      goto _fail;
-  }
-  dz = (PyArrayObject *) PyArray_FromAny(dzp,
-            PyArray_DescrFromType(NPY_FLOAT64), 1, 1, 0, NULL);
-  if ((dz == NULL) || (PyArray_SIZE(dz) != PyArray_SIZE(x))) {
-      PyErr_Format( _pixelizeError, "dz is of incorrect type (wanted 1D float)");
-      goto _fail;
-  }
-  center = (PyArrayObject *) PyArray_FromAny(centerp,
-            PyArray_DescrFromType(NPY_FLOAT64), 1, 1, NPY_ARRAY_C_CONTIGUOUS, NULL);
-  if ((dz == NULL) || (PyArray_SIZE(center) != 3)) {
-      PyErr_Format( _pixelizeError, "Center must have three points");
-      goto _fail;
-  }
-  inv_mat = (PyArrayObject *) PyArray_FromAny(inv_matp,
-            PyArray_DescrFromType(NPY_FLOAT64), 2, 2, 0, NULL);
-  if ((inv_mat == NULL) || (PyArray_SIZE(inv_mat) != 9)) {
-      PyErr_Format( _pixelizeError, "inv_mat must be three by three");
-      goto _fail;
-  }
-  indices = (PyArrayObject *) PyArray_FromAny(indicesp,
-            PyArray_DescrFromType(NPY_INT64), 1, 1, 0, NULL);
-  if ((indices == NULL) || (PyArray_SIZE(indices) != PyArray_SIZE(dx))) {
-      PyErr_Format( _pixelizeError, "indices must be same length as dx");
-      goto _fail;
-  }
-
-  // Check dimensions match
-  nx = PyArray_DIMS(x)[0];
-
-  // Calculate the pointer arrays to map input x to output x
-
-  centers = (npy_float64 *) PyArray_GETPTR1(center,0);
-
-  dims[0] = rows;
-  dims[1] = cols;
-  my_array =
-    (PyArrayObject *) PyArray_SimpleNewFromDescr(2, dims,
-              PyArray_DescrFromType(NPY_FLOAT64));
-  gridded = (npy_float64 *) PyArray_DATA(my_array);
-  mask = malloc(sizeof(npy_float64)*rows*cols);
-
-  for(i=0;i<3;i++)for(j=0;j<3;j++)
-      inv_mats[i][j]=*(npy_float64*)PyArray_GETPTR2(inv_mat,i,j);
-
-  for(p=0;p<cols*rows;p++)gridded[p]=mask[p]=0.0;
-  for(pp=0; pp<nx; pp++)
-  {
-    p = *((npy_int64 *) PyArray_GETPTR1(indices, pp));
-    xsp = *((npy_float64 *) PyArray_GETPTR1(x, p));
-    ysp = *((npy_float64 *) PyArray_GETPTR1(y, p));
-    zsp = *((npy_float64 *) PyArray_GETPTR1(z, p));
-    pxsp = *((npy_float64 *) PyArray_GETPTR1(px, p));
-    pysp = *((npy_float64 *) PyArray_GETPTR1(py, p));
-    dxsp = *((npy_float64 *) PyArray_GETPTR1(dx, p));
-    dysp = *((npy_float64 *) PyArray_GETPTR1(dy, p));
-    dzsp = *((npy_float64 *) PyArray_GETPTR1(dz, p));
-    dsp = *((npy_float64 *) PyArray_GETPTR1(d, p)); // We check this above
-    // Any point we want to plot is at most this far from the center
-    md = 2.0*sqrtl(dxsp*dxsp + dysp*dysp + dzsp*dzsp);
-    if(((pxsp+md<px_min) ||
-        (pxsp-md>px_max)) ||
-       ((pysp+md<py_min) ||
-        (pysp-md>py_max))) continue;
-    lc = max(floorl((pxsp-md-px_min)/px_dx),0);
-    lr = max(floorl((pysp-md-py_min)/px_dy),0);
-    rc = min(ceill((pxsp+md-px_min)/px_dx),rows);
-    rr = min(ceill((pysp+md-py_min)/px_dy),cols);
-    for (i=lr;i<rr;i++) {
-      cypx = px_dy * (i+0.5) + py_min;
-      for (j=lc;j<rc;j++) {
-        cxpx = px_dx * (j+0.5) + px_min;
-        cx = inv_mats[0][0]*cxpx + inv_mats[0][1]*cypx + centers[0];
-        cy = inv_mats[1][0]*cxpx + inv_mats[1][1]*cypx + centers[1];
-        cz = inv_mats[2][0]*cxpx + inv_mats[2][1]*cypx + centers[2];
-        if( (fabs(xsp-cx)*0.95>dxsp) || 
-            (fabs(ysp-cy)*0.95>dysp) ||
-            (fabs(zsp-cz)*0.95>dzsp)) continue;
-        mask[j*cols+i] += 1;
-        gridded[j*cols+i] += dsp;
-      }
-    }
-  }
-  for(p=0;p<cols*rows;p++)gridded[p]=gridded[p]/mask[p];
-
-  // Attatch output buffer to output buffer
-
-  Py_DECREF(x);
-  Py_DECREF(y);
-  Py_DECREF(z);
-  Py_DECREF(px);
-  Py_DECREF(py);
-  Py_DECREF(d);
-  Py_DECREF(dx);
-  Py_DECREF(dy);
-  Py_DECREF(dz);
-  Py_DECREF(center);
-  Py_DECREF(indices);
-  Py_DECREF(inv_mat);
-  free(mask);
-
-  return_value = Py_BuildValue("N", my_array);
-
-  return return_value;
-
-  _fail:
-
-    Py_XDECREF(x);
-    Py_XDECREF(y);
-    Py_XDECREF(z);
-    Py_XDECREF(px);
-    Py_XDECREF(py);
-    Py_XDECREF(d);
-    Py_XDECREF(dx);
-    Py_XDECREF(dy);
-    Py_XDECREF(dz);
-    Py_XDECREF(center);
-    Py_XDECREF(indices);
-    Py_XDECREF(inv_mat);
-
-    return NULL;
-
-}
-
-static PyMethodDef __MPLMethods[] = {
-    {"Pixelize", Py_Pixelize, METH_VARARGS, _pixelizeDocstring},
-    {"CPixelize", Py_CPixelize, METH_VARARGS, NULL},
-    {NULL, NULL} /* Sentinel */
-};
-
-/* platform independent*/
-#ifdef MS_WIN32
-__declspec(dllexport)
-#endif
-
-
-PyMODINIT_FUNC
-#if PY_MAJOR_VERSION >= 3
-#define _RETVAL m
-PyInit__MPL(void)
-#else
-#define _RETVAL 
-init_MPL(void)
-#endif
-{
-    PyObject *m, *d;
-#if PY_MAJOR_VERSION >= 3
-    static struct PyModuleDef moduledef = {
-        PyModuleDef_HEAD_INIT,
-        "_MPL",           /* m_name */
-        "Pixelization routines\n",
-                             /* m_doc */
-        -1,                  /* m_size */
-        __MPLMethods,    /* m_methods */
-        NULL,                /* m_reload */
-        NULL,                /* m_traverse */
-        NULL,                /* m_clear */
-        NULL,                /* m_free */
-    };
-    m = PyModule_Create(&moduledef); 
-#else
-    m = Py_InitModule("_MPL", __MPLMethods);
-#endif
-    d = PyModule_GetDict(m);
-    _pixelizeError = PyErr_NewException("_MPL.error", NULL, NULL);
-    PyDict_SetItemString(d, "error", _pixelizeError);
-    import_array();
-    return _RETVAL;
-}

diff -r 92004fd9fd3311c20db06616f206d0939a186abb -r 5da31254f065d004d45d5e182f674f1cce9ea57f yt/visualization/plot_modifications.py
--- a/yt/visualization/plot_modifications.py
+++ b/yt/visualization/plot_modifications.py
@@ -41,8 +41,6 @@
 from yt.utilities.exceptions import \
     YTDataTypeUnsupported
 
-from . import _MPL
-
 callback_registry = {}
 
 def _verify_geometry(func):
@@ -397,24 +395,18 @@
         if self.bv_y != 0.0:
             # Workaround for 0.0 without units
             fv_y -= self.bv_y
-        pixX = _MPL.Pixelize(plot.data['px'],
-                             plot.data['py'],
-                             plot.data['pdx'],
-                             plot.data['pdy'],
-                             fv_x,
-                             int(nx), int(ny),
-                             (x0, x1, y0, y1), 0, # bounds, antialias
-                             (period_x, period_y), periodic,
-                             ).transpose()
-        pixY = _MPL.Pixelize(plot.data['px'],
-                             plot.data['py'],
-                             plot.data['pdx'],
-                             plot.data['pdy'],
-                             fv_y,
-                             int(nx), int(ny),
-                             (x0, x1, y0, y1), 0, # bounds, antialias
-                             (period_x, period_y), periodic,
-                             ).transpose()
+        pixX = pixelize_cartesian(plot.data['px'], plot.data['py'],
+                                  plot.data['pdx'], plot.data['pdy'],
+                                  fv_x, int(nx), int(ny),
+                                  (x0, x1, y0, y1), 0, # bounds, antialias
+                                  (period_x, period_y), periodic,
+                                  ).transpose()
+        pixY = pixelize_cartesian(plot.data['px'], plot.data['py'],
+                                  plot.data['pdx'], plot.data['pdy'],
+                                  fv_y, int(nx), int(ny),
+                                  (x0, x1, y0, y1), 0, # bounds, antialias
+                                  (period_x, period_y), periodic,
+                                  ).transpose()
         X,Y = np.meshgrid(np.linspace(xx0,xx1,nx,endpoint=True),
                           np.linspace(yy0,yy1,ny,endpoint=True))
         if self.normalize:
@@ -710,28 +702,22 @@
         plot._axes.hold(True)
         nx = plot.image._A.shape[0] / self.factor
         ny = plot.image._A.shape[1] / self.factor
-        pixX = _MPL.Pixelize(plot.data['px'],
-                             plot.data['py'],
-                             plot.data['pdx'],
-                             plot.data['pdy'],
-                             plot.data[self.field_x],
-                             int(nx), int(ny),
-                             (x0, x1, y0, y1),).transpose()
-        pixY = _MPL.Pixelize(plot.data['px'],
-                             plot.data['py'],
-                             plot.data['pdx'],
-                             plot.data['pdy'],
-                             plot.data[self.field_y],
-                             int(nx), int(ny),
-                             (x0, x1, y0, y1),).transpose()
+        pixX = pixelize_cartesian(plot.data['px'], plot.data['py'],
+                                  plot.data['pdx'], plot.data['pdy'],
+                                  plot.data[self.field_x],
+                                  int(nx), int(ny),
+                                  (x0, x1, y0, y1),).transpose()
+        pixY = pixelize_cartesian(plot.data['px'], plot.data['py'],
+                                  plot.data['pdx'], plot.data['pdy'],
+                                  plot.data[self.field_y],
+                                  int(nx), int(ny),
+                                  (x0, x1, y0, y1),).transpose()
         if self.field_color:
-            self.field_color = _MPL.Pixelize(plot.data['px'],
-                                             plot.data['py'],
-                                             plot.data['pdx'],
-                                             plot.data['pdy'],
-                                             plot.data[self.field_color],
-                                             int(nx), int(ny),
-                                             (x0, x1, y0, y1),).transpose()
+            self.field_color = pixelize_cartesian(
+                        plot.data['px'], plot.data['py'],
+                        plot.data['pdx'], plot.data['pdy'],
+                        plot.data[self.field_color], int(nx), int(ny),
+                        (x0, x1, y0, y1),).transpose()
 
         X,Y = (np.linspace(xx0,xx1,nx,endpoint=True),
                np.linspace(yy0,yy1,ny,endpoint=True))
@@ -948,7 +934,7 @@
             xf_copy = clump[xf].copy().in_units("code_length")
             yf_copy = clump[yf].copy().in_units("code_length")
 
-            temp = _MPL.Pixelize(xf_copy, yf_copy,
+            temp = pixelize_cartesian(xf_copy, yf_copy,
                                  clump[dxf].in_units("code_length")/2.0,
                                  clump[dyf].in_units("code_length")/2.0,
                                  clump[dxf].d*0.0+i+1, # inits inside Pixelize

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