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

Fix naturaldelta sub second precision #169

Merged

Conversation

wolf1986
Copy link
Contributor

@wolf1986 wolf1986 commented Feb 2, 2024

Fixes #154

Changes proposed in this pull request:

  • Convert to float and not to int
  • Explicitly drop support from 'inf' & 'nan' that are supported by float
  • In tests, assert both float & timedelta variants are equivalent

@wolf1986 wolf1986 changed the title Bugfix/naturaldelta sub second precision Fix naturaldelta sub second precision Feb 2, 2024
Copy link

codecov bot commented Feb 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.19%. Comparing base (a28cb80) to head (c94f951).
Report is 9 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #169   +/-   ##
=======================================
  Coverage   99.19%   99.19%           
=======================================
  Files           9        9           
  Lines         746      748    +2     
=======================================
+ Hits          740      742    +2     
  Misses          6        6           
Flag Coverage Δ
macos-latest 97.59% <100.00%> (+<0.01%) ⬆️
ubuntu-latest 97.59% <100.00%> (+<0.01%) ⬆️
windows-latest 96.12% <100.00%> (+0.01%) ⬆️

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.

@hugovk hugovk added the changelog: Fixed For any bug fixes label Feb 24, 2024
src/humanize/time.py Outdated Show resolved Hide resolved
@hugovk hugovk merged commit 1399e04 into python-humanize:main Feb 24, 2024
30 checks passed
@hugovk
Copy link
Member

hugovk commented Feb 24, 2024

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog: Fixed For any bug fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

naturaldelta failing with float input and sub-second precision
2 participants