Skip to content

Commit

Permalink
Merge pull request #102 from mnfienen/main
Browse files Browse the repository at this point in the history
output clearing
  • Loading branch information
mnfienen authored Feb 1, 2024
2 parents 6879a39 + 0532d52 commit 8383072
Show file tree
Hide file tree
Showing 43 changed files with 8,237 additions and 8,404 deletions.
19 changes: 19 additions & 0 deletions notebooks/clear_all_notebooks.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import os
import pathlib as pl
notebook_count = 0
# add the basenames of any notebooks we want to keep the results of
# all solutions are still not being cleared

skipnbs = ['10_Rasterio.ipynb',
'11_xarray_mt_rainier_precip.ipynb',
'09_Geopandas_ABQ.ipynb']

for [path, subdirs, files] in os.walk('.'):
for cf in files:
if cf.lower().endswith('.ipynb') and '.ipynb_checkpoint' not in path:
nb = pl.Path(path) / cf
if 'solutions' not in str(nb) and nb.name not in skipnbs:
print(f"clearing {nb}")
os.system(f"jupyter nbconvert --clear-output --inplace {nb._str}")
notebook_count += 1
print(notebook_count," notebooks cleared")
17 changes: 1 addition & 16 deletions notebooks/part0_python_intro/00_python_basics_review.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1315,23 +1315,8 @@
}
],
"metadata": {
"anaconda-cloud": {},
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.7"
"name": "python"
}
},
"nbformat": 4,
Expand Down
20 changes: 2 additions & 18 deletions notebooks/part0_python_intro/00_skills_test_on_basics.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,7 @@
"cell_type": "code",
"execution_count": null,
"id": "5722af2e",
"metadata": {
"scrolled": true
},
"metadata": {},
"outputs": [],
"source": [
"words = ' '.join(words)\n",
Expand Down Expand Up @@ -294,22 +292,8 @@
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.7"
"name": "python"
}
},
"nbformat": 4,
Expand Down
17 changes: 1 addition & 16 deletions notebooks/part0_python_intro/01_functions_scripts.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -666,23 +666,8 @@
}
],
"metadata": {
"anaconda-cloud": {},
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.13"
"name": "python"
}
},
"nbformat": 4,
Expand Down
Loading

0 comments on commit 8383072

Please sign in to comment.