Skip to content

Conversation

@cochang-dwa
Copy link
Contributor

@cochang-dwa cochang-dwa commented Sep 26, 2025

Description

Closes #4752

Add Python type hints into documentation, in places where example code defines a function. That ended up being just src/doc/pythonbindings.rst. I also updated testsuite/runtest.py and the functions in testsuite/docs-examples-python/src/docs-examples-*.py.

While I was in pythonbindings.rst, I noticed a couple places with py::method (note the double colon). These lines didn't render in the docs, so I removed the extra colon to match other usage.

Tests

I locally built the docs to make sure html looks good. I ran the tests with ctest and the tests ran, so I'm taking that as a sign that runtest.py still works.

Checklist:

  • I have read the contribution guidelines.
  • I have updated the documentation, if applicable. (Check if there is no
    need to update the documentation, for example if this is a bug fix that
    doesn't change the API.)
  • I have ensured that the change is tested somewhere in the testsuite
    (adding new test cases if necessary).
  • If I added or modified a C++ API call, I have also amended the
    corresponding Python bindings (and if altering ImageBufAlgo functions, also
    exposed the new functionality as oiiotool options).
  • My code follows the prevailing code style of this project. If I haven't
    already run clang-format before submitting, I definitely will look at the CI
    test that runs clang-format and fix anything that it highlights as being
    nonconforming.

Signed-off-by: Connie Chang <[email protected]>
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Sep 26, 2025

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: cochang-dwa / name: Connie Chang (f815440)

Copy link
Collaborator

@lgritz lgritz left a comment

Choose a reason for hiding this comment

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

Looks good, thanks for the improvements! Merging.



.. py::method:: TypeDesc.TypeDesc(typename='unknown')
.. py:method:: TypeDesc.TypeDesc(typename='unknown')
Copy link
Collaborator

Choose a reason for hiding this comment

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

oh, good catch on these!

@lgritz lgritz merged commit b570c0a into AcademySoftwareFoundation:main Sep 27, 2025
31 checks passed
@lgritz lgritz added python Python APIs docs Documentation devdays25 DevDays 2025 project labels Sep 27, 2025
lgritz pushed a commit to lgritz/OpenImageIO that referenced this pull request Sep 27, 2025
Closes AcademySoftwareFoundation#4752

Add Python type hints into documentation, in places where example code
defines a function. That ended up being just
`src/doc/pythonbindings.rst`. I also updated `testsuite/runtest.py` and
the functions in `testsuite/docs-examples-python/src/docs-examples-*.py`.

While I was in `pythonbindings.rst`, I noticed a couple places with
`py::method` (note the double colon). These lines didn't render in the
docs, so I removed the extra colon to match other usage.

I locally built the docs to make sure html looks good. I ran the tests
with `ctest` and the tests ran, so I'm taking that as a sign that
`runtest.py` still works.

Signed-off-by: Connie Chang <[email protected]>
@cochang-dwa
Copy link
Contributor Author

Awesome, thank you @lgritz!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

devdays25 DevDays 2025 project docs Documentation python Python APIs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Python: add type annotations to all examples and documentation

2 participants