Coverage for install/scipp/core/hyperbolic.py: 35%
17 statements
« prev ^ index » next coverage.py v7.4.0, created at 2024-04-28 01:28 +0000
« prev ^ index » next coverage.py v7.4.0, created at 2024-04-28 01:28 +0000
1# SPDX-License-Identifier: BSD-3-Clause
2# Copyright (c) 2023 Scipp contributors (https://github.com/scipp)
4from __future__ import annotations
6from typing import Optional
8from .._scipp import core as _cpp
9from ..typing import VariableLikeType
10from ._cpp_wrapper_util import call_func as _call_cpp_func
13def sinh(
14 x: VariableLikeType, *, out: Optional[VariableLikeType] = None
15) -> VariableLikeType:
16 """Element-wise hyperbolic sine.
18 The input unit must be dimensionless.
20 Parameters
21 ----------
22 x: scipp.typing.VariableLike
23 Input data.
24 out:
25 Optional output buffer.
27 Returns
28 -------
29 : Same type as input
30 The hyperbolic sine values of the input.
31 """
32 return _call_cpp_func(_cpp.sinh, x, out=out)
35def cosh(
36 x: VariableLikeType, *, out: Optional[VariableLikeType] = None
37) -> VariableLikeType:
38 """Element-wise hyperbolic cosine.
40 The input unit must be dimensionless.
42 Parameters
43 ----------
44 x: scipp.typing.VariableLike
45 Input data.
46 out:
47 Optional output buffer.
49 Returns
50 -------
51 : Same type as input
52 The hyperbolic cosine values of the input.
53 """
54 return _call_cpp_func(_cpp.cosh, x, out=out)
57def tanh(
58 x: VariableLikeType, *, out: Optional[VariableLikeType] = None
59) -> VariableLikeType:
60 """Element-wise hyperbolic tangent.
62 The input unit must be dimensionless.
64 Parameters
65 ----------
66 x: scipp.typing.VariableLike
67 Input data.
68 out:
69 Optional output buffer.
71 Returns
72 -------
73 : Same type as input
74 The hyperbolic tangent values of the input.
75 """
76 return _call_cpp_func(_cpp.tanh, x, out=out)
79def asinh(
80 x: VariableLikeType, *, out: Optional[VariableLikeType] = None
81) -> VariableLikeType:
82 """Element-wise inverse hyperbolic sine.
84 The input unit must be dimensionless.
86 Parameters
87 ----------
88 x: scipp.typing.VariableLike
89 Input data.
90 out:
91 Optional output buffer.
93 Returns
94 -------
95 : Same type as input
96 The inverse hyperbolic sine values of the input.
97 """
98 return _call_cpp_func(_cpp.asinh, x, out=out)
101def acosh(
102 x: VariableLikeType, *, out: Optional[VariableLikeType] = None
103) -> VariableLikeType:
104 """Element-wise inverse hyperbolic cosine.
106 The input unit must be dimensionless.
108 Parameters
109 ----------
110 x: scipp.typing.VariableLike
111 Input data.
112 out:
113 Optional output buffer.
115 Returns
116 -------
117 : Same type as input
118 The inverse hyperbolic cosine values of the input.
119 """
120 return _call_cpp_func(_cpp.acosh, x, out=out)
123def atanh(
124 x: VariableLikeType, *, out: Optional[VariableLikeType] = None
125) -> VariableLikeType:
126 """Element-wise inverse hyperbolic tangent.
128 The input unit must be dimensionless.
130 Parameters
131 ----------
132 x: scipp.typing.VariableLike
133 Input data.
134 out:
135 Optional output buffer.
137 Returns
138 -------
139 : Same type as input
140 The inverse hyperbolic tangent values of the input.
141 """
142 return _call_cpp_func(_cpp.atanh, x, out=out)