[yt-svn] commit/yt: MatthewTurk: Merged in xarthisius/yt (pull request #1194)

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Wed Sep 10 11:24:09 PDT 2014


1 new commit in yt:

https://bitbucket.org/yt_analysis/yt/commits/f6379bbc462b/
Changeset:   f6379bbc462b
Branch:      yt
User:        MatthewTurk
Date:        2014-09-10 20:23:59
Summary:     Merged in xarthisius/yt (pull request #1194)

Add simple tests for _is_valid method in various frontends. Fixes issue #894
Affected #:  10 files

diff -r db158c18f4153804f4761e782586a030e37ebb23 -r f6379bbc462ba084bd62f72d4fa83e49dcd85362 yt/frontends/art/tests/test_outputs.py
--- a/yt/frontends/art/tests/test_outputs.py
+++ b/yt/frontends/art/tests/test_outputs.py
@@ -14,11 +14,13 @@
 # The full license is in the file COPYING.txt, distributed with this software.
 #-----------------------------------------------------------------------------
 
-from yt.testing import *
+from yt.testing import \
+    requires_file, \
+    assert_equal
 from yt.utilities.answer_testing.framework import \
     requires_ds, \
-    small_patch_amr, \
     big_patch_amr, \
+    PixelizedProjectionValuesTest, \
     data_dir_load
 from yt.frontends.art.api import ARTDataset
 
@@ -41,3 +43,8 @@
                     yield PixelizedProjectionValuesTest(
                         d9p, axis, field, weight_field,
                         dobj_name)
+
+
+ at requires_file(d9p)
+def test_ARTDataset():
+    assert isinstance(data_dir_load(d9p), ARTDataset)

diff -r db158c18f4153804f4761e782586a030e37ebb23 -r f6379bbc462ba084bd62f72d4fa83e49dcd85362 yt/frontends/artio/tests/test_outputs.py
--- a/yt/frontends/artio/tests/test_outputs.py
+++ b/yt/frontends/artio/tests/test_outputs.py
@@ -1,5 +1,5 @@
 """
-ARTIO frontend tests 
+ARTIO frontend tests
 
 
 
@@ -24,7 +24,7 @@
 from yt.frontends.artio.api import ARTIODataset
 
 _fields = ("temperature", "density", "velocity_magnitude",
-           ("deposit", "all_density"), ("deposit", "all_count")) 
+           ("deposit", "all_density"), ("deposit", "all_count"))
 
 sizmbhloz = "sizmbhloz-clref04SNth-rs9_a0.9011/sizmbhloz-clref04SNth-rs9_a0.9011.art"
 @requires_ds(sizmbhloz)
@@ -45,3 +45,8 @@
         s1 = dobj["ones"].sum()
         s2 = sum(mask.sum() for block, mask in dobj.blocks)
         yield assert_equal, s1, s2
+
+
+ at requires_file(sizmbhloz)
+def test_ARTIODataset():
+    assert isinstance(data_dir_load(sizmbhloz), ARTIODataset)

diff -r db158c18f4153804f4761e782586a030e37ebb23 -r f6379bbc462ba084bd62f72d4fa83e49dcd85362 yt/frontends/athena/tests/test_outputs.py
--- a/yt/frontends/athena/tests/test_outputs.py
+++ b/yt/frontends/athena/tests/test_outputs.py
@@ -57,3 +57,8 @@
     for test in small_patch_amr(stripping, _fields_stripping):
         test_stripping.__name__ = test.description
         yield test
+
+
+ at requires_file(cloud)
+def test_AthenaDataset():
+    assert isinstance(data_dir_load(cloud), AthenaDataset)

diff -r db158c18f4153804f4761e782586a030e37ebb23 -r f6379bbc462ba084bd62f72d4fa83e49dcd85362 yt/frontends/boxlib/tests/test_orion.py
--- a/yt/frontends/boxlib/tests/test_orion.py
+++ b/yt/frontends/boxlib/tests/test_orion.py
@@ -42,3 +42,8 @@
     for test in small_patch_amr(rt, _fields):
         test_radtube.__name__ = test.description
         yield test
+
+
+ at requires_file(rt)
+def test_OrionDataset():
+    assert isinstance(data_dir_load(rt), OrionDataset)

diff -r db158c18f4153804f4761e782586a030e37ebb23 -r f6379bbc462ba084bd62f72d4fa83e49dcd85362 yt/frontends/chombo/tests/test_outputs.py
--- a/yt/frontends/chombo/tests/test_outputs.py
+++ b/yt/frontends/chombo/tests/test_outputs.py
@@ -13,15 +13,18 @@
 # The full license is in the file COPYING.txt, distributed with this software.
 #-----------------------------------------------------------------------------
 
-from yt.testing import *
+from yt.testing import \
+    requires_file, \
+    assert_equal
 from yt.utilities.answer_testing.framework import \
     requires_ds, \
     small_patch_amr, \
-    big_patch_amr, \
     data_dir_load
-from yt.frontends.chombo.api import ChomboDataset
+from yt.frontends.chombo.api import \
+    ChomboDataset, \
+    Orion2Dataset
 
-_fields = ("density", "velocity_magnitude", #"velocity_divergence",
+_fields = ("density", "velocity_magnitude",  # "velocity_divergence",
            "magnetic_field_x")
 
 gc = "GaussianCloud/data.0077.3d.hdf5"
@@ -49,6 +52,22 @@
 def test_zp():
     ds = data_dir_load(zp)
     yield assert_equal, str(ds), "plt32.2d.hdf5"
-    for test in small_patch_amr(zp, _zp_fields, input_center="c", input_weight="rhs"):
+    for test in small_patch_amr(zp, _zp_fields, input_center="c",
+                                input_weight="rhs"):
         test_tb.__name__ = test.description
         yield test
+
+
+ at requires_file(zp)
+def test_ChomboDataset():
+    assert isinstance(data_dir_load(zp), ChomboDataset)
+
+
+ at requires_file(gc)
+def test_Orion2Dataset():
+    assert isinstance(data_dir_load(gc), Orion2Dataset)
+
+
+#@requires_file(kho)
+#def test_PlutoDataset():
+#    assert isinstance(data_dir_load(kho), PlutoDataset)

diff -r db158c18f4153804f4761e782586a030e37ebb23 -r f6379bbc462ba084bd62f72d4fa83e49dcd85362 yt/frontends/flash/tests/test_outputs.py
--- a/yt/frontends/flash/tests/test_outputs.py
+++ b/yt/frontends/flash/tests/test_outputs.py
@@ -42,3 +42,8 @@
     for test in small_patch_amr(wt, _fields_2d):
         test_wind_tunnel.__name__ = test.description
         yield test
+
+
+ at requires_file(wt)
+def test_FLASHDataset():
+    assert isinstance(data_dir_load(wt), FLASHDataset)

diff -r db158c18f4153804f4761e782586a030e37ebb23 -r f6379bbc462ba084bd62f72d4fa83e49dcd85362 yt/frontends/moab/tests/test_c5.py
--- a/yt/frontends/moab/tests/test_c5.py
+++ b/yt/frontends/moab/tests/test_c5.py
@@ -56,3 +56,7 @@
         for dobj_name in dso:
             yield FieldValuesTest(c5, field, dobj_name)
 
+
+ at requires_file(c5)
+def test_MoabHex8Dataset():
+    assert isinstance(data_dir_load(c5), MoabHex8Dataset)

diff -r db158c18f4153804f4761e782586a030e37ebb23 -r f6379bbc462ba084bd62f72d4fa83e49dcd85362 yt/frontends/ramses/tests/test_outputs.py
--- a/yt/frontends/ramses/tests/test_outputs.py
+++ b/yt/frontends/ramses/tests/test_outputs.py
@@ -1,5 +1,5 @@
 """
-RAMSES frontend tests 
+RAMSES frontend tests
 
 
 
@@ -21,10 +21,10 @@
     PixelizedProjectionValuesTest, \
     FieldValuesTest, \
     create_obj
-from yt.frontends.artio.api import ARTIODataset
+from yt.frontends.ramses.api import RAMSESDataset
 
 _fields = ("temperature", "density", "velocity_magnitude",
-           ("deposit", "all_density"), ("deposit", "all_count")) 
+           ("deposit", "all_density"), ("deposit", "all_count"))
 
 output_00080 = "output_00080/info_00080.txt"
 @requires_ds(output_00080)
@@ -44,3 +44,8 @@
         s1 = dobj["ones"].sum()
         s2 = sum(mask.sum() for block, mask in dobj.blocks)
         yield assert_equal, s1, s2
+
+
+ at requires_file(output_00080)
+def test_RAMSESDataset():
+    assert isinstance(data_dir_load(output_00080), RAMSESDataset)

diff -r db158c18f4153804f4761e782586a030e37ebb23 -r f6379bbc462ba084bd62f72d4fa83e49dcd85362 yt/frontends/sph/tests/test_owls.py
--- a/yt/frontends/sph/tests/test_owls.py
+++ b/yt/frontends/sph/tests/test_owls.py
@@ -53,3 +53,8 @@
         s1 = dobj["ones"].sum()
         s2 = sum(mask.sum() for block, mask in dobj.blocks)
         yield assert_equal, s1, s2
+
+
+ at requires_file(os33)
+def test_OWLSDataset():
+    assert isinstance(data_dir_load(os33), OWLSDataset)

diff -r db158c18f4153804f4761e782586a030e37ebb23 -r f6379bbc462ba084bd62f72d4fa83e49dcd85362 yt/frontends/sph/tests/test_tipsy.py
--- a/yt/frontends/sph/tests/test_tipsy.py
+++ b/yt/frontends/sph/tests/test_tipsy.py
@@ -92,3 +92,8 @@
         s1 = dobj["ones"].sum()
         s2 = sum(mask.sum() for block, mask in dobj.blocks)
         yield assert_equal, s1, s2
+
+
+ at requires_file(pkdgrav)
+def test_TipsyDataset():
+    assert isinstance(data_dir_load(pkdgrav), TipsyDataset)

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