From e4086bbe474f64dbb3427f1a4f32e3283661abe2 Mon Sep 17 00:00:00 2001 From: Phillip Cloud <417981+cpcloud@users.noreply.github.com> Date: Mon, 16 May 2022 08:57:12 -0400 Subject: [PATCH] feat(dask): implement trig functions --- ibis/backends/dask/execution/numeric.py | 27 +++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/ibis/backends/dask/execution/numeric.py b/ibis/backends/dask/execution/numeric.py index 6ac3525d0c84..1914083d4afb 100644 --- a/ibis/backends/dask/execution/numeric.py +++ b/ibis/backends/dask/execution/numeric.py @@ -40,6 +40,33 @@ def execute_series_unary_op(op, data, **kwargs): return call_numpy_ufunc(function, op, data, **kwargs) +@execute_node.register(ops.Acos, dd.Series) +def execute_series_acos(_, data, **kwargs): + return np.arccos(data) + + +@execute_node.register(ops.Asin, dd.Series) +def execute_series_asin(_, data, **kwargs): + return np.arcsin(data) + + +@execute_node.register(ops.Atan, dd.Series) +def execute_series_atan(_, data, **kwargs): + return np.arctan(data) + + +@execute_node.register(ops.Cot, dd.Series) +def execute_series_cot(_, data, **kwargs): + return np.cos(data) / np.sin(data) + + +@execute_node.register(ops.Atan2, dd.Series, dd.Series) +@execute_node.register(ops.Atan2, numeric_types, dd.Series) +@execute_node.register(ops.Atan2, dd.Series, numeric_types) +def execute_series_atan2(_, y, x, **kwargs): + return np.arctan2(y, x) + + @execute_node.register((ops.Ceil, ops.Floor), dd.Series) def execute_series_ceil(op, data, **kwargs): return_type = np.object_ if data.dtype == np.object_ else np.int64