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

Fix type name parsing in sphinx extension. #130

Merged
merged 3 commits into from
Feb 16, 2024
Merged

Conversation

YooSunYoung
Copy link
Member

Fix #129

Copy link
Member

Choose a reason for hiding this comment

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

What does the rendered docs look like with this?

Copy link
Member Author

Choose a reason for hiding this comment

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

With python 3.9

"""
    Parameters
    ----------
    event_weights_converter:
        A function to convert probabilities to event weights.
        The function should accept the probabilities as the first argument,
        and return the converted event weights.
"""
renders like:

image

And with python 3.10
image

But I couldn't find the way to make default not to include object address,
I ended up annotating them manually:

"""
    Parameters
    ----------
    event_weights_converter: :class:`~EventWeightsConverter`, \
        default: :func:`~event_weights_from_probability`
        A function to convert probabilities to event weights.
        The function should accept the probabilities as the first argument,
        and return the converted event weights.
"""

which renders like:
image

Copy link
Member Author

Choose a reason for hiding this comment

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

I think it makes sense to manually annotate them in this kind of special cases...

@YooSunYoung YooSunYoung merged commit 064be55 into main Feb 16, 2024
5 checks passed
@YooSunYoung YooSunYoung deleted the fix-type-name-parsing branch February 16, 2024 11:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Type name parsing
2 participants