Fix remapping of Params stream parameter names
@@ -1665,6 +1665,15 @@ def stream_name_mapping(stream, exclude_params=['name'], reverse=False):
If reverse is True, the mapping is from the renamed strings to the
original stream parameter names.
"""
+ from ..streams import Params
+ if isinstance(stream, Params):
+ mapping = {}
+ for p in stream.parameters:
+ if isinstance(p, str):
+ mapping[p] = stream._rename.get(p, p)
+ else:
+ mapping[p.name] = stream._rename.get((p.owner, p.name), p.name)
+ else:
filtered = [k for k in stream.param if k not in exclude_params]
mapping = {k: stream._rename.get(k, k) for k in filtered}
if reverse:
