Open pkrull-ansys opened 10 months ago
This is more of a sphinx-autoapi
issue if I am not mistaken. Assigning to @jorgepiloto
Thanks for the ping. Roberto is right, we need to check if this comes from our class.rst
template or it originates in the internals of sphinx-autoapi
.
I thought the |
symbol for representing a union was only supported in Python 3.10+. Could you try using:
from typing import Union
@property
def geometry(self) -> Union[StlFile, BuildFile]:
"""Part geometry."""
return self._geometry
This also ensures compatibility with 3.9.
@jorgepiloto The source file contains from __future__ import annotations
. I'd prefer to keep the 3.10+ type specifications if possible.
🔍 Before submitting the issue
🐞 Description of the bug
renders as
📝 Steps to reproduce
Write a class property or method that returns multiple possible types and annotate it using 3.10+ annotation style. Generate documentation using autoapi and ansys-sphinx-theme. Only the last return type is shown in the generated docs.
💻 Which operating system are you using?
Windows
📀 Which ANSYS version are you using?
24.1
🐍 Which Python version are you using?
3.9
📦 Installed packages