Skip to content

Commit e4086bb

Browse files
cpcloudkszucs
authored andcommitted
feat(dask): implement trig functions
1 parent 1fd52d2 commit e4086bb

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

ibis/backends/dask/execution/numeric.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,33 @@ def execute_series_unary_op(op, data, **kwargs):
4040
return call_numpy_ufunc(function, op, data, **kwargs)
4141

4242

43+
@execute_node.register(ops.Acos, dd.Series)
44+
def execute_series_acos(_, data, **kwargs):
45+
return np.arccos(data)
46+
47+
48+
@execute_node.register(ops.Asin, dd.Series)
49+
def execute_series_asin(_, data, **kwargs):
50+
return np.arcsin(data)
51+
52+
53+
@execute_node.register(ops.Atan, dd.Series)
54+
def execute_series_atan(_, data, **kwargs):
55+
return np.arctan(data)
56+
57+
58+
@execute_node.register(ops.Cot, dd.Series)
59+
def execute_series_cot(_, data, **kwargs):
60+
return np.cos(data) / np.sin(data)
61+
62+
63+
@execute_node.register(ops.Atan2, dd.Series, dd.Series)
64+
@execute_node.register(ops.Atan2, numeric_types, dd.Series)
65+
@execute_node.register(ops.Atan2, dd.Series, numeric_types)
66+
def execute_series_atan2(_, y, x, **kwargs):
67+
return np.arctan2(y, x)
68+
69+
4370
@execute_node.register((ops.Ceil, ops.Floor), dd.Series)
4471
def execute_series_ceil(op, data, **kwargs):
4572
return_type = np.object_ if data.dtype == np.object_ else np.int64

0 commit comments

Comments
 (0)