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 trigonometry expressions: arctanh arccosh arcsinh #2476

Merged

Conversation

fedemagnani
Copy link
Contributor

Closes #2470
Closes #2471
Closes #2472

@github-actions github-actions bot added documentation Improvements or additions to documentation enhancement New feature or request labels Jul 3, 2024
@fedemagnani
Copy link
Contributor Author

requesting review @colin-ho

Copy link
Contributor

@colin-ho colin-ho left a comment

Choose a reason for hiding this comment

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

Thanks for this @fedemagnani ! Just 2 small nits and this PR should be good to go

@@ -367,6 +367,51 @@ def test_table_numeric_atan2_literals() -> None:
)


def test_table_numeric_arctanh() -> None:
table = MicroPartition.from_pydict({"a": [0.0, 0.5, 0.9, -0.9, -0.5, -0.0, math.nan]})
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you also test that for values |x| >= 1, the arctanh expression returns Nan?



def test_table_numeric_arccosh() -> None:
table = MicroPartition.from_pydict({"a": [1.0, 2.0, 1.5, math.nan]})
Copy link
Contributor

Choose a reason for hiding this comment

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

And here, if you could also test that values x < 1 evaluate to NaN

@fedemagnani fedemagnani requested a review from colin-ho July 5, 2024 14:15
Copy link

codecov bot commented Jul 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Please upload report for BASE (main@3752740). Learn more about missing BASE report.
Report is 2 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #2476   +/-   ##
=======================================
  Coverage        ?   63.43%           
=======================================
  Files           ?      947           
  Lines           ?   106377           
  Branches        ?        0           
=======================================
  Hits            ?    67479           
  Misses          ?    38898           
  Partials        ?        0           
Files Coverage Δ
daft/expressions/expressions.py 93.54% <100.00%> (ø)
daft/series.py 91.09% <100.00%> (ø)
src/daft-core/src/array/ops/trigonometry.rs 89.74% <100.00%> (ø)
src/daft-core/src/python/series.rs 95.07% <100.00%> (ø)
src/daft-dsl/src/functions/numeric/mod.rs 100.00% <100.00%> (ø)
src/daft-dsl/src/python.rs 92.23% <100.00%> (ø)

Copy link
Contributor

@colin-ho colin-ho left a comment

Choose a reason for hiding this comment

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

Awesome, thanks for this contribution @fedemagnani !

@colin-ho colin-ho merged commit 42e5b46 into Eventual-Inc:main Jul 5, 2024
43 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add arctanh expression Add arcsinh expression Add arccosh expression
2 participants