[yt-svn] commit/yt: MatthewTurk: Fixes for EnzoGridGZ objects

Bitbucket commits-noreply at bitbucket.org
Fri Nov 11 11:09:10 PST 2011


1 new commit in yt:


https://bitbucket.org/yt_analysis/yt/changeset/acd635b16f88/
changeset:   acd635b16f88
branch:      yt
user:        MatthewTurk
date:        2011-11-11 20:08:48
summary:     Fixes for EnzoGridGZ objects
affected #:  2 files

diff -r 8f056f1511519d40c9bfdce38fc067f2d23e2357 -r acd635b16f88342f41ef63d6771fb3b37c852176 yt/data_objects/universal_fields.py
--- a/yt/data_objects/universal_fields.py
+++ b/yt/data_objects/universal_fields.py
@@ -510,7 +510,7 @@
     return new_field2
 add_field("AveragedDensity",
           function=_AveragedDensity,
-          validators=[ValidateSpatial(1)])
+          validators=[ValidateSpatial(1, ["Density"])])
 
 def _DivV(field, data):
     # We need to set up stencils


diff -r 8f056f1511519d40c9bfdce38fc067f2d23e2357 -r acd635b16f88342f41ef63d6771fb3b37c852176 yt/frontends/enzo/data_structures.py
--- a/yt/frontends/enzo/data_structures.py
+++ b/yt/frontends/enzo/data_structures.py
@@ -164,8 +164,9 @@
                 level, new_left_edge, **kwargs)
         # ----- This is EnzoGrid.get_data, duplicated here mostly for
         # ----  efficiency's sake.
-        sl = (slice(3 - n_zones, 3 - n_zones) for i in range(3))
-        for field in fields:
+        sl = [slice(3 - n_zones, -(3 - n_zones)) for i in range(3)]
+        if fields is None: return cube
+        for field in ensure_list(fields):
             if field in self.hierarchy.field_list:
                 conv_factor = 1.0
                 if self.pf.field_info.has_key(field):
@@ -173,7 +174,6 @@
                 if self.pf.field_info[field].particle_type: continue
                 temp = self.hierarchy.io._read_raw_data_set(self, field)
                 temp = temp.swapaxes(0, 2)
-                print "SETTING CUBE"
                 cube.field_data[field] = na.multiply(temp, conv_factor, temp)[sl]
         return cube

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