diff --git a/src/pyhf/cli/__init__.py b/src/pyhf/cli/__init__.py index ed53c296af..988998d39a 100644 --- a/src/pyhf/cli/__init__.py +++ b/src/pyhf/cli/__init__.py @@ -7,7 +7,7 @@ from pyhf.cli.complete import cli as complete from pyhf.contrib import cli as contrib -__all__ = ['cli', 'rootio', 'spec', 'infer', 'complete', 'contrib'] +__all__ = ['cli', 'complete', 'contrib', 'infer', 'rootio', 'spec'] def __dir__(): diff --git a/src/pyhf/infer/__init__.py b/src/pyhf/infer/__init__.py index dc5531cd93..058a7460d6 100644 --- a/src/pyhf/infer/__init__.py +++ b/src/pyhf/infer/__init__.py @@ -206,7 +206,7 @@ def hypotest( from pyhf.infer import intervals -__all__ = ["hypotest", "calculators", "intervals", "mle", "test_statistics", "utils"] +__all__ = ["calculators", "hypotest", "intervals", "mle", "test_statistics", "utils"] def __dir__(): diff --git a/src/pyhf/infer/intervals/upper_limits.py b/src/pyhf/infer/intervals/upper_limits.py index 601189cdbb..6b86d586fe 100644 --- a/src/pyhf/infer/intervals/upper_limits.py +++ b/src/pyhf/infer/intervals/upper_limits.py @@ -6,7 +6,7 @@ from pyhf import get_backend from pyhf.infer import hypotest -__all__ = ["upper_limit", "linear_grid_scan", "toms748_scan"] +__all__ = ["linear_grid_scan", "toms748_scan", "upper_limit"] def __dir__(): diff --git a/src/pyhf/optimize/opt_minuit.py b/src/pyhf/optimize/opt_minuit.py index 4f1edb3dca..24c30decc7 100644 --- a/src/pyhf/optimize/opt_minuit.py +++ b/src/pyhf/optimize/opt_minuit.py @@ -11,7 +11,7 @@ class minuit_optimizer(OptimizerMixin): Optimizer that minimizes via :meth:`iminuit.Minuit.migrad`. """ - __slots__ = ['name', 'errordef', 'steps', 'strategy', 'tolerance'] + __slots__ = ['errordef', 'name', 'steps', 'strategy', 'tolerance'] def __init__(self, *args, **kwargs): """ diff --git a/src/pyhf/optimize/opt_scipy.py b/src/pyhf/optimize/opt_scipy.py index 68c64bafe3..73b4b6bae2 100644 --- a/src/pyhf/optimize/opt_scipy.py +++ b/src/pyhf/optimize/opt_scipy.py @@ -10,7 +10,7 @@ class scipy_optimizer(OptimizerMixin): Optimizer that uses :func:`scipy.optimize.minimize`. """ - __slots__ = ['name', 'tolerance', 'solver_options'] + __slots__ = ['name', 'solver_options', 'tolerance'] def __init__(self, *args, **kwargs): """ diff --git a/src/pyhf/parameters/__init__.py b/src/pyhf/parameters/__init__.py index 8d9204b514..515e2bd48f 100644 --- a/src/pyhf/parameters/__init__.py +++ b/src/pyhf/parameters/__init__.py @@ -8,12 +8,12 @@ from pyhf.parameters.paramview import ParamViewer __all__ = [ - 'paramset', - 'unconstrained', + 'ParamViewer', 'constrained_by_normal', 'constrained_by_poisson', + 'paramset', 'reduce_paramsets_requirements', - 'ParamViewer', + 'unconstrained', ] diff --git a/src/pyhf/schema/__init__.py b/src/pyhf/schema/__init__.py index 0c08f018b2..a57c7d82f4 100644 --- a/src/pyhf/schema/__init__.py +++ b/src/pyhf/schema/__init__.py @@ -10,8 +10,8 @@ __all__ = [ "load_schema", - "validate", "path", + "validate", "version", ] diff --git a/src/pyhf/tensor/__init__.py b/src/pyhf/tensor/__init__.py index 1155461e4b..a1036cf48e 100644 --- a/src/pyhf/tensor/__init__.py +++ b/src/pyhf/tensor/__init__.py @@ -3,10 +3,10 @@ class _BackendRetriever: __slots__ = [ - "_array_types", "_array_subtypes", - "numpy_backend", + "_array_types", "jax_backend", + "numpy_backend", "pytorch_backend", "tensorflow_backend", ] diff --git a/src/pyhf/tensor/jax_backend.py b/src/pyhf/tensor/jax_backend.py index 438f3e7325..2a85006c04 100644 --- a/src/pyhf/tensor/jax_backend.py +++ b/src/pyhf/tensor/jax_backend.py @@ -52,7 +52,7 @@ def log_prob(self, value): class jax_backend: """JAX backend for pyhf""" - __slots__ = ['name', 'precision', 'dtypemap', 'default_do_grad'] + __slots__ = ['default_do_grad', 'dtypemap', 'name', 'precision'] #: The array type for jax array_type = Array diff --git a/src/pyhf/tensor/numpy_backend.py b/src/pyhf/tensor/numpy_backend.py index 8e019a7ec9..5221800a3d 100644 --- a/src/pyhf/tensor/numpy_backend.py +++ b/src/pyhf/tensor/numpy_backend.py @@ -54,7 +54,7 @@ def log_prob(self, value: NDArray[np.number[T]]) -> ArrayLike: class numpy_backend(Generic[T]): """NumPy backend for pyhf""" - __slots__ = ['name', 'precision', 'dtypemap', 'default_do_grad'] + __slots__ = ['default_do_grad', 'dtypemap', 'name', 'precision'] #: The array type for numpy array_type = np.ndarray diff --git a/src/pyhf/tensor/pytorch_backend.py b/src/pyhf/tensor/pytorch_backend.py index c962c864f9..0f9f253fcd 100644 --- a/src/pyhf/tensor/pytorch_backend.py +++ b/src/pyhf/tensor/pytorch_backend.py @@ -12,7 +12,7 @@ class pytorch_backend: """PyTorch backend for pyhf""" - __slots__ = ['name', 'precision', 'dtypemap', 'default_do_grad'] + __slots__ = ['default_do_grad', 'dtypemap', 'name', 'precision'] #: The array type for pytorch array_type = torch.Tensor diff --git a/src/pyhf/tensor/tensorflow_backend.py b/src/pyhf/tensor/tensorflow_backend.py index a36fa9206f..f15cf4cdac 100644 --- a/src/pyhf/tensor/tensorflow_backend.py +++ b/src/pyhf/tensor/tensorflow_backend.py @@ -10,7 +10,7 @@ class tensorflow_backend: """TensorFlow backend for pyhf""" - __slots__ = ['name', 'precision', 'dtypemap', 'default_do_grad'] + __slots__ = ['default_do_grad', 'dtypemap', 'name', 'precision'] #: The array type for tensorflow array_type = tf.Tensor diff --git a/src/pyhf/typing.py b/src/pyhf/typing.py index 19802e3da7..19dd36c485 100644 --- a/src/pyhf/typing.py +++ b/src/pyhf/typing.py @@ -12,26 +12,26 @@ ) __all__ = ( - "PathOrStr", - "ParameterBase", - "Parameter", - "Measurement", - "ModifierBase", - "NormSys", - "NormFactor", + "Channel", "HistoSys", - "StatError", - "ShapeSys", - "ShapeFactor", + "Literal", "LumiSys", + "Measurement", "Modifier", - "Sample", - "Channel", + "ModifierBase", + "NormFactor", + "NormSys", "Observation", - "Workspace", - "Literal", - "TypedDict", + "Parameter", + "ParameterBase", + "PathOrStr", "Protocol", + "Sample", + "ShapeFactor", + "ShapeSys", + "StatError", + "TypedDict", + "Workspace", )