mirror of
https://github.com/fastai/fastbook.git
synced 2025-04-04 01:40:44 +00:00
Merge f01550093e
into e8baa81d89
This commit is contained in:
commit
2cbd46619b
@ -564,7 +564,7 @@
|
||||
"split_at_heading": true
|
||||
},
|
||||
"kernelspec": {
|
||||
"display_name": "Python 3 (ipykernel)",
|
||||
"display_name": "python3",
|
||||
"language": "python",
|
||||
"name": "python3"
|
||||
}
|
||||
|
@ -693,7 +693,7 @@
|
||||
"split_at_heading": true
|
||||
},
|
||||
"kernelspec": {
|
||||
"display_name": "Python 3",
|
||||
"display_name": "python3",
|
||||
"language": "python",
|
||||
"name": "python3"
|
||||
}
|
||||
|
@ -313,7 +313,7 @@
|
||||
"split_at_heading": true
|
||||
},
|
||||
"kernelspec": {
|
||||
"display_name": "Python 3",
|
||||
"display_name": "python3",
|
||||
"language": "python",
|
||||
"name": "python3"
|
||||
}
|
||||
|
@ -1643,7 +1643,7 @@
|
||||
"split_at_heading": true
|
||||
},
|
||||
"kernelspec": {
|
||||
"display_name": "Python 3 (ipykernel)",
|
||||
"display_name": "python3",
|
||||
"language": "python",
|
||||
"name": "python3"
|
||||
}
|
||||
|
@ -709,7 +709,7 @@
|
||||
"split_at_heading": true
|
||||
},
|
||||
"kernelspec": {
|
||||
"display_name": "Python 3 (ipykernel)",
|
||||
"display_name": "python3",
|
||||
"language": "python",
|
||||
"name": "python3"
|
||||
}
|
||||
|
@ -712,7 +712,7 @@
|
||||
"split_at_heading": true
|
||||
},
|
||||
"kernelspec": {
|
||||
"display_name": "Python 3 (ipykernel)",
|
||||
"display_name": "python3",
|
||||
"language": "python",
|
||||
"name": "python3"
|
||||
}
|
||||
|
@ -300,7 +300,7 @@
|
||||
"split_at_heading": true
|
||||
},
|
||||
"kernelspec": {
|
||||
"display_name": "Python 3",
|
||||
"display_name": "python3",
|
||||
"language": "python",
|
||||
"name": "python3"
|
||||
}
|
||||
|
@ -755,7 +755,7 @@
|
||||
"split_at_heading": true
|
||||
},
|
||||
"kernelspec": {
|
||||
"display_name": "Python 3",
|
||||
"display_name": "python3",
|
||||
"language": "python",
|
||||
"name": "python3"
|
||||
}
|
||||
|
@ -1400,7 +1400,7 @@
|
||||
],
|
||||
"metadata": {
|
||||
"kernelspec": {
|
||||
"display_name": "Python 3 (ipykernel)",
|
||||
"display_name": "python3",
|
||||
"language": "python",
|
||||
"name": "python3"
|
||||
}
|
||||
|
@ -668,7 +668,7 @@
|
||||
"split_at_heading": true
|
||||
},
|
||||
"kernelspec": {
|
||||
"display_name": "Python 3 (ipykernel)",
|
||||
"display_name": "python3",
|
||||
"language": "python",
|
||||
"name": "python3"
|
||||
}
|
||||
|
@ -612,7 +612,7 @@
|
||||
"split_at_heading": true
|
||||
},
|
||||
"kernelspec": {
|
||||
"display_name": "Python 3",
|
||||
"display_name": "python3",
|
||||
"language": "python",
|
||||
"name": "python3"
|
||||
}
|
||||
|
@ -770,7 +770,7 @@
|
||||
"split_at_heading": true
|
||||
},
|
||||
"kernelspec": {
|
||||
"display_name": "Python 3",
|
||||
"display_name": "python3",
|
||||
"language": "python",
|
||||
"name": "python3"
|
||||
}
|
||||
|
@ -878,7 +878,7 @@
|
||||
"split_at_heading": true
|
||||
},
|
||||
"kernelspec": {
|
||||
"display_name": "Python 3",
|
||||
"display_name": "python3",
|
||||
"language": "python",
|
||||
"name": "python3"
|
||||
}
|
||||
|
@ -419,7 +419,7 @@
|
||||
"split_at_heading": true
|
||||
},
|
||||
"kernelspec": {
|
||||
"display_name": "Python 3",
|
||||
"display_name": "python3",
|
||||
"language": "python",
|
||||
"name": "python3"
|
||||
}
|
||||
|
@ -301,7 +301,7 @@
|
||||
"split_at_heading": true
|
||||
},
|
||||
"kernelspec": {
|
||||
"display_name": "Python 3",
|
||||
"display_name": "python3",
|
||||
"language": "python",
|
||||
"name": "python3"
|
||||
}
|
||||
|
@ -462,7 +462,7 @@
|
||||
"split_at_heading": true
|
||||
},
|
||||
"kernelspec": {
|
||||
"display_name": "Python 3",
|
||||
"display_name": "python3",
|
||||
"language": "python",
|
||||
"name": "python3"
|
||||
}
|
||||
|
@ -1114,7 +1114,7 @@
|
||||
"split_at_heading": true
|
||||
},
|
||||
"kernelspec": {
|
||||
"display_name": "Python 3",
|
||||
"display_name": "python3",
|
||||
"language": "python",
|
||||
"name": "python3"
|
||||
}
|
||||
|
@ -338,7 +338,7 @@
|
||||
"split_at_heading": true
|
||||
},
|
||||
"kernelspec": {
|
||||
"display_name": "Python 3",
|
||||
"display_name": "python3",
|
||||
"language": "python",
|
||||
"name": "python3"
|
||||
}
|
||||
|
@ -934,7 +934,7 @@
|
||||
"split_at_heading": true
|
||||
},
|
||||
"kernelspec": {
|
||||
"display_name": "Python 3",
|
||||
"display_name": "python3",
|
||||
"language": "python",
|
||||
"name": "python3"
|
||||
}
|
||||
|
@ -32,7 +32,7 @@
|
||||
"split_at_heading": true
|
||||
},
|
||||
"kernelspec": {
|
||||
"display_name": "Python 3",
|
||||
"display_name": "python3",
|
||||
"language": "python",
|
||||
"name": "python3"
|
||||
}
|
||||
|
@ -62,7 +62,7 @@
|
||||
"split_at_heading": true
|
||||
},
|
||||
"kernelspec": {
|
||||
"display_name": "Python 3",
|
||||
"display_name": "python3",
|
||||
"language": "python",
|
||||
"name": "python3"
|
||||
}
|
||||
|
@ -215,7 +215,7 @@
|
||||
],
|
||||
"metadata": {
|
||||
"kernelspec": {
|
||||
"display_name": "Python 3",
|
||||
"display_name": "python3",
|
||||
"language": "python",
|
||||
"name": "python3"
|
||||
}
|
||||
|
@ -7,6 +7,8 @@ dependencies:
|
||||
- python>=3.6
|
||||
- pytorch>=1.6
|
||||
- torchvision
|
||||
- execnb
|
||||
- nbformat
|
||||
- pip
|
||||
- pip:
|
||||
- -r requirements.txt
|
||||
|
@ -4,6 +4,7 @@ import nbformat
|
||||
from nbdev.export import *
|
||||
from nbdev.clean import *
|
||||
from fastcore.all import *
|
||||
from execnb.nbio import *
|
||||
|
||||
_re_header = re.compile(r'^#+\s+\S+')
|
||||
_re_clean = re.compile(r'^\s*#\s*clean\s*')
|
||||
@ -30,6 +31,11 @@ def proc_nb(fname, dest):
|
||||
nb['cells'] = [clean_tags(c) for j,c in enumerate(nb['cells']) if
|
||||
c['cell_type']=='code' or is_header_cell(c) or is_clean_cell(c) or j >= i]
|
||||
clean_nb(nb, clear_all=True)
|
||||
if 'path_' in nb:
|
||||
del nb['path_']
|
||||
for c in nb['cells']:
|
||||
if 'idx_' in c:
|
||||
del c['idx_']
|
||||
with open(dest/fname.name, 'w') as f: nbformat.write(nb, f, version=4)
|
||||
|
||||
def proc_all(path='.', dest_path='clean'):
|
||||
|
Loading…
Reference in New Issue
Block a user