[yt-svn] commit/yt-3.0: MatthewTurk: Adding try/except block for ID offsets, in case grids don't exist.

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Thu Aug 29 19:09:04 PDT 2013


1 new commit in yt-3.0:

https://bitbucket.org/yt_analysis/yt-3.0/commits/cff348ad3097/
Changeset:   cff348ad3097
Branch:      yt-3.0
User:        MatthewTurk
Date:        2013-08-30 03:56:20
Summary:     Adding try/except block for ID offsets, in case grids don't exist.
Affected #:  1 file

diff -r 68bb0d0b94e4def4eadba5903e1184264851ca1c -r cff348ad309725c0296b9b8f04ddcf9aa022f779 yt/utilities/amr_kdtree/amr_kdtree.py
--- a/yt/utilities/amr_kdtree/amr_kdtree.py
+++ b/yt/utilities/amr_kdtree/amr_kdtree.py
@@ -57,7 +57,10 @@
         min_level=None, max_level=None, data_source=None):
 
         self.pf = pf
-        self._id_offset = self.pf.h.grids[0]._id_offset
+        try:
+            self._id_offset = pf.h.grids[0]._id_offset
+        except AttributeError:
+            self._id_offset = 0
 
         if data_source is None:
             data_source = pf.h.all_data()

Repository URL: https://bitbucket.org/yt_analysis/yt-3.0/

--

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