Skip to content

Improve @example docs #4418

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

Merged
merged 9 commits into from
May 30, 2025
Merged

Improve @example docs #4418

merged 9 commits into from
May 30, 2025

Conversation

tybug
Copy link
Member

@tybug tybug commented May 29, 2025

(with a fair bit of content rewriting, not just moving the @example docs from .rst to .py)

Comment on lines 183 to 186

Methods
-------
Database methods
----------------

Copy link
Member Author

Choose a reason for hiding this comment

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

Methods is a keyword in numpy-style docstrings, so this fixes some rendering issues after adding the napoleon extension.

Copy link
Member

@Zac-HD Zac-HD left a comment

Choose a reason for hiding this comment

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

We should consider using the new py:deco role for all our decorators: sphinx-doc/sphinx#13292 ... once we update Sphinx to 8.2, which I presume is blocked on a plugin or something. Hmm.

Copy link
Member

@Zac-HD Zac-HD left a comment

Choose a reason for hiding this comment

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

I like the updated @given() docs!

They also convince me that the whole "inferred arguments" section should be divided up among the docstrings for given, st.builds, and st.from_type. Currently it's a bit fuzzy, and I think this (with xrefs of course) would actually make it easier to understand what happens.

@tybug
Copy link
Member Author

tybug commented May 29, 2025

They also convince me that the whole "inferred arguments" section should be divided up among the docstrings for given, st.builds, and st.from_type. Currently it's a bit fuzzy, and I think this (with xrefs of course) would actually make it easier to understand what happens.

Yeah, agree we'll want something like this, likely alongside a "working with types" tutorial or how-to.

Copy link
Member

@Zac-HD Zac-HD left a comment

Choose a reason for hiding this comment

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

Happy to merge as an improvement on the status quo; and make a note in the docs tracking issue about inferred strategies and working with types?

@tybug tybug merged commit c3943fa into HypothesisWorks:master May 30, 2025
60 checks passed
@tybug tybug deleted the docs-cleanup branch May 30, 2025 05:38
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.

2 participants