Commits

Sam Skillman committed 59e9f43

Modifying tests to use FieldValues with decimals (to avoid bitwise tests). Also
moving from FRB tests (that were storing the entire image) to just storing the
min, max, mean, and stddev.

  • Participants
  • Parent commits b463410

Comments (0)

Files changed (15)

run/Cooling/CoolingTest_Cloudy/test_cooling.py

     sim.get_time_series()
     for pf in sim:
         for field in _fields:
-            yield FieldValuesTest(pf, field)
+            yield FieldValuesTest(pf, field, decimals=13)
 

run/Cooling/CoolingTest_JHW/test_cooling.py

     sim.get_time_series()
     for pf in sim:
         for field in _fields:
-            yield FieldValuesTest(pf, field)
+            yield FieldValuesTest(pf, field, decimals=13)
 

run/Cooling/OneZoneFreefallTest/test_freefall.py

     sim.get_time_series()
     for pf in sim:
         for field in _fields:
-            yield FieldValuesTest(pf, field)
+            yield FieldValuesTest(pf, field, decimals=13)

run/GravitySolver/TestOrbit/test_orbit.py

     sim.get_time_series()
     for pf in sim:
         for field in _fields:
-            yield AllFieldValuesTest(pf, field, decimals=3)
+            yield AllFieldValuesTest(pf, field, decimals=13)

run/Hydro/Hydro-2D/NohProblem2D/test_noh2d.py

         sl = self.pf.h.slice(2, 0.5)
         frb = FixedResolutionBuffer(sl, (0.0, 1.0, 0.0, 1.0), 
                                     (400, 400), antialias=False)
-        return frb["Density"]
+        dens = frb["Density"]
+        return np.array([dens.mean(), dens.std(), dens.min(), dens.max()])
 
     def compare(self, new_result, old_result):
-        assert_allclose(new_result, old_result, rtol=1e-3, atol=0)
+        assert_allclose(new_result, old_result, rtol=1e-13, atol=0)
 
 class TestRadialDensity(AnswerTestingTest):
     _type_name = "noh2d_radial"

run/Hydro/Hydro-2D/NohProblem2DAMR/test_noh2damr.py

         sl = self.pf.h.slice(2, 0.5)
         frb = FixedResolutionBuffer(sl, (0.0, 1.0, 0.0, 1.0), 
                                     (400, 400), antialias=False)
-        return frb["Density"]
+        dens = frb["Density"]
+        return np.array([dens.mean(), dens.std(), dens.min(), dens.max()])
 
     def compare(self, new_result, old_result):
-        assert_allclose(new_result, old_result, rtol=1e-3, atol=0)
+        assert_allclose(new_result, old_result, rtol=1e-13, atol=0)
 
 class TestRadialDensity(AnswerTestingTest):
     _type_name = "noh2damr_radial"

run/Hydro/Hydro-3D/NohProblem3D/test_noh3d.py

         sl = self.pf.h.slice(2, 0.5)
         frb = FixedResolutionBuffer(sl, (0.0, 1.0, 0.0, 1.0),
                                     (100, 100), antialias=False)
-        return frb["Density"]
+        dens = frb["Density"]
+        return np.array([dens.mean(), dens.std(), dens.min(), dens.max()])
 
     def compare(self, new_result, old_result):
-        assert_allclose(new_result, old_result, rtol=1e-3, atol=0)
+        assert_allclose(new_result, old_result, rtol=1e-13, atol=0)
     
 class TestRadialDensity(AnswerTestingTest):
     _type_name = "noh3d_radial"

run/Hydro/Hydro-3D/NohProblem3DAMR/test_noh3damr.py

         sl = self.pf.h.slice(2, 0.5)
         frb = FixedResolutionBuffer(sl, (0.0, 1.0, 0.0, 1.0),
                                     (400, 400), antialias=False)
-        return frb["Density"]
+        dens = frb["Density"]
+        return np.array([dens.mean(), dens.std(), dens.min(), dens.max()])
 
     def compare(self, new_result, old_result):
-        assert_allclose(new_result, old_result, rtol=1e-3, atol=0)
+        assert_allclose(new_result, old_result, rtol=1e-13, atol=0)
 
 class TestRadialDensity(AnswerTestingTest):
     _type_name = "noh3damr_radial"

