Skip to content

Commit 47b2690

Browse files
committed
Update docstring of , , , and functions to use math where applicable
1 parent fcc0390 commit 47b2690

File tree

1 file changed

+38
-22
lines changed

1 file changed

+38
-22
lines changed

dpnp/dpnp_iface_trigonometric.py

Lines changed: 38 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -960,15 +960,16 @@ def cumlogsumexp(
960960
)
961961

962962

963-
_DEG2RAD_DOCSTRING = """
964-
Convert angles from degrees to radians.
963+
_DEG2RAD_DOCSTRING = r"""
964+
Convert angles from degrees to radians for each element :math:`x_i` for input
965+
array `x`.
965966
966967
For full documentation refer to :obj:`numpy.deg2rad`.
967968
968969
Parameters
969970
----------
970971
x : {dpnp.ndarray, usm_ndarray}
971-
Angles in degrees.
972+
Input array, expected to have a real-valued floating-point data type.
972973
out : {None, dpnp.ndarray, usm_ndarray}, optional
973974
Output array to populate.
974975
Array must have the correct shape and the expected data type.
@@ -982,8 +983,9 @@ def cumlogsumexp(
982983
Returns
983984
-------
984985
out : dpnp.ndarray
985-
The corresponding angle in radians. The data type of the returned array is
986-
determined by the Type Promotion Rules.
986+
An array containing the element-wise angle in radians.
987+
The data type of the returned array is determined by the Type Promotion
988+
Rules.
987989
988990
Limitations
989991
-----------
@@ -999,7 +1001,7 @@ def cumlogsumexp(
9991001
10001002
Notes
10011003
-----
1002-
dpnp.deg2rad(x) is ``x * pi / 180``.
1004+
.. math:: \operatorname{deg2rad}(x) = \frac{x * \pi}{180}
10031005
10041006
Examples
10051007
--------
@@ -1018,15 +1020,16 @@ def cumlogsumexp(
10181020
)
10191021

10201022

1021-
_DEGREES_DOCSTRING = """
1022-
Convert angles from radians to degrees.
1023+
_DEGREES_DOCSTRING = r"""
1024+
Convert angles from degrees to radians for each element :math:`x_i` for input
1025+
array `x`.
10231026
10241027
For full documentation refer to :obj:`numpy.degrees`.
10251028
10261029
Parameters
10271030
----------
10281031
x : {dpnp.ndarray, usm_ndarray}
1029-
Input array in radians.
1032+
Input array, expected to have a real-valued floating-point data type.
10301033
out : {None, dpnp.ndarray, usm_ndarray}, optional
10311034
Output array to populate.
10321035
Array must have the correct shape and the expected data type.
@@ -1040,8 +1043,9 @@ def cumlogsumexp(
10401043
Returns
10411044
-------
10421045
out : dpnp.ndarray
1043-
The corresponding degree values. The data type of the returned array is
1044-
determined by the Type Promotion Rules.
1046+
An array containing the element-wise angle in degrees.
1047+
The data type of the returned array is determined by the Type Promotion
1048+
Rules.
10451049
10461050
Limitations
10471051
-----------
@@ -1053,6 +1057,10 @@ def cumlogsumexp(
10531057
--------
10541058
:obj:`dpnp.rad2deg` : Equivalent function.
10551059
1060+
Notes
1061+
-----
1062+
.. math:: \operatorname{degrees}(x) = \frac{180 * x}{\pi}
1063+
10561064
Examples
10571065
--------
10581066
>>> import dpnp as np
@@ -1811,15 +1819,16 @@ def logsumexp(x, /, *, axis=None, dtype=None, keepdims=False, out=None):
18111819
)
18121820

18131821

1814-
_RAD2DEG_DOCSTRING = """
1815-
Convert angles from radians to degrees.
1822+
_RAD2DEG_DOCSTRING = r"""
1823+
Convert angles from degrees to radians for each element :math:`x_i` for input
1824+
array `x`.
18161825
18171826
For full documentation refer to :obj:`numpy.rad2deg`.
18181827
18191828
Parameters
18201829
----------
18211830
x : {dpnp.ndarray, usm_ndarray}
1822-
Angle in radians.
1831+
Input array, expected to have a real-valued floating-point data type.
18231832
out : {None, dpnp.ndarray, usm_ndarray}, optional
18241833
Output array to populate.
18251834
Array must have the correct shape and the expected data type.
@@ -1833,8 +1842,9 @@ def logsumexp(x, /, *, axis=None, dtype=None, keepdims=False, out=None):
18331842
Returns
18341843
-------
18351844
out : dpnp.ndarray
1836-
The corresponding angle in degrees. The data type of the returned array is
1837-
determined by the Type Promotion Rules.
1845+
An array containing the element-wise angle in degrees.
1846+
The data type of the returned array is determined by the Type Promotion
1847+
Rules.
18381848
18391849
Limitations
18401850
-----------
@@ -1850,7 +1860,7 @@ def logsumexp(x, /, *, axis=None, dtype=None, keepdims=False, out=None):
18501860
18511861
Notes
18521862
-----
1853-
dpnp.rad2deg(x) is ``180 * x / pi``.
1863+
.. math:: \operatorname{rad2deg}(x) = \frac{180 * x}{\pi}
18541864
18551865
Examples
18561866
--------
@@ -1869,15 +1879,16 @@ def logsumexp(x, /, *, axis=None, dtype=None, keepdims=False, out=None):
18691879
)
18701880

18711881

1872-
_RADIANS_DOCSTRING = """
1873-
Convert angles from degrees to radians.
1882+
_RADIANS_DOCSTRING = r"""
1883+
Convert angles from degrees to radians for each element :math:`x_i` for input
1884+
array `x`.
18741885
18751886
For full documentation refer to :obj:`numpy.radians`.
18761887
18771888
Parameters
18781889
----------
18791890
x : {dpnp.ndarray, usm_ndarray}
1880-
Input array in degrees.
1891+
Input array, expected to have a real-valued floating-point data type.
18811892
out : {None, dpnp.ndarray, usm_ndarray}, optional
18821893
Output array to populate.
18831894
Array must have the correct shape and the expected data type.
@@ -1891,8 +1902,9 @@ def logsumexp(x, /, *, axis=None, dtype=None, keepdims=False, out=None):
18911902
Returns
18921903
-------
18931904
out : dpnp.ndarray
1894-
The corresponding radian values. The data type of the returned array is
1895-
determined by the Type Promotion Rules.
1905+
An array containing the element-wise angle in radians.
1906+
The data type of the returned array is determined by the Type Promotion
1907+
Rules.
18961908
18971909
Limitations
18981910
-----------
@@ -1904,6 +1916,10 @@ def logsumexp(x, /, *, axis=None, dtype=None, keepdims=False, out=None):
19041916
--------
19051917
:obj:`dpnp.deg2rad` : Equivalent function.
19061918
1919+
Notes
1920+
-----
1921+
.. math:: \operatorname{radians}(x) = \frac{x * \pi}{180}
1922+
19071923
Examples
19081924
--------
19091925
>>> import dpnp as np

0 commit comments

Comments
 (0)