AcademySoftwareFoundation / AcademySoftwareFoundation/OpenColorIO
[python][feature-request] `GradingPrimary` : fail to assertEqual 2 similar instances
- Dominant language
- C++
- Stars
- 2.1k
- Forks
- 503
- PR merge metrics
- No merged PRs in 30d
Description
Hello, same as in #1641, seems 2 similar `ocio.GradingPrimary` instance doesn't assert equal.
```python
import unittest
import PyOpenColorIO as ocio
class OcioGradingPrimary(unittest.TestCase):
def test_equal1(self):
gp1 = ocio.GradingPrimary(ocio.GRADING_LIN)
gp1.saturation = 0.3
gp2 = ocio.GradingPrimary(ocio.GRADING_LIN)
gp2.saturation = 0.3
self.assertEqual(gp1, gp2)
def test_equal2(self):
gp1 = ocio.GradingPrimary(ocio.GRADING_LOG)
gp1.contrast = ocio.GradingRGBM(0.5, 0.5, 0.5, 0.0)
gp2 = ocio.GradingPrimary(ocio.GRADING_LOG)
gp1.contrast = ocio.GradingRGBM(0.5, 0.5, 0.5, 0.0)
self.assertEqual(gp1, gp2)
if __name__ == "__main__":
unittest.main()
```
CONTEXT: OCIO 2.1.1
I assume it's not an expected behaviour?
Cheers.
Liam.
Contributor guide
Research direction
Start by running the Python reproducer for PyOpenColorIO.GradingPrimary and compare the two assertEqual cases. Trace the GradingPrimary equality behavior in the Python bindings and add or update focused tests so equivalent instances compare equal, including the linear and logarithmic examples shown.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, python
- Domain
- computer-graphics
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100