Repository: scikit-hep/pyhf

Issue:
`Workspace.prune` only accepts lists
### Summary

The [docstring for `Workspace.prune`](https://github.com/scikit-hep/pyhf/blob/c493c7c5ad3e5aeda7d022cdf5fe77e9fdab43a2/src/pyhf/workspace.py#L624-L629) signals support for `str` arguments, but currently only lists are supported (tested for modifier types / samples / channels). This happens since `_prune_and_rename` iterates over its arguments without enforcing conversion to lists first. Happy to provide a MR to fix this behavior if desired, or update the docstrings to require list arguments.

### OS / Environment

```console
n/a
```


### Steps to Reproduce

<!--- Paste your minimal failing Python example code between the quotes below -->
```python (paste below)
import pyhf

spec = {
    "channels": [
        {
            "name": "SR",
            "samples": [
                {"data": [10.0], "name": "Signal", "modifiers": []},
                {
                    "data": [112.0],
                    "modifiers": [
                        {
                            "data": {"hi_data": [67.0], "lo_data": [158.0]},
                            "name": "Modeling",
                            "type": "histosys"
                        }
                    ],
                    "name": "Background"
                }
            ]
        }
    ],
    "measurements": [
        {"config": {"parameters": [], "poi": ""}, "name": "minimal_example"}
    ],
    "observations": [
        {"data": [120.0], "name": "SR"}
    ],
    "version": "1.0.0"
}

ws = pyhf.Workspace(spec)
ws.prune(modifier_types=["histosys"])  # works fine
ws.prune(modifier_types="histosys")  # pyhf.exceptions.InvalidWorkspaceOperation
ws.prune(samples="Background")  # pyhf.exceptions.InvalidWorkspaceOperation
ws.prune(channels="SR")  # pyhf.exceptions.InvalidWorkspaceOperation

```

### File Upload (optional)

_No response_

### Expected Results

No exceptions raised.

### Actual Results

```console
Traceback (most recent call last):
  File "test.py", line 34, in <module>
    ws.prune(modifier_types="histosys")  # pyhf.exceptions.InvalidWorkspaceOperation
  File "[...]/pyhf/src/pyhf/workspace.py", line 638, in prune
    return self._prune_and_rename(
  File "[...]/pyhf/src/pyhf/workspace.py", line 513, in _prune_and_rename
    raise exceptions.InvalidWorkspaceOperation(
pyhf.exceptions.InvalidWorkspaceOperation: h is not one of the modifier types in this workspace.
```


### pyhf Version

```console
0.6.4.dev38
```


### Code of Conduct

- [X] I agree to follow the Code of Conduct


Discussion:

Resolving patch:
diff --git a/src/pyhf/workspace.py b/src/pyhf/workspace.py
--- a/src/pyhf/workspace.py
+++ b/src/pyhf/workspace.py
@@ -485,11 +485,11 @@ def _prune_and_rename(
         corresponding `observation`.
 
         Args:
-            prune_modifiers: A :obj:`str` or a :obj:`list` of modifiers to prune.
-            prune_modifier_types: A :obj:`str` or a :obj:`list` of modifier types to prune.
-            prune_samples: A :obj:`str` or a :obj:`list` of samples to prune.
-            prune_channels: A :obj:`str` or a :obj:`list` of channels to prune.
-            prune_measurements: A :obj:`str` or a :obj:`list` of measurements to prune.
+            prune_modifiers: A :obj:`list` of modifiers to prune.
+            prune_modifier_types: A :obj:`list` of modifier types to prune.
+            prune_samples: A :obj:`list` of samples to prune.
+            prune_channels: A :obj:`list` of channels to prune.
+            prune_measurements: A :obj:`list` of measurements to prune.
             rename_modifiers: A :obj:`dict` mapping old modifier name to new modifier name.
             rename_samples: A :obj:`dict` mapping old sample name to new sample name.
             rename_channels: A :obj:`dict` mapping old channel name to new channel name.
@@ -622,11 +622,11 @@ def prune(
         The pruned workspace must also be a valid workspace.
 
         Args:
-            modifiers: A :obj:`str` or a :obj:`list` of modifiers to prune.
-            modifier_types: A :obj:`str` or a :obj:`list` of modifier types to prune.
-            samples: A :obj:`str` or a :obj:`list` of samples to prune.
-            channels: A :obj:`str` or a :obj:`list` of channels to prune.
-            measurements: A :obj:`str` or a :obj:`list` of measurements to prune.
+            modifiers: A :obj:`list` of modifiers to prune.
+            modifier_types: A :obj:`list` of modifier types to prune.
+            samples: A :obj:`list` of samples to prune.
+            channels: A :obj:`list` of channels to prune.
+            measurements: A :obj:`list` of measurements to prune.
 
         Returns:
             ~pyhf.workspace.Workspace: A new workspace object with the specified components removed


Test patch: