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

nb_execution_mode=auto should take into account cells with no expected output #416

Open
bsipocz opened this issue May 5, 2022 · 4 comments
Labels
bug Something isn't working

Comments

@bsipocz
Copy link
Collaborator

bsipocz commented May 5, 2022

Describe the bug

context and expectation
When I use nb_execution_mode=auto I would expect that execution is skipped when all the code cells are run.

bug
But instead the execution is always run.

problem
This is because some of the cells

I think none of these cases should trigger the execution.

I'm happy to propose a fix in a PR

Reproduce the bug

Run all the cells in the notebook referenced above, save it. Then run sphinx-build -b html -D nb_execution_mode=auto . _build/html on it

List your environment

No response

@bsipocz bsipocz added the bug Something isn't working label May 5, 2022
@welcome
Copy link

welcome bot commented May 5, 2022

Thanks for opening your first issue here! Engagement like this is essential for open source projects! 🤗

If you haven't done so already, check out EBP's Code of Conduct. Also, please try to follow the issue template as it helps other community members to contribute more effectively.

If your issue is a feature request, others may react to it, to raise its prominence (see Feature Voting).

Welcome to the EBP community! 🎉

@chrisjsewell
Copy link
Member

chrisjsewell commented May 5, 2022

Heya, yeh happy to see proposals/suggestions thanks 👍

I'd note an alternative solution though, now we have file-level configuration: https://myst-nb.readthedocs.io/en/latest/configuration.html#file-level-configuration

if you want certain notebooks executed and others not, you could set globally nb_execution_mode="force", then set per-notebook:

{
  "metadata": {
    "mystnb": {
      "execution_mode": "off"
    }
  }
}

or visa-versa

@bsipocz
Copy link
Collaborator Author

bsipocz commented May 5, 2022

Yes, I think that will be a good solution for some of the projects I maintain (e.g. where I definitely want to keep the outputs as they are, e.g. when they are a product of cells with a long run time), but the auto option promises such a nice, low maintenance middle-ground.

@fzimmermann89
Copy link

We have a similar issue: A lot of cells in our notebooks do not produce any output.
The notebooks are automatically created and are either fresh without any outputs, or up to date.

This, we would like a "lazy" option: Instead of running if any output is missing, run if no output exists.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants