[yt-users] Flush_data_to_grids glitch

David Collins dcollins4096 at gmail.com
Sun Jul 6 16:43:42 PDT 2014


Hi, everybody--

In data_containers.py, around line 2664, there's a routine
flush_data_to_grids.  It seems like the line that says
"np = pointI[0].ravel().size"

is an error, as np refers to the numpy package.  Does that seem right?  I
expect that should be number_of_points, or something?

    def _flush_data_to_grids(self, field, default_val, dtype='float32'):
        """
        A dangerous, thusly underscored, thing to do to a data object,
        we can flush back any changes in a given field that have been made
        with a default value for the rest of the grid.
        """
        i = 0
        for grid in self._grids:
            pointI = self._get_point_indices(grid)
            np = pointI[0].ravel().size
            if grid.has_key(field):
                new_field = grid[field]
            else:
                new_field = np.ones(grid.ActiveDimensions, dtype=dtype) *
default_val
            new_field[pointI] = self[field][i:i+np]
            grid[field] = new_field
            i += np


-- 
-- Sent from a computer.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20140706/cfaa51ca/attachment.htm>


More information about the yt-users mailing list