run/MHD/1D/BrioWu-MHD-1D/test_briowu.py

     sim.get_time_series()
     for pf in sim:
         for field in _fields:
-            yield AllFieldValuesTest(pf, field)
+            yield AllFieldValuesTest(pf, field, decimals=13)

run/MHD/2D/MHD2DRotorTest/test_rotor.py

     def run(self):
         sl = self.pf.h.slice(2, 0.5)
         frb = FixedResolutionBuffer(sl, (0.0, 1.0, 0.0, 1.0), (200,200))
-        return frb[self.field]
+        dd = frb[self.field]
+        return np.array([dd.mean(), dd.std(), dd.min(), dd.max()])
 
     def compare(self, new_result, old_result):
-        assert_allclose(new_result, old_result, rtol=1e-3, atol=0)
+        assert_allclose(new_result, old_result, rtol=1e-13, atol=0)
 
 @requires_outputlog(_dir_name, _pf_name)
 def test_rotor():

run/MHD/2D/SedovBlast-MHD-2D-Fryxell/test_fryxell.py

     def run(self):
         sl = self.pf.h.slice(2, 0.5)
         frb = FixedResolutionBuffer(sl, (0.0, 1.0, 0.0, 1.0), (200,200))
-        return frb[self.field]
+        dd = frb[self.field]
+        return np.array([dd.mean(), dd.std(), dd.min(), dd.max()])
 
     def compare(self, new_result, old_result):
-        assert_allclose(new_result, old_result, rtol=1e-3, atol=0)
+        assert_allclose(new_result, old_result, rtol=1e-13, atol=0)
 
 @requires_outputlog(_dir_name, _pf_name)
 def test_fryxell():

run/MHD/2D/SedovBlast-MHD-2D-Gardiner/test_gardiner.py

     def run(self):
         sl = self.pf.h.slice(2, 0.5)
         frb = FixedResolutionBuffer(sl, (0.0, 1.0, 0.0, 1.0), (200,200))
-        return frb[self.field]
+        dd = frb[self.field]
+        return np.array([dd.mean(), dd.std(), dd.min(), dd.max()])
 
     def compare(self, new_result, old_result):
-        assert_allclose(new_result, old_result, rtol=1e-3, atol=0)
+        assert_allclose(new_result, old_result, rtol=1e-13, atol=0)
 
 @requires_outputlog(_dir_name, _pf_name)
 def test_gardiner():

run/RadiationTransport/PhotonShadowing/test_photonshadowing.py

     def run(self):
         sl = self.pf.h.slice(2,0.5)
         frb = FixedResolutionBuffer(sl, (0,1,0,1), (200,200))
-        return frb[self.field]
+        dd = frb[self.field]
+        return np.array([dd.mean(), dd.std(), dd.min(), dd.max()])
 
     def compare(self, new_result, old_result):
-        assert_allclose(new_result, old_result, rtol=1e-3, atol=0)
+        assert_allclose(new_result, old_result, rtol=1e-13, atol=0)
 
 @requires_outputlog(_dir_name, _pf_name)
 def test_photon_shadowing():

run/RadiationTransport/PhotonTest/test_photontest.py

     def run(self):
         sl = self.pf.h.slice(2,0.5)
         frb = FixedResolutionBuffer(sl, (0,1,0,1), (200,200))
-        return frb[self.field]
+        dd = frb[self.field]
+        return np.array([dd.mean(), dd.std(), dd.min(), dd.max()])
 
     def compare(self, new_result, old_result):
-        assert_allclose(new_result, old_result, rtol=1e-3, atol=0)
+        assert_allclose(new_result, old_result, rtol=1e-13, atol=0)
 
 @requires_outputlog(_dir_name, _pf_name)
 def test_photon_test():

run/RadiationTransport/PhotonTestAMR/test_amrphotontest.py

     def run(self):
         sl = self.pf.h.slice(2,0.5)
         frb = FixedResolutionBuffer(sl, (0,1,0,1), (200,200))
-        return frb[self.field]
+        dd = frb[self.field]
+        return np.array([dd.mean(), dd.std(), dd.min(), dd.max()])
 
     def compare(self, new_result, old_result):
-        assert_allclose(new_result, old_result, rtol=1e-3, atol=0)
+        assert_allclose(new_result, old_result, rtol=1e-13, atol=0)
 
 @requires_outputlog(_dir_name, _pf_name)
 def test_amr_photon_test():