jiffy icon indicating copy to clipboard operation
jiffy copied to clipboard

add quarter-year and half-year support

Open dJani97 opened this issue 2 years ago • 2 comments

What does this PR do?

Adds quarter-year and half-year support to Jiffy. Added docs. Also added unit tests to cover these new units. Pun intended.

This solves https://github.com/jama5262/jiffy/issues/123

Although I didn't have to modify any code related to monthly and yearly difference calculations, two unit tests kept failing with a margin of ~0.0005. These tests fail even if I pull your unmodified version of develop and try running the tests on my machine. Maybe a newer version of Dart handles floats slightly differently? I updated these two tests since the difference was so marginal.

Types of changes

  • [ ] Bug fix (non-breaking change which fixes an issue)
  • [x] New feature (non-breaking change which adds functionality)
  • [ ] Breaking change (a fix or feature that would cause existing functionality to change)

Checklist

  • [x] Directed the PR to develop branch and not the master branch
  • [x] Wrote additional tests, if needed
  • [x] All tests have passed
  • [x] I have updated the documentation accordingly, if needed.

dJani97 avatar Feb 10 '22 22:02 dJani97

Fixed the formatting and pushed. Please run the CI again.

dJani97 avatar Feb 11 '22 17:02 dJani97

@jama5262 interestingly the unit tests on this CI seem to yield slightly different results when compared to running them on my own Windows machine.

Expected: <-0.15033557046979865>
    Actual: <-0.15053763440860216>

This actually passed on my computer.

Is this normal? Should I just push a commit with the "CI values" to let this test pass?

dJani97 avatar Feb 16 '22 11:02 dJani97

There is a new major version of Jiffy that has been released with major changes, please feel free to open another PR with the changes you desire to be added to Jiffy, closing this PR for now

jama5262 avatar Mar 11 '23 12:03 jama5262