Repository: vispy/vispy

Issue:
Unnecessary Deprecation in vispy.color.get_colormap?
`vispy.color.get_colormap` with certain colormaps gives [DeprecationWarning for certain colormaps](https://github.com/vispy/vispy/blob/main/vispy/color/colormap.py#L1133-L1140):

```
DeprecationWarning: Colormap 'hsl' has been deprecated since vispy 0.7. Please import and create 'vispy.color.colormap.HSL' directly instead.
```

I think this may be a holdover from a brief period when those colormaps were returning, not an _instance_ of the colormap, but the _class itself_.  The `DeprecationWarning` was introduced in dcb19017b99e21004075c2d9d15fcf4207740ce4, which is the same commit where the HSL and other colormaps were changed in the `_colormaps` dict [from being instances, to being classes](https://github.com/vispy/vispy/blob/6b68262412f6f31b5d9911f3f919953a5bb63b30/vispy/color/colormap.py#L1133-L1140).  They went _back_ to being instances in 7d1f5966db90836ecbb003c1325d028fec7b2f4b, but the DeprecationWarning remained.  

I think the DeprecationWarning was possibly left in by mistake.  

Can the DeprecationWarning be removed?


Discussion:
Oh this hurts my head. It has been so long. I think you're right though. The deprecation at  the time was still useful (even after the switch from class to instances) to remind users "hey, I know you used to expect a class, but that's deprecated".

I would be open to a PR @codypiersall where you remove the deprecation and you could remove the `*args` and `**kwargs` too which are also documented as deprecated.

Resolving patch:
diff --git a/examples/demo/scene/picking.py b/examples/demo/scene/picking.py
--- a/examples/demo/scene/picking.py
+++ b/examples/demo/scene/picking.py
@@ -18,7 +18,7 @@
 selected = None
 
 # plot data
-cmap = get_colormap('hsl', value=0.5)
+cmap = get_colormap('hsl')
 colors = cmap.map(np.linspace(0.1, 0.9, data.shape[0]))
 t = np.arange(data.shape[1]) * (dt * 1000)
 for i, y in enumerate(data):
diff --git a/vispy/color/colormap.py b/vispy/color/colormap.py
--- a/vispy/color/colormap.py
+++ b/vispy/color/colormap.py
@@ -1092,17 +1092,13 @@ def __init__(self, limits=(0.33, 0.66, 1.0)):
 )
 
 
-def get_colormap(name, *args, **kwargs):
-    """Obtain a colormap.
+def get_colormap(name):
+    """Obtain a colormap by name.
 
     Parameters
     ----------
     name : str | Colormap
         Colormap name. Can also be a Colormap for pass-through.
-    *args:
-        Deprecated.
-    **kwargs
-        Deprecated.
 
     Examples
     --------
@@ -1111,18 +1107,10 @@ def get_colormap(name, *args, **kwargs):
 
     .. versionchanged: 0.7
 
-        Additional args/kwargs are no longer accepted. Colormap classes are
-        no longer created on the fly. To create a ``cubehelix``
-        (``CubeHelixColormap``), ``single_hue`` (``SingleHue``), ``hsl``
-        (``HSL``), ``husl`` (``HSLuv``), ``diverging`` (``Diverging``), or
-        ``RdYeBuCy`` (``RedYellowBlueCyan``) colormap you must import and
-        instantiate it directly from the ``vispy.color.colormap`` module.
+        Additional args/kwargs are no longer accepted. Colormap instances are
+        no longer created on the fly.
 
     """
-    if args or kwargs:
-        warnings.warn("Creating a Colormap instance with 'get_colormap' is "
-                      "no longer supported. No additional arguments or "
-                      "keyword arguments should be passed.", DeprecationWarning)
     if isinstance(name, BaseColormap):
         return name
 
@@ -1130,14 +1118,6 @@ def get_colormap(name, *args, **kwargs):
         raise TypeError('colormap must be a Colormap or string name')
     if name in _colormaps:  # vispy cmap
         cmap = _colormaps[name]
-        if name in ("cubehelix", "single_hue", "hsl", "husl", "diverging", "RdYeBuCy"):
-            warnings.warn(
-                f"Colormap '{name}' has been deprecated since vispy 0.7. "
-                f"Please import and create 'vispy.color.colormap.{cmap.__class__.__name__}' "
-                "directly instead.",
-                DeprecationWarning,
-                stacklevel=2,
-            )
 
     elif has_matplotlib():  # matplotlib cmap
         try:


Test patch: