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

Sphinx Python Documentation #1567

Draft
wants to merge 55 commits into
base: main
Choose a base branch
from

Commits on Oct 18, 2023

  1. Update AcademySoftwareFoundation#342 Sphinx Python Documentation.

    Work in progress.
    
    This PR adds a new build target named `MaterialXDocsPython`,
    which generates Python API documentation using Sphinx.
    
    The existing developer guide contents are incorporated into
    the new HTML documentation, which lives side-by-side to the
    existing Doxygen-generated C++ API documentation.
    
    The docstrings of the Python modules were tweaked to describe
    what the individual modules are responsible for.
    
    Signed-off-by: Stefan Habel <[email protected]>
    StefanHabel committed Oct 18, 2023
    Configuration menu
    Copy the full SHA
    bef6e1f View commit details
    Browse the repository at this point in the history
  2. Sphinx Python Documentation (AcademySoftwareFoundation#1567) - Added …

    …MATERIALX_BUILD_PYTHON_DOCS build option.
    StefanHabel committed Oct 18, 2023
    Configuration menu
    Copy the full SHA
    9d4b492 View commit details
    Browse the repository at this point in the history
  3. Sphinx Python Documentation (AcademySoftwareFoundation#1567) - Update…

    …d Markdown files to use absolute URLs.
    
    This is to make sure the URLs can be loaded within GitHub, Doxygen,
    Sphinx, and the PyPI project page. Requires internet access.
    
    Also updated XML text snippets to use XML comment delimiters.
    StefanHabel committed Oct 18, 2023
    Configuration menu
    Copy the full SHA
    e129d65 View commit details
    Browse the repository at this point in the history
  4. Sphinx Python Documentation (AcademySoftwareFoundation#1567) - Revise…

    …d `index.rst`.
    
    Changed index page title, added introduction text, and changed the
    order of Python modules, to reflect the order in which support for the
    different shading languages was added to MaterialX.
    StefanHabel committed Oct 18, 2023
    Configuration menu
    Copy the full SHA
    6a5da31 View commit details
    Browse the repository at this point in the history
  5. Sphinx Python Documentation (AcademySoftwareFoundation#1567) - Resolv…

    …ed import order dependency issue.
    
    This patch adds calls of `pybind11::module::import()` to the Python
    bindings of modules that depend on specific other modules.
    
    This approach is similar to importing required modules via `import` in
    Python packages/modules.
    
    At the same time, we can remove the new documentation for this issue,
    and can remove extra steps from the Sphinx `conf.py` configuration file.
    
    With this patch in place, it should be possible to import any of the
    MaterialX Python modules in any order.
    StefanHabel committed Oct 18, 2023
    Configuration menu
    Copy the full SHA
    e1113ea View commit details
    Browse the repository at this point in the history
  6. Sphinx Python Documentation (AcademySoftwareFoundation#1567) - Tweake…

    …d Sphinx configuration.
    
    - Added a new description/about text in the sidebar, including blue
      link buttons to GitHub and MaterialX on Mastodon (with an SVG-based
      embedded icon)
    - Applied the "monokai" syntax highlighting theme to code snippets
    - Added custom Jinja templates for classes and modules, in order to add
      a section title before the alphabetical indices on pages
    - Added a custom HTML template for the navigation section in the sidebar
      in order to limit the depth of the table of contents
    - Added code to remove module names from the signatures of functions,
      in order to make the docs more readable
    StefanHabel committed Oct 18, 2023
    Configuration menu
    Copy the full SHA
    e4382bb View commit details
    Browse the repository at this point in the history
  7. Sphinx Python Documentation (AcademySoftwareFoundation#1567) - Fixed …

    …a couple of typos in header files.
    StefanHabel committed Oct 18, 2023
    Configuration menu
    Copy the full SHA
    c983b87 View commit details
    Browse the repository at this point in the history
  8. Sphinx Python Documentation (AcademySoftwareFoundation#1567) - Added …

    …define to produce detailed error messages in pybind11.
    StefanHabel committed Oct 18, 2023
    Configuration menu
    Copy the full SHA
    3567610 View commit details
    Browse the repository at this point in the history
  9. Sphinx Python Documentation (AcademySoftwareFoundation#1567) - Added …

    …docstrings to PyMaterialXCore.
    StefanHabel committed Oct 18, 2023
    Configuration menu
    Copy the full SHA
    abc2edb View commit details
    Browse the repository at this point in the history
  10. Sphinx Python Documentation (AcademySoftwareFoundation#1567) - Added …

    …docstrings to PyMaterialXFormat.
    StefanHabel committed Oct 18, 2023
    Configuration menu
    Copy the full SHA
    133a0b4 View commit details
    Browse the repository at this point in the history
  11. Sphinx Python Documentation (AcademySoftwareFoundation#1567) - Added …

    …docstrings to PyMaterialXGenGlsl.
    StefanHabel committed Oct 18, 2023
    Configuration menu
    Copy the full SHA
    67bb241 View commit details
    Browse the repository at this point in the history
  12. Sphinx Python Documentation (AcademySoftwareFoundation#1567) - Added …

    …docstrings to PyMaterialXGenMdl.
    StefanHabel committed Oct 18, 2023
    Configuration menu
    Copy the full SHA
    e715c0f View commit details
    Browse the repository at this point in the history
  13. Sphinx Python Documentation (AcademySoftwareFoundation#1567) - Added …

    …docstrings to PyMaterialXGenMsl.
    StefanHabel committed Oct 18, 2023
    Configuration menu
    Copy the full SHA
    6a9d8e5 View commit details
    Browse the repository at this point in the history
  14. Sphinx Python Documentation (AcademySoftwareFoundation#1567) - Added …

    …docstrings to PyMaterialXGenOsl.
    StefanHabel committed Oct 18, 2023
    Configuration menu
    Copy the full SHA
    2c04542 View commit details
    Browse the repository at this point in the history
  15. Sphinx Python Documentation (AcademySoftwareFoundation#1567) - Added …

    …docstrings to PyMaterialXGenShader.
    StefanHabel committed Oct 18, 2023
    Configuration menu
    Copy the full SHA
    8790578 View commit details
    Browse the repository at this point in the history
  16. Sphinx Python Documentation (AcademySoftwareFoundation#1567) - Added …

    …docstrings to PyMaterialXRender.
    StefanHabel committed Oct 18, 2023
    Configuration menu
    Copy the full SHA
    0439c07 View commit details
    Browse the repository at this point in the history
  17. Sphinx Python Documentation (AcademySoftwareFoundation#1567) - Added …

    …docstrings to PyMaterialXRenderGlsl.
    StefanHabel committed Oct 18, 2023
    Configuration menu
    Copy the full SHA
    1e745bd View commit details
    Browse the repository at this point in the history
  18. Sphinx Python Documentation (AcademySoftwareFoundation#1567) - Added …

    …docstrings to PyMaterialXRenderMsl.
    StefanHabel committed Oct 18, 2023
    Configuration menu
    Copy the full SHA
    4c11bde View commit details
    Browse the repository at this point in the history
  19. Sphinx Python Documentation (AcademySoftwareFoundation#1567) - Added …

    …docstrings to PyMaterialXRenderOsl.
    StefanHabel committed Oct 18, 2023
    Configuration menu
    Copy the full SHA
    9d73ddc View commit details
    Browse the repository at this point in the history
  20. Sphinx Python Documentation (AcademySoftwareFoundation#1567) - Update…

    …d listings of modules in `README.md` files.
    StefanHabel committed Oct 18, 2023
    Configuration menu
    Copy the full SHA
    0e1e502 View commit details
    Browse the repository at this point in the history
  21. Sphinx Python Documentation (AcademySoftwareFoundation#1567) - Remove…

    …d aliasing of `PyMaterialXFormat.readFromXmlFile()` function.
    
    The function is now exposed under its real name in the pybind11 bindings
    in C++.
    StefanHabel committed Oct 18, 2023
    Configuration menu
    Copy the full SHA
    805f13c View commit details
    Browse the repository at this point in the history

Commits on Oct 20, 2023

  1. Fixed a couple of typos in MaterialXGenShader/Util.h.

    Signed-off-by: Stefan Habel <[email protected]>
    StefanHabel committed Oct 20, 2023
    Configuration menu
    Copy the full SHA
    c0d65ed View commit details
    Browse the repository at this point in the history
  2. Added PYMATERIALX_IMPORT_MODULE macro to import a PyMaterialX module

    either within the `MaterialX` Python package or as a standalone module.
    
    Signed-off-by: Stefan Habel <[email protected]>
    StefanHabel committed Oct 20, 2023
    Configuration menu
    Copy the full SHA
    ab6860b View commit details
    Browse the repository at this point in the history
  3. Added PYMATERIALX_DOCSTRING macro to erase the first newline character

    from docstrings.
    
    This allows us to start docstrings on a new line, while keeping the help
    text that `help()` in a `python` session provides clean.
    
    Also added docstrings to a couple more functions.
    
    Signed-off-by: Stefan Habel <[email protected]>
    StefanHabel committed Oct 20, 2023
    Configuration menu
    Copy the full SHA
    26a972f View commit details
    Browse the repository at this point in the history
  4. Added warnings and statistics to the Sphinx generation.

    The warnings give us an idea of how much work is left to be done:
    ```
    The MaterialX Python API consists of:
        * 11 modules
        * 48 functions
        * 139 classes
        * 1176 methods
        * 6 exception types
    
    WARNING: 475 methods look like their parameters have not all been named using `py::arg()`:
    ```
    
    Signed-off-by: Stefan Habel <[email protected]>
    StefanHabel committed Oct 20, 2023
    Configuration menu
    Copy the full SHA
    b8eecc0 View commit details
    Browse the repository at this point in the history

Commits on Oct 21, 2023

  1. Added section describing the MaterialX Python API. (AcademySoftwareFo…

    …undation#1567)
    
    ...to mention the `MaterialX` Python package, and the way it's typically
    aliased as `mx` upon `import`.
    
    Also removed the paragraph about the MaterialX.org site, as it seemed
    unnecessary.
    
    Also added a link to the auto-generated alphabetical index to the TOC.
    
    Signed-off-by: Stefan Habel <[email protected]>
    StefanHabel committed Oct 21, 2023
    Configuration menu
    Copy the full SHA
    bf427e4 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    fbe2947 View commit details
    Browse the repository at this point in the history
  3. Extended build checks to warn about undocumented functions and method…

    …s. (AcademySoftwareFoundation#1567)
    
    For example:
    ```
    WARNING: 1141 methods look like they do not have docstrings yet.
    ```
    
    Signed-off-by: Stefan Habel <[email protected]>
    StefanHabel committed Oct 21, 2023
    Configuration menu
    Copy the full SHA
    f064a22 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    d30276b View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    86030d0 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    90c78d4 View commit details
    Browse the repository at this point in the history

Commits on Oct 25, 2023

  1. Merge branch 'main' into AcademySoftwareFoundation#342-Sphinx-Python-…

    …Documentation
    
    Signed-off-by: Jonathan Stone <[email protected]>
    jstone-lucasfilm committed Oct 25, 2023
    Configuration menu
    Copy the full SHA
    37f1ef5 View commit details
    Browse the repository at this point in the history

Commits on Oct 31, 2023

  1. Extended docstrings of PyMaterialXCore and PyMaterialXFormat. (Ac…

    …ademySoftwareFoundation#1567)
    
    Mentioning that all functions and classes from those modules are available
    in the top-level `MaterialX` Python package.
    
    Also removed the repeated `import` statements from example code in utility
    functions of `PyMaterialXCore`.
    
    Also wrapped more module docstrings in `PYMATERIALX_DOCSTRING()`.
    
    Signed-off-by: Stefan Habel <[email protected]>
    StefanHabel committed Oct 31, 2023
    Configuration menu
    Copy the full SHA
    aed7f8f View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    052f38e View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    939c996 View commit details
    Browse the repository at this point in the history
  4. Exposed Element.getChild() in the Python API docs. (AcademySoftware…

    …Foundation#1567)
    
    ...by renaming `Element._getChild()` to `Element.getChild()`.
    
    Signed-off-by: Stefan Habel <[email protected]>
    StefanHabel committed Oct 31, 2023
    Configuration menu
    Copy the full SHA
    77b5944 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    be2db5e View commit details
    Browse the repository at this point in the history
  6. More fixes in header files. (AcademySoftwareFoundation#1567)

    Signed-off-by: Stefan Habel <[email protected]>
    StefanHabel committed Oct 31, 2023
    Configuration menu
    Copy the full SHA
    71bd3fd View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    f7bea44 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    e66a3f5 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    28fd863 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    74872ea View commit details
    Browse the repository at this point in the history
  11. Tweaked style sheet. (AcademySoftwareFoundation#1567)

    Signed-off-by: Stefan Habel <[email protected]>
    StefanHabel committed Oct 31, 2023
    Configuration menu
    Copy the full SHA
    572089b View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    513ef90 View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    c9a2469 View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    21eecdd View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    40079f1 View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    dfa106a View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    f62be3a View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    77ca69c View commit details
    Browse the repository at this point in the history
  19. Configuration menu
    Copy the full SHA
    6253abc View commit details
    Browse the repository at this point in the history
  20. Configuration menu
    Copy the full SHA
    c1b31c0 View commit details
    Browse the repository at this point in the history
  21. Configuration menu
    Copy the full SHA
    0ca9f23 View commit details
    Browse the repository at this point in the history
  22. Configuration menu
    Copy the full SHA
    f73acc4 View commit details
    Browse the repository at this point in the history
  23. Configuration menu
    Copy the full SHA
    b589282 View commit details
    Browse the repository at this point in the history