Is it possible to remove an Element from an Overlay? pop() throws an error

Hi,

import numpy as np
import holoviews as hv

data = np.random.randn(100,2)

a = hv.Curve(data, group='A', label='A')
b = hv.Curve(data, group='B', label='B')
c = hv.Curve(data, group='C', label='C')

ov = hv.Overlay([a, b, c])
ov.pop('C')

I see the following below. I am not sure exactly though if this is the intended use of Overlay.pop().

(datashader) henry@henry-gs65:streamvis$ python3 tests/test_pop_from_overlay.py 
Traceback (most recent call last):
  File "/home/henry/ai/projects/streamvis/tests/test_pop_from_overlay.py", line 12, in <module>
    ov.pop('C')
  File "/home/henry/miniconda3/envs/datashader/lib/python3.11/site-packages/holoviews/core/tree.py", line 336, in pop
    item = self[identifier]
           ~~~~^^^^^^^^^^^^
  File "/home/henry/miniconda3/envs/datashader/lib/python3.11/site-packages/holoviews/core/overlay.py", line 185, in __getitem__
    return Overlay([(k, v[key]) for k, v in self.items()])
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/henry/miniconda3/envs/datashader/lib/python3.11/site-packages/holoviews/core/overlay.py", line 185, in <listcomp>
    return Overlay([(k, v[key]) for k, v in self.items()])
                        ~^^^^^
  File "/home/henry/miniconda3/envs/datashader/lib/python3.11/site-packages/holoviews/element/chart.py", line 54, in __getitem__
    return super().__getitem__(index)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/henry/miniconda3/envs/datashader/lib/python3.11/site-packages/holoviews/core/data/__init__.py", line 711, in __getitem__
    data = self.select(**selection)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/henry/miniconda3/envs/datashader/lib/python3.11/site-packages/holoviews/core/data/__init__.py", line 195, in pipelined_fn
    result = method_fn(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/henry/miniconda3/envs/datashader/lib/python3.11/site-packages/holoviews/core/data/__init__.py", line 619, in select
    data = self.interface.select(self, **selection)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/henry/miniconda3/envs/datashader/lib/python3.11/site-packages/holoviews/core/data/array.py", line 204, in select
    selection_mask = cls.select_mask(dataset, selection)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/henry/miniconda3/envs/datashader/lib/python3.11/site-packages/holoviews/core/data/interface.py", line 373, in select_mask
    data_index = np.argmin(np.abs(arr - sel))
                                  ~~~~^~~~~
numpy.core._exceptions._UFuncNoLoopError: ufunc 'subtract' did not contain a loop with signature matching types (dtype('float64'), dtype('<U1')) -> None

It’s not elegant but you could create a new overlay without it:

new_ov = hv.Overlay([el for k, el in ov.items() if k != ('C', 'C')])