Skip to content

Commit

Permalink
Fix bug with notebook not running due to fewer than 5 examples found (#…
Browse files Browse the repository at this point in the history
…726)

* Fix bug with notebook not running due to fewer than 5 examples found

* Fix the notebook in the correct place

* Fix typo

* Exclude notebook from execution on Windows and Mac due to timeouts
  • Loading branch information
jklaise authored Jul 28, 2022
1 parent 93d1477 commit a8a9bbd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 3 additions & 3 deletions doc/source/examples/trustscore_mnist.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,7 @@
],
"source": [
"plt.figure(figsize=(20, 4))\n",
"for i in range(n):\n",
"for i in range(min(n, len(idx_low))): # in case fewer than n instances are found\n",
" ax = plt.subplot(1, n, i+1)\n",
" plt.imshow(imgs_low[i].reshape(28, 28))\n",
" plt.title('Model prediction: {} (p={:.2f}) \\n Label: {} \\n Trust score: {:.3f}' \\\n",
Expand Down Expand Up @@ -782,7 +782,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -796,7 +796,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.13"
"version": "3.9.13"
}
},
"nbformat": 4,
Expand Down
3 changes: 3 additions & 0 deletions testing/test_notebooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@
if platform.system() == 'Windows':
EXCLUDE_NOTEBOOKS.add('protoselect_adult_cifar10.ipynb') # Exclude <your notebook> on Windows due to the use of wget
EXCLUDE_NOTEBOOKS.add('similarity_explanations_20ng.ipynb') # times out, likely due to the EmbeddingModel being slow
EXCLUDE_NOTEBOOKS.add('trustscore_mnist.ipynb') # times out
if platform.system() == 'Darwin':
EXCLUDE_NOTEBOOKS.add('trustscore_mnist.ipynb') # times out
EXECUTE_NOTEBOOKS = ALL_NOTEBOOKS - EXCLUDE_NOTEBOOKS

@pytest.mark.timeout(600)
Expand Down

0 comments on commit a8a9bbd

Please sign in to comment.