From a3671d7dab827cb9a1516524036213ba5458d844 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sun, 28 Jan 2024 21:10:11 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- deepmd/utils/random.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/deepmd/utils/random.py b/deepmd/utils/random.py index 5832978fbc..ecc0787d38 100644 --- a/deepmd/utils/random.py +++ b/deepmd/utils/random.py @@ -11,25 +11,25 @@ def choice( - a: Union[np.ndarray, int], - size: Union[int, Tuple[int, ...]] = None, - replace: bool = True, - p: Optional[np.ndarray] = None, - ): + a: Union[np.ndarray, int], + size: Union[int, Tuple[int, ...]] = None, + replace: bool = True, + p: Optional[np.ndarray] = None, +): """Generates a random sample from a given 1-D array. Parameters ---------- - a: 1-D array-like or int + a : 1-D array-like or int If an ndarray, a random sample is generated from its elements. If an int, the random sample is generated as if it were np.arange(a) - size: int or tuple of ints, optional + size : int or tuple of ints, optional Output shape. If the given shape is, e.g., (m, n, k), then m * n * k samples are drawn. Default is None, in which case a single value is returned. - replace: boolean, optional + replace : boolean, optional Whether the sample is with or without replacement. Default is True, meaning that a value of a can be selected multiple times. - p: 1-D array-like, optional + p : 1-D array-like, optional The probabilities associated with each entry in a. If not given, the sample assumes a uniform distribution over all entries in a.