[yt-svn] commit/yt: xarthisius: Merged in ngoldbaum/yt (pull request #1755)
commits-noreply at bitbucket.org
commits-noreply at bitbucket.org
Wed Sep 23 10:56:48 PDT 2015
1 new commit in yt:
https://bitbucket.org/yt_analysis/yt/commits/d70d717bcd11/
Changeset: d70d717bcd11
Branch: yt
User: xarthisius
Date: 2015-09-23 17:56:31+00:00
Summary: Merged in ngoldbaum/yt (pull request #1755)
Reduce number of SPH answer tests by not testing all fields with weight fields
Affected #: 4 files
diff -r 076a50c910710d2067022f0ef64efd2a6efab9e7 -r d70d717bcd116621c0d30808a495b905a4046f58 yt/frontends/gadget/tests/test_outputs.py
--- a/yt/frontends/gadget/tests/test_outputs.py
+++ b/yt/frontends/gadget/tests/test_outputs.py
@@ -14,6 +14,8 @@
# The full license is in the file COPYING.txt, distributed with this software.
#-----------------------------------------------------------------------------
+from collections import OrderedDict
+
from yt.testing import requires_file
from yt.utilities.answer_testing.framework import \
data_dir_load, \
@@ -23,20 +25,25 @@
isothermal_h5 = "IsothermalCollapse/snap_505.hdf5"
isothermal_bin = "IsothermalCollapse/snap_505"
-gdg = "GadgetDiskGalaxy/snapshot_0200.hdf5"
+gdg = "GadgetDiskGalaxy/snapshot_200.hdf5"
-iso_fields = (
- ("gas", "density"),
- ("gas", "temperature"),
- ('gas', 'velocity_magnitude'),
- ("deposit", "all_density"),
- ("deposit", "all_count"),
- ("deposit", "all_cic"),
- ("deposit", "PartType0_density"),
+# This maps from field names to weight field names to use for projections
+iso_fields = OrderedDict(
+ [
+ (("gas", "density"), None),
+ (("gas", "temperature"), None),
+ (("gas", "temperature"), ('gas', 'density')),
+ (('gas', 'velocity_magnitude'), None),
+ (("deposit", "all_density"), None),
+ (("deposit", "all_count"), None),
+ (("deposit", "all_cic"), None),
+ (("deposit", "PartType0_density"), None),
+ ]
)
iso_kwargs = dict(bounding_box=[[-3, 3], [-3, 3], [-3, 3]])
-gdg_fields = iso_fields + (("deposit", "PartType4_density"), )
+gdg_fields = iso_fields.copy()
+gdg_fields["deposit", "PartType4_density"] = None
gdg_kwargs = dict(bounding_box=[[-1e5, 1e5], [-1e5, 1e5], [-1e5, 1e5]])
@@ -57,6 +64,6 @@
@requires_ds(gdg, big_data=True)
def test_gadget_disk_galaxy():
- for test in sph_answer(gdg, 'snap_505', 11907080, gdg_fields,
+ for test in sph_answer(gdg, 'snapshot_200', 11907080, gdg_fields,
ds_kwargs=gdg_kwargs):
yield test
diff -r 076a50c910710d2067022f0ef64efd2a6efab9e7 -r d70d717bcd116621c0d30808a495b905a4046f58 yt/frontends/owls/tests/test_outputs.py
--- a/yt/frontends/owls/tests/test_outputs.py
+++ b/yt/frontends/owls/tests/test_outputs.py
@@ -14,6 +14,8 @@
# The full license is in the file COPYING.txt, distributed with this software.
#-----------------------------------------------------------------------------
+from collections import OrderedDict
+
from yt.testing import \
requires_file
from yt.utilities.answer_testing.framework import \
@@ -24,17 +26,21 @@
os33 = "snapshot_033/snap_033.0.hdf5"
-_fields = (
- ("gas", "density"),
- ("gas", "temperature"),
- ('gas', 'He_p0_number_density'),
- ('gas', 'N_p1_number_density'),
- ('gas', 'velocity_magnitude'),
- ("deposit", "all_density"),
- ("deposit", "all_count"),
- ("deposit", "all_cic"),
- ("deposit", "PartType0_density"),
- ("deposit", "PartType4_density"))
+# This maps from field names to weight field names to use for projections
+_fields = OrderedDict(
+ [
+ (("gas", "density"), None),
+ (("gas", "temperature"), None),
+ (("gas", "temperature"), ("gas", "density")),
+ (('gas', 'He_p0_number_density'), None),
+ (('gas', 'velocity_magnitude'), None),
+ (("deposit", "all_density"), None),
+ (("deposit", "all_count"), None),
+ (("deposit", "all_cic"), None),
+ (("deposit", "PartType0_density"), None),
+ (("deposit", "PartType4_density"), None),
+ ]
+)
@requires_ds(os33, big_data=True)
diff -r 076a50c910710d2067022f0ef64efd2a6efab9e7 -r d70d717bcd116621c0d30808a495b905a4046f58 yt/frontends/tipsy/tests/test_outputs.py
--- a/yt/frontends/tipsy/tests/test_outputs.py
+++ b/yt/frontends/tipsy/tests/test_outputs.py
@@ -14,7 +14,11 @@
# The full license is in the file COPYING.txt, distributed with this software.
#-----------------------------------------------------------------------------
-from yt.testing import assert_equal, requires_file
+from collections import OrderedDict
+
+from yt.testing import \
+ assert_equal, \
+ requires_file
from yt.utilities.answer_testing.framework import \
requires_ds, \
data_dir_load, \
@@ -92,12 +96,15 @@
s2 = sum(mask.sum() for block, mask in dobj.blocks)
yield assert_equal, s1, s2
-tg_fields = (
- ('gas', 'density'),
- ('gas', 'temperature'),
- ('gas', 'velocity_magnitude'),
- ('gas', 'Fe_fraction'),
- ('Stars', 'Metals'),
+tg_fields = OrderedDict(
+ [
+ (('gas', 'density'), None),
+ (('gas', 'temperature'), None),
+ (('gas', 'temperature'), ('gas', 'density')),
+ (('gas', 'velocity_magnitude'), None),
+ (('gas', 'Fe_fraction'), None),
+ (('Stars', 'Metals'), None),
+ ]
)
tipsy_gal = 'TipsyGalaxy/galaxy.00300'
@@ -105,7 +112,7 @@
def test_tipsy_galaxy():
for test in sph_answer(tipsy_gal, 'galaxy.00300', 315372, tg_fields):
yield test
-
+
@requires_file(gasoline_dmonly)
@requires_file(pkdgrav)
def test_TipsyDataset():
diff -r 076a50c910710d2067022f0ef64efd2a6efab9e7 -r d70d717bcd116621c0d30808a495b905a4046f58 yt/utilities/answer_testing/framework.py
--- a/yt/utilities/answer_testing/framework.py
+++ b/yt/utilities/answer_testing/framework.py
@@ -805,7 +805,8 @@
ds_fn, field, dobj_name)
def big_patch_amr(ds_fn, fields, input_center="max", input_weight="density"):
- if not can_run_ds(ds_fn): return
+ if not can_run_ds(ds_fn):
+ return
dso = [ None, ("sphere", (input_center, (0.1, 'unitary')))]
yield GridHierarchyTest(ds_fn)
yield ParentageRelationshipsTest(ds_fn)
@@ -837,17 +838,16 @@
s1 = dobj["ones"].sum()
s2 = sum(mask.sum() for block, mask in dobj.blocks)
yield assert_equal, s1, s2
- for field in fields:
+ for field, weight_field in fields.items():
if field[0] in ds.particle_types:
particle_type = True
else:
particle_type = False
for axis in [0, 1, 2]:
- for weight_field in [None, ('gas', 'density')]:
- if particle_type is False:
- yield PixelizedProjectionValuesTest(
- ds_fn, axis, field, weight_field,
- dobj_name)
+ if particle_type is False:
+ yield PixelizedProjectionValuesTest(
+ ds_fn, axis, field, weight_field,
+ dobj_name)
yield FieldValuesTest(ds_fn, field, dobj_name,
particle_type=particle_type)
return
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