[Yt-svn] commit/yt: MatthewTurk: This should fix #295 by moving the field parameters into the

Bitbucket commits-noreply at bitbucket.org
Thu Sep 22 15:41:20 PDT 2011


1 new changeset in yt:

http://bitbucket.org/yt_analysis/yt/changeset/47791cdeea71/
changeset:   47791cdeea71
branch:      yt
user:        MatthewTurk
date:        2011-09-23 00:38:53
summary:     This should fix #295 by moving the field parameters into the
retrieve_ghost_zones call.
affected #:  2 files (-1 bytes)

--- a/yt/data_objects/data_containers.py	Thu Sep 22 18:22:24 2011 -0400
+++ b/yt/data_objects/data_containers.py	Thu Sep 22 18:38:53 2011 -0400
@@ -2972,7 +2972,8 @@
     _con_args = ('level', 'left_edge', 'right_edge', 'ActiveDimensions')
     def __init__(self, level, left_edge, dims, fields = None,
                  pf = None, num_ghost_zones = 0, use_pbar = True, **kwargs):
-        AMR3DData.__init__(self, center=None, fields=fields, pf=pf, **kwargs)
+        AMR3DData.__init__(self, center=kwargs.pop("center", None),
+                           fields=fields, pf=pf, **kwargs)
         self.left_edge = na.array(left_edge)
         self.level = level
         self.dds = self.pf.h.select_grids(self.level)[0].dds.copy()
@@ -3147,7 +3148,7 @@
                     self._update_level_state(last_level + 1)
                     self._refine(1, field)
                     last_level = grid.Level
-                self._get_data_from_grid(grid, field, grid.Level)
+                self._get_data_from_grid(grid, field)
             if self.level > 0:
                 self[field] = self[field][1:-1,1:-1,1:-1]
             if na.any(self[field] == -999):
@@ -3194,7 +3195,7 @@
                                output_field, output_left)
         self[field] = output_field
 
-    def _get_data_from_grid(self, grid, fields, level):
+    def _get_data_from_grid(self, grid, fields):
         fields = ensure_list(fields)
         g_fields = [grid[field] for field in fields]
         c_fields = [self[field] for field in fields]


--- a/yt/data_objects/grid_patch.py	Thu Sep 22 18:22:24 2011 -0400
+++ b/yt/data_objects/grid_patch.py	Thu Sep 22 18:38:53 2011 -0400
@@ -447,6 +447,9 @@
         kwargs = {'dims': self.ActiveDimensions + 2*n_zones,
                   'num_ghost_zones':n_zones,
                   'use_pbar':False, 'fields':fields}
+        # This should update the arguments to set the field parameters to be
+        # those of this grid.
+        kwargs.update(self.field_parameters)
         if smoothed:
             #cube = self.hierarchy.smoothed_covering_grid(
             #    level, new_left_edge, new_right_edge, **kwargs)

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