-
Notifications
You must be signed in to change notification settings - Fork 56
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
Calling jupyter-execute
runs the notebook but doesn't save it
#306
Comments
Fixes jupyter#306. Now actually write out the executed notebook to the same path as the input.
Yes, the intended behavior of the |
OK. Any chance this functionality could/should be added to cli.py with, e.g., a I'm probably misunderstanding something, but I don't understand the purpose of the cli interface without the option to save. |
The notebook could have side effects, like saving files. But I'm not against adding an option in the CLI to save the notebook. Let's see how other people feel about that. |
Sounds good. I'll put an optional write in the linked PR for demo purposes. |
I updated #307 to optionally save the executed notebook. |
* fix: Actually write out executed notebook in jupyter-execute Fixes #306. Now actually write out the executed notebook to the same path as the input. * feat: Added cli options to save executed notebook This commit adds two options to optionally save the executed notebook. * `--inplace`: Save the executed notebook to the input notebook path * `--output`: Save the executed notebook to `output`. This option can take a pattern like `{notebook_name}-new`, where `notebook_name` is the name of the input notebook without extension `.ipynb`. Also, the output location is always relative to the input notebook location. * chore: update mocker for opening files to remove error --------- Co-authored-by: wpk <william.krekelberg@nist.gov>
I'm trying to execute notebooks from the command line using jupyter-execute with the minimum number of dependencies (I just want to run and save the notebook, and
nbconvert
is overkill for this). If I use an environment with only "nbclient" and "ipykernel", runningjupyter execute notebook.ipynb
runs the notebook, but does not save the results anywhere. There's no call back tonbformat.write
anywhere incli.py
!.Is this intended behavior? If not, I think adding
nbformat.write(nb, input_path)
after the notebook is executed will fix it.Thanks!
The text was updated successfully, but these errors were encountered: