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

Avoid exception from Continuous scale for normed property with non-float data #3190

Merged
merged 1 commit into from
Dec 28, 2022

Conversation

mwaskom
Copy link
Owner

@mwaskom mwaskom commented Dec 18, 2022

Fixes #3106 in a narrow way by avoiding a TypeError when sorting out the normalization:

This result isn't ideal, we'd like to propagate the boolean-ness of the data through to the visualization, but this is consistent with other numpy / matplotlib behavior where boolean data are upcast to 0/1 floats in numeric contexts. So boolean data should still get a non-continuous scale by default but contra #3135 I think there should be a separate Boolean scale concept rather than default to Nominal.

@codecov
Copy link

codecov bot commented Dec 18, 2022

Codecov Report

Merging #3190 (19c607b) into master (87e0972) will decrease coverage by 0.00%.
The diff coverage is 100.00%.

❗ Current head 19c607b differs from pull request most recent head 0df8277. Consider uploading reports for the commit 0df8277 to get more accurate results

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3190      +/-   ##
==========================================
- Coverage   98.42%   98.42%   -0.01%     
==========================================
  Files          76       76              
  Lines       24115    24114       -1     
==========================================
- Hits        23735    23734       -1     
  Misses        380      380              
Impacted Files Coverage Δ
seaborn/_core/scales.py 90.09% <100.00%> (ø)
tests/_core/test_scales.py 100.00% <100.00%> (ø)
tests/_core/test_plot.py 98.68% <0.00%> (-0.01%) ⬇️
seaborn/_core/plot.py 99.33% <0.00%> (ø)

@mwaskom mwaskom changed the title Avoid exception from Continuous scale for normed property Avoid exception from Continuous scale for normed property with non-float data Dec 20, 2022
@mwaskom mwaskom merged commit 7271035 into master Dec 28, 2022
@mwaskom mwaskom deleted the fix/continuous_non_float branch December 28, 2022 01:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Color mapping fails with boolean data
1 participant