-
Notifications
You must be signed in to change notification settings - Fork 260
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
Include notebook tutorials in documentation #565
Conversation
a8499df
to
4adb536
Compare
Codecov Report
@@ Coverage Diff @@
## master #565 +/- ##
==========================================
- Coverage 97.28% 97.23% -0.06%
==========================================
Files 88 88
Lines 8030 8028 -2
==========================================
- Hits 7812 7806 -6
- Misses 218 222 +4
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
63835ad
to
d5e2861
Compare
In principle seems good, nice to have everything in one place, though we should still link to the examples as these kinds of notebooks are better if people "follow along" rather than just passively reading it. My only concern is that this may end up making building the docs too slow? Doesn't seem too bad right now: ReadTheDocs is just under 6 minutes, which is fine for CI. But what about for pre-commit hooks? We build docs right now in |
Building docs becomes slower but test should pass faster if we decide to remove the notebook tests. Good point with the building docs in the pre-commit hooks. I think there is a way to cache the results. I will have a look into this. |
a2b5eb9
to
dc6aee0
Compare
I switched from Also setting the environment variable |
…o doctest to make the intent clear.
Where do you think we should place the reference to the examples (now called tutorials)? Options that I see:
What do you prefer? |
I agree 3 is more effort than it's worth -- I doubt things will work with Colab out of the box.
Of these options my vote would be for 1). But better yet would be if we could make Sphinx automatically add a link? It already includes a (somewhat subtle) edit link, so perhaps we could mod that. Not worth much time though. executablebooks/MyST-NB#148 is a related issue but with no clear resolution. |
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.
Change largely LGTM.
In addition to the notebook linking issue discussed above, one concern I have is that this change means we are no longer testing the notebooks on Windows/Mac as we are relying entirely on the RTD executor to test them.
Given this, I'm inclined to think it's worth keeping the test for them in test_examples.py
. Skipping them in the doctest
build makes sense though -- no reason to run the doctests from the example algorithms on both RTD and CircleCI. WDYT?
Good point. I added them back again but we skip the test when on linux. Btw: we can ignore the coverage changes here. They are due to the coverage being measured on linux. |
…include_tutorials_in_documentation
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, one minor suggestion.
We've lost some coverage in the test suite itself because skipping notebooks on Linux, and CodeCov is calculated from the Linux run only...
I agree no point in running the notebooks on both Linux CircleCI and RTD, so I'd be OK adding a # pragma: no cover
here (with a comment explaining why.)
What about the remaining indirect coverage change? Do we also add the |
Is the only remaining indirect coverage change the plotting code in I'd be fine ignoring that, we're going to remove that file from imitation soon anyway in #541 We try pretty hard to maintain 100% coverage of the tests themselves to make sure we're not missing test code accidentally. But other code we can be much more lenient on. Especially stuff in the examples directory IIRC we actually exclude from the CodeCov calculation. |
Description
While cleaning up the documentation, I found a nice way to integrate the tutorial notebooks with the sphinx documentation.
There is a number of redundant options we could also remove in this PR:
test_examples.py:test_run_tutorial_notebooks_notebooks
test.docs
circleci job, we could remove themake doctest
step since this is executed by the readthedocs job anyways.Testing
Description of how you've tested your changes.