Skip to content

Conversation

JeanChristopheMorinPerso
Copy link
Member

@JeanChristopheMorinPerso JeanChristopheMorinPerso commented Oct 4, 2022

Summarize your change.

A couple of months ago, I noticed that the drop_frame parameter of the RationalTime.to_timecode method was using py::object as its type. This is confusing for the user.

With the change, running help(opentimelineio.opentime.RationalTime.to_timecode) returns:

to_timecode(...)
    to_timecode(*args, **kwargs)
    Overloaded function.
    
    1. to_timecode(self: opentimelineio._opentime.RationalTime, rate: float, drop_frame: Optional[bool]) -> str

And it still works as before:

>>> opentimelineio.opentime.RationalTime(30 * 59 + 30).to_timecode(29.97, 0)
'00:29:58:06'
>>> opentimelineio.opentime.RationalTime(30 * 59 + 30).to_timecode(29.97, False)
'00:29:58:06'
>>> opentimelineio.opentime.RationalTime(30 * 59 + 30).to_timecode(29.97, 1)
'00:30:00;00'
>>> opentimelineio.opentime.RationalTime(30 * 59 + 30).to_timecode(29.97, True)
'00:30:00;00'
>>> opentimelineio.opentime.RationalTime(30 * 59 + 30).to_timecode(29.97, None)
'00:30:00;00'

@JeanChristopheMorinPerso JeanChristopheMorinPerso deleted the optional_drop_frame_arg branch October 5, 2022 14:22
@JeanChristopheMorinPerso JeanChristopheMorinPerso restored the optional_drop_frame_arg branch October 5, 2022 14:22
@codecov-commenter
Copy link

Codecov Report

Merging #1443 (b0d5ce4) into main (21970b8) will decrease coverage by 1.70%.
The diff coverage is 100.00%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1443      +/-   ##
==========================================
- Coverage   86.38%   84.67%   -1.71%     
==========================================
  Files         201      203       +2     
  Lines       20854    22547    +1693     
  Branches     2298     4530    +2232     
==========================================
+ Hits        18014    19092    +1078     
- Misses       2244     2396     +152     
- Partials      596     1059     +463     
Flag Coverage Δ
py-unittests 84.67% <100.00%> (-1.71%) ⬇️

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

Impacted Files Coverage Δ
...pentimelineio/opentimelineio-bindings/otio_utils.h 75.28% <ø> (-1.19%) ⬇️
...lineio/opentime-bindings/opentime_rationalTime.cpp 95.49% <100.00%> (+1.66%) ⬆️
...entimelineio-bindings/otio_serializableObjects.cpp 53.79% <0.00%> (-37.79%) ⬇️
...eio/opentimelineio-bindings/otio_anyDictionary.cpp 70.58% <0.00%> (-29.42%) ⬇️
...elineio/opentimelineio-bindings/otio_anyVector.cpp 72.22% <0.00%> (-27.78%) ⬇️
...ntimelineio/opentimelineio-bindings/otio_tests.cpp 50.37% <0.00%> (-20.05%) ⬇️
src/opentimelineio/typeRegistry.h 81.25% <0.00%> (-18.75%) ⬇️
src/opentimelineio/composition.h 70.37% <0.00%> (-18.52%) ⬇️
...ntimelineio/opentimelineio-bindings/otio_imath.cpp 45.79% <0.00%> (-15.75%) ⬇️
src/opentimelineio/track.cpp 80.14% <0.00%> (-11.16%) ⬇️
... and 50 more

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 21970b8...b0d5ce4. Read the comment docs.

@ssteinbach ssteinbach added this to the Public Beta 16 milestone Oct 5, 2022
Signed-off-by: Jean-Christophe Morin <[email protected]>
Copy link
Collaborator

@ssteinbach ssteinbach left a comment

Choose a reason for hiding this comment

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

Looks pretty good, just wanted to make sure that I understand the new header and how it ties into this change.

Signed-off-by: Jean-Christophe Morin <[email protected]>
@ssteinbach ssteinbach merged commit 76f7419 into AcademySoftwareFoundation:main Oct 12, 2022
@JeanChristopheMorinPerso JeanChristopheMorinPerso deleted the optional_drop_frame_arg branch October 12, 2022 03:44
MichaelPlug pushed a commit to MichaelPlug/OpenTimelineIO that referenced this pull request Aug 5, 2023
…ecode method (AcademySoftwareFoundation#1443)

* Improve typing of the drop_frame parameter on the RationalTime.to_timecode method

Signed-off-by: Jean-Christophe Morin <[email protected]>
Signed-off-by: Michele Spina <[email protected]>
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.

3 participants