[Yt-svn] yt-commit r378 - trunk/yt/lagos
mturk at wrangler.dreamhost.com
mturk at wrangler.dreamhost.com
Sat Feb 16 12:26:22 PST 2008
Author: mturk
Date: Sat Feb 16 12:26:20 2008
New Revision: 378
URL: http://yt.spacepope.org/changeset/378
Log:
Somewhere along the way the parallel projections broke because of an API shift.
I have changed _get_point_indices to have a consistent API, which should
alleviate the problem. Additionally, I no longer decorate with restore_grid_state
on these, because it was an ugly hack that I do not even think is necessary,
because we are now much more careful about which fields to generate to
calculate the cutting mask anyway.
Modified:
trunk/yt/lagos/BaseDataTypes.py
Modified: trunk/yt/lagos/BaseDataTypes.py
==============================================================================
--- trunk/yt/lagos/BaseDataTypes.py (original)
+++ trunk/yt/lagos/BaseDataTypes.py Sat Feb 16 12:26:20 2008
@@ -571,11 +571,8 @@
def _get_point_indices(self, grid, use_child_mask=True):
k = na.zeros(grid.ActiveDimensions, dtype='bool')
k = (k | self._get_cut_mask(grid))
- if use_child_mask:
- pointI = na.where(k & grid.child_mask)
- else:
- pointI = na.where(k)
- return pointI
+ if use_child_mask: k = (k & grid.child_mask)
+ return na.where(k)
class EnzoProjBase(Enzo2DData):
def __init__(self, axis, field, weight_field = None,
@@ -981,12 +978,11 @@
def __touch_grid_field(self, grid, field):
grid[field]
- @restore_grid_state
- def _get_point_indices(self, grid, field=None):
+ def _get_point_indices(self, grid, use_child_mask=True):
k = na.zeros(grid.ActiveDimensions, dtype='bool')
k = (k | self._get_cut_mask(grid))
- pointI = na.where(k & grid.child_mask)
- return pointI
+ if use_child_mask: k = (k & grid.child_mask)
+ return na.where(k)
def extract_region(self, indices):
"""
@@ -1168,7 +1164,8 @@
zi[self._base_indices][ind_ind]])
self._grids = self._base_region.pf.h.grids[self._indices.keys()]
- def _get_point_indices(self, grid):
+ def _get_point_indices(self, grid, use_child_mask=True):
+ # Yeah, if it's not true, we don't care.
return self._indices[grid.id-1]
class EnzoCylinderBase(Enzo3DData):
More information about the yt-svn
mailing list