[Yt-svn] yt: Added check to profiler for empty halo list.

hg at spacepope.org hg at spacepope.org
Mon Oct 4 14:24:15 PDT 2010


hg Repository: yt
details:   yt/rev/52b3233ca5f8
changeset: 3427:52b3233ca5f8
user:      Britton Smith <brittonsmith at gmail.com>
date:
Mon Oct 04 17:24:09 2010 -0400
description:
Added check to profiler for empty halo list.

diffstat:

 yt/analysis_modules/halo_profiler/multi_halo_profiler.py |  4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diffs (14 lines):

diff -r a0c9c29058b5 -r 52b3233ca5f8 yt/analysis_modules/halo_profiler/multi_halo_profiler.py
--- a/yt/analysis_modules/halo_profiler/multi_halo_profiler.py	Mon Oct 04 16:26:05 2010 -0400
+++ b/yt/analysis_modules/halo_profiler/multi_halo_profiler.py	Mon Oct 04 17:24:09 2010 -0400
@@ -255,6 +255,10 @@
     def make_profiles(self, filename=None, prefilters=None, **kwargs):
         "Make radial profiles for all halos on the list."
 
+        if len(self.all_halos) == 0:
+            mylog.error("Halo list is empty, returning.")
+            return None
+
         # Reset filtered halo list.
         self.filtered_halos = []
 



More information about the yt-svn mailing list