Closed ChrisBarker-NOAA closed 7 years ago
This has been done. Now use CellTree.locate(points)
and it should work for singular (x,y)
, lists [(x1,y1),(x2,y2)]
, tuples, arrays, whatever. I've also moved the vectorization from cython into C, for quite a major speedup, apparently, and renamed several functions in the C as well
great, thanks!
I wonder why the cython looping was slower? but whatever we're using C anyway, so why not?
The loop was slower because there was just quantitatively more generated C code within the loop itself. Difference between calling a function once versus 70k times.
ah, got it -- calling a function in a loop, rather than doing the actual work in the loop (kinds like inlining)
I noticed that there is:
CellTree.find_poly()
and
CelTree.multi_locate
these should either be merged -- allow multi-locate to take a single point (and jsut cal it locate, or ??)
or at least give them similar names.