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

Build and execute notebooks with nbsphinx #1330

Merged
merged 58 commits into from
Oct 25, 2018

Conversation

jenshnielsen
Copy link
Collaborator

@jenshnielsen jenshnielsen commented Oct 23, 2018

This tries to simplify the execution of notebooks as part of the build process. This seems to solve
the issue building notebooks on windows and simplifies the logic. Currently all notebooks are
executed unless metadata is added to mark them not executable. The execution can be customized on a per notebook basis to allow longer timeout or cells raising errors. We make use of this in a few examples

Execution of notebooks can be skipped completely by setting an env variable for speed

In the process I fixed some broken code in a few notebooks and some broken links.

It is now possible to build the docs in two ways from both windows (with cmd/bat) files and from
osx/linux with Makefiles.

The target htmlapi will execute all notebooks that can be executed.
The target htmlfast skips the notebook execution and is better suited for rapid iterations

TODO:

  • Document how this is done. Especially that you need to disable execution of driver notebooks and the way to skip the notebook execution. We should perhaps even have a make target that does this.
  • There still seems to be one failure that I have not tracked down yet

@jenshnielsen
Copy link
Collaborator Author

@QCoDeS/core I think this is ready for review

@jenshnielsen
Copy link
Collaborator Author

This is likely to conflict with #1309 so we should decide which one goes in first

@Dominik-Vogel
Copy link
Contributor

I will take a look at this PR and will hopefully learn enough to be able to merge it into #1309. So this one can go first.

Co-Authored-By: jenshnielsen <jenshnielsen@gmail.com>
Copy link
Contributor

@astafan8 astafan8 left a comment

Choose a reason for hiding this comment

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

all cool! really, thanks for cleaning this up!

one thing: is there going to be a small description for developers about how this works? i'm interested in the following: what to do if i am adding a new notebook, when should i enable/disable its execution and how (well, i know how, but it's nice if that's documented), how do i enable/prevent sphinx from building the notebook. (please ignore this request if all of this is neatly covered in sphinx docs, and there is nothing specific/special to our setup within qcodes)

docs/conf.py Outdated Show resolved Hide resolved
docs/Makefile Show resolved Hide resolved
docs_requirements.txt Show resolved Hide resolved
@jenshnielsen
Copy link
Collaborator Author

jenshnielsen commented Oct 24, 2018

@astafan8 Yes we should probably have a documenting QCoDeS page that includes some of this along with best practice for documentation. Google style and so on. I added part of it to the writing drivers notebook because I figured that was the most likely place for new users to look

@astafan8
Copy link
Contributor

@jenshnielsen ok, let's say that for now the info that you wrote in the driver docs is enough.

@jenshnielsen jenshnielsen merged commit bd18b7e into microsoft:master Oct 25, 2018
@jenshnielsen jenshnielsen deleted the nbsphinx branch October 25, 2018 10:27
giulioungaretti pushed a commit that referenced this pull request Oct 25, 2018
Merge: bcacdeb ecacaac
Author: Jens Hedegaard Nielsen <jenshnielsen@gmail.com>

    Merge pull request #1330 from jenshnielsen/nbsphinx
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.

None yet

3 participants