[Yt-svn] yt: Fixing the period setting in the merger tree.

hg at spacepope.org hg at spacepope.org
Thu Dec 16 15:20:36 PST 2010


hg Repository: yt
details:   yt/rev/3e99bb6dbb72
changeset: 3616:3e99bb6dbb72
user:      Stephen Skory <stephenskory at yahoo.com>
date:
Thu Dec 16 16:20:17 2010 -0700
description:
Fixing the period setting in the merger tree.

diffstat:

 yt/analysis_modules/halo_merger_tree/merger_tree.py |  6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diffs (23 lines):

diff -r 4225edfc20da -r 3e99bb6dbb72 yt/analysis_modules/halo_merger_tree/merger_tree.py
--- a/yt/analysis_modules/halo_merger_tree/merger_tree.py	Thu Dec 16 12:44:52 2010 -0700
+++ b/yt/analysis_modules/halo_merger_tree/merger_tree.py	Thu Dec 16 16:20:17 2010 -0700
@@ -164,7 +164,6 @@
         self.dm_only = dm_only
         self.refresh = refresh
         self.sleep = sleep # How long to wait between db sync checks.
-        self.period = -1
         if self.sleep <= 0.:
             self.sleep = 5
         # MPI stuff
@@ -216,9 +215,8 @@
         for cycle, file in enumerate(self.restart_files):
             gc.collect()
             pf = load(file)
-            # get the period, only once is sufficient
-            if self.period == -1:
-                self.period = pf.domain_right_edge - pf.domain_left_edge
+            # This will be fetched many times, but it's not a problem.
+            self.period = pf.domain_right_edge - pf.domain_left_edge
             # If the halos are already found, skip this data step, unless
             # refresh is True.
             dir = os.path.dirname(file)



More information about the yt-svn mailing list