-
-
Notifications
You must be signed in to change notification settings - Fork 11.2k
DOC: doctest ReST sources in doc/source/reference
#29547
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
base: main
Are you sure you want to change the base?
Conversation
This still misses subdirectories. Also, some subdirectories (reference/random as an example) use `.. code-block :: python` and `.. ipython` syntax, which the doctest finder/parser misses.
There is no good way to show both the result *and* a warning in the doctesting machinery otherwise.
LGTM, I guess we know it is working since there is a failing test
Using |
[skip actions][skip azp][skip cirrus]
379a317
to
fa44f38
Compare
A proof by a CI failure, as it were :-). Funny enough, the
Yup, thanks. I keep forgetting the exact syntax in different projects. Maybe it's something to add to the PR template? For me (based on statistics of one!) it'd help to have a link to the relevant section of the docs. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, nice to add things and fixup the docs.
But I wonder what your opion is on those warnings, or if we can't find an easy fix?
I love running tests with all warnings being turned to errors, but for doc tests this is actually making the documentation worse to bend it to an environment nobody uses in practice.
>>> np.float32(1) + 1e300 | ||
Traceback (most recent call last): | ||
... | ||
RuntimeWarning: overflow encountered in cast |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmm, this seems a tad annoying? Can we change warning settings for doctests to not raise? I think just printing the warning as it was is nicer, because that is what users see!
Prompted by #29544 : Add doctesting of ReST sources in
doc/source/reference
, which were never doctested IIUC.This is a minimal fix. Several larger-scale potential improvements are discussed in gh-29544.