Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
6c2b854
docs: add an example to the class docstring
lars-reimann Jan 19, 2025
3003aee
feat: rounding methods and `sign`
lars-reimann Jan 19, 2025
3eb952e
feat: `arccos`, `arcsin`, `arctan`
lars-reimann Jan 19, 2025
b06487a
feat: `cos`, `sin`, `tan`
lars-reimann Jan 19, 2025
c2d28dc
feat: `cosh`, `sinh`, `tanh`
lars-reimann Jan 19, 2025
e4f1ab0
feat: `arccosh`, `arcsinh`, `arctanh`
lars-reimann Jan 19, 2025
8c04972
feat: `exp`, `sqrt`
lars-reimann Jan 19, 2025
5284199
feat: `degrees_to_radians` and `radians_to_degrees`
lars-reimann Jan 19, 2025
f0e78b6
feat: `log`
lars-reimann Jan 19, 2025
f3e1802
docs: minor change
lars-reimann Jan 19, 2025
7a67170
test: `sqrt`
lars-reimann Jan 20, 2025
6e13577
test: `sign`
lars-reimann Jan 20, 2025
8563ac4
test: `degrees_to_radians`
lars-reimann Jan 20, 2025
e45c4d2
test: `radians_to_degrees`
lars-reimann Jan 20, 2025
6c7b699
test: `sin`, `cos`, `tan`
lars-reimann Jan 20, 2025
3024624
test: `arcsin`, `arccos`, `arctan`
lars-reimann Jan 20, 2025
3fded10
test: `sinh`, `cosh`, `tanh`
lars-reimann Jan 20, 2025
46c6743
test: `arsinh`, `arcosh`, `artanh`
lars-reimann Jan 20, 2025
5741373
test: `exp`
lars-reimann Jan 20, 2025
431d096
test: `round_to_significant_figures`
lars-reimann Jan 20, 2025
b330a4b
chore: normalize names of inverse trigonometric/hyperbolic functions
lars-reimann Jan 20, 2025
284b969
feat: add `cbrt`, `ln`, and `log10`
lars-reimann Jan 20, 2025
6d5ef18
test: `round_to_decimal_places`
lars-reimann Jan 20, 2025
4f5502b
test: `ln` and `log10`
lars-reimann Jan 20, 2025
0be396f
test: `cbrt`
lars-reimann Jan 20, 2025
a0df4d0
test: `log`
lars-reimann Jan 20, 2025
62e9008
test: update assertion
lars-reimann Jan 20, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 78 additions & 0 deletions src/safeds/data/tabular/query/_lazy_math_operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from typing import TYPE_CHECKING

from safeds._utils import _structural_hash
from safeds._validation import _check_bounds, _ClosedBound, _OpenBound
from safeds.data.tabular.containers._lazy_cell import _LazyCell
from safeds.data.tabular.query._math_operations import MathOperations

Expand Down Expand Up @@ -46,8 +47,85 @@ def __str__(self) -> str:
def abs(self) -> Cell:
return _LazyCell(self._expression.__abs__())

def acos(self) -> Cell:
return _LazyCell(self._expression.arccos())

def acosh(self) -> Cell:
return _LazyCell(self._expression.arccosh())

def asin(self) -> Cell:
return _LazyCell(self._expression.arcsin())

def asinh(self) -> Cell:
return _LazyCell(self._expression.arcsinh())

def atan(self) -> Cell:
return _LazyCell(self._expression.arctan())

def atanh(self) -> Cell:
return _LazyCell(self._expression.arctanh())

def cbrt(self) -> Cell:
return _LazyCell(self._expression.cbrt())

def ceil(self) -> Cell:
return _LazyCell(self._expression.ceil())

def cos(self) -> Cell:
return _LazyCell(self._expression.cos())

def cosh(self) -> Cell:
return _LazyCell(self._expression.cosh())

def degrees_to_radians(self) -> Cell:
return _LazyCell(self._expression.radians())

def exp(self) -> Cell:
return _LazyCell(self._expression.exp())

def floor(self) -> Cell:
return _LazyCell(self._expression.floor())

def ln(self) -> Cell:
return _LazyCell(self._expression.log())

def log(self, base: float) -> Cell:
_check_bounds("base", base, lower_bound=_OpenBound(0))
if base == 1:
raise ValueError("The base of the logarithm must not be 1.")

return _LazyCell(self._expression.log(base))

def log10(self) -> Cell:
return _LazyCell(self._expression.log10())

def radians_to_degrees(self) -> Cell:
return _LazyCell(self._expression.degrees())

def round_to_decimal_places(self, decimal_places: int) -> Cell:
_check_bounds("decimal_places", decimal_places, lower_bound=_ClosedBound(0))

return _LazyCell(self._expression.round(decimal_places))

def round_to_significant_figures(self, significant_figures: int) -> Cell:
_check_bounds("significant_figures", significant_figures, lower_bound=_ClosedBound(1))

return _LazyCell(self._expression.round_sig_figs(significant_figures))

def sign(self) -> Cell:
return _LazyCell(self._expression.sign())

def sin(self) -> Cell:
return _LazyCell(self._expression.sin())

def sinh(self) -> Cell:
return _LazyCell(self._expression.sinh())

def sqrt(self) -> Cell:
return _LazyCell(self._expression.sqrt())

def tan(self) -> Cell:
return _LazyCell(self._expression.tan())

def tanh(self) -> Cell:
return _LazyCell(self._expression.tanh())
Loading