[Yt-svn] yt: Adding printing of key parameters at parameter file instanta...

hg at spacepope.org hg at spacepope.org
Thu Dec 9 10:43:06 PST 2010


hg Repository: yt
details:   yt/rev/1f0c1289964c
changeset: 3590:1f0c1289964c
user:      Matthew Turk <matthewturk at gmail.com>
date:
Thu Dec 09 10:43:03 2010 -0800
description:
Adding printing of key parameters at parameter file instantation.

diffstat:

 yt/data_objects/static_output.py |  19 +++++++++++++++++++
 1 files changed, 19 insertions(+), 0 deletions(-)

diffs (36 lines):

diff -r 6bb02347e6cd -r 1f0c1289964c yt/data_objects/static_output.py
--- a/yt/data_objects/static_output.py	Thu Dec 09 10:03:41 2010 -0800
+++ b/yt/data_objects/static_output.py	Thu Dec 09 10:43:03 2010 -0800
@@ -85,6 +85,7 @@
                 _pf_store.check_pf(self)
             except NoParameterShelf:
                 pass
+        self.print_key_parameters()
 
     def __reduce__(self):
         args = (self._hash(),)
@@ -165,6 +166,24 @@
     hierarchy = property(_get_hierarchy, _set_hierarchy)
     h = property(_get_hierarchy, _set_hierarchy)
 
+    def print_key_parameters(self):
+        for a in ["current_time", "domain_dimensions", "domain_left_edge",
+                 "domain_right_edge", "cosmological_simulation"]:
+            if not hasattr(self, a):
+                mylog.error("Missing %s in parameter file definition!", a)
+                continue
+            v = getattr(self, a)
+            mylog.info("Parameters: %-25s = %s", a, v)
+        if hasattr(self, "cosmological_simulation") and \
+            getattr(self, "cosmological_simulation"):
+            for a in ["current_redshift", "omega_lambda", "omega_matter",
+                      "hubble_constant"]:
+                if not hasattr(self, a):
+                    mylog.error("Missing %s in parameter file definition!", a)
+                    continue
+                v = getattr(self, a)
+                mylog.info("Parameters: %-25s = %s", a, v)
+
 def _reconstruct_pf(*args, **kwargs):
     pfs = ParameterFileStore()
     pf = pfs.get_pf_hash(*args)



More information about the yt-svn mailing list