Antialiased line support for where reductions #1269
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds antialiased line support for
where
reductions on CPU, with and without dask, of the following:all of which return values from the
"other"
column, and the same calls but without"other"
which return row indexes.Also, all of the above within a categorical
by
reduction such asExample code:
Example outputs returning row indexes for

max
,min
,first
andlast
respectively (integers in the range -1 to 2 inclusive):If you don't want to work out the maths yourself, just note that these are examples are setup such that the outputs should all have different overlaps.
Example outputs when returning values from the

"other"
column (floats which are either 11, 22 or 33, ornp.nan
):The colors here are in the opposite orders to the equivalent row index examples above, but the overlaps are the same.
The edges are hard (not antialiased) when returning row indexes because there is no such thing as a fractional row index. The edges are also hard when returning values from the
"other"
column as these values are derived from the row indexes. Returning antialiased edges for the latter is currently not possible given how the antialiased lines are implemented, but is a possible area for improvement in the future.In terms of implementation, the second stage antialiased accumulation here reuses the
where
combine()
functions to keep code duplication to a minimum.