[Yt-svn] yt-commit r420 - trunk/yt/lagos

mturk at wrangler.dreamhost.com mturk at wrangler.dreamhost.com
Wed Apr 30 21:15:52 PDT 2008


Author: mturk
Date: Wed Apr 30 21:15:51 2008
New Revision: 420
URL: http://yt.spacepope.org/changeset/420

Log:
Minor fix (doesn't yet fix the full particle support) in the DerivedQuantities,
and another fix that fixes possibly one of the most obscure bugs ever.

If you generated any data object using a fields = [something] argument, it would
not copy the fields list, but instead assign it.  So any subsequent
modifications would modify that list, and the calling/creating code could get
confused by this.



Modified:
   trunk/yt/lagos/BaseDataTypes.py
   trunk/yt/lagos/__init__.py

Modified: trunk/yt/lagos/BaseDataTypes.py
==============================================================================
--- trunk/yt/lagos/BaseDataTypes.py	(original)
+++ trunk/yt/lagos/BaseDataTypes.py	Wed Apr 30 21:15:51 2008
@@ -85,7 +85,7 @@
             self.pf = pf
             self.hierarchy = pf.hierarchy
         if fields == None: fields = []
-        self.fields = ensure_list(fields)
+        self.fields = ensure_list(fields)[:]
         self.data = {}
         self.field_parameters = {}
         self.__set_default_field_parameters()
@@ -1396,11 +1396,12 @@
         # the same as the field_parameter
         if self._is_fully_enclosed(grid):
             return True # We do not want child masking here
-        if not isinstance(grid, FakeGridForParticles) \
+        if not isinstance(grid, (FakeGridForParticles, GridChildMaskWrapper)) \
            and grid.id in self._cut_masks:
             return self._cut_masks[grid.id]
         cm = ( (grid["RadiusCode"]<=self.radius) & grid.child_mask )
-        if not isinstance(grid, FakeGridForParticles): self._cut_masks[grid.id] = cm
+        if not isinstance(grid, (FakeGridForParticles, GridChildMaskWrapper)):
+            self._cut_masks[grid.id] = cm
         return cm
 
 class EnzoCoveringGrid(Enzo3DData):

Modified: trunk/yt/lagos/__init__.py
==============================================================================
--- trunk/yt/lagos/__init__.py	(original)
+++ trunk/yt/lagos/__init__.py	Wed Apr 30 21:15:51 2008
@@ -67,7 +67,7 @@
 from WeaveStrings import *
 from EnzoDefs import *
 from DerivedFields import *
-from DerivedQuantities import DerivedQuantityCollection
+from DerivedQuantities import DerivedQuantityCollection, GridChildMaskWrapper
 from DataReadingFuncs import *
 from ClusterFiles import *
 from ContourFinder import *



More information about the yt-svn mailing list