Commits

Nathan Goldbaum committed 418f717 Merge

Merging.

  • Participants
  • Parent commits c187324, 7cabbf1

Comments (0)

Files changed (4)

yt/data_objects/data_containers.py

         else:
             self.fields = ensure_list(fields)
         from yt.visualization.plot_window import \
-            GetBoundsAndCenter, PWViewerMPL
+            GetWindowParameters, PWViewerMPL
         from yt.visualization.fixed_resolution import FixedResolutionBuffer
-        (bounds, center) = GetBoundsAndCenter(axis, center, width, self.pf)
+        (bounds, center, units) = GetWindowParameters(axis, center, width, self.pf)
+        if axes_unit is None and units != ('1', '1'):
+            axes_unit = units
         pw = PWViewerMPL(self, bounds, origin=origin, frb_generator=FixedResolutionBuffer, 
                          plot_type=plot_type)
         pw.set_axes_unit(axes_unit)

yt/data_objects/tests/test_projection.py

 from yt.testing import *
+import os
 
 def setup():
     from yt.config import ytcfg
     ytcfg["yt","__withintesting"] = "True"
 
+def teardown_func(fns):
+    for fn in fns:
+        os.remove(fn)
+
 def test_projection():
     for nprocs in [8, 1]:
         # We want to test both 1 proc and 8 procs, to make sure that
             xax = x_dict[ax]
             yax = y_dict[ax]
             for wf in ["Density", None]:
+                fns = []
                 proj = pf.h.proj(ax, ["Ones", "Density"], weight_field = wf)
                 yield assert_equal, proj["Ones"].sum(), proj["Ones"].size
                 yield assert_equal, proj["Ones"].min(), 1.0
                 yield assert_equal, np.unique(proj["py"]), uc[yax]
                 yield assert_equal, np.unique(proj["pdx"]), 1.0/(dims[xax]*2.0)
                 yield assert_equal, np.unique(proj["pdy"]), 1.0/(dims[yax]*2.0)
+                pw = proj.to_pw()
+                fns += pw.save()
                 frb = proj.to_frb((1.0,'unitary'), 64)
                 for proj_field in ['Ones', 'Density']:
                     yield assert_equal, frb[proj_field].info['data_source'], \
                             proj.center
                     yield assert_equal, frb[proj_field].info['weight_field'], \
                             wf
+                teardown_func(fns)
             # wf == None
             yield assert_equal, wf, None
             v1 = proj["Density"].sum()

yt/data_objects/tests/test_slice.py

 from yt.testing import *
+import os
 
 def setup():
     from yt.config import ytcfg
     ytcfg["yt","__withintesting"] = "True"
 
+def teardown_func(fns):
+    for fn in fns:
+        os.remove(fn)
+
 def test_slice():
     for nprocs in [8, 1]:
         # We want to test both 1 proc and 8 procs, to make sure that
             xax = x_dict[ax]
             yax = y_dict[ax]
             for wf in ["Density", None]:
+                fns = []
                 slc = pf.h.slice(ax, slc_pos, ["Ones", "Density"])
                 yield assert_equal, slc["Ones"].sum(), slc["Ones"].size
                 yield assert_equal, slc["Ones"].min(), 1.0
                 yield assert_equal, np.unique(slc["py"]), uc[yax]
                 yield assert_equal, np.unique(slc["pdx"]), 1.0/(dims[xax]*2.0)
                 yield assert_equal, np.unique(slc["pdy"]), 1.0/(dims[yax]*2.0)
+                pw = slc.to_pw()
+                fns += pw.save()
                 frb = slc.to_frb((1.0,'unitary'), 64)
                 for slc_field in ['Ones', 'Density']:
                     yield assert_equal, frb[slc_field].info['data_source'], \
                             slc.center
                     yield assert_equal, frb[slc_field].info['coord'], \
                             slc_pos
+                teardown_func(fns)
             # wf == None
             yield assert_equal, wf, None
 
-

yt/visualization/tests/test_plotwindow.py

 from yt.testing import *
 from yt.mods import SlicePlot, ProjectionPlot, \
     OffAxisSlicePlot, OffAxisProjectionPlot
-import glob, os
+import os
 
 def setup():
     from yt.config import ytcfg