[yt-svn] commit/yt: MatthewTurk: Merged in jzuhone/yt-3.x/yt-3.0 (pull request #961)

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Thu Jun 19 05:53:09 PDT 2014


1 new commit in yt:

https://bitbucket.org/yt_analysis/yt/commits/5088ddc41bd7/
Changeset:   5088ddc41bd7
Branch:      yt-3.0
User:        MatthewTurk
Date:        2014-06-19 14:52:56
Summary:     Merged in jzuhone/yt-3.x/yt-3.0 (pull request #961)

FITS answer tests, fixing Windows test failures
Affected #:  4 files

diff -r 534e2b948eda6907fa640eabbf4f307e8a0360ef -r 5088ddc41bd7c54f01f22aa5a0c217728268dbe0 yt/frontends/fits/tests/test_outputs.py
--- a/yt/frontends/fits/tests/test_outputs.py
+++ b/yt/frontends/fits/tests/test_outputs.py
@@ -17,38 +17,27 @@
 from yt.utilities.answer_testing.framework import \
     requires_pf, \
     small_patch_amr, \
-    big_patch_amr, \
     data_dir_load
+from ..data_structures import FITSDataset
 
-_fields = ("intensity")
-
-m33 = "radio_fits/m33_hi.fits"
- at requires_pf(m33, big_data=True)
-def test_m33():
-    pf = data_dir_load(m33, nan_mask=0.0)
-    yield assert_equal, str(pf), "m33_hi.fits"
-    for test in small_patch_amr(m33, _fields):
-        test_m33.__name__ = test.description
-        yield test
-
-_fields = ("temperature")
+_fields_grs = ("temperature",)
 
 grs = "radio_fits/grs-50-cube.fits"
 @requires_pf(grs)
 def test_grs():
-    pf = data_dir_load(grs, nan_mask=0.0)
-    yield assert_equal, str(pf), "grs-50-cube.fits"
-    for test in small_patch_amr(grs, _fields):
+    ds = data_dir_load(grs, cls=FITSDataset, kwargs={"nan_mask":0.0})
+    yield assert_equal, str(ds), "grs-50-cube.fits"
+    for test in small_patch_amr(grs, _fields_grs, input_center="c", input_weight="ones"):
         test_grs.__name__ = test.description
         yield test
 
-_fields = ("x-velocity","y-velocity","z-velocity")
+_fields_vels = ("velocity_x","velocity_y","velocity_z")
 
-vf = "UniformGrid/velocity_field_20.fits"
+vf = "UnigridData/velocity_field_20.fits"
 @requires_pf(vf)
 def test_velocity_field():
-    pf = data_dir_load(bf)
-    yield assert_equal, str(pf), "velocity_field_20.fits"
-    for test in small_patch_amr(vf, _fields):
+    ds = data_dir_load(vf, cls=FITSDataset)
+    yield assert_equal, str(ds), "velocity_field_20.fits"
+    for test in small_patch_amr(vf, _fields_vels, input_center="c", input_weight="ones"):
         test_velocity_field.__name__ = test.description
         yield test

diff -r 534e2b948eda6907fa640eabbf4f307e8a0360ef -r 5088ddc41bd7c54f01f22aa5a0c217728268dbe0 yt/units/yt_array.py
--- a/yt/units/yt_array.py
+++ b/yt/units/yt_array.py
@@ -563,7 +563,7 @@
             unit_lut = pickle.loads(dataset.attrs['unit_registry'])
         else:
             unit_lut = None
-
+        f.close()
         registry = UnitRegistry(lut=unit_lut, add_default_symbols=False)
         return cls(data, units, registry=registry)
 

diff -r 534e2b948eda6907fa640eabbf4f307e8a0360ef -r 5088ddc41bd7c54f01f22aa5a0c217728268dbe0 yt/utilities/answer_testing/framework.py
--- a/yt/utilities/answer_testing/framework.py
+++ b/yt/utilities/answer_testing/framework.py
@@ -691,32 +691,32 @@
     else:
         return ftrue
 
-def small_patch_amr(pf_fn, fields):
+def small_patch_amr(pf_fn, fields, input_center="max", input_weight="density"):
     if not can_run_pf(pf_fn): return
-    dso = [ None, ("sphere", ("max", (0.1, 'unitary')))]
+    dso = [ None, ("sphere", (input_center, (0.1, 'unitary')))]
     yield GridHierarchyTest(pf_fn)
     yield ParentageRelationshipsTest(pf_fn)
     for field in fields:
         yield GridValuesTest(pf_fn, field)
         for axis in [0, 1, 2]:
             for ds in dso:
-                for weight_field in [None, "density"]:
+                for weight_field in [None, input_weight]:
                     yield ProjectionValuesTest(
                         pf_fn, axis, field, weight_field,
                         ds)
                 yield FieldValuesTest(
                         pf_fn, field, ds)
 
-def big_patch_amr(pf_fn, fields):
+def big_patch_amr(pf_fn, fields, input_center="max", input_weight="density"):
     if not can_run_pf(pf_fn): return
-    dso = [ None, ("sphere", ("max", (0.1, 'unitary')))]
+    dso = [ None, ("sphere", (input_center, (0.1, 'unitary')))]
     yield GridHierarchyTest(pf_fn)
     yield ParentageRelationshipsTest(pf_fn)
     for field in fields:
         yield GridValuesTest(pf_fn, field)
         for axis in [0, 1, 2]:
             for ds in dso:
-                for weight_field in [None, "density"]:
+                for weight_field in [None, input_weight]:
                     yield PixelizedProjectionValuesTest(
                         pf_fn, axis, field, weight_field,
                         ds)

diff -r 534e2b948eda6907fa640eabbf4f307e8a0360ef -r 5088ddc41bd7c54f01f22aa5a0c217728268dbe0 yt/utilities/lib/tests/test_ragged_arrays.py
--- a/yt/utilities/lib/tests/test_ragged_arrays.py
+++ b/yt/utilities/lib/tests/test_ragged_arrays.py
@@ -13,7 +13,7 @@
 
 def test_index_unop():
     np.random.seed(0x4d3d3d3)
-    indices = np.arange(1000)
+    indices = np.arange(1000, dtype="int64")
     np.random.shuffle(indices)
     sizes = np.array([
         200, 50, 50, 100, 32, 32, 32, 32, 32, 64, 376], dtype="int64")

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