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

nbconvert is running import code from examples #10

Open
2 of 5 tasks
eeholmes opened this issue Apr 5, 2022 · 2 comments
Open
2 of 5 tasks

nbconvert is running import code from examples #10

eeholmes opened this issue Apr 5, 2022 · 2 comments
Assignees

Comments

@eeholmes
Copy link
Member

eeholmes commented Apr 5, 2022

Reference this line in GitHub Action:

jupyter nbconvert --to markdown docs/source/examples/*.ipynb

jupyter nbconvert is not supposed to execute the notebook and it doesn't seem to execute any code blocks except the first code block with imports. The other code blocks are not being run. See for example where you see the 'module not found error showing up'
https://eeholmes.github.io/coastal_topobathy/examples/OpenAltimetry_example.html

Brainstorm of possible problems. Not that any of these really make sense but for the life of me I can't figure out why nbconvert is executing any of the code blocks!

  • The notebook state actually has that error. No, it is fine on the JupyterLab notebook that I saved.
  • It always runs the first code block; No, problem persists when I put a code block with just # at top
  • It always runs the import blocks? Need to test more but there is a lower code with an import that is ok.
  • Has something to do with copying the notebooks into docs/source
    cp -R examples docs/source
    How would that possibly cause this problem?
  • Something else
@eeholmes eeholmes self-assigned this Apr 5, 2022
@iled
Copy link
Member

iled commented Apr 5, 2022

I don't know what is causing this issue, but an alternative would be doing the conversion to markdown through Jupytext

Use the MyST Markdown format, a markdown flavor that “implements the best parts of reStructuredText”, if you wish to render your notebooks using Sphinx or Jupyter Book.

@eeholmes
Copy link
Member Author

eeholmes commented Apr 5, 2022

Thanks I'll try jupytext conversion to markdown.
https://jupytext.readthedocs.io/en/latest/using-cli.html

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

No branches or pull requests

2 participants