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

Update minimum_unit handling of naturaldelta and naturaltime #142

Merged
merged 4 commits into from
Aug 30, 2020
Merged

Update minimum_unit handling of naturaldelta and naturaltime #142

merged 4 commits into from
Aug 30, 2020

Conversation

hugovk
Copy link
Collaborator

@hugovk hugovk commented Jul 15, 2020

Fixes #75 (comment).

Changes proposed in this pull request:

  • Upgrade the unit for naturaldelta or naturaltime, even if minimum_unit is lower

TODO

  • Update docstrings
  • Should naturaldelta(delta=FOUR_MICROSECONDS, minimum_unit="milliseconds") return "a moment" instead of "0 milliseconds"? (And similarly for naturaltime)

@hugovk hugovk added the changelog: Fixed For any bug fixes label Jul 15, 2020
@codecov-commenter
Copy link

codecov-commenter commented Jul 15, 2020

Codecov Report

Merging #142 into master will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master      #142   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            9         9           
  Lines          554       556    +2     
=========================================
+ Hits           554       556    +2     
Flag Coverage Δ
#GHA_Ubuntu 100.00% <100.00%> (ø)
#GHA_Windows 100.00% <100.00%> (ø)
#GHA_macOS 100.00% <100.00%> (ø)

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

Impacted Files Coverage Δ
src/humanize/time.py 100.00% <100.00%> (ø)
tests/test_time.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f09cd62...4d52d00. Read the comment docs.

@hugovk hugovk changed the title Update minimum unit handling Update minimum_unit handling of naturaldelta and naturaltime Jul 15, 2020
@hugovk
Copy link
Collaborator Author

hugovk commented Aug 30, 2020

  • Should naturaldelta(delta=FOUR_MICROSECONDS, minimum_unit="milliseconds") return "a moment" instead of "0 milliseconds"? (And similarly for naturaltime)

Leaving existing behaviour for now.

@hugovk hugovk merged commit 0397654 into jmoiron:master Aug 30, 2020
@hugovk hugovk deleted the update-minimum_unit-handling branch August 30, 2020 14:39
@hugovk hugovk mentioned this pull request Sep 10, 2020
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.

Support milliseconds, microseconds etc.
2 participants