pygeogrids icon indicating copy to clipboard operation
pygeogrids copied to clipboard

Fix issue #75

Open sebhahn opened this issue 2 years ago • 1 comments

First implementation of handling np.inf in k_nearest_neighbor search:

  • always return k results (i.e. include np.inf in distances)
  • set gpi (with a distance == np.inf) to int32 max value (i.e. 2147483647)

I'm not really happy with setting the gpi to a dummy value. Another option would be returning a masked array for gpi and distance. Or return a boolean array indicating valid entries and leave it to the user how to handle them

main changes: https://github.com/TUW-GEO/pygeogrids/pull/76/commits/fdc80d21d5c8e620a5472b6b94e9c2cc435ee91b

sebhahn avatar May 24 '22 14:05 sebhahn

Thanks. Looks generally good. I don't mind the dummy value. It should be clear from the docs that the GPI and dist should be used together. From my side we can merge this. I think it should not affect any of our other packages.

wpreimes avatar May 30 '22 12:05 wpreimes