[Yt-svn] commit/yt: sskory: Adding missing import, and apparently 'parent' isn't always

Bitbucket commits-noreply at bitbucket.org
Sun Apr 24 13:59:19 PDT 2011


1 new changeset in yt:

http://bitbucket.org/yt_analysis/yt/changeset/1758e14b73a3/
changeset:   r4196:1758e14b73a3
branch:      yt
user:        sskory
date:        2011-04-24 22:58:44
summary:     Adding missing import, and apparently 'parent' isn't always
a list, so I've added a try in case it isn't. Works for me.
affected #:  1 file (102 bytes)

--- a/yt/analysis_modules/level_sets/clump_handling.py	Sat Apr 23 19:08:57 2011 -0400
+++ b/yt/analysis_modules/level_sets/clump_handling.py	Sun Apr 24 14:58:44 2011 -0600
@@ -25,6 +25,8 @@
 import numpy as na
 import copy
 
+from yt.funcs import *
+
 from .contour_finder import identify_contours
 
 class Clump(object):
@@ -153,7 +155,11 @@
 def _reconstruct_clump(parent, field, mi, ma, function_value, children, data, clump_info, 
         function=None):
     obj = object.__new__(Clump)
-    if iterable(parent): parent = parent[1]
+    if iterable(parent):
+        try:
+            parent = parent[1]
+        except KeyError:
+            parent = parent
     if children is None: children = []
     obj.parent, obj.field, obj.min_val, obj.max_val, obj.function_value, obj.children, obj.clump_info, obj.function = \
         parent, field, mi, ma, function_value, children, clump_info, function

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