-
Notifications
You must be signed in to change notification settings - Fork 8
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
Custom color tables causing crashes/warnings #17
Comments
Do you know what the original error was? If it failed somewhere in the middle it would fail as you find here because it would be re-registering colormaps it already successfully registered. |
Or do you mean the bottom of the stack trace is correct it's the top that is different (because you called it directly?) |
Yes - the actual error at the bottom of the trace is the same (iirc), I just triggered it directly instead of trying to make an image. Note that it doesn't crash (just warns) if you're just re-registering something you've already made before (that's what the last error is), it's only in the particular case where you're trying to overwrite a built-in matplotlib color map that it halts. |
I see. Strange that this has never come up before, I haven't added a call to this particular function anywhere ¯_(ツ)_/¯ |
I agree, strange! If I find myself in a situation where I get a deeper stack trace I'll let you know. Maybe it's from a matplotlib update or something. |
I am having some issues with the function load_my_custom_color_tables() in firestudio/utils/stellar_utils/colors.py. The first time I tried to make a stellar image the code crashed with the following error:
(Note: this is not the original error, this is a reproduction from me calling the function myself.)
It is upset about trying to create a colormap with the same name as one of the built-in matplotlib maps. I was able to sidestep this by renaming the “rainbow” table to “rainbow_custom”.
A more minor issue is that each subsequent time I make a stellar image, I get a series of warnings about re-registering a name for a map that already exists:
~/home/python/firestudio/utils/stellar_utils/colors.py:28: UserWarning: Trying to register the cmap 'heat_red' which already exists.
(but for every map defined in that function). This does not break anything, but it is somewhat annoying.
The text was updated successfully, but these errors were encountered: