Skip to content

Conversation

@drculhane
Copy link
Contributor

Closes #5132 and #5149.

This takes the place of PR #5204.

  • The binops in pdarrayclass.py now give a RuntimeWarning or a Floating Point Error (or nothing) if / or // cause a divide-by-zero, depending on the "divide" setting of ak.errstate.

  • Because the RuntimeWarning surfaced an issue in arctan2, I've rewritten that function somewhat. It now has an "out" parameter matching numpy, and uses the "where" parameter correctly.

  • arctan2 now also accepts bool inputs, which requires special handling. np.arctan2, if given bool inputs, returns np.float16, which arkouda doesn't like.

  • Most of the original arctan2 function remains as _arctan2_, because (subjective opinion here) I think that calling it as a separate function improves the readability of the code.

  • In doing this rewriting, I removed some mypy ignores that are no longer needed.

  • I rewrote the unit tests for arctan2 to use our newer assert functions. I think this cleans up that code significantly. In the cases that use "where," I check both the returned result, and the returned "out" pdarray, since they should match.

@codecov
Copy link

codecov bot commented Jan 15, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (main@d780663). Learn more about missing BASE report.

Additional details and impacted files
@@           Coverage Diff            @@
##             main     #5315   +/-   ##
========================================
  Coverage        ?   100.00%           
========================================
  Files           ?         4           
  Lines           ?        63           
  Branches        ?         0           
========================================
  Hits            ?        63           
  Misses          ?         0           
  Partials        ?         0           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

floor division by zero doesn't match numpy

1 participant