Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEAT] Implements other trigonometry expressions #2123

Merged
merged 3 commits into from
Apr 15, 2024

Conversation

MeepoWin
Copy link
Contributor

@MeepoWin MeepoWin commented Apr 15, 2024

The only trigonometric function we are missing from Ibis is arctan2, which I will implement in other PRs.

This closes #1908
This closes #1915

@MeepoWin MeepoWin marked this pull request as ready for review April 15, 2024 06:52
@samster25 samster25 added the enhancement New feature or request label Apr 15, 2024
tests/table/test_eval.py Show resolved Hide resolved
if not is_arc:
table = MicroPartition.from_pydict({"a": [0.0, math.pi, math.pi / 2, math.nan]})
else:
table = MicroPartition.from_pydict({"a": [0.0, 1, 0.5, math.nan]})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should also have tests to ensure behavior for non valid values. A panic is probably fine!
I ran a test case on duckdb for asin for pi.
image

Copy link
Contributor Author

@MeepoWin MeepoWin Apr 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair enough. However, I think nan is more appropriate(this is also the behavior of this PR), because there may be only a few invalid values in a series at any one time, but panic will stop the world. You can always use something like dropNan to filter out invalid values if needed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That seems reasonable

Copy link
Member

@samster25 samster25 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MeepoWin You're so fast at this now! 🥇

@samster25 samster25 merged commit 2d036a2 into Eventual-Inc:main Apr 15, 2024
29 checks passed
@colin-ho colin-ho mentioned this pull request May 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[EXPRESSIONS] .radians [EXPRESSIONS] .degrees
2 participants