10000 Rename CET maps to algorithmic names by randallpittman · Pull Request #64 · holoviz/colorcet · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Rename CET maps to algorithmic names #64

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

Merged
merged 9 commits into from
Feb 26, 2021

Conversation

randallpittman
Copy link
Contributor
@randallpittman randallpittman commented Feb 24, 2021

As I mentioned here, this PR renames the CET-*.py CSVs to their algorithmic names (pulled from mapping in CET_to_py.py). They are merged into assets/CETperceptual_csv_0_1 with redundant maps deleted. See the attached rename_CET_maps.py script to see how this was accomplished.

As an aside, I did check that duplicated maps were the same before executing the merge (the automated diffs are not present in the attached script). Other than some float calculation discrepancies (0 vs 4.25235e-17 or whatever), they were the same.

I also modified CET_to_py.py a bit to find the existing order of maps in colorcet/__init__.py and keep those maps as-is (as requested here) when regenerating it to reduce questions about the diff. I added a # cmap_def comment to each colormap definition in __init__.py to easily find them with a regex.

CET_to_py.py does now use pathlib so it needs to be run with Python 3. I guess for that matter I could have used f-strings, but stuck with the existing str.format() use. colorcet itself still works fine in Python 2.7.

@randallpittman randallpittman marked this pull request as ready for review February 24, 2021 03:44
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.

Looks good, thanks! I guess the plan is to later remove the v1/v2 distinction altogether (e.g. aliases_v2), to make it simple to include v3?

I added a # cmap_def comment to each colormap definition in init.py to easily find them with a regex.

That's ok if it really helps some other tooling, but it doesn't seem necessary to me, since ^[a-zA-Z].* = [[] already matches the same set of lines.

CET_to_py.py does now use pathlib so it needs to be run with Python 3. colorcet itself still works fine in Python 2.7.

Sure. No problem requiring py3 for managing updates.

rename_CET_maps.py

That should go into assets for future reference.

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.

Looks good! I'm happy to keep # cmap_def as-is, so is it ready to merge?

@randallpittman
Copy link
Contributor Author

Looks good! I'm happy to keep # cmap_def as-is, so is it ready to merge?

Yes.

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.

2 participants
0