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

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

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

3 

4from __future__ import annotations 

5 

6from typing import Optional 

7 

8from .._scipp import core as _cpp 

9from ..typing import VariableLikeType 

10from ._cpp_wrapper_util import call_func as _call_cpp_func 

11 

12 

13def sinh( 

14 x: VariableLikeType, *, out: Optional[VariableLikeType] = None 

15) -> VariableLikeType: 

16 """Element-wise hyperbolic sine. 

17 

18 The input unit must be dimensionless. 

19 

20 Parameters 

21 ---------- 

22 x: scipp.typing.VariableLike 

23 Input data. 

24 out: 

25 Optional output buffer. 

26 

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) 

33 

34 

35def cosh( 

36 x: VariableLikeType, *, out: Optional[VariableLikeType] = None 

37) -> VariableLikeType: 

38 """Element-wise hyperbolic cosine. 

39 

40 The input unit must be dimensionless. 

41 

42 Parameters 

43 ---------- 

44 x: scipp.typing.VariableLike 

45 Input data. 

46 out: 

47 Optional output buffer. 

48 

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) 

55 

56 

57def tanh( 

58 x: VariableLikeType, *, out: Optional[VariableLikeType] = None 

59) -> VariableLikeType: 

60 """Element-wise hyperbolic tangent. 

61 

62 The input unit must be dimensionless. 

63 

64 Parameters 

65 ---------- 

66 x: scipp.typing.VariableLike 

67 Input data. 

68 out: 

69 Optional output buffer. 

70 

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) 

77 

78 

79def asinh( 

80 x: VariableLikeType, *, out: Optional[VariableLikeType] = None 

81) -> VariableLikeType: 

82 """Element-wise inverse hyperbolic sine. 

83 

84 The input unit must be dimensionless. 

85 

86 Parameters 

87 ---------- 

88 x: scipp.typing.VariableLike 

89 Input data. 

90 out: 

91 Optional output buffer. 

92 

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) 

99 

100 

101def acosh( 

102 x: VariableLikeType, *, out: Optional[VariableLikeType] = None 

103) -> VariableLikeType: 

104 """Element-wise inverse hyperbolic cosine. 

105 

106 The input unit must be dimensionless. 

107 

108 Parameters 

109 ---------- 

110 x: scipp.typing.VariableLike 

111 Input data. 

112 out: 

113 Optional output buffer. 

114 

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) 

121 

122 

123def atanh( 

124 x: VariableLikeType, *, out: Optional[VariableLikeType] = None 

125) -> VariableLikeType: 

126 """Element-wise inverse hyperbolic tangent. 

127 

128 The input unit must be dimensionless. 

129 

130 Parameters 

131 ---------- 

132 x: scipp.typing.VariableLike 

133 Input data. 

134 out: 

135 Optional output buffer. 

136 

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)