2017-12-09 20:17:56 +01:00
|
|
|
#!/bin/bash
|
2017-12-10 18:38:25 +01:00
|
|
|
if [ "$#" -ne 1 ]; then
|
|
|
|
echo "usage: nbdiff_checkpoint NOTEBOOK.ipynb"
|
|
|
|
echo
|
|
|
|
echo "Show differences between given jupyter notebook and its checkpointed version (in .ipynb_checkpoints subdirectory)"
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
2017-12-09 20:17:56 +01:00
|
|
|
DIRNAME=$(dirname "$1")
|
|
|
|
BASENAME=$(basename "$1" .ipynb)
|
|
|
|
|
|
|
|
WORKING_COPY=$DIRNAME/$BASENAME.ipynb
|
|
|
|
CHECKPOINT_COPY=$DIRNAME/.ipynb_checkpoints/$BASENAME-checkpoint.ipynb
|
|
|
|
|
2017-12-10 18:38:25 +01:00
|
|
|
echo "----- Analysing how to change $CHECKPOINT_COPY into $WORKING_COPY -----"
|
2017-12-09 20:17:56 +01:00
|
|
|
nbdiff "$CHECKPOINT_COPY" "$WORKING_COPY" --ignore-details
|