[yt-svn] commit/yt: 3 new changesets
commits-noreply at bitbucket.org
commits-noreply at bitbucket.org
Wed Nov 5 19:55:20 PST 2014
3 new commits in yt:
https://bitbucket.org/yt_analysis/yt/commits/73267a51698c/
Changeset: 73267a51698c
Branch: yt
User: atmyers
Date: 2014-10-15 19:27:56+00:00
Summary: some Orion datasets apparently have velocity as the native fields, instead of momentum. This handles that case.
Affected #: 1 file
diff -r 9d022af9c4de627a45b1250f8c5427b9d8562989 -r 73267a51698c5bafe0739f745e2c426bc6bc673c yt/frontends/boxlib/fields.py
--- a/yt/frontends/boxlib/fields.py
+++ b/yt/frontends/boxlib/fields.py
@@ -97,6 +97,8 @@
# Now, let's figure out what fields are included.
if any(f[1] == "xmom" for f in self.field_list):
self.setup_momentum_to_velocity()
+ elif any(f[1] == "xvel" for f in self.field_list):
+ self.setup_velocity_to_momentum()
self.add_field(("gas", "thermal_energy"),
function=_thermal_energy,
units="erg/g")
@@ -112,11 +114,22 @@
def _get_vel(axis):
def velocity(field, data):
return data["%smom" % axis]/data["density"]
+ return velocity
for ax in 'xyz':
self.add_field(("gas", "velocity_%s" % ax),
function=_get_vel(ax),
units="cm/s")
+ def setup_velocity_to_momentum(self):
+ def _get_mom(axis):
+ def momentum(field, data):
+ return data["%svel" % axis]*data["density"]
+ return momentum
+ for ax in 'xyz':
+ self.add_field(("gas", "momentum_%s" % ax),
+ function=_get_mom(ax),
+ units=mom_units)
+
class CastroFieldInfo(FieldInfoContainer):
https://bitbucket.org/yt_analysis/yt/commits/701be3efdf87/
Changeset: 701be3efdf87
Branch: yt
User: atmyers
Date: 2014-10-15 19:29:32+00:00
Summary: turning on the answer tests for a couple of datasets that use Orion sink/star particles
Affected #: 2 files
diff -r 73267a51698c5bafe0739f745e2c426bc6bc673c -r 701be3efdf87f98851b43a14abe523a9febc5698 yt/frontends/boxlib/tests/test_orion.py
--- a/yt/frontends/boxlib/tests/test_orion.py
+++ b/yt/frontends/boxlib/tests/test_orion.py
@@ -43,6 +43,14 @@
test_radtube.__name__ = test.description
yield test
+star = "StarParticles/plrd01000"
+ at requires_ds(star)
+def test_star():
+ ds = data_dir_load(star)
+ yield assert_equal, str(ds), "plrd01000"
+ for test in small_patch_amr(star, _fields):
+ test_star.__name__ = test.description
+ yield test
@requires_file(rt)
def test_OrionDataset():
diff -r 73267a51698c5bafe0739f745e2c426bc6bc673c -r 701be3efdf87f98851b43a14abe523a9febc5698 yt/frontends/chombo/tests/test_outputs.py
--- a/yt/frontends/chombo/tests/test_outputs.py
+++ b/yt/frontends/chombo/tests/test_outputs.py
@@ -46,6 +46,15 @@
test_tb.__name__ = test.description
yield test
+iso = "IsothermalSphere/data.0000.3d.hdf5"
+ at requires_ds(iso)
+def test_iso():
+ ds = data_dir_load(iso)
+ yield assert_equal, str(ds), "data.0000.3d.hdf5"
+ for test in small_patch_amr(iso, _fields):
+ test_iso.__name__ = test.description
+ yield test
+
_zp_fields = ("rhs", "phi", "gravitational_field_x",
"gravitational_field_y")
zp = "ZeldovichPancake/plt32.2d.hdf5"
https://bitbucket.org/yt_analysis/yt/commits/13e9e2fc55a8/
Changeset: 13e9e2fc55a8
Branch: yt
User: xarthisius
Date: 2014-11-06 03:55:12+00:00
Summary: Merged in atmyers/yt (pull request #1252)
Adding Orion sink/star particle tests
Affected #: 3 files
diff -r 61b8f5675cc23c5e0b3635c70766ab5d0cd71bbb -r 13e9e2fc55a831b17c34aeb7d3030d1ed2752e71 yt/frontends/boxlib/fields.py
--- a/yt/frontends/boxlib/fields.py
+++ b/yt/frontends/boxlib/fields.py
@@ -97,6 +97,8 @@
# Now, let's figure out what fields are included.
if any(f[1] == "xmom" for f in self.field_list):
self.setup_momentum_to_velocity()
+ elif any(f[1] == "xvel" for f in self.field_list):
+ self.setup_velocity_to_momentum()
self.add_field(("gas", "thermal_energy"),
function=_thermal_energy,
units="erg/g")
@@ -112,11 +114,22 @@
def _get_vel(axis):
def velocity(field, data):
return data["%smom" % axis]/data["density"]
+ return velocity
for ax in 'xyz':
self.add_field(("gas", "velocity_%s" % ax),
function=_get_vel(ax),
units="cm/s")
+ def setup_velocity_to_momentum(self):
+ def _get_mom(axis):
+ def momentum(field, data):
+ return data["%svel" % axis]*data["density"]
+ return momentum
+ for ax in 'xyz':
+ self.add_field(("gas", "momentum_%s" % ax),
+ function=_get_mom(ax),
+ units=mom_units)
+
class CastroFieldInfo(FieldInfoContainer):
diff -r 61b8f5675cc23c5e0b3635c70766ab5d0cd71bbb -r 13e9e2fc55a831b17c34aeb7d3030d1ed2752e71 yt/frontends/boxlib/tests/test_orion.py
--- a/yt/frontends/boxlib/tests/test_orion.py
+++ b/yt/frontends/boxlib/tests/test_orion.py
@@ -43,6 +43,14 @@
test_radtube.__name__ = test.description
yield test
+star = "StarParticles/plrd01000"
+ at requires_ds(star)
+def test_star():
+ ds = data_dir_load(star)
+ yield assert_equal, str(ds), "plrd01000"
+ for test in small_patch_amr(star, _fields):
+ test_star.__name__ = test.description
+ yield test
@requires_file(rt)
def test_OrionDataset():
diff -r 61b8f5675cc23c5e0b3635c70766ab5d0cd71bbb -r 13e9e2fc55a831b17c34aeb7d3030d1ed2752e71 yt/frontends/chombo/tests/test_outputs.py
--- a/yt/frontends/chombo/tests/test_outputs.py
+++ b/yt/frontends/chombo/tests/test_outputs.py
@@ -47,6 +47,15 @@
test_tb.__name__ = test.description
yield test
+iso = "IsothermalSphere/data.0000.3d.hdf5"
+ at requires_ds(iso)
+def test_iso():
+ ds = data_dir_load(iso)
+ yield assert_equal, str(ds), "data.0000.3d.hdf5"
+ for test in small_patch_amr(iso, _fields):
+ test_iso.__name__ = test.description
+ yield test
+
_zp_fields = ("rhs", "phi", "gravitational_field_x",
"gravitational_field_y")
zp = "ZeldovichPancake/plt32.2d.hdf5"
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