Rename CET maps to algorithmic names#64
Conversation
jbednar
left a comment
There was a problem hiding this comment.
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.
jbednar
left a comment
There was a problem hiding this comment.
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-*.pyCSVs to their algorithmic names (pulled frommappinginCET_to_py.py). They are merged intoassets/CETperceptual_csv_0_1with redundant maps deleted. See the attachedrename_CET_maps.pyscript 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
floatcalculation discrepancies (0vs4.25235e-17or whatever), they were the same.I also modified
CET_to_py.pya bit to find the existing order of maps incolorcet/__init__.pyand keep those maps as-is (as requested here) when regenerating it to reduce questions about the diff. I added a# cmap_defcomment to each colormap definition in__init__.pyto easily find them with a regex.CET_to_py.pydoes now usepathlibso 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.colorcetitself still works fine in Python 2.7.