This commit is contained in:
Nikhil Gupta 2025-02-03 12:59:51 +00:00 committed by GitHub
commit 2cbd46619b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
24 changed files with 30 additions and 22 deletions

View File

@ -564,7 +564,7 @@
"split_at_heading": true "split_at_heading": true
}, },
"kernelspec": { "kernelspec": {
"display_name": "Python 3 (ipykernel)", "display_name": "python3",
"language": "python", "language": "python",
"name": "python3" "name": "python3"
} }

View File

@ -693,7 +693,7 @@
"split_at_heading": true "split_at_heading": true
}, },
"kernelspec": { "kernelspec": {
"display_name": "Python 3", "display_name": "python3",
"language": "python", "language": "python",
"name": "python3" "name": "python3"
} }

View File

@ -313,7 +313,7 @@
"split_at_heading": true "split_at_heading": true
}, },
"kernelspec": { "kernelspec": {
"display_name": "Python 3", "display_name": "python3",
"language": "python", "language": "python",
"name": "python3" "name": "python3"
} }

View File

@ -1643,7 +1643,7 @@
"split_at_heading": true "split_at_heading": true
}, },
"kernelspec": { "kernelspec": {
"display_name": "Python 3 (ipykernel)", "display_name": "python3",
"language": "python", "language": "python",
"name": "python3" "name": "python3"
} }

View File

@ -709,7 +709,7 @@
"split_at_heading": true "split_at_heading": true
}, },
"kernelspec": { "kernelspec": {
"display_name": "Python 3 (ipykernel)", "display_name": "python3",
"language": "python", "language": "python",
"name": "python3" "name": "python3"
} }

View File

@ -712,7 +712,7 @@
"split_at_heading": true "split_at_heading": true
}, },
"kernelspec": { "kernelspec": {
"display_name": "Python 3 (ipykernel)", "display_name": "python3",
"language": "python", "language": "python",
"name": "python3" "name": "python3"
} }

View File

@ -300,7 +300,7 @@
"split_at_heading": true "split_at_heading": true
}, },
"kernelspec": { "kernelspec": {
"display_name": "Python 3", "display_name": "python3",
"language": "python", "language": "python",
"name": "python3" "name": "python3"
} }

View File

@ -755,7 +755,7 @@
"split_at_heading": true "split_at_heading": true
}, },
"kernelspec": { "kernelspec": {
"display_name": "Python 3", "display_name": "python3",
"language": "python", "language": "python",
"name": "python3" "name": "python3"
} }

View File

@ -1400,7 +1400,7 @@
], ],
"metadata": { "metadata": {
"kernelspec": { "kernelspec": {
"display_name": "Python 3 (ipykernel)", "display_name": "python3",
"language": "python", "language": "python",
"name": "python3" "name": "python3"
} }

View File

@ -668,7 +668,7 @@
"split_at_heading": true "split_at_heading": true
}, },
"kernelspec": { "kernelspec": {
"display_name": "Python 3 (ipykernel)", "display_name": "python3",
"language": "python", "language": "python",
"name": "python3" "name": "python3"
} }

View File

@ -612,7 +612,7 @@
"split_at_heading": true "split_at_heading": true
}, },
"kernelspec": { "kernelspec": {
"display_name": "Python 3", "display_name": "python3",
"language": "python", "language": "python",
"name": "python3" "name": "python3"
} }

View File

@ -770,7 +770,7 @@
"split_at_heading": true "split_at_heading": true
}, },
"kernelspec": { "kernelspec": {
"display_name": "Python 3", "display_name": "python3",
"language": "python", "language": "python",
"name": "python3" "name": "python3"
} }

View File

@ -878,7 +878,7 @@
"split_at_heading": true "split_at_heading": true
}, },
"kernelspec": { "kernelspec": {
"display_name": "Python 3", "display_name": "python3",
"language": "python", "language": "python",
"name": "python3" "name": "python3"
} }

View File

@ -419,7 +419,7 @@
"split_at_heading": true "split_at_heading": true
}, },
"kernelspec": { "kernelspec": {
"display_name": "Python 3", "display_name": "python3",
"language": "python", "language": "python",
"name": "python3" "name": "python3"
} }

View File

@ -301,7 +301,7 @@
"split_at_heading": true "split_at_heading": true
}, },
"kernelspec": { "kernelspec": {
"display_name": "Python 3", "display_name": "python3",
"language": "python", "language": "python",
"name": "python3" "name": "python3"
} }

View File

@ -462,7 +462,7 @@
"split_at_heading": true "split_at_heading": true
}, },
"kernelspec": { "kernelspec": {
"display_name": "Python 3", "display_name": "python3",
"language": "python", "language": "python",
"name": "python3" "name": "python3"
} }

View File

@ -1114,7 +1114,7 @@
"split_at_heading": true "split_at_heading": true
}, },
"kernelspec": { "kernelspec": {
"display_name": "Python 3", "display_name": "python3",
"language": "python", "language": "python",
"name": "python3" "name": "python3"
} }

View File

@ -338,7 +338,7 @@
"split_at_heading": true "split_at_heading": true
}, },
"kernelspec": { "kernelspec": {
"display_name": "Python 3", "display_name": "python3",
"language": "python", "language": "python",
"name": "python3" "name": "python3"
} }

View File

@ -934,7 +934,7 @@
"split_at_heading": true "split_at_heading": true
}, },
"kernelspec": { "kernelspec": {
"display_name": "Python 3", "display_name": "python3",
"language": "python", "language": "python",
"name": "python3" "name": "python3"
} }

View File

@ -32,7 +32,7 @@
"split_at_heading": true "split_at_heading": true
}, },
"kernelspec": { "kernelspec": {
"display_name": "Python 3", "display_name": "python3",
"language": "python", "language": "python",
"name": "python3" "name": "python3"
} }

View File

@ -62,7 +62,7 @@
"split_at_heading": true "split_at_heading": true
}, },
"kernelspec": { "kernelspec": {
"display_name": "Python 3", "display_name": "python3",
"language": "python", "language": "python",
"name": "python3" "name": "python3"
} }

View File

@ -215,7 +215,7 @@
], ],
"metadata": { "metadata": {
"kernelspec": { "kernelspec": {
"display_name": "Python 3", "display_name": "python3",
"language": "python", "language": "python",
"name": "python3" "name": "python3"
} }

View File

@ -7,6 +7,8 @@ dependencies:
- python>=3.6 - python>=3.6
- pytorch>=1.6 - pytorch>=1.6
- torchvision - torchvision
- execnb
- nbformat
- pip - pip
- pip: - pip:
- -r requirements.txt - -r requirements.txt

View File

@ -4,6 +4,7 @@ import nbformat
from nbdev.export import * from nbdev.export import *
from nbdev.clean import * from nbdev.clean import *
from fastcore.all import * from fastcore.all import *
from execnb.nbio import *
_re_header = re.compile(r'^#+\s+\S+') _re_header = re.compile(r'^#+\s+\S+')
_re_clean = re.compile(r'^\s*#\s*clean\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 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] c['cell_type']=='code' or is_header_cell(c) or is_clean_cell(c) or j >= i]
clean_nb(nb, clear_all=True) 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) with open(dest/fname.name, 'w') as f: nbformat.write(nb, f, version=4)
def proc_all(path='.', dest_path='clean'): def proc_all(path='.', dest_path='clean'):