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

Simplify aliases and import new cmaps from Dec 2020 #65

Merged
merged 24 commits into from
Nov 12, 2021

Conversation

randallpittman
Copy link
Contributor

@randallpittman randallpittman commented Feb 27, 2021

Summary

In Dec. 2020 Peter updated the CET colormaps. This PR contains multiple changes:

  1. Change aliases to a dict of lists. This simplifies the logic of finding all the aliases for a given name and makes it easy to add aliases for a given map.
  2. Add new colormaps available in the Dec 2020 update to colorcet.m from Peter Kovesi, as well as at most one alias for any colormaps that do not yet have one.

Notes

  • This PR depends on, and follows after, PR Rename CET maps to algorithmic names #64, which makes each colormap's algorithmic name AKA descriptorname the name of the CSV file.
  • Resolves Allow more aliases #60
  • Resolves Update colorcet to upstream, especially new Gouldian Parula replacement #56
  • Since the CET_ name may in some cases be the only alias to a map, I have not removed those, though we talked about it previously. (Actually, I did at first, but then reverted the change). If someone wants to do this it's pretty easy--just remove cetnames, cetnames_flipped, and anything that references those variables from CET_to_py.py, rerun CET_to_py.py and update the tests.
  • In this PR new colormap CSVs are not downloaded from Peter's site (as he doesn't have them all there anyway) but rather are generated from colorcet.m (using MATLAB/Octave script make_csvs_from_colorcet.m), since colorcet.m is the "upstream" of those CSVs. Some of the existing CSV colormaps in holoviz/colorcet don't exactly match what what's in colorcet.m but what's already here is being left as-is.
  • A few CSVs have been renamed or removed as duplicates of existing CSVs with the same colormap. All CET CSVs should now have the algorithmic name (e.g. linear_kbc_5_95_c73 instead of linear_blue_5_95_c73. The old names (..._blue_...) may still be used.
  • All existing aliases have been retained. New aliases have been added only for new colormaps or where aliases did not previously exist.
  • Instructions for merging future additions from colorcet.m are at the top of make_csvs_from_colorcet.m and CET_merge.py.

@randallpittman
Copy link
Contributor Author

randallpittman commented Mar 1, 2021

Since aliases and mapping were reordered alphabetically, and mapping was renamed to cetnames, the attached file shows the actual changes to these dicts.

aliases_cetnames_diff.txt

@randallpittman
Copy link
Contributor Author

Just FYI I'm still planning to finish this ASAP. Work has kept me busy.

@jbednar
Copy link
Member

jbednar commented Mar 17, 2021

Cool, thanks. I'm excited to see these made available, but no rush!

@jbednar
Copy link
Member

jbednar commented May 10, 2021

I'd guess you're still busy, but just checking in to see if you know when this can get wrapped up? I'd love to make a new release so people can use this cool stuff!

@randallpittman
Copy link
Contributor Author

I'd guess you're still busy, but just checking in to see if you know when this can get wrapped up? I'd love to make a new release so people can use this cool stuff!

@jbednar Yes, sorry to leave it hanging for so long. I'll spend a few hours today and see if I can get it submitted.

@randallpittman
Copy link
Contributor Author

randallpittman commented May 10, 2021

Ok, I apparently was like 99.9999% finished. 😳🤦🏼‍♂️ Unless I've forgotten something major since last touching this!

I guess I didn't really touch the docs at all which you may want to do.

@randallpittman randallpittman marked this pull request as ready for review May 10, 2021 19:05
@randallpittman
Copy link
Contributor Author

This is ready to go, from my end.

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 for all this work! I can't spot any problems with it, so now that CI isn't broken any more I'll merge it now and do more testing locally before making a release. Sorry for the long delay while we focused on Param!

assets/CET_merge.py Outdated Show resolved Hide resolved
@jbednar jbednar merged commit d4defcc into holoviz:master Nov 12, 2021
@randallpittman
Copy link
Contributor Author

@jbednar You're welcome! It was a fun pet project to take up. Also, Param looks amazing--I had not looked into it before.

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.

Allow more aliases Update colorcet to upstream, especially new Gouldian Parula replacement
2 participants