From 0100f8d80bf13fdddac4f959a940b99eea694f21 Mon Sep 17 00:00:00 2001 From: sizhky <1992chinna@gmail.com> Date: Sat, 18 Nov 2023 16:59:55 +0530 Subject: [PATCH] 0.507 --- _proc/adapters.ipynb | 28 +- _proc/bounding_boxes.ipynb | 8 +- _proc/config.ipynb | 8 +- _proc/decorators.ipynb | 12 +- _proc/interactive_show.ipynb | 36 +-- _proc/jupyter_notebook.ipynb | 83 ++++-- _proc/load_defautls.ipynb | 8 +- _proc/markups.ipynb | 38 ++- _proc/pdf.ipynb | 4 +- _proc/sklegos.ipynb | 24 +- changelog.md | 8 + docs/jupyter_notebook.html | 14 +- docs/markups.html | 32 ++- docs/search.json | 4 +- docs/sitemap.xml | 44 +-- nbs/jupyter_notebook.ipynb | 14 +- nbs/logging.ipynb | 35 +-- nbs/markups.ipynb | 94 ++++--- nbs/paths.ipynb | 6 +- scripts.ipynb | 515 +++++++++++++++-------------------- torch_snippets/_modidx.py | 4 + torch_snippets/dates.py | 2 + torch_snippets/ipython.py | 13 +- torch_snippets/loader.py | 2 + torch_snippets/logger.py | 35 +-- torch_snippets/markup.py | 20 +- torch_snippets/paths.py | 4 + 27 files changed, 586 insertions(+), 509 deletions(-) diff --git a/_proc/adapters.ipynb b/_proc/adapters.ipynb index 685038d..04a2a7c 100644 --- a/_proc/adapters.ipynb +++ b/_proc/adapters.ipynb @@ -48,8 +48,8 @@ } ], "source": [ - "#| echo: false\n", - "#| output: asis\n", + "# | echo: false\n", + "# | output: asis\n", "show_doc(file_2_bytes)" ] }, @@ -101,8 +101,8 @@ } ], "source": [ - "#| echo: false\n", - "#| output: asis\n", + "# | echo: false\n", + "# | output: asis\n", "show_doc(bytes_2_file)" ] }, @@ -150,8 +150,8 @@ } ], "source": [ - "#| echo: false\n", - "#| output: asis\n", + "# | echo: false\n", + "# | output: asis\n", "show_doc(b64_2_file)" ] }, @@ -183,8 +183,8 @@ } ], "source": [ - "#| echo: false\n", - "#| output: asis\n", + "# | echo: false\n", + "# | output: asis\n", "show_doc(b64_2_np)" ] }, @@ -220,8 +220,8 @@ } ], "source": [ - "#| echo: false\n", - "#| output: asis\n", + "# | echo: false\n", + "# | output: asis\n", "show_doc(np_2_b64)" ] }, @@ -253,8 +253,8 @@ } ], "source": [ - "#| echo: false\n", - "#| output: asis\n", + "# | echo: false\n", + "# | output: asis\n", "show_doc(cvat_2_csvs)" ] }, @@ -290,8 +290,8 @@ } ], "source": [ - "#| echo: false\n", - "#| output: asis\n", + "# | echo: false\n", + "# | output: asis\n", "show_doc(csvs_2_cvat)" ] }, diff --git a/_proc/bounding_boxes.ipynb b/_proc/bounding_boxes.ipynb index f18fed1..e31c824 100644 --- a/_proc/bounding_boxes.ipynb +++ b/_proc/bounding_boxes.ipynb @@ -586,8 +586,8 @@ } ], "source": [ - "#| echo: false\n", - "#| output: asis\n", + "# | echo: false\n", + "# | output: asis\n", "show_doc(isin)" ] }, @@ -625,8 +625,8 @@ } ], "source": [ - "#| echo: false\n", - "#| output: asis\n", + "# | echo: false\n", + "# | output: asis\n", "show_doc(merge_by_bb)" ] } diff --git a/_proc/config.ipynb b/_proc/config.ipynb index f5daeb6..3e90471 100644 --- a/_proc/config.ipynb +++ b/_proc/config.ipynb @@ -39,8 +39,8 @@ } ], "source": [ - "#| echo: false\n", - "#| output: asis\n", + "# | echo: false\n", + "# | output: asis\n", "show_doc(DeepLearningConfig)" ] }, @@ -235,8 +235,8 @@ } ], "source": [ - "#| echo: false\n", - "#| output: asis\n", + "# | echo: false\n", + "# | output: asis\n", "show_doc(GenericConfig)" ] }, diff --git a/_proc/decorators.ipynb b/_proc/decorators.ipynb index 31377e2..dfe88e5 100644 --- a/_proc/decorators.ipynb +++ b/_proc/decorators.ipynb @@ -47,8 +47,8 @@ } ], "source": [ - "#| echo: false\n", - "#| output: asis\n", + "# | echo: false\n", + "# | output: asis\n", "show_doc(check_kwargs_not_none)" ] }, @@ -80,8 +80,8 @@ } ], "source": [ - "#| echo: false\n", - "#| output: asis\n", + "# | echo: false\n", + "# | output: asis\n", "show_doc(io)" ] }, @@ -113,8 +113,8 @@ } ], "source": [ - "#| echo: false\n", - "#| output: asis\n", + "# | echo: false\n", + "# | output: asis\n", "show_doc(timeit)" ] }, diff --git a/_proc/interactive_show.ipynb b/_proc/interactive_show.ipynb index f38da62..0e01476 100644 --- a/_proc/interactive_show.ipynb +++ b/_proc/interactive_show.ipynb @@ -35,8 +35,8 @@ } ], "source": [ - "#| echo: false\n", - "#| output: asis\n", + "# | echo: false\n", + "# | output: asis\n", "show_doc(ishow)" ] }, @@ -68,8 +68,8 @@ } ], "source": [ - "#| echo: false\n", - "#| output: asis\n", + "# | echo: false\n", + "# | output: asis\n", "show_doc(df2graph_nodes)" ] }, @@ -101,8 +101,8 @@ } ], "source": [ - "#| echo: false\n", - "#| output: asis\n", + "# | echo: false\n", + "# | output: asis\n", "show_doc(viz2)" ] }, @@ -134,8 +134,8 @@ } ], "source": [ - "#| echo: false\n", - "#| output: asis\n", + "# | echo: false\n", + "# | output: asis\n", "show_doc(convert_to_nx)" ] }, @@ -167,8 +167,8 @@ } ], "source": [ - "#| echo: false\n", - "#| output: asis\n", + "# | echo: false\n", + "# | output: asis\n", "show_doc(tolist)" ] }, @@ -200,8 +200,8 @@ } ], "source": [ - "#| echo: false\n", - "#| output: asis\n", + "# | echo: false\n", + "# | output: asis\n", "show_doc(tonp)" ] }, @@ -233,8 +233,8 @@ } ], "source": [ - "#| echo: false\n", - "#| output: asis\n", + "# | echo: false\n", + "# | output: asis\n", "show_doc(plot_graph)" ] }, @@ -266,8 +266,8 @@ } ], "source": [ - "#| echo: false\n", - "#| output: asis\n", + "# | echo: false\n", + "# | output: asis\n", "show_doc(plot_image)" ] }, @@ -371,8 +371,8 @@ } ], "source": [ - "#| echo: false\n", - "#| output: asis\n", + "# | echo: false\n", + "# | output: asis\n", "show_doc(to_networkx)" ] } diff --git a/_proc/jupyter_notebook.ipynb b/_proc/jupyter_notebook.ipynb index 3a0ab8b..a1d1080 100644 --- a/_proc/jupyter_notebook.ipynb +++ b/_proc/jupyter_notebook.ipynb @@ -57,6 +57,39 @@ "cell_type": "code", "execution_count": 2, "metadata": {}, + "outputs": [ + { + "data": { + "text/markdown": [ + "---\n", + "\n", + "### backup_all_notebooks\n", + "\n", + "> backup_all_notebooks (folder)" + ], + "text/plain": [ + "---\n", + "\n", + "### backup_all_notebooks\n", + "\n", + "> backup_all_notebooks (folder)" + ] + }, + "execution_count": 2, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "#| echo: false\n", + "#| output: asis\n", + "show_doc(backup_all_notebooks)" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, "outputs": [ { "data": { @@ -67,7 +100,7 @@ "\n", "> backup_this_notebook (this_file_path, save_html_to=None,\n", "> override_previous_backup=False, changelog=None,\n", - "> exclude_input=False)" + "> exclude_input=False, force_save_notebook=True)" ], "text/plain": [ "---\n", @@ -76,10 +109,10 @@ "\n", "> backup_this_notebook (this_file_path, save_html_to=None,\n", "> override_previous_backup=False, changelog=None,\n", - "> exclude_input=False)" + "> exclude_input=False, force_save_notebook=True)" ] }, - "execution_count": 2, + "execution_count": 3, "metadata": {}, "output_type": "execute_result" } @@ -92,7 +125,7 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 4, "metadata": {}, "outputs": [ { @@ -112,7 +145,7 @@ "> save_notebook (file_path)" ] }, - "execution_count": 3, + "execution_count": 4, "metadata": {}, "output_type": "execute_result" } @@ -136,7 +169,7 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 5, "metadata": {}, "outputs": [ { @@ -156,7 +189,7 @@ "> show_big_dataframe (df, max_rows=30)" ] }, - "execution_count": 4, + "execution_count": 5, "metadata": {}, "output_type": "execute_result" } @@ -169,7 +202,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 6, "metadata": {}, "outputs": [ { @@ -180,7 +213,7 @@ "### display_dfs_side_by_side\n", "\n", "> display_dfs_side_by_side (*args, titles= 0x7f88f1237100>, max_rows=50)" + "> 0x7f915b1867c0>, max_rows=50)" ], "text/plain": [ "---\n", @@ -188,10 +221,10 @@ "### display_dfs_side_by_side\n", "\n", "> display_dfs_side_by_side (*args, titles= 0x7f88f1237100>, max_rows=50)" + "> 0x7f915b1867c0>, max_rows=50)" ] }, - "execution_count": 5, + "execution_count": 6, "metadata": {}, "output_type": "execute_result" } @@ -204,7 +237,7 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 7, "metadata": {}, "outputs": [ { @@ -224,7 +257,7 @@ "> h6 (text)" ] }, - "execution_count": 6, + "execution_count": 7, "metadata": {}, "output_type": "execute_result" } @@ -237,7 +270,7 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 8, "metadata": {}, "outputs": [ { @@ -257,7 +290,7 @@ "> h5 (text)" ] }, - "execution_count": 7, + "execution_count": 8, "metadata": {}, "output_type": "execute_result" } @@ -270,7 +303,7 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": 9, "metadata": {}, "outputs": [ { @@ -290,7 +323,7 @@ "> h4 (text)" ] }, - "execution_count": 8, + "execution_count": 9, "metadata": {}, "output_type": "execute_result" } @@ -303,7 +336,7 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 10, "metadata": {}, "outputs": [ { @@ -323,7 +356,7 @@ "> h3 (text)" ] }, - "execution_count": 9, + "execution_count": 10, "metadata": {}, "output_type": "execute_result" } @@ -336,7 +369,7 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": 11, "metadata": {}, "outputs": [ { @@ -356,7 +389,7 @@ "> h2 (text)" ] }, - "execution_count": 10, + "execution_count": 11, "metadata": {}, "output_type": "execute_result" } @@ -369,7 +402,7 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 12, "metadata": {}, "outputs": [ { @@ -389,7 +422,7 @@ "> h1 (text)" ] }, - "execution_count": 11, + "execution_count": 12, "metadata": {}, "output_type": "execute_result" } @@ -402,7 +435,7 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": 13, "metadata": {}, "outputs": [ { @@ -422,7 +455,7 @@ "> shutdown_current_notebook (delay:int=None)" ] }, - "execution_count": 12, + "execution_count": 13, "metadata": {}, "output_type": "execute_result" } diff --git a/_proc/load_defautls.ipynb b/_proc/load_defautls.ipynb index eb3ed03..6faae90 100644 --- a/_proc/load_defautls.ipynb +++ b/_proc/load_defautls.ipynb @@ -51,8 +51,8 @@ } ], "source": [ - "#| echo: false\n", - "#| output: asis\n", + "# | echo: false\n", + "# | output: asis\n", "show_doc(loadifexists)" ] }, @@ -88,8 +88,8 @@ } ], "source": [ - "#| echo: false\n", - "#| output: asis\n", + "# | echo: false\n", + "# | output: asis\n", "show_doc(exists)" ] } diff --git a/_proc/markups.ipynb b/_proc/markups.ipynb index 8275ab8..ff2fbf2 100644 --- a/_proc/markups.ipynb +++ b/_proc/markups.ipynb @@ -81,14 +81,13 @@ "#| echo: false\n", "#| output: asis\n", "from nbdev import show_doc\n", - "from torch_snippets import AttrDict\n", "\n", "show_doc(AttrDict)" ] }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 22, "id": "bfb4146f-90bf-42bc-bf40-69fb6d612ea2", "metadata": { "execution": { @@ -173,7 +172,7 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 23, "id": "7c5c6a5f-0b72-4e47-8dcf-c8f68e6cfaba", "metadata": { "execution": { @@ -272,6 +271,31 @@ "print(\"e\" in y.d)" ] }, + { + "cell_type": "code", + "execution_count": 24, + "id": "74fbdc3d", + "metadata": { + "language": "python" + }, + "outputs": [ + { + "data": { + "text/plain": [ + "{'b': 10, 'c': 11}" + ] + }, + "execution_count": 24, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "x = {\"abc\": {\"b\": 10, \"c\": 11}, \"d\": {\"e\": {\"f\": [2, {\"abc\": \"pqrs\"}, 2.234]}}}\n", + "y = AttrDict(x)\n", + "y.abc[[\"b\", \"c\"]]" + ] + }, { "cell_type": "code", "execution_count": 2, @@ -340,7 +364,7 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": null, "id": "2f9a8810-5782-4bcc-a34f-33f04c855ada", "metadata": { "language": "python", @@ -589,7 +613,7 @@ "\n", "### write_xml\n", "\n", - "> write_xml (data:Union[torch_snippets.markup.AttrDict,dict],\n", + "> write_xml (data:Union[__main__.AttrDict,dict],\n", "> file_path:Union[str,pathlib.Path])" ], "text/plain": [ @@ -597,7 +621,7 @@ "\n", "### write_xml\n", "\n", - "> write_xml (data:Union[torch_snippets.markup.AttrDict,dict],\n", + "> write_xml (data:Union[__main__.AttrDict,dict],\n", "> file_path:Union[str,pathlib.Path])" ] }, @@ -676,7 +700,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.9" + "version": "3.8.15" }, "vscode": { "interpreter": { diff --git a/_proc/pdf.ipynb b/_proc/pdf.ipynb index eeba8d8..12d30a6 100644 --- a/_proc/pdf.ipynb +++ b/_proc/pdf.ipynb @@ -55,8 +55,8 @@ } ], "source": [ - "#| echo: false\n", - "#| output: asis\n", + "# | echo: false\n", + "# | output: asis\n", "show_doc(PDF)" ] }, diff --git a/_proc/sklegos.ipynb b/_proc/sklegos.ipynb index 90020b3..fecff0a 100644 --- a/_proc/sklegos.ipynb +++ b/_proc/sklegos.ipynb @@ -66,8 +66,8 @@ } ], "source": [ - "#| echo: false\n", - "#| output: asis\n", + "# | echo: false\n", + "# | output: asis\n", "show_doc(MakeFrame)" ] }, @@ -130,8 +130,8 @@ } ], "source": [ - "#| echo: false\n", - "#| output: asis\n", + "# | echo: false\n", + "# | output: asis\n", "show_doc(ImputeMissingValues)" ] }, @@ -175,8 +175,8 @@ } ], "source": [ - "#| echo: false\n", - "#| output: asis\n", + "# | echo: false\n", + "# | output: asis\n", "show_doc(LambdaTransformer)" ] }, @@ -212,8 +212,8 @@ } ], "source": [ - "#| echo: false\n", - "#| output: asis\n", + "# | echo: false\n", + "# | output: asis\n", "show_doc(MakeFrame)" ] }, @@ -249,8 +249,8 @@ } ], "source": [ - "#| echo: false\n", - "#| output: asis\n", + "# | echo: false\n", + "# | output: asis\n", "show_doc(Cat2Num)" ] }, @@ -286,8 +286,8 @@ } ], "source": [ - "#| echo: false\n", - "#| output: asis\n", + "# | echo: false\n", + "# | output: asis\n", "show_doc(SplitDateColumn)" ] }, diff --git a/changelog.md b/changelog.md index aaa4262..e1198f6 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,13 @@ # Changelog +#### 0.507 + +🧹 import only important functins from `dates.py` +πŸŽ‰ add `backup_all_notebooks` that backs up every notebook present in a specific folder +πŸŽ‰ `reset_logger` can disable stdout logging if needed, using `disable_stdout=True` kwarg (False by default) +`common_items` will take a list of folders and return common stems from the folders +images will show a black border when grid is True + #### 0.506 Info, Debug, Warn and Excep will format ouputs separated by a `;` when args are passed diff --git a/docs/jupyter_notebook.html b/docs/jupyter_notebook.html index fb3155a..4578e73 100644 --- a/docs/jupyter_notebook.html +++ b/docs/jupyter_notebook.html @@ -282,6 +282,7 @@

On this page