-
Notifications
You must be signed in to change notification settings - Fork 581
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
fix error when colorscale given boolean array #2193
fix error when colorscale given boolean array #2193
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2193 +/- ##
==========================================
- Coverage 92.5% 92.34% -0.16%
==========================================
Files 149 149
Lines 18870 18872 +2
Branches 2299 2299
==========================================
- Hits 17455 17427 -28
- Misses 902 926 +24
- Partials 513 519 +6
Continue to review full report at Codecov.
|
@@ -62,6 +62,7 @@ def test_colorscale_no_threshold(): | |||
assert colors['cmap'].N == 256 | |||
assert (colors['norm'].vmax, colors['norm'].vmin) == (13, -13) | |||
assert colors['abs_threshold'] is None | |||
colors = js_plotting_utils.colorscale(cmap, values > 0, .5) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does not really test the new feature, does it ?
This does not really test the new feature, does it ?
It fails without the fix introduced in this PR, because `vmin = -vmax`
results in a TypeError if vmax is a numpy boolean
|
@@ -87,6 +87,7 @@ def colorscale(cmap, values, threshold=None, symmetric_cmap=True, | |||
vmin = 0 | |||
if vmax is None: | |||
vmax = abs_values.max() | |||
vmax = float(vmax) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A comment here, why we are typecasting this to float, so future maintainers will have an easier time understanding it.
Did this need a whats_new? |
…nt_modify_fetch_dev * 'master' of https://github.com/nilearn/nilearn: Verbose doc building to ease tracking of progress & diagnose stalls (nilearn#2203) New conda env is created once conda path has been activated Conda environment is created for full-builds Refactor CircleCI config for reduced redundancy (nilearn#2204) Installation should fail on Python < 3.5 (nilearn#2198) [MRG] Add get data function (nilearn#2172) fix error when colorscale given boolean array (nilearn#2193) remove is_valid filter (nilearn#2169) Moved new entries to next release FIX: marker size issue in plot_connectome nilearn#2185 (nilearn#2186) Updated Appveyor status badge Run tests on local Windows machines & Azure Pipelines (nilearn#2191) Updated requirements list for devs (nilearn#2190) Update azure-pipelines.yml for Azure Pipelines Release Nilearn 0.6.0 alpha (nilearn#2164) Making fetch_localizer_button_task backwards compatibile (nilearn#2182) [DOC] Update whats_new to reference nilearn#2013 (Merging of several examples) (nilearn#2183)
…smooth-image * 'master' of https://github.com/nilearn/nilearn: (25 commits) Add testing for Nilearn setup & install & Fix the broken dependency installation (nilearn#2201) Fix uniform ball cloud test for sklearn >= 0.22 (nilearn#2175) MAINT: sklearn Deprecations (nilearn#2219) DOC: title in bold [DOC] Add note about decreasing memory usage (nilearn#2223) Rel 060b0 (nilearn#2208) Nilearn 0.6.0b0 release (nilearn#2206) Fixed the redundant & missing test case in merged PR nilearn#2035 (nilearn#2205) Modify fetch_development_fmri to fetch adults or children (nilearn#2035) Verbose doc building to ease tracking of progress & diagnose stalls (nilearn#2203) New conda env is created once conda path has been activated Conda environment is created for full-builds Refactor CircleCI config for reduced redundancy (nilearn#2204) Installation should fail on Python < 3.5 (nilearn#2198) [MRG] Add get data function (nilearn#2172) fix error when colorscale given boolean array (nilearn#2193) remove is_valid filter (nilearn#2169) Moved new entries to next release FIX: marker size issue in plot_connectome nilearn#2185 (nilearn#2186) Updated Appveyor status badge ...
No description provided.