Skip to content

Aligns round function to numpy, adds unit tests#5396

Open
drculhane wants to merge 3 commits intoBears-R-Us:mainfrom
drculhane:Closes-5386
Open

Aligns round function to numpy, adds unit tests#5396
drculhane wants to merge 3 commits intoBears-R-Us:mainfrom
drculhane:Closes-5386

Conversation

@drculhane
Copy link
Contributor

@drculhane drculhane commented Feb 4, 2026

Closes #5386

This aligns round to numpy by:

(1) removing the "where" parameter (numpy round doesn't have this),
(2) adding a "decimals" parameter to allow for rounding to a number of decimal places,
(3) implementing numpy's "round to even" (e.g. 2.5 rounds to 2, but 3.5 rounds to 4).

It also adds unit tests for round. There hadn't been any.

@codecov
Copy link

codecov bot commented Feb 4, 2026

Codecov Report

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

Additional details and impacted files
@@           Coverage Diff            @@
##             main     #5396   +/-   ##
========================================
  Coverage        ?   100.00%           
========================================
  Files           ?         5           
  Lines           ?       115           
  Branches        ?         0           
========================================
  Hits            ?       115           
  Misses          ?         0           
  Partials        ?         0           
Flag Coverage Δ
python-coverage 100.00% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ 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.

@drculhane drculhane marked this pull request as ready for review February 4, 2026 13:46
Copy link
Contributor

@ajpotts ajpotts left a comment

Choose a reason for hiding this comment

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

Thanks!

@ajpotts ajpotts enabled auto-merge February 4, 2026 17:52
@ajpotts ajpotts added this pull request to the merge queue Feb 4, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Feb 4, 2026
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.

Add a decimal parameter to round, to match numpy

2 participants