[yt-svn] commit/yt: bwkeller: Merged in ngoldbaum/yt (pull request #1781)

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Mon Oct 5 11:20:25 PDT 2015


1 new commit in yt:

https://bitbucket.org/yt_analysis/yt/commits/4802fa59d73c/
Changeset:   4802fa59d73c
Branch:      yt
User:        bwkeller
Date:        2015-10-05 18:20:13+00:00
Summary:     Merged in ngoldbaum/yt (pull request #1781)

Support enzo answers tests with yt-3
Affected #:  2 files

diff -r 092c46b49e487ccad91a0ef709bd94700c6d8969 -r 4802fa59d73c068a5241089786e5f4cffc90544e yt/fields/field_aliases.py
--- a/yt/fields/field_aliases.py
+++ b/yt/fields/field_aliases.py
@@ -83,7 +83,11 @@
     ("CuttingPlaneBy",                   "cutting_plane_by"),
     ("MeanMolecularWeight",              "mean_molecular_weight"),
     ("particle_density",                 "particle_density"),
+    ("ThermalEnergy",                    "thermal_energy"),
+    ("TotalEnergy",                      "total_energy"),
     ("MagneticEnergy",                   "magnetic_energy"),
+    ("GasEnergy",                        "thermal_energy"),
+    ("Gas_Energy",                       "thermal_energy"),
     ("BMagnitude",                       "b_magnitude"),
     ("PlasmaBeta",                       "plasma_beta"),
     ("MagneticPressure",                 "magnetic_pressure"),

diff -r 092c46b49e487ccad91a0ef709bd94700c6d8969 -r 4802fa59d73c068a5241089786e5f4cffc90544e yt/frontends/enzo/answer_testing_support.py
--- a/yt/frontends/enzo/answer_testing_support.py
+++ b/yt/frontends/enzo/answer_testing_support.py
@@ -78,16 +78,17 @@
 
     def __call__(self):
         # Read in the ds
-        ds = load(self.data_file)  
-        exact = self.get_analytical_solution() 
+        ds = load(self.data_file)
+        ds.setup_deprecated_fields()
+        exact = self.get_analytical_solution()
 
         ad = ds.all_data()
         position = ad['x']
         for k in self.fields:
-            field = ad[k]
+            field = ad[k].d
             for xmin, xmax in zip(self.left_edges, self.right_edges):
                 mask = (position >= xmin)*(position <= xmax)
-                exact_field = np.interp(position[mask], exact['pos'], exact[k]) 
+                exact_field = np.interp(position[mask], exact['pos'], exact[k])
                 myname = "ShockTubeTest_%s" % k
                 # yield test vs analytical solution 
                 yield AssertWrapper(myname, assert_allclose, field[mask],

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