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

Defaults for Smart color scale #1255

Merged
merged 3 commits into from
Sep 4, 2018

Conversation

Dominik-Vogel
Copy link
Contributor

This is a commit that got lost in the pipeline to #1253

@codecov
Copy link

codecov bot commented Sep 3, 2018

Codecov Report

Merging #1255 into master will decrease coverage by 0.01%.
The diff coverage is 33.33%.

@@            Coverage Diff            @@
##           master   #1255      +/-   ##
=========================================
- Coverage   70.51%   70.5%   -0.02%     
=========================================
  Files          74      74              
  Lines        8092    8095       +3     
=========================================
+ Hits         5706    5707       +1     
- Misses       2386    2388       +2

@@ -29,7 +30,7 @@ def plot_by_id(run_id: int,
Sequence[
matplotlib.colorbar.Colorbar]]]=None,
rescale_axes: bool=True,
smart_colorscale: bool=False) -> AxesTupleList:
smart_colorscale: Union[bool,None]=None) -> AxesTupleList:
Copy link
Collaborator

Choose a reason for hiding this comment

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

This should be Optional[bool] i think. Which is equivalent but less ugly

@@ -68,6 +69,9 @@ def plot_by_id(run_id: int,
colorbar axes may be None if no colorbar is created (e.g. for
1D plots)
"""
# defaults
smart_colorscale = smart_colorscale or config.gui.smart_colorscale
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this logic correct?

None or True => True
None or False => False
True or False => True
True or True => True 
False or False => True

Seems correct
but

False or True  => True

seems wrong to me?

I.e if you pass False to the function but it's enabled in the config it will be enabled anyway?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That is indeed a very good point.

@Dominik-Vogel Dominik-Vogel merged commit faf5f6f into microsoft:master Sep 4, 2018
giulioungaretti pushed a commit that referenced this pull request Sep 4, 2018
Merge: 4cfcf7a 7a3849c
Author: Dominik Vogel <30660470+Dominik-Vogel@users.noreply.github.com>

    Merge pull request #1255 from Dominik-Vogel/smart_color_scale
@Dominik-Vogel Dominik-Vogel deleted the smart_color_scale branch September 4, 2018 11:22
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.

None yet

2 participants