This implements a new scheme for potentially fast indexing of patch-based AMR data. It is not yet faster, and it is currently disabled. However, it moves a considerable amount of computation into Cython, removes almost all of the caching of child masks and selector masks from grid patch objects (for what should be an extremely large memory savings on big patch datasets) and should when implemented result in a much bigger performance boost for things like projections, ghost zones, and the like.
There are several caveats:
It is currently disabled
It uses the existing grid patch object API as a fallback
It will not (yet) work with datasets where a child patch has non-unique parentage; this should be a simple fix but it is not yet implemented.
refinement factor is exclusively 2, but can be changed.
As noted above, it is not yet faster. For the small dataset I have been testing with, it's roughly the same speed as the old method, but importantly it does not rely on any caching of selection or child masking. Both of these could be huge speedups, but as-is the memory win is pleasing. (i.e., no more uint8_t masks of selection and children for every grid in a selector object.)
More on this as time permits. I am optimistic that this will eventually replace the existing methods for selecting data in patch based AMR for non-"grid" data selection.
UPDATE 1: This is ready for review. As it stands, behavior is unchanged. But it lays the groundwork for future fast indexing systems, so I would like to get it landed as a staging ground before building it further and enabling it.
As someone who has never touched this part of the code, I really don't know what is going on here. Would it be possible to include some comments and docstrings on major functions, or even a basic description of what is going on, so that I (we) can best review the code? Other than that, I'd just be looking for small coding mistakes.
Yup, answer tests should fail if the data changes -- but it's still turned off. I'll add comments to the Cython code, but I am not yet sure about adding docstrings since most/all of them are private methods.
One note is that the grid_tree stuff is all from @John ZuHone , with minor cleanups.