Coverage for install/scipp/core/hyperbolic.py: 38%
16 statements
« prev ^ index » next coverage.py v7.6.1, created at 2024-11-17 01:51 +0000
« prev ^ index » next coverage.py v7.6.1, created at 2024-11-17 01:51 +0000
1# SPDX-License-Identifier: BSD-3-Clause
2# Copyright (c) 2023 Scipp contributors (https://github.com/scipp)
4from __future__ import annotations
6from .._scipp import core as _cpp
7from ..typing import VariableLikeType
8from ._cpp_wrapper_util import call_func as _call_cpp_func
11def sinh(
12 x: VariableLikeType, *, out: VariableLikeType | None = None
13) -> VariableLikeType:
14 """Element-wise hyperbolic sine.
16 The input unit must be dimensionless.
18 Parameters
19 ----------
20 x: scipp.typing.VariableLike
21 Input data.
22 out:
23 Optional output buffer.
25 Returns
26 -------
27 : Same type as input
28 The hyperbolic sine values of the input.
29 """
30 return _call_cpp_func(_cpp.sinh, x, out=out) # type: ignore[return-value]
33def cosh(
34 x: VariableLikeType, *, out: VariableLikeType | None = None
35) -> VariableLikeType:
36 """Element-wise hyperbolic cosine.
38 The input unit must be dimensionless.
40 Parameters
41 ----------
42 x: scipp.typing.VariableLike
43 Input data.
44 out:
45 Optional output buffer.
47 Returns
48 -------
49 : Same type as input
50 The hyperbolic cosine values of the input.
51 """
52 return _call_cpp_func(_cpp.cosh, x, out=out) # type: ignore[return-value]
55def tanh(
56 x: VariableLikeType, *, out: VariableLikeType | None = None
57) -> VariableLikeType:
58 """Element-wise hyperbolic tangent.
60 The input unit must be dimensionless.
62 Parameters
63 ----------
64 x: scipp.typing.VariableLike
65 Input data.
66 out:
67 Optional output buffer.
69 Returns
70 -------
71 : Same type as input
72 The hyperbolic tangent values of the input.
73 """
74 return _call_cpp_func(_cpp.tanh, x, out=out) # type: ignore[return-value]
77def asinh(
78 x: VariableLikeType, *, out: VariableLikeType | None = None
79) -> VariableLikeType:
80 """Element-wise inverse hyperbolic sine.
82 The input unit must be dimensionless.
84 Parameters
85 ----------
86 x: scipp.typing.VariableLike
87 Input data.
88 out:
89 Optional output buffer.
91 Returns
92 -------
93 : Same type as input
94 The inverse hyperbolic sine values of the input.
95 """
96 return _call_cpp_func(_cpp.asinh, x, out=out) # type: ignore[return-value]
99def acosh(
100 x: VariableLikeType, *, out: VariableLikeType | None = None
101) -> VariableLikeType:
102 """Element-wise inverse hyperbolic cosine.
104 The input unit must be dimensionless.
106 Parameters
107 ----------
108 x: scipp.typing.VariableLike
109 Input data.
110 out:
111 Optional output buffer.
113 Returns
114 -------
115 : Same type as input
116 The inverse hyperbolic cosine values of the input.
117 """
118 return _call_cpp_func(_cpp.acosh, x, out=out) # type: ignore[return-value]
121def atanh(
122 x: VariableLikeType, *, out: VariableLikeType | None = None
123) -> VariableLikeType:
124 """Element-wise inverse hyperbolic tangent.
126 The input unit must be dimensionless.
128 Parameters
129 ----------
130 x: scipp.typing.VariableLike
131 Input data.
132 out:
133 Optional output buffer.
135 Returns
136 -------
137 : Same type as input
138 The inverse hyperbolic tangent values of the input.
139 """
140 return _call_cpp_func(_cpp.atanh, x, out=out) # type: ignore[return-value]