Repository: scikit-hep/pyhf

Issue:
Update modifierclass.rst template to accept functions that aren't methods of a class
# Description

First noticed in PR #750, while trying to get the docs to show the full signatures and docstrings:

```rst
.. autosummary::
   :toctree: _generated/
   :nosignatures:
   :template: modifierclass.rst
```

I'm getting the following warnings (which we treat as errors) when I try to build the docs:
```
WARNING: error while formatting arguments for pyhf.infer.calculators.generate_asimov_data: 'function' object has no attribute '__mro__'
WARNING: error while formatting arguments for pyhf.infer.hypotest: 'function' object has no attribute '__mro__'
WARNING: error while formatting arguments for pyhf.infer.mle.fit: 'function' object has no attribute '__mro__'
WARNING: error while formatting arguments for pyhf.infer.mle.fixed_poi_fit: 'function' object has no attribute '__mro__'
WARNING: error while formatting arguments for pyhf.infer.mle.twice_nll: 'function' object has no attribute '__mro__'
WARNING: error while formatting arguments for pyhf.infer.test_statistics.qmu: 'function' object has no attribute '__mro__'
```

which I believe is happening as `__mro__` only exists on the class, and these functions exist in the source code outside of a class definition.

This means that the [`modifierclass.rst` template](https://github.com/scikit-hep/pyhf/blob/1ee6e38d42d9551220f20de483e0049b28c848b0/docs/_templates/modifierclass.rst) will need to get updated to deal with functions that aren't methods of a class.
Fix up docstring for _minimize() functions in the optimizers
# Description

From https://github.com/scikit-hep/pyhf/pull/1338#pullrequestreview-596818258

> I'm not sure if it can be fixed here, but the "Minimizer Options" aren't being displayed correctly for the optimizer _minimize methods.

![_minimize](https://user-images.githubusercontent.com/5142394/108911722-42011c00-75ed-11eb-805d-80d0d5a20ca2.png)

> we've never been able to see the `_minimize` methods before, so it isn't surprising they might not look perfect.


Discussion:
For context, without the 

```rst
.. autosummary::
   :nosignatures:
   :template: modifierclass.rst
```

I'm getting no build errors but

![docs_not_working](https://user-images.githubusercontent.com/5142394/75615479-d97e7c80-5b09-11ea-9d57-fc1ccdd0b6bd.png)

and with it I am getting the build errors above but with the more desirable expansion of the methods docstrings.

![docs_working](https://user-images.githubusercontent.com/5142394/75615490-f1ee9700-5b09-11ea-880f-e1114e2825b5.png)



Resolving patch:
diff --git a/src/pyhf/optimize/opt_minuit.py b/src/pyhf/optimize/opt_minuit.py
--- a/src/pyhf/optimize/opt_minuit.py
+++ b/src/pyhf/optimize/opt_minuit.py
@@ -25,10 +25,12 @@ def __init__(self, *args, **kwargs):
 
 
         Args:
-            errordef (:obj:`float`): See minuit docs. Default is 1.0.
-            steps (:obj:`int`): Number of steps for the bounds. Default is 1000.
-            strategy (:obj:`int`): See :attr:`iminuit.Minuit.strategy`. Default is None.
-            tolerance (:obj:`float`): tolerance for termination. See specific optimizer for detailed meaning. Default is 0.1.
+            errordef (:obj:`float`): See minuit docs. Default is ``1.0``.
+            steps (:obj:`int`): Number of steps for the bounds. Default is ``1000``.
+            strategy (:obj:`int`): See :attr:`iminuit.Minuit.strategy`. Default is ``None``.
+            tolerance (:obj:`float`): Tolerance for termination.
+              See specific optimizer for detailed meaning.
+              Default is ``0.1``.
         """
         self.name = 'minuit'
         self.errordef = kwargs.pop('errordef', 1)
@@ -84,9 +86,12 @@ def _minimize(
         underlying minimizer.
 
         Minimizer Options:
-            maxiter (:obj:`int`): maximum number of iterations. Default is 100000.
-            strategy (:obj:`int`): See :attr:`iminuit.Minuit.strategy`. Default is to configure in response to `do_grad`.
-            tolerance (:obj:`float`): tolerance for termination. See specific optimizer for detailed meaning. Default is 0.1.
+          * maxiter (:obj:`int`): Maximum number of iterations. Default is ``100000``.
+          * strategy (:obj:`int`): See :attr:`iminuit.Minuit.strategy`.
+            Default is to configure in response to ``do_grad``.
+          * tolerance (:obj:`float`): Tolerance for termination.
+            See specific optimizer for detailed meaning.
+            Default is ``0.1``.
 
         Returns:
             fitresult (scipy.optimize.OptimizeResult): the fit result
diff --git a/src/pyhf/optimize/opt_scipy.py b/src/pyhf/optimize/opt_scipy.py
--- a/src/pyhf/optimize/opt_scipy.py
+++ b/src/pyhf/optimize/opt_scipy.py
@@ -18,7 +18,9 @@ def __init__(self, *args, **kwargs):
         See :class:`pyhf.optimize.mixins.OptimizerMixin` for other configuration options.
 
         Args:
-            tolerance (:obj:`float`): tolerance for termination. See specific optimizer for detailed meaning. Default is None.
+            tolerance (:obj:`float`): Tolerance for termination.
+              See specific optimizer for detailed meaning.
+              Default is ``None``.
         """
         self.name = 'scipy'
         self.tolerance = kwargs.pop('tolerance', None)
@@ -43,10 +45,13 @@ def _minimize(
         Same signature as :func:`scipy.optimize.minimize`.
 
         Minimizer Options:
-            maxiter (:obj:`int`): maximum number of iterations. Default is 100000.
-            verbose (:obj:`bool`): print verbose output during minimization. Default is off.
-            method (:obj:`str`): minimization routine. Default is 'SLSQP'.
-            tolerance (:obj:`float`): tolerance for termination. See specific optimizer for detailed meaning. Default is None.
+          * maxiter (:obj:`int`): Maximum number of iterations. Default is ``100000``.
+          * verbose (:obj:`bool`): Print verbose output during minimization.
+            Default is ``False``.
+          * method (:obj:`str`): Minimization routine. Default is ``'SLSQP'``.
+          * tolerance (:obj:`float`): Tolerance for termination. See specific optimizer
+            for detailed meaning.
+            Default is ``None``.
 
         Returns:
             fitresult (scipy.optimize.OptimizeResult): the fit result


Test patch: