I'd return `clipped_param` here to have a consistent return value on both branches. You are modifying the dictionary in-place (you should state that in the Parameters section of the docstring) so there is no need to return it, really.