1. Matthew Turk
  2. yt_answer_testing

Commits

Matthew Turk  committed 57593ab

Initial import

  • Participants
  • Branches default

Comments (0)

Files changed (2)

File README

View file
+yt Answer Testing
+=================
+
+This is where answer testing for yt is set up.  The idea is that you should be
+able to go into this directory and run:
+
+    enzo_test store SOMENAME *.py
+
+and it will run all the tests inside the *.py files.  SOMENAME should probably
+be the current changeset hash.  All the parameter files located in OutputLog
+will be passed into the load() function, the tests will be run, answers stored,
+and then
+
+    enzo_test compare OTHERNAME SOMENAME *.py
+
+will compare the two results.
+
+Currently it is not parallel-safe.
+
+The idea is that once we have some set of tests, we can execute this on every
+couple changesets, see the results, and then determine whether or not we have
+ultimately succeeded in creating a stable code.

File projections.py

View file
+from yt.utilities.answer_testing.output_tests import \
+    SingleOutputTest, create_test
+from yt.utilities.answer_testing.hydro_tests import \
+    TestProjection, TestGasDistribution
+
+# We want to test several things.  We need to be able to run the 
+
+fields_to_test = ["Density", "Temperature", "x-velocity", "y-velocity", "z-velocity",
+                  # Now some derived fields
+                  "Pressure", "SoundSpeed", "particle_density", "Entropy",
+                  # Ghost zones
+                  "AveragedDensity", "DivV"]
+
+for axis in range(3):
+    for field in fields_to_test:
+        create_test(TestProjection, "projection_test_%s_%s" % (axis, field),
+                    field = field, axis = axis)
+
+for field in fields_to_test:
+    create_test(TestGasDistribution, "profile_density_test_%s" % field,
+                field_x = "Density", field_y = field)
+
+