Skip to content

Commit 387d98c

Browse files
committed
Update how the source code is formatted
1 parent c9dd464 commit 387d98c

File tree

2 files changed

+9
-11
lines changed

2 files changed

+9
-11
lines changed

readme.ipynb

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@
380380
"test_imports (src.importnb.tests.test_unittests.TestRemote) ... skipped 'requires IP'\n",
381381
"\n",
382382
"----------------------------------------------------------------------\n",
383-
"Ran 7 tests in 2.021s\n",
383+
"Ran 7 tests in 2.023s\n",
384384
"\n",
385385
"OK (skipped=1, expected failures=1)\n"
386386
]
@@ -391,9 +391,10 @@
391391
" from pathlib import Path\n",
392392
" from nbconvert.exporters.python import PythonExporter\n",
393393
" from importnb.compile import export\n",
394-
" for path in Path('src/notebooks/').rglob(\"\"\"*.ipynb\"\"\"): \n",
394+
" root = 'src/importnb/notebooks/'\n",
395+
" for path in Path(root).rglob(\"\"\"*.ipynb\"\"\"): \n",
395396
" if 'checkpoint' not in str(path):\n",
396-
" export(path, Path('src/importnb') / path.with_suffix('.py').relative_to('src/notebooks'))\n",
397+
" export(path, Path('src/importnb') / path.with_suffix('.py').relative_to(root))\n",
397398
" \n",
398399
" __import__('unittest').main(module='src.importnb.tests.test_unittests', argv=\"discover --verbose\".split(), exit=False) \n"
399400
]
@@ -408,7 +409,7 @@
408409
"output_type": "stream",
409410
"text": [
410411
"[NbConvertApp] Converting notebook readme.ipynb to markdown\n",
411-
"[NbConvertApp] Writing 7121 bytes to readme.md\n"
412+
"[NbConvertApp] Writing 7022 bytes to readme.md\n"
412413
]
413414
}
414415
],

readme.md

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -214,9 +214,10 @@ For example, create a file called `tricks.yaml` containing
214214
from pathlib import Path
215215
from nbconvert.exporters.python import PythonExporter
216216
from importnb.compile import export
217-
for path in Path('src/notebooks/').rglob("""*.ipynb"""):
217+
root = 'src/importnb/notebooks/'
218+
for path in Path(root).rglob("""*.ipynb"""):
218219
if 'checkpoint' not in str(path):
219-
export(path, Path('src/importnb') / path.with_suffix('.py').relative_to('src/notebooks'))
220+
export(path, Path('src/importnb') / path.with_suffix('.py').relative_to(root))
220221

221222
__import__('unittest').main(module='src.importnb.tests.test_unittests', argv="discover --verbose".split(), exit=False)
222223

@@ -231,7 +232,7 @@ For example, create a file called `tricks.yaml` containing
231232
test_imports (src.importnb.tests.test_unittests.TestRemote) ... skipped 'requires IP'
232233

233234
----------------------------------------------------------------------
234-
Ran 7 tests in 2.022s
235+
Ran 7 tests in 2.023s
235236

236237
OK (skipped=1, expected failures=1)
237238

@@ -242,10 +243,6 @@ For example, create a file called `tricks.yaml` containing
242243
!jupyter nbconvert --to markdown readme.ipynb
243244
```
244245

245-
[NbConvertApp] Converting notebook readme.ipynb to markdown
246-
[NbConvertApp] Writing 7130 bytes to readme.md
247-
248-
249246
if __name__ == '__main__':
250247
from IPython.display import display, Image
251248
!pyreverse importnb -opng -pimportnb

0 commit comments

Comments
 (0)