From 29d71648d0aaea0fead009fb452bcfece0197a2a Mon Sep 17 00:00:00 2001 From: Natalia Mokeeva Date: Sun, 27 Nov 2022 20:33:51 +0100 Subject: [PATCH 1/2] CI_check_correctness_notebooks --- ci/code_checks.sh | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/ci/code_checks.sh b/ci/code_checks.sh index c6067faf92d37..11be2f16fdc0a 100755 --- a/ci/code_checks.sh +++ b/ci/code_checks.sh @@ -12,9 +12,10 @@ # $ ./ci/code_checks.sh doctests # run doctests # $ ./ci/code_checks.sh docstrings # validate docstring errors # $ ./ci/code_checks.sh single-docs # check single-page docs build warning-free +# $ ./ci/code_checks.sh notebooks # check correctness of documentation of notebooks -[[ -z "$1" || "$1" == "code" || "$1" == "doctests" || "$1" == "docstrings" || "$1" == "single-docs" ]] || \ - { echo "Unknown command $1. Usage: $0 [code|doctests|docstrings]"; exit 9999; } +[[ -z "$1" || "$1" == "code" || "$1" == "doctests" || "$1" == "docstrings" || "$1" == "single-docs" || "$1" == "notebooks" ]] || \ + { echo "Unknown command $1. Usage: $0 [code|doctests|docstrings|single-docs|notebooks]"; exit 9999; } BASE_DIR="$(dirname $0)/.." RET=0 @@ -84,6 +85,15 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then fi +### DOCUMENTATION NOTEBOOKS ### +if [[ -z "$CHECK" || "$CHECK" == "notebooks" ]]; then + + MSG='Notebooks' ; echo $MSG + jupyter nbconvert --execute $(find doc/source -name '*.ipynb') --to notebook + RET=$(($RET + $?)) ; echo $MSG "DONE" + +fi + ### SINGLE-PAGE DOCS ### if [[ -z "$CHECK" || "$CHECK" == "single-docs" ]]; then python doc/make.py --warnings-are-errors --single pandas.Series.value_counts From 90925858f3e0182fc2fc6d1dd57e0963a77ea57a Mon Sep 17 00:00:00 2001 From: Natalia Mokeeva Date: Mon, 28 Nov 2022 10:49:49 +0100 Subject: [PATCH 2/2] add run code_checks.sh notebooks in CI --- .github/workflows/code-checks.yml | 4 ++++ ci/code_checks.sh | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/code-checks.yml b/.github/workflows/code-checks.yml index 66bc7cd917b31..7a90e1bec7783 100644 --- a/.github/workflows/code-checks.yml +++ b/.github/workflows/code-checks.yml @@ -79,6 +79,10 @@ jobs: run: ci/code_checks.sh docstrings if: ${{ steps.build.outcome == 'success' && always() }} + - name: Run check of documentation notebooks + run: ci/code_checks.sh notebooks + if: ${{ steps.build.outcome == 'success' && always() }} + - name: Use existing environment for type checking run: | echo $PATH >> $GITHUB_PATH diff --git a/ci/code_checks.sh b/ci/code_checks.sh index 11be2f16fdc0a..3c1362b1ac83e 100755 --- a/ci/code_checks.sh +++ b/ci/code_checks.sh @@ -12,7 +12,7 @@ # $ ./ci/code_checks.sh doctests # run doctests # $ ./ci/code_checks.sh docstrings # validate docstring errors # $ ./ci/code_checks.sh single-docs # check single-page docs build warning-free -# $ ./ci/code_checks.sh notebooks # check correctness of documentation of notebooks +# $ ./ci/code_checks.sh notebooks # check execution of documentation notebooks [[ -z "$1" || "$1" == "code" || "$1" == "doctests" || "$1" == "docstrings" || "$1" == "single-docs" || "$1" == "notebooks" ]] || \ { echo "Unknown command $1. Usage: $0 [code|doctests|docstrings|single-docs|notebooks]"; exit 9999; }