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

Add utility functions for comparison and rounding #1623

Merged
merged 3 commits into from Dec 6, 2023

Conversation

darbyjohnston
Copy link
Contributor

Fixes #1622

This PR adds a few utility functions to RationalTime for comparison and rounding:

  • A function that compares whether two RationalTimes have the same value and rate. This is different from the "==" operator which scales the time before comparison (e.g., otime::RationalTime(30.2) == otime::RationalTime(60.4, 2.0)).
  • Rounding functions that return the floor(), ceil(), and round() of a RationalTime.

If these seem useful I can also add Python bindings for them.

Signed-off-by: Darby Johnston <darbyjohnston@yahoo.com>
@codecov-commenter
Copy link

codecov-commenter commented Jun 11, 2023

Codecov Report

Merging #1623 (0012fe1) into main (45c6cfd) will decrease coverage by 0.08%.
Report is 9 commits behind head on main.
The diff coverage is 84.37%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1623      +/-   ##
==========================================
- Coverage   79.91%   79.84%   -0.08%     
==========================================
  Files         197      197              
  Lines       21731    21792      +61     
  Branches     4339     4358      +19     
==========================================
+ Hits        17367    17399      +32     
- Misses       2213     2232      +19     
- Partials     2151     2161      +10     
Flag Coverage Δ
py-unittests 79.84% <84.37%> (-0.08%) ⬇️

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

Files Coverage Δ
src/opentime/timeRange.h 98.18% <100.00%> (ø)
tests/test_opentime.py 99.74% <100.00%> (+<0.01%) ⬆️
src/opentime/rationalTime.h 93.61% <87.50%> (-0.71%) ⬇️
...lineio/opentime-bindings/opentime_rationalTime.cpp 58.25% <0.00%> (-2.36%) ⬇️

... and 21 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

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

Signed-off-by: Darby Johnston <darbyjohnston@yahoo.com>
@darbyjohnston darbyjohnston marked this pull request as ready for review June 12, 2023 16:43
@meshula
Copy link
Collaborator

meshula commented Jun 12, 2023

Looking good to me, maybe get a second approval :)

Signed-off-by: Darby Johnston <darbyjohnston@yahoo.com>
@meshula
Copy link
Collaborator

meshula commented Dec 6, 2023

Thanks Darby!

@meshula meshula merged commit f9f3889 into AcademySoftwareFoundation:main Dec 6, 2023
39 checks passed
@reinecke reinecke added this to the Public Beta 16 milestone Mar 25, 2024
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 utility functions for comparison and rounding
6 participants