Index of /examples/jupyter_notebook/batch_notebook

[ICO]NameLast modifiedSizeDescription

[PARENTDIR]Parent Directory   -  

Running Python notebooks through the batch system

Running Python notebooks through the batch system


module load python3/3.8.10

#  Here are 4 ways you can run a Jupyter Notebook in a batch job.

# 1.
# convert notebook to a script that can be run as a batch job. This
# can be done within a batch job or beforehand.
jupyter nbconvert --to script notebook_name.ipynb
# Now run the script
python notebook_name.py

# 2.
# execute the notebook directly. Results are saved within the
# notebook exactly the way they would be if run from within
# Jupyter. 
jupyter nbconvert --to notebook --execute notebook_name.ipynb

# 3.
# execute the notebook as in step 2 and then convert it to a pdf
# Load the pandoc  and texlive modules
module load pandoc/2.5
module load texlive/2021
jupyter nbconvert  --to pdf notebook_name.ipynb  

# 4.
# Again, execute the notebook as in step 2 then convert it
# to an HTML doc. This requires the module loads from part 3.
#Or if you want to save it into HTML format then: 
jupyter nbconvert --to html notebook_name.ipynb 

Help: help@scv.bu.edu

Note: RCS example programs are provided "as is" without any warranty of any kind. The user assumes the entire risk of quality, performance, and repair of any defect. You are welcome to copy and modify any of the given examples for your own use.