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

Allow pixel_ratio to go below 1 #5813

Merged
merged 1 commit into from
Jul 19, 2023
Merged

Allow pixel_ratio to go below 1 #5813

merged 1 commit into from
Jul 19, 2023

Conversation

jbednar
Copy link
Member

@jbednar jbednar commented Jul 18, 2023

For some reason datashade/rasterize pixel_ratio was constrained to increasing the resolution, but it should also be useful for reducing the resolution:

import holoviews as hv, numpy as np
from holoviews.operation.datashader import datashade, rasterize, dynspread
hv.extension("bokeh")

p = hv.Points(np.random.multivariate_normal((0,0), [[0.1, 0.1], [0.1, 1.0]], (300,)))
dynspread(rasterize(p, pixel_ratio=2)) + dynspread(rasterize(p, pixel_ratio=0.25))
image

Now checks that the ratio is above zero, rather than 1 or larger:
image

@jbednar jbednar requested a review from jlstevens July 18, 2023 22:10
@codecov-commenter
Copy link

codecov-commenter commented Jul 18, 2023

Codecov Report

Merging #5813 (65d33ed) into main (003be41) will not change coverage.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main    #5813   +/-   ##
=======================================
  Coverage   88.17%   88.17%           
=======================================
  Files         307      307           
  Lines       62916    62916           
=======================================
  Hits        55479    55479           
  Misses       7437     7437           
Flag Coverage Δ
ui-tests 22.40% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
holoviews/operation/resample.py 90.26% <100.00%> (ø)

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

@philippjfr philippjfr merged commit 513be29 into main Jul 19, 2023
@philippjfr philippjfr deleted the coarsepixels branch July 19, 2023 14:28
jbednar added a commit that referenced this pull request Jul 20, 2023
hoxbro pushed a commit that referenced this pull request Jul 21, 2023
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants