Sam Skillman  committed e2d94c6

Only test the FieldValues once, not once for each projection direction. Swap out
the assert_rel_equal to the more forgiving (of comparing zeros) numpy.testing.assert_allclose.

  • Participants
  • Parent commits 6021af8
  • Branches yt

Comments (0)

Files changed (2)

File yt/frontends/enzo/

     for field in fields:
         yield GridValuesTest(pf_fn, field)
         if 'particle' in field: continue
-        for axis in [0, 1, 2]:
-            for ds in dso:
+        for ds in dso:
+            for axis in [0, 1, 2]:
                 for weight_field in [None, "Density"]:
                     yield ProjectionValuesTest(
                         pf_fn, axis, field, weight_field,
                         ds, decimals=3)
-                yield FieldValuesTest(
-                        pf_fn, field, ds, decimals=3)
+            yield FieldValuesTest(
+                    pf_fn, field, ds, decimals=3)
 class ShockTubeTest(object):
     def __init__(self, data_file, solution_file, fields, 

File yt/utilities/answer_testing/

             assert_equal(new_result, old_result, 
                          err_msg=err_msg, verbose=True)
-            assert_rel_equal(new_result, old_result, self.decimals,
+            assert_allclose(new_result, old_result, 10.**(-self.decimals),
                              err_msg=err_msg, verbose=True)
 class AllFieldValuesTest(AnswerTestingTest):
                 assert_equal(new_result[k], old_result[k],
-                assert_rel_equal(new_result[k], old_result[k], 
-                                 self.decimals, err_msg=err_msg)
+                assert_allclose(new_result[k], old_result[k], 
+                                 10.**-(self.decimals), err_msg=err_msg)
 class PixelizedProjectionValuesTest(AnswerTestingTest):
     _type_name = "PixelizedProjectionValues"