[Yt-svn] yt-commit r1051 - trunk/yt/lagos/hop

mturk at wrangler.dreamhost.com mturk at wrangler.dreamhost.com
Sat Dec 27 09:24:55 PST 2008


Author: mturk
Date: Sat Dec 27 09:24:54 2008
New Revision: 1051
URL: http://yt.spacepope.org/changeset/1051

Log:
Added a sort step to the halo joining



Modified:
   trunk/yt/lagos/hop/SS_HopOutput.py

Modified: trunk/yt/lagos/hop/SS_HopOutput.py
==============================================================================
--- trunk/yt/lagos/hop/SS_HopOutput.py	(original)
+++ trunk/yt/lagos/hop/SS_HopOutput.py	Sat Dec 27 09:24:54 2008
@@ -324,6 +324,13 @@
             halo._distributed = True
             halo._owner = proc
             halo.id = i
+        self._groups.sort(key = lambda h: -1 * h.get_size())
+        sorted_max_dens = {}
+        for i, halo in enumerate(self._groups):
+            if halo.id in self._max_dens:
+                sorted_max_dens[i] = self._max_dens[halo.id]
+            halo.id = i
+        self._max_dens = sorted_max_dens
         
     def _reposition_particles(self, bounds):
         # This only does periodicity.  We do NOT want to deal with anything



More information about the yt-svn mailing list