-
-
Notifications
You must be signed in to change notification settings - Fork 491
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
Use scipy-doctest
instead of refguide-check
#747
Conversation
$ pytest --doctest-modules --pyargs pywt -v --doctest-collect=api ... pywt/__init__.py::pywt.ContinuousWavelet.wavefun PASSED [ 3%] pywt/__init__.py::pywt.Modes PASSED [ 6%] pywt/__init__.py::pywt.Wavelet.wavefun PASSED [ 9%] pywt/__init__.py::pywt.array_to_coeffs PASSED [ 12%] pywt/__init__.py::pywt.coeffs_to_array PASSED [ 16%] pywt/__init__.py::pywt.cwt PASSED [ 19%] pywt/__init__.py::pywt.dwt PASSED [ 22%] pywt/__init__.py::pywt.dwt2 PASSED [ 25%] pywt/__init__.py::pywt.dwt_max_level PASSED [ 29%] pywt/__init__.py::pywt.dwtn_max_level PASSED [ 32%] pywt/__init__.py::pywt.families PASSED [ 35%] pywt/__init__.py::pywt.fswavedecn PASSED [ 38%] pywt/__init__.py::pywt.idwt PASSED [ 41%] pywt/__init__.py::pywt.idwt2 PASSED [ 45%] pywt/__init__.py::pywt.integrate_wavelet PASSED [ 48%] pywt/__init__.py::pywt.iswt PASSED [ 51%] pywt/__init__.py::pywt.iswt2 PASSED [ 54%] pywt/__init__.py::pywt.iswtn PASSED [ 58%] pywt/__init__.py::pywt.ravel_coeffs PASSED [ 61%] pywt/__init__.py::pywt.threshold PASSED [ 64%] pywt/__init__.py::pywt.unravel_coeffs PASSED [ 67%] pywt/__init__.py::pywt.upcoef PASSED [ 70%] pywt/__init__.py::pywt.wavedec PASSED [ 74%] pywt/__init__.py::pywt.wavedec2 PASSED [ 77%] pywt/__init__.py::pywt.wavedecn PASSED [ 80%] pywt/__init__.py::pywt.wavedecn_shapes PASSED [ 83%] pywt/__init__.py::pywt.wavedecn_size PASSED [ 87%] pywt/__init__.py::pywt.wavelist PASSED [ 90%] pywt/__init__.py::pywt.waverec PASSED [ 93%] pywt/__init__.py::pywt.waverec2 PASSED [ 96%] pywt/__init__.py::pywt.waverecn PASSED [100%] ================================== 31 passed in 0.80s =====================
Makes this green: $ pytest --doctest-glob=*rst doc/source/regression/ -vs
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.
Thanks for doing this, @ev-br! All of the changes look good to me. I would suggest leaving out the files under doc/source/regression/
, though – they are being converted to Markdown-style notebooks in gh-741, which means that the changes to them won't be needed since MyST-NB will execute them. That PR is close to getting merged and should be done by today or so.
The script can do two things: - run modified doctests; this is done via smoke-docs / scipy-doctests now - check __all__ lists vs refguide entries; this was already disabled, on CI at least
Thanks @agriyakhetarpal . Rolled back all changes to *rst files, removed the corresponding stanza from the CI run, and removed the refguide-check utility as "not used anymore". Would be nice if you could trigger the CI run for me, would you? |
Thanks! I tried but it turns out I don't have enough permissions to trigger a CI run – tagging @rgommers who can do this for you. |
triggered now - the joys of spammer-protection:) |
Thanks Ralf! So the CI is green, thus the question is whether y'all want it :-). And if you do, whether you want a spin command to to mimic scipy's |
Yes, and yes. thanks:)
Do you want to include that here, or separately? |
A follow-up PR would not require restarting the CI for me, so seems easier :-). |
Did you actually notice the doctesting happening in CI? I only see |
Indeed! So it was never actually running on CI, huh :-). Pushed a commit to switch it always on. Depending on how you want to play this, can iterate the CI in follow-ups or here. (If the latter, a new commit asks for one more confirmation I'm not a crypto miner) |
If it becomes a pain for CI not to run, maybe submit a trivial typo/change PR that can be merged straight away? |
Co-authored-by: Agriya Khetarpal <[email protected]>
With the latest failure, maybe we should do |
Co-authored-by: Agriya Khetarpal <[email protected]>
Since sphinx on CI, which is the source of the failures, is not really related, maybe it's best to separate the fixes. |
Okay, current status:
So how about not fixing the sphinx-build check in this PR? If that's OK, the PR is ready from my side. |
I'll hope to fix the sphinx-build checks in a separate PR after this – I would be fine with this getting merged. |
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.
Thanks @ev-br, this looks quite nice! Overall much cleaner docs, in addition to getting rid of the refguide_check.py
script which is great. Just a few small comments.
pip install -r util/readthedocs/requirements.txt | ||
sphinx-build -b html -W --keep-going -d _build/doctrees . doc/source doc/build | ||
cd .. | ||
# XXX sphinx build is broken on CI |
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.
What is happening here? Debug left-over, or is something actually broken right now? If so, I think three lines can be safely deleted. The separate CI job to build the docs with the ReadTheDocs integration is green.
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.
The RTD job is not building the docs with -W
, I guess: python -m sphinx -T -b html -d _build/doctrees -D language=en . $READTHEDOCS_OUTPUT/html
. Not that there are any warnings because we're already warning-free.
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.
Indeed, this sphinx-build
incantation did not previously run on CI because REFGUIDE-CHECK: [0]
, and was always broken. There's a standing offer to fix this in a follow-up though :-). #747 (comment)
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.
Okay thanks, let's do that - offer is appreciated:)
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 now and CI is happy, so in it goes. Thanks @ev-br! And thanks @agriyakhetarpal for the review and help.
SciPy has recently refactored its refguide-check utility into a separate pip-installable package and added integration of the modified doctesting with pytest. This PR switches the refguide-check run (which uses the utility vendored from scipy) to this refactored way.
There are several minor tweaks to docstrings --- I'm actually not sure all the affected docstrings were checked previously (but they are now):
$ doctest:
comments are no longer neededContinuousWavelet
example is to avoid a DeprecationWarning from matplotlib 3.7The pytest incantations to run doctesting are explicit on the CI --- in SciPy, these are hidden behind the
dev.py smoke-docs
interface.