-
-
Notifications
You must be signed in to change notification settings - Fork 371
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bogus column and row at edge? #259
Comments
After looking at the code, it looks to me like the handling of the last column has multiple issues. For example:
Here there are six data points, all within the specified range, and I would expect them to fit evenly into the pixel array as follows:
Instead the current code yields:
I.e., all six datapoints are being squeezed into only two of the pixels, which is difficult to justify from their coordinates. The correct answer can be obtained by removing a bogus "-1":
yielding:
Great! However, there are then problems with the upper bound. According to the docstring for
Obviously, the result is then not just incorrect, but if that point is at the end of the array then segfaults are likely. To fix this, we can define the upper bound to be exclusive:
But this is a change in semantics, and it may be surprising to users that points on the upper boundary are not included in the counts. Still, it seems like there would need to be quite a lot of extra code and checking to somehow ensure that points on the upper boundary are included if the mapping is done correctly, since no other cell boundary can act that way (or else points in interior cells would be counted twice). See my HoloViews continuous coordinates tutorial for a detailed analysis of these issues; it's focusing on making a regular grid of samples from a continuous function, but basically the same approach applies to irregular samples from a continuous function as we have here. If we do so here, we will then need to update the test data. |
There seems to be an empty column and row at the edge of aggregated arrays:
The extra row and column ends up being transparent, at least for counts, so it has little effect, but it still seems like we should be returning a fully filled-out array.
The text was updated successfully, but these errors were encountered: