-
Notifications
You must be signed in to change notification settings - Fork 10
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
Update docs version #154
Update docs version #154
Conversation
A PR has been generated to the instance repo: You can check out the PR to preview your changes |
I used from operator import add
from collections.abc import Iterable, Callable
from typing import TypeVar
A = TypeVar("A")
T = TypeVar("T")
class accumulate(...)
def __init__(iterable: Iterable[A], func: Callable[[A, A], T] = add) -> None:
... into this monstrosity to keep ...
class _Adder:
"""This just exists to allow Sphinx to parse the function signature."""
def __call__(self, a: A, b: A) -> T:
a + b
def __repr__(self) -> str:
return "add" # pragma: no cover
class accumulate(...)
def __init__(iterable: Iterable[A], func: Callable[[A, A], T] = _Adder()) -> None:
... |
@flying-sheep happy to keep sphinx autodoc typehints, but would you be able to update the typed returns extension on this repo? This PR on sphinx autodoc typehints tox-dev/sphinx-autodoc-typehints#311 causes an issue where : precedes all return descriptions. |
I’ll check out the return problem. But before I do that: I can’t find the issue you filed to sphinx-autodoc-typehints’ repo about this problem, can you link it to me? I investigated further, and while using
Comparison:
I think neither style is good. |
I didn't file an issue because the problem seems to be more specific to our custom typed returns extension, which is in this repo/scanpy/etc. You can see the "bug" in the left image above: I can remove the change in this PR, but we should figure something out with the |
Ah I see! Regarding the colon, since we know which PR it comes from and that it’s just there instead of being indicative of a deeper problem, we can simply remove it, right? We should move that little typed-returns customization to scanpydoc and test it properly, but for now, I’ll just fix it here. |
built docs