-
Notifications
You must be signed in to change notification settings - Fork 59
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
Conversation
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.
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.
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.
Looks good! I'm happy to keep # cmap_def
as-is, so is it ready to merge?
Yes. |
As I mentioned here, this PR renames the
CET-*.py
CSVs to their algorithmic names (pulled frommapping
inCET_to_py.py
). They are merged intoassets/CETperceptual_csv_0_1
with redundant maps deleted. See the attachedrename_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
vs4.25235e-17
or whatever), they were the same.I also modified
CET_to_py.py
a bit to find the existing order of maps incolorcet/__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 usepathlib
so it needs to be run with Python 3. I guess for that matter I could have usedf
-strings, but stuck with the existingstr.format()
use.colorcet
itself still works fine in Python 2.7.