This is a re-issue of PR 2127. I'm issuing it now so @Bili Dong has a reference to build off of.
Here's the description from the original pull request:
This adds an initial implementation of a smoothing kernel for pixelizing SPH fields and changes the field API for SPH data so 'gas' fields are returns at the locations of SPH particles. This code is still in implementation stage.
Update 1: Initial work to integrate the pixelizer into the rest of yt
Update 2: Added slice pixelizer, finished integrating into SlicePlot
Update 3: projections work, lots of work to get local fields fully working
Update 4 all data objects fully working. Merged with Meagan's bitmask index work.
I see where the issue is. In the definition of __coarse_index_data_file, although np.ndarray[anyfloat, ndim=1] hsml is assumed in the argument, there are computations involving hsml and other variables, for example in this line, where the other variable rpos_min is defined as cdef np.float64_t rpos_min, thus causing the error (because hsml is float32 in this case).
My analysis above is wrong. Currently I can only tell that the error raises when pos and hsml have different dtypes. When they are the same, even when both are np.float32, it works. I'm referring to pos and hsml in this line.
I think it's a limitation of cython's fused types. We can make a function take two arrays with dtype floating, but then both arrays must have the same dtype. It doesn't combinatorially generate code for the case when both arrays have different dtypes that are members of the cython.floating fused type.
I've been looking at the source code for a while. I feel I don't have enough knowledge to work on this. One strange thing I find is that while ds.find_max(('gas', 'density')) raises error, ds.all_data()[('gas', 'density')] doesn't. Is this expected?
Yes, the former is indirectly invoking a derived quantity, the latter isn't. Right now derived quantities are hitting a code path that assumes you can generate coordinates for a mesh that doesn't exist anymore now that we've removed the mesh. The fix is probably just to short-circuit that but I haven't sat down and tried to figure out how to do that yet.
Don't waste too much time on fixing derived quantities, I am planning to do it soon and am probably more familiar with that part of the codebase.