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

Return early in eq_hist() if all data masked out #1168

Merged
merged 1 commit into from
Jan 20, 2023
Merged

Return early in eq_hist() if all data masked out #1168

merged 1 commit into from
Jan 20, 2023

Conversation

ianthomas23
Copy link
Member

Fixes #1166.

If pass an fully-masked array to eq_hist() function, return early with an array of NaNs. This avoids calculating the cumulative distribution function of no data and the resultant IndexError because the CDF has no contents.

Passes new test locally on both CPU and GPU.

@ianthomas23 ianthomas23 modified the milestones: v0.14.x, v0.14.4 Jan 19, 2023
Copy link
Member

@philippjfr philippjfr left a comment

Choose a reason for hiding this comment

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

Looks good, thanks for the quick fix!

@codecov
Copy link

codecov bot commented Jan 19, 2023

Codecov Report

Merging #1168 (4398ff9) into main (73d3deb) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main    #1168   +/-   ##
=======================================
  Coverage   85.40%   85.40%           
=======================================
  Files          35       35           
  Lines        7987     7989    +2     
=======================================
+ Hits         6821     6823    +2     
  Misses       1166     1166           
Impacted Files Coverage Δ
datashader/transfer_functions/__init__.py 86.81% <100.00%> (+0.04%) ⬆️

📣 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.

Thanks!

@ianthomas23 ianthomas23 merged commit f86da03 into holoviz:main Jan 20, 2023
@ianthomas23 ianthomas23 deleted the 1166_eq_hist_no_data branch January 20, 2023 09:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

shade(..., how="eq_hist") with no valid data raises index out of bounds error
3 participants