[documentation][python] GradingPrimary: missing expected value type doc
Hello, When looking at the GradingPrimary class documentation (https://opencolorio.readthedocs.io/en/latest/api/grading_transforms.html), we can see a bunch of property is available but none of them specifies which type of value is expected when set.
This would have not been an issue if they all except the same type but seems some except a GradingRGBM instance while others just expect a float.
Would be cool to have in the documentation what type is expected.
Here are the tests I ran to check who accepts what
import unittest
import PyOpenColorIO as ocio
class OcioGradingPrimary(unittest.TestCase):
@staticmethod
def to_rgbm(v):
rgbm = ocio.GradingRGBM()
rgbm.master = v
return rgbm
def test_properties(self):
gp = ocio.GradingPrimary(ocio.GRADING_LIN)
gp.brightness = self.to_rgbm(0.18)
gp.clampBlack = 0.18
gp.clampWhite = 0.18
gp.contrast = self.to_rgbm(0.18)
gp.exposure = self.to_rgbm(0.18)
gp.gain = self.to_rgbm(0.18)
gp.gamma = self.to_rgbm(0.18)
gp.lift = self.to_rgbm(0.18)
gp.offset = self.to_rgbm(0.18)
gp.pivot = 0.18
gp.saturation = 0.18
gp.brightness = self.to_rgbm(0.18)
with self.assertRaises(TypeError): gp.clampBlack = self.to_rgbm(0.18)
with self.assertRaises(TypeError): gp.clampWhite = self.to_rgbm(0.18)
gp.contrast = self.to_rgbm(0.18)
gp.exposure = self.to_rgbm(0.18)
gp.gain = self.to_rgbm(0.18)
gp.gamma = self.to_rgbm(0.18)
gp.lift = self.to_rgbm(0.18)
gp.offset = self.to_rgbm(0.18)
with self.assertRaises(TypeError): gp.pivot = self.to_rgbm(0.18)
with self.assertRaises(TypeError): gp.saturation = self.to_rgbm(0.18)
if __name__ == "__main__":
unittest.main()
Cheers. Liam.
@MrLixm can you help me where can I get to know more about this documentation to gain knowledge in type of expected value? I want to work on this
Hello, sorry but I am not familiar with how the OCIO documentation is built.
I am only an user for it and as mentioned in the first message the python documentation doesn't mention which data type must be used:
While the C++ documentation indicate the type:
https://opencolorio.readthedocs.io/en/latest/api/grading_transforms.html#gradingprimary
Hope this helps, Liam.
yeah it works, thanks for information, should I need to perform additional tests or update the results based on these test results, which was provided by you, that is which property accepts which type? @MrLixm
@MrLixm I have opened a pull request, please review it suggest me if any changes required. Thank you
Closing this as fixed in PR #1989.