Skip to content

Commit bff1afe

Browse files
committed
Update docstring of cos and cosh function to use math where applicable.
1 parent e3b223b commit bff1afe

File tree

1 file changed

+15
-11
lines changed

1 file changed

+15
-11
lines changed

dpnp/dpnp_iface_trigonometric.py

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -750,14 +750,14 @@ def _get_accumulation_res_dt(a, dtype):
750750

751751

752752
_COS_DOCSTRING = """
753-
Computes cosine for each element `x_i` for input array `x`.
753+
Computes cosine for each element :math:`x_i` for input array `x`.
754754
755755
For full documentation refer to :obj:`numpy.cos`.
756756
757757
Parameters
758758
----------
759759
x : {dpnp.ndarray, usm_ndarray}
760-
Input array, expected to have numeric data type.
760+
Input array, expected to have a floating-point data type.
761761
out : {None, dpnp.ndarray, usm_ndarray}, optional
762762
Output array to populate.
763763
Array must have the correct shape and the expected data type.
@@ -771,8 +771,8 @@ def _get_accumulation_res_dt(a, dtype):
771771
Returns
772772
-------
773773
out : dpnp.ndarray
774-
An array containing the element-wise cosine. The data type
775-
of the returned array is determined by the Type Promotion Rules.
774+
An array containing the element-wise cosine. The data type of the returned
775+
array is determined by the Type Promotion Rules.
776776
777777
Limitations
778778
-----------
@@ -782,7 +782,7 @@ def _get_accumulation_res_dt(a, dtype):
782782
783783
See Also
784784
--------
785-
:obj:`dpnp.arccos` : Trigonometric inverse cosine, element-wise.
785+
:obj:`dpnp.acos` : Trigonometric inverse cosine, element-wise.
786786
:obj:`dpnp.sin` : Trigonometric sine, element-wise.
787787
:obj:`dpnp.tan` : Trigonometric tangent, element-wise.
788788
:obj:`dpnp.cosh` : Hyperbolic cosine, element-wise.
@@ -806,15 +806,19 @@ def _get_accumulation_res_dt(a, dtype):
806806
)
807807

808808

809-
_COSH_DOCSTRING = """
810-
Computes hyperbolic cosine for each element `x_i` for input array `x`.
809+
_COSH_DOCSTRING = r"""
810+
Computes hyperbolic cosine for each element :math:`x_i` for input array `x`.
811+
812+
The mathematical definition of the hyperbolic cosine is
813+
814+
.. math:: \operatorname{cosh}(x) = \frac{e^x + e^{-x}}{2}
811815
812816
For full documentation refer to :obj:`numpy.cosh`.
813817
814818
Parameters
815819
----------
816820
x : {dpnp.ndarray, usm_ndarray}
817-
Input array, expected to have numeric data type.
821+
Input array, expected to have a floating-point data type.
818822
out : {None, dpnp.ndarray, usm_ndarray}, optional
819823
Output array to populate.
820824
Array must have the correct shape and the expected data type.
@@ -828,8 +832,8 @@ def _get_accumulation_res_dt(a, dtype):
828832
Returns
829833
-------
830834
out : dpnp.ndarray
831-
An array containing the element-wise hyperbolic cosine. The data type
832-
of the returned array is determined by the Type Promotion Rules.
835+
An array containing the element-wise hyperbolic cosine. The data type of
836+
the returned array is determined by the Type Promotion Rules.
833837
834838
Limitations
835839
-----------
@@ -839,7 +843,7 @@ def _get_accumulation_res_dt(a, dtype):
839843
840844
See Also
841845
--------
842-
:obj:`dpnp.arccosh` : Hyperbolic inverse cosine, element-wise.
846+
:obj:`dpnp.acosh` : Hyperbolic inverse cosine, element-wise.
843847
:obj:`dpnp.sinh` : Hyperbolic sine, element-wise.
844848
:obj:`dpnp.tanh` : Hyperbolic tangent, element-wise.
845849
:obj:`dpnp.cos` : Trigonometric cosine, element-wise.

0 commit comments

Comments
 (0)