Skip to content
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

Refactor stage 2 aggregation for antialiased lines #1145

Merged
merged 7 commits into from
Nov 14, 2022
Merged

Refactor stage 2 aggregation for antialiased lines #1145

merged 7 commits into from
Nov 14, 2022

Conversation

ianthomas23
Copy link
Member

This PR refactors the second stage aggregation for antialiased lines so that the mathematical aggregation operations are passed into the line rendering functions from the Reduction classes, and in such a way that multiple reductions can be supported. There is no functional change from the end users point of view.

This is the final set of changes required before issue #1133 can be implemented for antialiased lines on the CPU.

Implementation details

  • An antialias_stage_2 tuple is created from the supplied Reductions and passed into the line rendering functions. This tuple contains one item per Reduction, and each item is a 2-tuple of AntialiasCombination (an enum specifying the mathematical combination operator) and a zero_value which is the initial value of the aggregation (currently only np.nan but will be 0 for e.g. _sum_zero).

@ianthomas23 ianthomas23 added this to the v0.14.3 milestone Nov 8, 2022
@codecov
Copy link

codecov bot commented Nov 8, 2022

Codecov Report

Merging #1145 (3b43022) into master (e888ba3) will increase coverage by 0.03%.
The diff coverage is 94.26%.

@@            Coverage Diff             @@
##           master    #1145      +/-   ##
==========================================
+ Coverage   85.16%   85.20%   +0.03%     
==========================================
  Files          33       34       +1     
  Lines        7632     7732     +100     
==========================================
+ Hits         6500     6588      +88     
- Misses       1132     1144      +12     
Impacted Files Coverage Δ
datashader/compiler.py 95.04% <88.88%> (-1.12%) ⬇️
datashader/glyphs/line.py 92.71% <93.03%> (-0.51%) ⬇️
datashader/reductions.py 85.84% <96.55%> (+0.48%) ⬆️
datashader/core.py 87.76% <100.00%> (-0.23%) ⬇️
datashader/data_libraries/dask.py 94.49% <100.00%> (ø)
datashader/data_libraries/dask_xarray.py 98.91% <100.00%> (ø)
datashader/data_libraries/pandas.py 100.00% <100.00%> (ø)
datashader/enums.py 100.00% <100.00%> (ø)
datashader/glyphs/area.py 79.82% <100.00%> (ø)
datashader/glyphs/points.py 88.29% <100.00%> (ø)
... and 4 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Member

@jbednar jbednar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems like this is necessary, and it doesn't make things appreciably worse, so go for it!

datashader/compiler.py Outdated Show resolved Hide resolved
Co-authored-by: James A. Bednar <jbednar@users.noreply.github.com>
@ianthomas23 ianthomas23 merged commit e3d2d1f into holoviz:master Nov 14, 2022
@ianthomas23 ianthomas23 deleted the antialias_stage_2_agg branch November 14, 2022 10:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants