Skip to content

Add python bindings for the edit functions - #2077

Merged
darbyjohnston merged 3 commits into
AcademySoftwareFoundation:mainfrom
darbyjohnston:edit-python-bindings
Nov 27, 2026
Merged

darbyjohnston merged 3 commits into
AcademySoftwareFoundation:mainfrom
darbyjohnston:edit-python-bindings

Conversation

@darbyjohnston

@darbyjohnston darbyjohnston commented Oct 23, 2026 •

Copy link
Copy Markdown
Collaborator

This PR adds Python bindings for the editing functions: src/opentimelineio/algo/editAlgorithm.h

Assisted-by: Claude Code / Claude Opus 5.5

@codecov-commenter

codecov-commenter commented Oct 23, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 93.86503% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 87.33%. Comparing base (36e8d4c) to head (7c61617).

Files with missing lines Patch % Lines
...eio/opentimelineio-bindings/otio_editAlgorithm.cpp 90.24% 8 Missing ⚠️
tests/test_edit_algo.py 96.96% 1 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2077      +/-   ##
==========================================
+ Coverage   86.70%   87.33%   +0.63%     
==========================================
  Files         186      189       +3     
  Lines       13762    13925     +163     
  Branches     1280     1273       -7     
==========================================
+ Hits        11932    12162     +230     
+ Misses       1660     1592      -68     
- Partials      170      171       +1     
Flag Coverage Δ
cpp-unittests 64.67% <ø> (ø)
py-unittests 85.69% <93.86%> (+1.82%) ⬆️

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

Files with missing lines Coverage Δ
...melineio/opentimelineio-bindings/otio_bindings.cpp 98.64% <100.00%> (+<0.01%) ⬆️
...entimelineio/opentimelineio/algorithms/__init__.py 100.00% <100.00%> (ø)
...y-opentimelineio/opentimelineio/algorithms/edit.py 100.00% <100.00%> (ø)
tests/test_edit_algo.py 96.96% <96.96%> (ø)
...eio/opentimelineio-bindings/otio_editAlgorithm.cpp 90.24% <90.24%> (ø)

... and 3 files with indirect coverage changes


Continue to review full report in Codecov by Harness.

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

The functions in algo/editAlgorithm.h (overwrite, insert, trim, slice,
slip, slide, ripple, roll, fill and remove) and the ReferencePoint enum
are available as otio.algorithms.edit. The tests check that each one can
be called from Python; the algorithms are tested in C++.

Signed-off-by: Darby Johnston <darbyjohnston@yahoo.com>
@darbyjohnston

Copy link
Copy Markdown
Collaborator Author

Fixes from the original PR split out here:
#2079

@jhodges10

Copy link
Copy Markdown
Collaborator

@darbyjohnston is it worth setting up a CI job that checks the coverage of the C++ functions for python coverage going forwards, similar to the one that checks for test coverage and posting that as a comment?

@darbyjohnston

Copy link
Copy Markdown
Collaborator Author

I think the edit functions didn't have Python bindings because they were considered experimental:
#1654

They have been in C++ API for a few years now, so it seems reasonable to also include them with Python.

@jhodges10

Copy link
Copy Markdown
Collaborator

I think the edit functions didn't have Python bindings because they were considered experimental: #1654

They have been in C++ API for a few years now, so it seems reasonable to also include them with Python.

I would agree with that assessment.

@darbyjohnston darbyjohnston added the enhancement A request for something new. label Nov 20, 2026

@timlehr timlehr left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks @darbyjohnston. Awesome to get these finally into Python. Anything holding this back still? Code seems fine to me.

@darbyjohnston

Copy link
Copy Markdown
Collaborator Author

I think this is ready, there is a related PR with some possible bug fixes for the functions (#2079), but that doesn't have to hold up this one.

@timlehr

timlehr commented Nov 24, 2026

Copy link
Copy Markdown
Member

@darbyjohnston Sweet, I'd say land this, before it gets stale.

@camkerr camkerr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I actually used these python functions in my review of #2079

Worked great for me. Here's the link to that review and my sample files if anyone would like to take a look:

#2079 (review)

@darbyjohnston

Copy link
Copy Markdown
Collaborator Author

Thanks for the reviews! I'll go ahead and merge...

@darbyjohnston
darbyjohnston merged commit a501b17 into AcademySoftwareFoundation:main Nov 27, 2026
67 checks passed
@github-project-automation github-project-automation Bot moved this from In Progress to Done in OpenTimelineIO Release 1.0 Nov 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement A request for something new.

Projects

Development

Successfully merging this pull request may close these issues.

5 participants