Skip to content
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

Adding notebook testing to ci actions #218

Merged
merged 5 commits into from
Sep 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,43 @@ jobs:
- name: Docstrings are defined
run: make flake8

notebook-test:
name: Notebook Tests / Python ${{ matrix.python-version }}
strategy:
fail-fast: false
matrix:
# Tests currently fail for 3.8 and 3.9.
python-version: ['3.10', '3.11']
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./python/mlcroissant
steps:
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install library
run: pip install .[dev]

- run: pip install ipython ipykernel nbconvert

# Notebooks are in the recipes/ folder.
- name: Run notebook
run: |
ipython kernel install --user --name croissant-notebook
for notebook in recipes/*ipynb
do
jupyter nbconvert \
--ExecutePreprocessor.timeout=600 \
--ExecutePreprocessor.kernel_name=croissant-notebook \
--to notebook \
--execute $notebook
done

python-format:
name: Python format
runs-on: ubuntu-latest
Expand Down
8 changes: 4 additions & 4 deletions python/mlcroissant/recipes/introduction.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
" mlc.nodes.Field(\n",
" name=\"context\",\n",
" description=\"\",\n",
" data_type=mlc.constants.SCHEMA_ORG_DATA_TYPE_TEXT,\n",
" data_types=mlc.constants.SCHEMA_ORG_DATA_TYPE_TEXT,\n",
" source=mlc.nodes.Source(\n",
" uid=\"jsonl-files\",\n",
" node_type=\"distribution\",\n",
Expand All @@ -113,7 +113,7 @@
" mlc.nodes.Field(\n",
" name=\"completion\",\n",
" description=\"The expected completion of the promt.\",\n",
" data_type=mlc.constants.SCHEMA_ORG_DATA_TYPE_TEXT,\n",
" data_types=mlc.constants.SCHEMA_ORG_DATA_TYPE_TEXT,\n",
" source=mlc.nodes.Source(\n",
" uid=\"jsonl-files\",\n",
" node_type=\"distribution\",\n",
Expand All @@ -126,7 +126,7 @@
" \"The machine learning task appearing as the name of the\"\n",
" \" file.\"\n",
" ),\n",
" data_type=mlc.constants.SCHEMA_ORG_DATA_TYPE_TEXT,\n",
" data_types=mlc.constants.SCHEMA_ORG_DATA_TYPE_TEXT,\n",
" source=mlc.nodes.Source(\n",
" uid=\"jsonl-files\",\n",
" node_type=\"distribution\",\n",
Expand Down Expand Up @@ -316,4 +316,4 @@
"outputs": []
}
]
}
}
Loading