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

Fix for find_children() with stacks #1755

Conversation

darbyjohnston
Copy link
Contributor

Fixes #1652

After some investigation, it looks like the find_children() function was not working with stacks when given a search range. To fix this, an override is added for the function children_in_range() that works with "stacks" of children.

Signed-off-by: Darby Johnston <[email protected]>
Signed-off-by: Darby Johnston <[email protected]>
Signed-off-by: Darby Johnston <[email protected]>
Signed-off-by: Darby Johnston <[email protected]>
Signed-off-by: Darby Johnston <[email protected]>
Copy link
Collaborator

@jminor jminor left a comment

Choose a reason for hiding this comment

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

This is a great find & a clear fix.
Skimming the history of the codebase, I think this bug has existed since before the port from Python to C++. The implementation of children_in_range in Composition only works correctly for Tracks. This bug was likely introduced by the bisection optimization, but I didn't look back that far in the history to confirm.
I wonder if there's a general implementation that could go into Composition, and only the optimized one could be in Track, but since there are only 2 subclasses of Composition anyways, I think your fix is great and should be long lived.

@darbyjohnston
Copy link
Contributor Author

Thanks, I think the bug did predate the C++ port since the confidence tests didn't cover it. That's an interesting point about the optimization, If the bisect code was for Python it would be interesting to test how much it helps in C++.

@jminor
Copy link
Collaborator

jminor commented Jun 6, 2024

Oh, I thought of one other edge case... Could you try this with a Track that has a source_range trim on it? I suspect that the new function you made might need to use trimmed_range_in_parent instead of trimmed_range.

@darbyjohnston
Copy link
Contributor Author

I didn't realize tracks could have a source range, how does that affect the clips? If the track source range duration is shorter than the clips, are they trimmed?

reinecke and others added 9 commits June 12, 2024 16:16
…wareFoundation#1762)

Added fix for pip._vendor.distlib issue on windows msys2

Signed-off-by: Eric Reinecke <[email protected]>
* Prepare plugin detection for removal of the cmx_3600 adapter (AcademySoftwareFoundation#1488)

* add "extract_adapters" to CI triggers
* use "otiod" as override example

Signed-off-by: apetrynet <[email protected]>
Signed-off-by: Eric Reinecke <[email protected]>
Signed-off-by: Eric Reinecke <[email protected]>

* Extracted CMX3600 adapter and related sample data and tests (AcademySoftwareFoundation#1487)

* Removed the cmx_3600 adapter
* Removed sample data only used by the cmx_3600 adapter
* Add "extract_adapters" to CI triggers
* otioz test called for an edl we removed. Replaced with an otio file
* Converted screening_example.edl to screening_example.otio and used it in tests
* Removed other adapter suffixes from plugin tests as they belong to adapters soon to be extracted
* Autogenerated docs for CMX3600 removed

Signed-off-by: apetrynet <[email protected]>
Signed-off-by: Eric Reinecke <[email protected]>
Signed-off-by: Eric Reinecke <[email protected]>

* Extract AAF Adapter from OTIO core and establish separate git repo (AcademySoftwareFoundation#1348)

* Remove AAF adapter
* Add Note about the AAF adapter being moved

Signed-off-by: Mark Reid <[email protected]>
Signed-off-by: Eric Reinecke <[email protected]>
Signed-off-by: Eric Reinecke <[email protected]>

* Remove fcp adapter (AcademySoftwareFoundation#1501)

* removing the fcp adapter and it's test files
* replaced premiere_example.xml with premiere_example.otio to pass console tests.
* updated auto generated docs

Signed-off-by: apetrynet <[email protected]>
Signed-off-by: Eric Reinecke <[email protected]>
Signed-off-by: Eric Reinecke <[email protected]>

* Remove svg adapter (AcademySoftwareFoundation#1502)

* removed svg adapter and related test files
* updated auto documentation

Signed-off-by: apetrynet <[email protected]>
Signed-off-by: Eric Reinecke <[email protected]>
Signed-off-by: Eric Reinecke <[email protected]>

* Remove maya sequencer adapter related files (AcademySoftwareFoundation#1520)

* Remove maya adapter related files
* Update docs

Signed-off-by: rosborne132 <[email protected]>
Signed-off-by: Eric Reinecke <[email protected]>
Signed-off-by: Eric Reinecke <[email protected]>

* Remove fcp x xml adapter related files (AcademySoftwareFoundation#1529)

* remove fcp x xml adapter files
* update docs

Signed-off-by: rosborne132 <[email protected]>
Signed-off-by: Eric Reinecke <[email protected]>
Signed-off-by: Eric Reinecke <[email protected]>

* remove hls adapter related files (AcademySoftwareFoundation#1535)

Signed-off-by: rosborne132 <[email protected]>
Signed-off-by: Eric Reinecke <[email protected]>
Signed-off-by: Eric Reinecke <[email protected]>

* remove ale adapter related files (AcademySoftwareFoundation#1536)

* remove ale adapter related files

Signed-off-by: rosborne132 <[email protected]>
Signed-off-by: Eric Reinecke <[email protected]>
Signed-off-by: Eric Reinecke <[email protected]>

* Remove burnins adapter related files (AcademySoftwareFoundation#1537)

* extract burnin files
* remove test

Signed-off-by: rosborne132 <[email protected]>
Signed-off-by: Eric Reinecke <[email protected]>
Signed-off-by: Eric Reinecke <[email protected]>

* extract xges adapter files (AcademySoftwareFoundation#1538)

* extract xges adapter files

Signed-off-by: rosborne132 <[email protected]>
Signed-off-by: Eric Reinecke <[email protected]>
Signed-off-by: Eric Reinecke <[email protected]>

* Remove the remains of "contrib"

* Removed the "contrib" directory tree and all references to the contrib adapters.
* Plugin system, setup and auto doc scripts no longer rely on contrib files.
* Also removed some entries on other adapters left behind in the adapters.md file.
* add README_contrib.md to the manifest

Signed-off-by: apetrynet <[email protected]>
Signed-off-by: Eric Reinecke <[email protected]>
Signed-off-by: Eric Reinecke <[email protected]>

* fixed `doc-plugins-update` when custom hooks are in environment (AcademySoftwareFoundation#1644)

Signed-off-by: Tim Lehr <[email protected]>
Signed-off-by: Eric Reinecke <[email protected]>
Signed-off-by: Eric Reinecke <[email protected]>

* added support for pathlib.Path filepath arguments for adapter IO functions (AcademySoftwareFoundation#1704)

Signed-off-by: Tim Lehr <[email protected]>
Signed-off-by: Eric Reinecke <[email protected]>
Signed-off-by: Eric Reinecke <[email protected]>

* Removed orphaned FCP XML adapter post-rebase.

Signed-off-by: Eric Reinecke <[email protected]>

* Update README.md to point users to the adapter repos

Co-authored-by: Daniel Flehner Heen <[email protected]>
Signed-off-by: Eric Reinecke <[email protected]>

* Updated documentation about adapters to better reflect the current landscape

Signed-off-by: Eric Reinecke <[email protected]>

* Removed contrib plugin manifest from package data

Signed-off-by: Eric Reinecke <[email protected]>

* Removed extract_adapters branch from CI references

Signed-off-by: Eric Reinecke <[email protected]>

---------

Signed-off-by: apetrynet <[email protected]>
Signed-off-by: Eric Reinecke <[email protected]>
Signed-off-by: Eric Reinecke <[email protected]>
Signed-off-by: Mark Reid <[email protected]>
Signed-off-by: rosborne132 <[email protected]>
Signed-off-by: Tim Lehr <[email protected]>
Co-authored-by: Daniel Flehner Heen <[email protected]>
Co-authored-by: Mark Reid <[email protected]>
Co-authored-by: Rob Osborne <[email protected]>
Co-authored-by: Tim Lehr <[email protected]>
Signed-off-by: Darby Johnston <[email protected]>
Signed-off-by: Darby Johnston <[email protected]>
Signed-off-by: Darby Johnston <[email protected]>
Signed-off-by: Darby Johnston <[email protected]>
Signed-off-by: Darby Johnston <[email protected]>
@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 88.23529% with 2 lines in your changes missing coverage. Please review.

Project coverage is 81.68%. Comparing base (c0e97b0) to head (d8ab747).
Report is 11 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1755      +/-   ##
==========================================
- Coverage   84.11%   81.68%   -2.44%     
==========================================
  Files         198      176      -22     
  Lines       22241    12342    -9899     
  Branches     4687     3023    -1664     
==========================================
- Hits        18709    10082    -8627     
+ Misses       2610     1718     -892     
+ Partials      922      542     -380     
Flag Coverage Δ
py-unittests 81.68% <88.23%> (-2.44%) ⬇️

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

Files Coverage Δ
src/opentimelineio/composition.h 65.51% <ø> (ø)
src/opentimelineio/stackAlgorithm.cpp 56.70% <100.00%> (ø)
...opentimelineio/opentimelineio/adapters/__init__.py 85.18% <100.00%> (-2.32%) ⬇️
...timelineio/console/autogen_plugin_documentation.py 64.10% <ø> (-7.94%) ⬇️
...-opentimelineio/opentimelineio/plugins/manifest.py 87.50% <ø> (+2.88%) ⬆️
tests/test_builtin_adapters.py 96.29% <ø> (+0.46%) ⬆️
tests/test_console.py 95.31% <ø> (-0.02%) ⬇️
tests/test_examples.py 90.00% <ø> (-0.48%) ⬇️
tests/test_otiod.py 96.87% <ø> (-0.05%) ⬇️
tests/test_otioz.py 97.93% <ø> (-0.03%) ⬇️
... and 4 more

... and 57 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 4b3b673...d8ab747. Read the comment docs.

@darbyjohnston
Copy link
Contributor Author

Replaced by #1766.

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.

find_children is broken with two tracks.
4 participants