diff --git a/src/awkward/operations/ak_angle.py b/src/awkward/operations/ak_angle.py index 49128bd944..87bd5ce5af 100644 --- a/src/awkward/operations/ak_angle.py +++ b/src/awkward/operations/ak_angle.py @@ -15,7 +15,8 @@ @ak._connect.numpy.implements("angle") @high_level_function() def angle(val, deg=False, highlevel=True, behavior=None, attrs=None): - """ + """Returns the counterclockwise angle of each complex element in radians or degrees. + Args: val : array_like Input array. @@ -28,8 +29,9 @@ def angle(val, deg=False, highlevel=True, behavior=None, attrs=None): attrs (None or dict): Custom attributes for the output array, if high-level. - Returns the counterclockwise angle from the positive real axis on the complex - plane in the range ``(-pi, pi]``, with dtype as a float. + Returns: + The counterclockwise angle from the positive real axis on the complex + plane in the range ``(-pi, pi]``, with dtype as a float. """ # Dispatch yield (val,) diff --git a/src/awkward/operations/ak_imag.py b/src/awkward/operations/ak_imag.py index b90d2dbfa4..d2d419b3ae 100644 --- a/src/awkward/operations/ak_imag.py +++ b/src/awkward/operations/ak_imag.py @@ -15,7 +15,10 @@ @ak._connect.numpy.implements("imag") @high_level_function() def imag(val, highlevel=True, behavior=None, attrs=None): - """ + """Returns the imaginary components of the given array elements. + + If the arrays have complex elements, the returned arrays are floats. + Args: val : array_like Input array. @@ -26,8 +29,8 @@ def imag(val, highlevel=True, behavior=None, attrs=None): attrs (None or dict): Custom attributes for the output array, if high-level. - Returns the imaginary components of the given array elements. - If the arrays have complex elements, the returned arrays are floats. + Returns: + The imaginary components of the given array elements. """ # Dispatch yield (val,) diff --git a/src/awkward/operations/ak_isclose.py b/src/awkward/operations/ak_isclose.py index d5ff825c61..45dc5558ea 100644 --- a/src/awkward/operations/ak_isclose.py +++ b/src/awkward/operations/ak_isclose.py @@ -27,7 +27,11 @@ def isclose( behavior=None, attrs=None, ): - """ + """Returns a boolean array of element-wise approximate-equality between two arrays. + + Implements [np.isclose](https://numpy.org/doc/stable/reference/generated/numpy.isclose.html) + for Awkward Arrays. + Args: a: Array-like data (anything #ak.to_layout recognizes). b: Array-like data (anything #ak.to_layout recognizes). @@ -42,8 +46,9 @@ def isclose( attrs (None or dict): Custom attributes for the output array, if high-level. - Implements [np.isclose](https://numpy.org/doc/stable/reference/generated/numpy.isclose.html) - for Awkward Arrays. + Returns: + An array of booleans, True where `a` and `b` are approximately equal + within the given tolerances. """ # Dispatch yield a, b diff --git a/src/awkward/operations/ak_real.py b/src/awkward/operations/ak_real.py index 655e4e8007..ff9fcdeaf7 100644 --- a/src/awkward/operations/ak_real.py +++ b/src/awkward/operations/ak_real.py @@ -15,7 +15,10 @@ @ak._connect.numpy.implements("real") @high_level_function() def real(array, highlevel=True, behavior=None, attrs=None): - """ + """Returns the real components of the given array elements. + + If the arrays have complex elements, the returned arrays are floats. + Args: array : array_like Input array. @@ -26,8 +29,8 @@ def real(array, highlevel=True, behavior=None, attrs=None): attrs (None or dict): Custom attributes for the output array, if high-level. - Returns the real components of the given array elements. - If the arrays have complex elements, the returned arrays are floats. + Returns: + The real components of the given array elements. """ # Dispatch yield (array,) diff --git a/src/awkward/operations/ak_round.py b/src/awkward/operations/ak_round.py index 6d6e0e0471..199cb4074d 100644 --- a/src/awkward/operations/ak_round.py +++ b/src/awkward/operations/ak_round.py @@ -24,7 +24,8 @@ def round( behavior=None, attrs=None, ): - """ + """Rounds each array element to the given number of decimals. + Args: array : array_like Input array. @@ -40,8 +41,8 @@ def round( attrs (None or dict): Custom attributes for the output array, if high-level. - Returns the real components of the given array elements. - If the arrays have complex elements, the returned arrays are floats. + Returns: + An array with each element rounded to the given number of `decimals`. """ # Dispatch yield (array,)