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

Reverse preset color order #2568

Merged
merged 4 commits into from
Nov 15, 2023
Merged

Conversation

rosteen
Copy link
Collaborator

@rosteen rosteen commented Nov 14, 2023

As requested in #2558 (comment).

Comment on lines 644 to 646
preset_colors = [preset_colors[0], preset_colors[3]]
preset_colors = [preset_colors[1], preset_colors[4]]
elif n_visible == 3:
preset_colors = [preset_colors[0], preset_colors[2], preset_colors[3]]
preset_colors = [preset_colors[1], preset_colors[2], preset_colors[4]]
Copy link
Member

Choose a reason for hiding this comment

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

this surprised me at first (I expected just a change to preset_colors), but I guess this is just to avoid the purple on the end and the purple switched sides?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Exactly.

@kecnry kecnry added this to the 3.8 milestone Nov 14, 2023
Copy link

codecov bot commented Nov 14, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (cfe7e25) 90.84% compared to head (245785d) 90.79%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2568      +/-   ##
==========================================
- Coverage   90.84%   90.79%   -0.05%     
==========================================
  Files         160      160              
  Lines       19357    19356       -1     
==========================================
- Hits        17584    17575       -9     
- Misses       1773     1781       +8     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@rosteen rosteen added the trivial Only needs one approval instead of two label Nov 14, 2023
@camipacifici
Copy link
Contributor

I am surprised that it does not go to red now...
Screenshot 2023-11-14 at 3 36 09 PM
I would have expected blue-green-orange-red.

@rosteen
Copy link
Collaborator Author

rosteen commented Nov 14, 2023

I would have expected blue-green-orange-red.

Updated.

@pllim pllim added the imviz label Nov 14, 2023
Copy link
Contributor

@camipacifici camipacifici left a comment

Choose a reason for hiding this comment

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

Lovely, thank you!
Screenshot 2023-11-14 at 4 34 30 PM

@rosteen
Copy link
Collaborator Author

rosteen commented Nov 14, 2023

The changleog failure seems to be due to a docker build failure in the CI infrastructure, not related. @kecnry cool if I hit merge?

Copy link
Member

@kecnry kecnry left a comment

Choose a reason for hiding this comment

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

I restarted the failed jobs, but if they fail again for no reason, feel free to merge (just added one small suggestion - take it or leave it!)

Comment on lines 645 to 649
if n_visible >= 2 and n_visible < len(preset_colors):
preset_colors = [preset_colors[i] for i in preset_inds[n_visible]]
elif n_visible > len(preset_colors):
cmap = matplotlib.colormaps['gist_rainbow'].resampled(n_visible)
preset_colors = [matplotlib.colors.to_hex(cmap(i), keep_alpha=True) for
Copy link
Member

Choose a reason for hiding this comment

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

this might now read better and be harder to break in the opposite order (if n_visible > len(preset_color): ... elif n_visible > 2: ...)

Copy link
Member

Choose a reason for hiding this comment

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

ah, I wasn't thinking about the == case, so doesn't really make a difference I guess 🤷‍♂️

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Well, I'm not changing it back!

@rosteen rosteen merged commit 64e0974 into spacetelescope:main Nov 15, 2023
14 of 15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
imviz trivial Only needs one approval instead of two
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants