Skip to content

Add ColormapsRegistry as experimental and add it to pyplot#20935

Merged
tacaswell merged 3 commits into
matplotlib:masterfrom
timhoffm:experimental-colormaps
Sep 16, 2021
Merged

Add ColormapsRegistry as experimental and add it to pyplot#20935
tacaswell merged 3 commits into
matplotlib:masterfrom
timhoffm:experimental-colormaps

Conversation

@timhoffm

@timhoffm timhoffm commented Aug 28, 2021

Copy link
Copy Markdown
Member

PR Summary

  • Mark the new ColormapRegistry API as experimental
  • Add the ColormapRegistry to pyplot as plt.colormaps.

Follow-up to #18503.
See also #20853.

@timhoffm timhoffm changed the title Experimental colormaps Add ColormapsRegistry as experimental and add it to pyplot Aug 28, 2021
@timhoffm timhoffm force-pushed the experimental-colormaps branch from 281b31c to 111003d Compare August 28, 2021 23:59
@jklymak

jklymak commented Aug 29, 2021

Copy link
Copy Markdown
Member

I'm a little confused about marking this as experimental? Isn't this the only way to manage the colormap registry? Or is your point that the access methods etc are experimental, but the old API still exists?

@timhoffm

timhoffm commented Aug 29, 2021

Copy link
Copy Markdown
Member Author

Yes, the old API still exists. On the dev call we decided to be on the safe side and mark the new API as experimental to still have the freedom to change everything.

Dee also the transition path in #20853.

@timhoffm timhoffm force-pushed the experimental-colormaps branch from 111003d to 99f7606 Compare August 29, 2021 21:19
@story645

Copy link
Copy Markdown
Member

subplots_mosaic is tagged provisional(https://matplotlib.org/devdocs/tutorials/index.html#provisional) so should there be some sort of consistency?

@timhoffm

timhoffm commented Aug 29, 2021

Copy link
Copy Markdown
Member Author

I was following th "experimental" terminology from scipy. Also to me, "provisional" sounds unfinished and not in the final state. Indeed:

provisional: for the present time but likely to change:

https://dictionary.cambridge.org/dictionary/english/provisional

It's unlikely but possible that the ColormapRegistry changes, so provisional is not the right term.

@story645

story645 commented Aug 30, 2021

Copy link
Copy Markdown
Member

So then should the section of the tutorials subplot mosaic is in change to experimental? Either word indicates that the API isn't final?

@timhoffm

Copy link
Copy Markdown
Member Author

I think so. Both indicate not final, but in my understanging "provisional" = likely to change; "experimental" = might still change. But that should be re-checked by native speakers.

@jklymak

jklymak commented Aug 31, 2021

Copy link
Copy Markdown
Member

We have been using "experimental" for years now, so should probably stick to that?

@timhoffm

Copy link
Copy Markdown
Member Author

We have been using both, but more often "experimental":

experimental: 36 hits
https://matplotlib.org/devdocs/search.html?q=experimental#

provisional: 10 hits
https://matplotlib.org/devdocs/search.html?q=provisional#

@timhoffm timhoffm added this to the v3.5.0 milestone Sep 3, 2021
Comment thread doc/users/next_whats_new/colormaps.rst Outdated
Comment thread doc/users/next_whats_new/colormaps.rst
Comment thread lib/matplotlib/cm.py Outdated
Comment thread lib/matplotlib/pyplot.py


def colormaps():
"""

@anntzer anntzer Sep 6, 2021

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this docstring be copied (with slight editing) into ColormapRegistry.__doc__, e.g. into a Notes section (so that it is still available e.g. under ipython with plt.colormaps?)?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think so. The old docstring is a bit tutorial plus a long description of all available colormaps. This is essentially all covered in the colormap reference and the colormap tutorials. The docstring of ColormapRegistry should essentially be limited to the API.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess the question is, do we want to have a description of all colormaps available "offline" from just standard docstrings. But perhaps that would be better served by having some colormap metadata anyways... so that discussion can happen later.

@timhoffm timhoffm force-pushed the experimental-colormaps branch 2 times, most recently from 5a8d72e to 21cbff3 Compare September 9, 2021 18:53
@timhoffm

timhoffm commented Sep 9, 2021

Copy link
Copy Markdown
Member Author

@dstansby I've clarified what experimental means here.

@timhoffm timhoffm force-pushed the experimental-colormaps branch from 21cbff3 to 2ee48ca Compare September 11, 2021 18:59
@timhoffm timhoffm force-pushed the experimental-colormaps branch from 2ee48ca to abd8213 Compare September 11, 2021 20:02
@tacaswell tacaswell merged commit 4d6ab93 into matplotlib:master Sep 16, 2021
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull request Sep 16, 2021
timhoffm added a commit that referenced this pull request Sep 16, 2021
…935-on-v3.5.x

Backport PR #20935 on branch v3.5.x (Add ColormapsRegistry as experimental and add it to pyplot)
tacaswell added a commit that referenced this pull request Oct 20, 2021
ENH: Add ColormapsRegistry as experimental and add it to pyplot
ericpre pushed a commit to ericpre/matplotlib that referenced this pull request Oct 20, 2021
ENH: Add ColormapsRegistry as experimental and add it to pyplot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants