AcademySoftwareFoundation / AcademySoftwareFoundation/OpenTimelineIO

`RationalTime.__add__` always uses the higher rate

Open
#262 0 comments 0 reactions 1 assignee Claimed by @ssteinbach View on GitHub
needs discussion time calculations
Dominant language
C++
Stars
2k
Forks
351
Avg merge
1d 12h
Merged PRs (30d)
1

Description

Currently when you have:
```python
a = RationalTime(0, 12)
b = RationalTime(10, 24)
c = a + b
d = b + a

c.rate == d.rate == 24
# True
```
Both `c` and `d` will be at rate 24, because the `__add__` method always produces a `RationalTime` in the higher of the two rates. This might be the correct behavior, or it could be unpredictable.

A potential alternative would use the order of the arguments to choose which rate to use in the product. I'm filing this issue to see if anyone objects to this behavior or if we should leave it the way it is.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.