Commits

Matthew Turk  committed b5e0b68

More optimizations for getting grid IO to be speed competitive

  • Participants
  • Parent commits 2d9732e

Comments (0)

Files changed (3)

File yt/data_objects/static_output.py

         else:
             raise YTGeometryNotSupported(self.geometry)
 
+    _last_freq = None
+    _last_finfo = None
     def _get_field_info(self, ftype, fname):
-        if (ftype, fname) in self.field_info:
-            return self.field_info[(ftype, fname)]
+        field = (ftype, fname)
+        if field == self._last_freq:
+            return self._last_finfo
+        if field in self.field_info:
+            self._last_freq = field
+            self._last_finfo = self.field_info[(ftype, fname)]
+            return self._last_finfo
         if fname in self.field_info:
-            return self.field_info[fname]
+            self._last_freq = field
+            self._last_finfo = self.field_info[fname]
+            return self._last_finfo
         raise YTFieldNotFound((fname, ftype), self)
 
 def _reconstruct_pf(*args, **kwargs):

File yt/geometry/grid_geometry_handler.py

         return self.parameter_file.conversion_factors[unit]
 
     def _identify_base_chunk(self, dobj):
-        if getattr(dobj, "_grids", None) is None:
+        if dobj._type_name == "grid":
+            dobj._chunk_info = np.empty(1, dtype='object')
+            dobj._chunk_info[0] = dobj
+        elif getattr(dobj, "_grids", None) is None:
             gi = dobj.selector.select_grids(self.grid_left_edge,
                                             self.grid_right_edge)
             grids = list(sorted(self.grids[gi], key = lambda g: g.filename))

File yt/geometry/selection_routines.pyx

     @cython.wraparound(False)
     @cython.cdivision(True)
     def fill_mask(self, gobj):
-        cdef np.ndarray[np.uint8_t, ndim=3] mask 
-        mask = np.ones(gobj.ActiveDimensions, dtype='uint8')
-        return mask.astype("bool")
+        return None
 
     @cython.boundscheck(False)
     @cython.wraparound(False)