[yt-svn] commit/yt: 3 new changesets
Bitbucket
commits-noreply at bitbucket.org
Wed Nov 14 07:16:02 PST 2012
3 new commits in yt:
https://bitbucket.org/yt_analysis/yt/changeset/ab6c7184809e/
changeset: ab6c7184809e
branch: yt
user: brittonsmith
date: 2012-11-13 04:40:55
summary: Adding a verbose option to assert_rel_equal.
affected #: 2 files
diff -r d84dc871dfc9657a2b2f461cb7a6e0bad7508386 -r ab6c7184809ebe326070391b21ee8c6860eb3001 yt/testing.py
--- a/yt/testing.py
+++ b/yt/testing.py
@@ -29,7 +29,7 @@
assert_array_less, assert_string_equal, assert_array_almost_equal_nulp,\
assert_allclose
-def assert_rel_equal(a1, a2, decimals, err_msg=''):
+def assert_rel_equal(a1, a2, decimals, err_msg='', verbose=True):
# We have nan checks in here because occasionally we have fields that get
# weighted without non-zero weights. I'm looking at you, particle fields!
if isinstance(a1, np.ndarray):
@@ -39,7 +39,8 @@
a2[np.isnan(a2)] = 1.0
elif np.isnan(a1) and np.isnan(a2):
return True
- return assert_almost_equal(a1/a2, 1.0, decimals, err_msg=err_msg)
+ return assert_almost_equal(a1/a2, 1.0, decimals, err_msg=err_msg,
+ verbose=verbose)
def amrspace(extent, levels=7, cells=8):
"""Creates two numpy arrays representing the left and right bounds of
diff -r d84dc871dfc9657a2b2f461cb7a6e0bad7508386 -r ab6c7184809ebe326070391b21ee8c6860eb3001 yt/utilities/answer_testing/framework.py
--- a/yt/utilities/answer_testing/framework.py
+++ b/yt/utilities/answer_testing/framework.py
@@ -310,7 +310,7 @@
err_msg=err_msg, verbose=True)
else:
assert_rel_equal(new_result, old_result, self.decimals,
- err_msg=err_msg)
+ err_msg=err_msg, verbose=True)
class AllFieldValuesTest(AnswerTestingTest):
_type_name = "AllFieldValues"
@@ -334,7 +334,7 @@
err_msg=err_msg, verbose=True)
else:
assert_rel_equal(new_result, old_result, self.decimals,
- err_msg=err_msg)
+ err_msg=err_msg, verbose=True)
class ProjectionValuesTest(AnswerTestingTest):
_type_name = "ProjectionValues"
https://bitbucket.org/yt_analysis/yt/changeset/8df4f0a5ed5f/
changeset: 8df4f0a5ed5f
branch: yt
user: brittonsmith
date: 2012-11-14 16:15:06
summary: Tweaking the standard enzo answer tests.
affected #: 1 file
diff -r ab6c7184809ebe326070391b21ee8c6860eb3001 -r 8df4f0a5ed5fef39f09c0dda55224979a3ebc07b yt/frontends/enzo/answer_testing_support.py
--- a/yt/frontends/enzo/answer_testing_support.py
+++ b/yt/frontends/enzo/answer_testing_support.py
@@ -59,8 +59,6 @@
def standard_small_simulation(pf_fn, fields):
if not can_run_pf(pf_fn): return
dso = [None]
- yield GridHierarchyTest(pf_fn)
- yield ParentageRelationshipsTest(pf_fn)
for field in fields:
yield GridValuesTest(pf_fn, field)
if 'particle' in field: continue
@@ -69,9 +67,9 @@
for weight_field in [None, "Density"]:
yield ProjectionValuesTest(
pf_fn, axis, field, weight_field,
- ds)
+ ds, decimals=3)
yield FieldValuesTest(
- pf_fn, field, ds)
+ pf_fn, field, ds, decimals=3)
class ShockTubeTest(object):
def __init__(self, data_file, solution_file, fields,
https://bitbucket.org/yt_analysis/yt/changeset/6021af872bc0/
changeset: 6021af872bc0
branch: yt
user: brittonsmith
date: 2012-11-14 16:15:53
summary: Merged.
affected #: 2 files
diff -r 8df4f0a5ed5fef39f09c0dda55224979a3ebc07b -r 6021af872bc06755516426d6fc8f3acc8e49c81d yt/frontends/flash/data_structures.py
--- a/yt/frontends/flash/data_structures.py
+++ b/yt/frontends/flash/data_structures.py
@@ -274,6 +274,7 @@
self.conversion_factors["Time"] = 1.0
for unit in mpc_conversion.keys():
self.units[unit] = mpc_conversion[unit] / mpc_conversion["cm"]
+ self.units[unit+"cm"] = self.units[unit]
self.units[unit] /= (1.0+self.current_redshift)
def _setup_cgs_units(self):
diff -r 8df4f0a5ed5fef39f09c0dda55224979a3ebc07b -r 6021af872bc06755516426d6fc8f3acc8e49c81d yt/utilities/physical_constants.py
--- a/yt/utilities/physical_constants.py
+++ b/yt/utilities/physical_constants.py
@@ -20,6 +20,7 @@
boltzmann_constant_cgs = 1.3806504e-16 # erg K^-1
gravitational_constant_cgs = 6.67428e-8 # cm^3 g^-1 s^-2
planck_constant_cgs = 6.62606896e-27 # erg s
+stefan_boltzmann_constant_cgs = 5.670373e-5 # erg cm^-2 s^-1 K^-4
rho_crit_now = 1.8788e-29 # g times h^2 (critical mass for closure, Cosmology)
# Misc. Approximations
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