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

1# SPDX-License-Identifier: BSD-3-Clause 

2# Copyright (c) 2023 Scipp contributors (https://github.com/scipp) 

3 

4from __future__ import annotations 

5 

6from .._scipp import core as _cpp 

7from ..typing import VariableLikeType 

8from ._cpp_wrapper_util import call_func as _call_cpp_func 

9 

10 

11def sinh( 

12 x: VariableLikeType, *, out: VariableLikeType | None = None 

13) -> VariableLikeType: 

14 """Element-wise hyperbolic sine. 

15 

16 The input unit must be dimensionless. 

17 

18 Parameters 

19 ---------- 

20 x: scipp.typing.VariableLike 

21 Input data. 

22 out: 

23 Optional output buffer. 

24 

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] 

31 

32 

33def cosh( 

34 x: VariableLikeType, *, out: VariableLikeType | None = None 

35) -> VariableLikeType: 

36 """Element-wise hyperbolic cosine. 

37 

38 The input unit must be dimensionless. 

39 

40 Parameters 

41 ---------- 

42 x: scipp.typing.VariableLike 

43 Input data. 

44 out: 

45 Optional output buffer. 

46 

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] 

53 

54 

55def tanh( 

56 x: VariableLikeType, *, out: VariableLikeType | None = None 

57) -> VariableLikeType: 

58 """Element-wise hyperbolic tangent. 

59 

60 The input unit must be dimensionless. 

61 

62 Parameters 

63 ---------- 

64 x: scipp.typing.VariableLike 

65 Input data. 

66 out: 

67 Optional output buffer. 

68 

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] 

75 

76 

77def asinh( 

78 x: VariableLikeType, *, out: VariableLikeType | None = None 

79) -> VariableLikeType: 

80 """Element-wise inverse hyperbolic sine. 

81 

82 The input unit must be dimensionless. 

83 

84 Parameters 

85 ---------- 

86 x: scipp.typing.VariableLike 

87 Input data. 

88 out: 

89 Optional output buffer. 

90 

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] 

97 

98 

99def acosh( 

100 x: VariableLikeType, *, out: VariableLikeType | None = None 

101) -> VariableLikeType: 

102 """Element-wise inverse hyperbolic cosine. 

103 

104 The input unit must be dimensionless. 

105 

106 Parameters 

107 ---------- 

108 x: scipp.typing.VariableLike 

109 Input data. 

110 out: 

111 Optional output buffer. 

112 

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] 

119 

120 

121def atanh( 

122 x: VariableLikeType, *, out: VariableLikeType | None = None 

123) -> VariableLikeType: 

124 """Element-wise inverse hyperbolic tangent. 

125 

126 The input unit must be dimensionless. 

127 

128 Parameters 

129 ---------- 

130 x: scipp.typing.VariableLike 

131 Input data. 

132 out: 

133 Optional output buffer. 

134 

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]