-
Notifications
You must be signed in to change notification settings - Fork 133
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
Error 'TreeRebuilder' object has no attribute 'visit_typealias' #474
Comments
Hi all, (correction in my next comment: it is actually more subtle) Basically when giving type hints to a dataclass, autoapi gets thrown off by some types. In my case the type hings: from numpy.typing import ArrayLike, NDArray
@dataclass
class mydata(object):
"""
This is my data class
Args:
anin : One integer for you
barray : This is now an array
"""
anin : int = 0
barray : ArrayLike = None For now, I will use type numpy.ndarray so that I can get back on line, but I hope this gets solved at some point, because I would like to use those generic types. |
Actually, the problem is more subtle, because this compiles correcly: import numpy as np
ArrayLike = np.typing.ArrayLike
@dataclass
class mydata(object):
"""
This is my data class
Args:
anin : One integer for you
barray : This is now an array
"""
anin: int = 0
barray: ArrayLike = None So basically you cannot import just the class from a module, you must reference the type directly through the namespace of its submodule. If you import the type directly, it will not work. (it will crash the autoapi without helpful messages.) I have also seen this from types of other modules. Again, I hope this helped, and I hope we can improve this. |
Hi,
I am trying to use autoapi to document my new package nifits, but it seems to fail spectacularly.
Error message is
I have no idea what gives rise to this. I tried many things:
docs/
directory and making it from scratch with sphinx-quickstart. It starts failing when using extension autoapi. (also -E option does not seem to affect the output).Here is the output I obtained.
I concluded that autoapi has problems with my source base, but I have no idea of what sort. Could you help me figure it out based on the error I obtain?
Thanks in advance.
The text was updated successfully, but these errors were encountered: