Skip to content

Commit d023a36

Browse files
authored
1155 workaround and verbose option (#1164)
- workaround for #1155 - skip transform_visualization.ipynb - adds `--verbose` for runner.sh ### Checks <!--- Put an `x` in all the boxes that apply, and remove the not applicable items --> - [x] Avoid including large-size files in the PR. - [x] Clean up long text outputs from code cells in the notebook. - [x] For security purposes, please check the contents and remove any sensitive info such as user names and private key. - [x] Ensure (1) hyperlinks and markdown anchors are working (2) use relative paths for tutorial repo files (3) put figure and graphs in the `./figure` folder - [x] Notebook runs automatically `./runner.sh -t <path to .ipynb file>` Signed-off-by: Wenqi Li <wenqil@nvidia.com>
1 parent 33feab3 commit d023a36

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

runner.sh

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ skip_run_papermill=("${skip_run_papermill[@]}" .*monailabel_pancreas_tumor_segme
8383
skip_run_papermill=("${skip_run_papermill[@]}" .*monailabel_endoscopy_cvat_tooltracking*)
8484
skip_run_papermill=("${skip_run_papermill[@]}" .*monailabel_pathology_nuclei_segmentation_QuPath*)
8585
skip_run_papermill=("${skip_run_papermill[@]}" .*monailabel_radiology_spleen_segmentation_OHIF*)
86+
skip_run_papermill=("${skip_run_papermill[@]}" .*transform_visualization*) # https://github.com/Project-MONAI/tutorials/issues/1155
8687

8788
# output formatting
8889
separator=""
@@ -107,6 +108,7 @@ doStandardizeCells=false
107108
autofix=false
108109
failfast=false
109110
pattern=""
111+
papermill_opt=""
110112

111113
kernelspec="python3"
112114

@@ -116,7 +118,7 @@ NB_OUTPUT_LINE_CAP=100
116118

117119
function print_usage {
118120
echo "runner.sh [--no-run] [--no-checks] [--autofix] [-f/--failfast] [-p/--pattern <find pattern>] [-h/--help]"
119-
echo "[-v/--version]"
121+
echo "[-v/--version] [--verbose]"
120122
echo ""
121123
echo "MONAI tutorials testing utilities. When running the notebooks, we first search for variables, such as"
122124
echo "\"max_epochs\" and set them to 1 to reduce testing time."
@@ -132,6 +134,7 @@ function print_usage {
132134
echo " -h, --help : show this help message and exit"
133135
echo " -t, --test : shortcut to run a single notebook using pattern \`-and -wholename\`"
134136
echo " -v, --version : show MONAI and system version information and exit"
137+
echo " --verbose : show papermill logs when testing the noteboobks"
135138
echo ""
136139
echo "Examples:"
137140
echo "./runner.sh # run full tests (${green}recommended before making pull requests${noColor})."
@@ -170,6 +173,9 @@ do
170173
--no-run)
171174
doRun=false
172175
;;
176+
--verbose)
177+
papermill_opt=" --log-output --log-level DEBUG "
178+
;;
173179
--no-checks)
174180
doChecks=false
175181
;;
@@ -504,7 +510,9 @@ for file in "${files[@]}"; do
504510
done
505511

506512
python -c 'import monai; monai.config.print_config()'
507-
time out=$(echo "$notebook" | papermill --progress-bar -k "$kernelspec")
513+
cmd=$(echo "papermill ${papermill_opt} --progress-bar -k ${kernelspec}")
514+
echo "$cmd"
515+
time out=$(echo "$notebook" | eval "$cmd")
508516
success=$?
509517
if [[ ${success} -ne 0 || "$out" =~ "\"status\": \"failed\"" ]]; then
510518
test_fail ${success}

0 commit comments

Comments
 (0)