Skip to content

Commit

Permalink
Update Makefile with fix for clear
Browse files Browse the repository at this point in the history
The `--clear-output` flag has been broken for a while, replace it with a
the still-working direct configuration (see
jupyter/nbconvert#822).

Also, update all notebooks with cleared versions.
  • Loading branch information
rawlins committed Nov 27, 2018
1 parent 4e32a6c commit 0cc1d45
Show file tree
Hide file tree
Showing 24 changed files with 626 additions and 2,090 deletions.
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
testopts = "--ExecutePreprocessor.timeout=120"

clear:
for nb in notebooks/*.ipynb; do jupyter nbconvert --clear-output "$$nb" || exit 1; done
for nb in notebooks/documentation/*.ipynb; do jupyter nbconvert --clear-output "$$nb" || exit 1; done
for nb in notebooks/fragments/*.ipynb; do jupyter nbconvert --clear-output "$$nb" || exit 1; done
for nb in notebooks/misc/*.ipynb; do jupyter nbconvert --clear-output "$$nb" || exit 1; done
for nb in notebooks/tutorials/*.ipynb; do jupyter nbconvert --clear-output "$$nb" || exit 1; done
for nb in notebooks/*.ipynb; do jupyter nbconvert --ClearOutputPreprocessor.enabled=True --inplace "$$nb" || exit 1; done
for nb in notebooks/documentation/*.ipynb; do jupyter nbconvert --ClearOutputPreprocessor.enabled=True --inplace "$$nb" || exit 1; done
for nb in notebooks/fragments/*.ipynb; do jupyter nbconvert --ClearOutputPreprocessor.enabled=True --inplace "$$nb" || exit 1; done
for nb in notebooks/misc/*.ipynb; do jupyter nbconvert --ClearOutputPreprocessor.enabled=True --inplace "$$nb" || exit 1; done
for nb in notebooks/tutorials/*.ipynb; do jupyter nbconvert --ClearOutputPreprocessor.enabled=True --inplace "$$nb" || exit 1; done

notebooks/Lambda\ Notebook\ Demo\ \(executed\).ipynb: notebooks/Lambda\ Notebook\ Demo.ipynb
cp notebooks/Lambda\ Notebook\ Demo.ipynb notebooks/Lambda\ Notebook\ Demo\ \(executed\).ipynb
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"metadata": {},
"outputs": [],
"source": [
"%%lamb\n",
Expand Down Expand Up @@ -100,9 +98,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"metadata": {},
"outputs": [],
"source": [
"def istwo(x):\n",
Expand All @@ -114,9 +110,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"metadata": {},
"outputs": [],
"source": [
"istwo(2)"
Expand All @@ -125,9 +119,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"metadata": {},
"outputs": [],
"source": [
"istwo(3)"
Expand All @@ -136,9 +128,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"metadata": {},
"outputs": [],
"source": [
"istwov2(2)"
Expand All @@ -154,9 +144,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"metadata": {},
"outputs": [],
"source": [
"(lambda x: x==2)(2)"
Expand All @@ -172,9 +160,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"metadata": {},
"outputs": [],
"source": [
"%%lamb\n",
Expand All @@ -198,9 +184,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"metadata": {},
"outputs": [],
"source": [
"istwo(2)"
Expand All @@ -209,9 +193,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"metadata": {},
"outputs": [],
"source": [
"istwo(2).reduce_all()"
Expand All @@ -220,9 +202,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"metadata": {},
"outputs": [],
"source": [
"istwo(2).reduce_all().derivation"
Expand Down Expand Up @@ -256,9 +236,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"metadata": {},
"outputs": [],
"source": [
"def isfun(x): # I called it this because `is` is a reserved word in python.\n",
Expand All @@ -272,9 +250,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"metadata": {},
"outputs": [],
"source": [
"f = isfun(2)\n",
Expand All @@ -284,9 +260,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"metadata": {},
"outputs": [],
"source": [
"(isfun(2))(2) # note that isfun(2,2) won't work, because the function takes only one argument."
Expand All @@ -295,9 +269,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"metadata": {},
"outputs": [],
"source": [
"def isfun(x):\n",
Expand All @@ -309,9 +281,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"metadata": {},
"outputs": [],
"source": [
"isfun(2)(2) # this is equivalent to (isfun(2))(2), the first parenthesis are only helpful for clarity."
Expand All @@ -320,9 +290,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"metadata": {},
"outputs": [],
"source": [
"isfun(2)(3)"
Expand All @@ -338,9 +306,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"metadata": {},
"outputs": [],
"source": [
"%%lamb\n",
Expand All @@ -358,9 +324,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"metadata": {},
"outputs": [],
"source": [
"(is_V * two)[0].content.derivation"
Expand All @@ -378,9 +342,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"metadata": {},
"outputs": [],
"source": [
"plus * two"
Expand All @@ -396,9 +358,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"metadata": {},
"outputs": [],
"source": [
"(two * (plus * two)) * (is_V * four)"
Expand All @@ -407,9 +367,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"metadata": {},
"outputs": [],
"source": [
"((two * (plus * two)) * (is_V * five))[0].content.derivation"
Expand All @@ -432,9 +390,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"metadata": {},
"outputs": [],
"source": [
"((two * (plus * two)) * (is_V * four)).trace()"
Expand All @@ -443,9 +399,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"metadata": {},
"outputs": [],
"source": [
"r = ((two * (plus * two)) * (is_V * four))\n",
Expand All @@ -470,9 +424,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"metadata": {},
"outputs": [],
"source": [
"two * (plus * (two * (plus * two)))"
Expand All @@ -481,9 +433,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"metadata": {},
"outputs": [],
"source": []
}
Expand Down
Loading

0 comments on commit 0cc1d45

Please sign in to comment.