|
29 | 29 | import polars as pl |
30 | 30 |
|
31 | 31 |
|
32 | | -@polars_compiler.register_op(numeric_ops.CosOp) |
33 | | -def cos_op_impl( |
34 | | - compiler: polars_compiler.PolarsExpressionCompiler, |
35 | | - op: numeric_ops.CosOp, # type: ignore |
36 | | - input: pl.Expr, |
37 | | -) -> pl.Expr: |
38 | | - return input.cos() |
39 | | - |
40 | | - |
41 | 32 | @polars_compiler.register_op(numeric_ops.LnOp) |
42 | 33 | def ln_op_impl( |
43 | 34 | compiler: polars_compiler.PolarsExpressionCompiler, |
@@ -80,6 +71,78 @@ def sin_op_impl( |
80 | 71 | return input.sin() |
81 | 72 |
|
82 | 73 |
|
| 74 | +@polars_compiler.register_op(numeric_ops.CosOp) |
| 75 | +def cos_op_impl( |
| 76 | + compiler: polars_compiler.PolarsExpressionCompiler, |
| 77 | + op: numeric_ops.CosOp, # type: ignore |
| 78 | + input: pl.Expr, |
| 79 | +) -> pl.Expr: |
| 80 | + return input.cos() |
| 81 | + |
| 82 | + |
| 83 | +@polars_compiler.register_op(numeric_ops.TanOp) |
| 84 | +def tan_op_impl( |
| 85 | + compiler: polars_compiler.PolarsExpressionCompiler, |
| 86 | + op: numeric_ops.SinOp, # type: ignore |
| 87 | + input: pl.Expr, |
| 88 | +) -> pl.Expr: |
| 89 | + return input.tan() |
| 90 | + |
| 91 | + |
| 92 | +@polars_compiler.register_op(numeric_ops.SinhOp) |
| 93 | +def sinh_op_impl( |
| 94 | + compiler: polars_compiler.PolarsExpressionCompiler, |
| 95 | + op: numeric_ops.SinOp, # type: ignore |
| 96 | + input: pl.Expr, |
| 97 | +) -> pl.Expr: |
| 98 | + return input.sinh() |
| 99 | + |
| 100 | + |
| 101 | +@polars_compiler.register_op(numeric_ops.CoshOp) |
| 102 | +def cosh_op_impl( |
| 103 | + compiler: polars_compiler.PolarsExpressionCompiler, |
| 104 | + op: numeric_ops.CosOp, # type: ignore |
| 105 | + input: pl.Expr, |
| 106 | +) -> pl.Expr: |
| 107 | + return input.cosh() |
| 108 | + |
| 109 | + |
| 110 | +@polars_compiler.register_op(numeric_ops.TanhOp) |
| 111 | +def tanh_op_impl( |
| 112 | + compiler: polars_compiler.PolarsExpressionCompiler, |
| 113 | + op: numeric_ops.SinOp, # type: ignore |
| 114 | + input: pl.Expr, |
| 115 | +) -> pl.Expr: |
| 116 | + return input.tanh() |
| 117 | + |
| 118 | + |
| 119 | +@polars_compiler.register_op(numeric_ops.ArcsinOp) |
| 120 | +def asin_op_impl( |
| 121 | + compiler: polars_compiler.PolarsExpressionCompiler, |
| 122 | + op: numeric_ops.ArcsinOp, # type: ignore |
| 123 | + input: pl.Expr, |
| 124 | +) -> pl.Expr: |
| 125 | + return input.arcsin() |
| 126 | + |
| 127 | + |
| 128 | +@polars_compiler.register_op(numeric_ops.ArccosOp) |
| 129 | +def acos_op_impl( |
| 130 | + compiler: polars_compiler.PolarsExpressionCompiler, |
| 131 | + op: numeric_ops.ArccosOp, # type: ignore |
| 132 | + input: pl.Expr, |
| 133 | +) -> pl.Expr: |
| 134 | + return input.arccos() |
| 135 | + |
| 136 | + |
| 137 | +@polars_compiler.register_op(numeric_ops.ArctanOp) |
| 138 | +def atan_op_impl( |
| 139 | + compiler: polars_compiler.PolarsExpressionCompiler, |
| 140 | + op: numeric_ops.ArctanOp, # type: ignore |
| 141 | + input: pl.Expr, |
| 142 | +) -> pl.Expr: |
| 143 | + return input.arctan() |
| 144 | + |
| 145 | + |
83 | 146 | @polars_compiler.register_op(numeric_ops.SqrtOp) |
84 | 147 | def sqrt_op_impl( |
85 | 148 | compiler: polars_compiler.PolarsExpressionCompiler, |
|
0 commit comments