Speed up AMRKDTree if .grids exist

#1514 Declined
Repository
samskillman
Branch
yt
Repository
yt_analysis
Branch
yt
Author
  1. Sam Skillman
Reviewers
Description

If ds.index.grids exist, use them to get left/right edges, levels. Otherwise the .blocks is too slow to get masks for all grids.

Comments (10)

  1. MattT

    I think this can be fixed with a change like this:

    grids = []
    for chunk in self.data_source.chunk([], "all"):
        grids += chunk._current_chunk.objs
    grids = np.array(grids, dtype="object")
    

    What I think is happening is that it's over-included things.

    1. Sam Skillman author

      Is there a way to get a given level's grids through that interface? I think we need to add a level at a time. If so, feel free to push up to my repo.