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

[documentation][python] GradingPrimary: missing expected value type doc #1640

Closed
MrLixm opened this issue May 8, 2022 · 5 comments
Closed
Labels
Documentation Documentation related development and/or updates. good first issue Standard label for new developers to locate good issues to tackle to learn about OCIO development. help wanted Issues that the TSC has decided are worth implementing, but don't currently have the dev resources.

Comments

@MrLixm
Copy link

MrLixm commented May 8, 2022

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.

@carolalynn carolalynn added Documentation Documentation related development and/or updates. good first issue Standard label for new developers to locate good issues to tackle to learn about OCIO development. help wanted Issues that the TSC has decided are worth implementing, but don't currently have the dev resources. labels Apr 1, 2024
@sumana-2705
Copy link
Contributor

@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

@MrLixm
Copy link
Author

MrLixm commented Jun 27, 2024

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:
image
While the C++ documentation indicate the type:
image
https://opencolorio.readthedocs.io/en/latest/api/grading_transforms.html#gradingprimary

Hope this helps,
Liam.

@sumana-2705
Copy link
Contributor

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

@sumana-2705
Copy link
Contributor

sumana-2705 commented Jul 1, 2024

@MrLixm
I have opened a pull request, please review it suggest me if any changes required.
Thank you

doug-walker added a commit that referenced this issue Aug 9, 2024
…1640 (#1989)

* Update documentation: Specify types for GradingPrimary attributes

Signed-off-by: sumana sree <[email protected]>

* added pivotWhite and pivotBlack types to documentation

Signed-off-by: sumana sree <[email protected]>

---------

Signed-off-by: sumana sree <[email protected]>
Co-authored-by: Doug Walker <[email protected]>
@doug-walker
Copy link
Collaborator

Closing this as fixed in PR #1989.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation Documentation related development and/or updates. good first issue Standard label for new developers to locate good issues to tackle to learn about OCIO development. help wanted Issues that the TSC has decided are worth implementing, but don't currently have the dev resources.
Projects
None yet
Development

No branches or pull requests

4 participants