diff --git a/fastcore/_nbdev.py b/fastcore/_nbdev.py index dccc6cbc..af4012af 100644 --- a/fastcore/_nbdev.py +++ b/fastcore/_nbdev.py @@ -150,6 +150,7 @@ "save_config_file": "02_foundation.ipynb", "read_config_file": "02_foundation.ipynb", "Config": "02_foundation.ipynb", + "working_dir": "03_xtras.ipynb", "walk": "03_xtras.ipynb", "globtastic": "03_xtras.ipynb", "maybe_open": "03_xtras.ipynb", diff --git a/fastcore/xtras.py b/fastcore/xtras.py index 979ade63..9e81035e 100644 --- a/fastcore/xtras.py +++ b/fastcore/xtras.py @@ -4,12 +4,12 @@ from __future__ import annotations -__all__ = ['walk', 'globtastic', 'maybe_open', 'image_size', 'bunzip', 'loads', 'loads_multi', 'dumps', 'untar_dir', - 'repo_details', 'run', 'open_file', 'save_pickle', 'load_pickle', 'dict2obj', 'obj2dict', 'repr_dict', - 'is_listy', 'mapped', 'IterLen', 'ReindexCollection', 'get_source_link', 'truncstr', 'spark_chars', - 'sparkline', 'modify_exception', 'round_multiple', 'str2bool', 'set_num_threads', 'join_path_file', - 'autostart', 'EventTimer', 'stringfmt_names', 'PartialFormatter', 'partial_format', 'utc2local', 'local2utc', - 'trace', 'modified_env', 'ContextManagers', 'shufflish'] +__all__ = ['working_dir', 'walk', 'globtastic', 'maybe_open', 'image_size', 'bunzip', 'loads', 'loads_multi', 'dumps', + 'untar_dir', 'repo_details', 'run', 'open_file', 'save_pickle', 'load_pickle', 'dict2obj', 'obj2dict', + 'repr_dict', 'is_listy', 'mapped', 'IterLen', 'ReindexCollection', 'get_source_link', 'truncstr', + 'spark_chars', 'sparkline', 'modify_exception', 'round_multiple', 'str2bool', 'set_num_threads', + 'join_path_file', 'autostart', 'EventTimer', 'stringfmt_names', 'PartialFormatter', 'partial_format', + 'utc2local', 'local2utc', 'trace', 'modified_env', 'ContextManagers', 'shufflish'] # Cell #nbdev_comment from __future__ import annotations @@ -24,6 +24,16 @@ from contextlib import contextmanager,ExitStack from datetime import datetime, timezone +# Cell +@contextmanager +def working_dir(path:Path|str, # path to temporarily change the working directory to + ): + "Changes working directory and returns to previous on exit." + prev_cwd = Path.cwd() + os.chdir(path) + try: yield + finally: os.chdir(prev_cwd) + # Cell def walk( path:Path|str, # path to start searching diff --git a/nbs/03_xtras.ipynb b/nbs/03_xtras.ipynb index 0e617f58..6fc9531e 100644 --- a/nbs/03_xtras.ipynb +++ b/nbs/03_xtras.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "code", - "execution_count": null, + "execution_count": 1, "metadata": {}, "outputs": [], "source": [ @@ -11,7 +11,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 2, "metadata": {}, "outputs": [], "source": [ @@ -21,7 +21,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 3, "metadata": {}, "outputs": [], "source": [ @@ -38,7 +38,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 4, "metadata": {}, "outputs": [], "source": [ @@ -63,7 +63,62 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "## File Functions" + "## File Functions\n", + "\n", + "A Context Manager For Changing Directories" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": {}, + "outputs": [], + "source": [ + "#export\n", + "@contextmanager\n", + "def working_dir(path:Path|str, # path to temporarily change the working directory to\n", + " ):\n", + " \"Changes working directory and returns to previous on exit.\"\n", + " prev_cwd = Path.cwd()\n", + " os.chdir(path)\n", + " try: yield\n", + " finally: os.chdir(prev_cwd)" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "/Users/hamel/github/fastcore/fastcore\n", + "/Users/hamel/github/fastcore/nbs\n" + ] + } + ], + "source": [ + "with working_dir('../fastcore/'):\n", + " print(os.getcwd())\n", + "print(os.getcwd())" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": {}, + "outputs": [], + "source": [ + "#hide\n", + "_cwd = os.getcwd()\n", + "with working_dir('../fastcore/'):\n", + " _cwd_temp = os.getcwd()\n", + " assert _cwd_temp != _cwd\n", + " \n", + "_cwd_after = os.getcwd()\n", + "assert _cwd == _cwd_after" ] }, { @@ -75,7 +130,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 8, "metadata": {}, "outputs": [], "source": [ @@ -97,7 +152,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 9, "metadata": {}, "outputs": [], "source": [ @@ -134,7 +189,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 10, "metadata": {}, "outputs": [ { @@ -143,7 +198,7 @@ "(#9) ['./08_script.ipynb','./04_dispatch.ipynb','./06_docments.ipynb','./01_basics.ipynb','./fastcore/docments.py','./fastcore/dispatch.py','./fastcore/basics.py','./fastcore/docscrape.py','./fastcore/script.py']" ] }, - "execution_count": null, + "execution_count": 10, "metadata": {}, "output_type": "execute_result" } @@ -154,7 +209,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 11, "metadata": {}, "outputs": [], "source": [ @@ -176,7 +231,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 12, "metadata": {}, "outputs": [], "source": [ @@ -198,7 +253,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 13, "metadata": {}, "outputs": [], "source": [ @@ -231,7 +286,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 14, "metadata": {}, "outputs": [ { @@ -240,7 +295,7 @@ "'jpeg'" ] }, - "execution_count": null, + "execution_count": 14, "metadata": {}, "output_type": "execute_result" } @@ -259,7 +314,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 15, "metadata": {}, "outputs": [], "source": [ @@ -279,7 +334,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 16, "metadata": {}, "outputs": [], "source": [ @@ -295,7 +350,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 17, "metadata": {}, "outputs": [], "source": [ @@ -311,7 +366,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 18, "metadata": {}, "outputs": [], "source": [ @@ -320,7 +375,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 19, "metadata": {}, "outputs": [], "source": [ @@ -351,7 +406,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 20, "metadata": {}, "outputs": [], "source": [ @@ -360,7 +415,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 21, "metadata": {}, "outputs": [], "source": [ @@ -378,7 +433,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 22, "metadata": {}, "outputs": [], "source": [ @@ -393,7 +448,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 23, "metadata": {}, "outputs": [], "source": [ @@ -408,7 +463,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 24, "metadata": {}, "outputs": [], "source": [ @@ -427,7 +482,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 25, "metadata": {}, "outputs": [], "source": [ @@ -445,7 +500,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 26, "metadata": {}, "outputs": [], "source": [ @@ -460,7 +515,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 27, "metadata": {}, "outputs": [], "source": [ @@ -474,7 +529,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 28, "metadata": {}, "outputs": [], "source": [ @@ -499,7 +554,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 29, "metadata": {}, "outputs": [], "source": [ @@ -522,7 +577,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 30, "metadata": {}, "outputs": [], "source": [ @@ -539,7 +594,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 31, "metadata": {}, "outputs": [], "source": [ @@ -555,7 +610,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 32, "metadata": {}, "outputs": [], "source": [ @@ -565,7 +620,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 33, "metadata": {}, "outputs": [], "source": [ @@ -579,7 +634,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 34, "metadata": {}, "outputs": [], "source": [ @@ -589,7 +644,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 35, "metadata": {}, "outputs": [], "source": [ @@ -627,7 +682,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 36, "metadata": {}, "outputs": [ { @@ -636,7 +691,7 @@ "'pip 21.2.4 from /Users/hamel/opt/anaconda3/lib/python3.9/site-packages/pip (python 3.9)'" ] }, - "execution_count": null, + "execution_count": 36, "metadata": {}, "output_type": "execute_result" } @@ -649,7 +704,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 37, "metadata": {}, "outputs": [], "source": [ @@ -672,7 +727,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 38, "metadata": {}, "outputs": [], "source": [ @@ -691,7 +746,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 39, "metadata": {}, "outputs": [], "source": [ @@ -704,7 +759,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 40, "metadata": {}, "outputs": [], "source": [ @@ -722,7 +777,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 41, "metadata": {}, "outputs": [], "source": [ @@ -735,7 +790,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 42, "metadata": {}, "outputs": [], "source": [ @@ -748,7 +803,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 43, "metadata": {}, "outputs": [], "source": [ @@ -772,7 +827,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 44, "metadata": {}, "outputs": [], "source": [ @@ -793,7 +848,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 45, "metadata": {}, "outputs": [], "source": [ @@ -812,7 +867,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 46, "metadata": {}, "outputs": [], "source": [ @@ -823,7 +878,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 47, "metadata": {}, "outputs": [], "source": [ @@ -844,7 +899,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 48, "metadata": {}, "outputs": [], "source": [ @@ -854,7 +909,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 49, "metadata": {}, "outputs": [], "source": [ @@ -869,7 +924,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 50, "metadata": {}, "outputs": [], "source": [ @@ -881,7 +936,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 51, "metadata": {}, "outputs": [ { @@ -901,7 +956,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 52, "metadata": {}, "outputs": [], "source": [ @@ -913,7 +968,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 53, "metadata": {}, "outputs": [], "source": [ @@ -926,7 +981,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 54, "metadata": {}, "outputs": [], "source": [ @@ -938,7 +993,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 55, "metadata": {}, "outputs": [], "source": [ @@ -965,7 +1020,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 56, "metadata": {}, "outputs": [], "source": [ @@ -978,7 +1033,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 57, "metadata": {}, "outputs": [], "source": [ @@ -991,7 +1046,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 58, "metadata": {}, "outputs": [], "source": [ @@ -1005,7 +1060,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 59, "metadata": {}, "outputs": [], "source": [ @@ -1018,16 +1073,16 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 60, "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "Path('/home/jhoward/git/fastcore/fastcore')" + "Path('/Users/hamel/github/fastcore/fastcore')" ] }, - "execution_count": null, + "execution_count": 60, "metadata": {}, "output_type": "execute_result" } @@ -1039,7 +1094,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 61, "metadata": {}, "outputs": [ { @@ -1048,7 +1103,7 @@ "Path('../fastcore')" ] }, - "execution_count": null, + "execution_count": 61, "metadata": {}, "output_type": "execute_result" } @@ -1059,7 +1114,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 62, "metadata": {}, "outputs": [], "source": [ @@ -1085,16 +1140,16 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 63, "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "Path('05_transform.ipynb')" + "Path('parallel_test.py')" ] }, - "execution_count": null, + "execution_count": 63, "metadata": {}, "output_type": "execute_result" } @@ -1119,16 +1174,16 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 64, "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "(Path('../fastcore/all.py'), Path('05_transform.ipynb'))" + "(Path('../fastcore/shutil.py'), Path('parallel_win.ipynb'))" ] }, - "execution_count": null, + "execution_count": 64, "metadata": {}, "output_type": "execute_result" } @@ -1144,7 +1199,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 65, "metadata": {}, "outputs": [], "source": [ @@ -1157,7 +1212,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 66, "metadata": {}, "outputs": [], "source": [ @@ -1180,7 +1235,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 67, "metadata": {}, "outputs": [], "source": [ @@ -1193,7 +1248,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 68, "metadata": {}, "outputs": [], "source": [ @@ -1217,7 +1272,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 69, "metadata": {}, "outputs": [], "source": [ @@ -1230,7 +1285,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 70, "metadata": {}, "outputs": [], "source": [ @@ -1262,7 +1317,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 71, "metadata": {}, "outputs": [ { @@ -1304,7 +1359,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 72, "metadata": {}, "outputs": [ { @@ -1313,7 +1368,7 @@ "['e', 'd', 'c', 'b', 'a']" ] }, - "execution_count": null, + "execution_count": 72, "metadata": {}, "output_type": "execute_result" } @@ -1332,7 +1387,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 73, "metadata": {}, "outputs": [ { @@ -1358,7 +1413,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 74, "metadata": {}, "outputs": [ { @@ -1367,7 +1422,7 @@ "['e', 'd', 'c', 'b', 'a']" ] }, - "execution_count": null, + "execution_count": 74, "metadata": {}, "output_type": "execute_result" } @@ -1387,7 +1442,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 75, "metadata": {}, "outputs": [ { @@ -1396,7 +1451,7 @@ "CacheInfo(hits=1, misses=1, maxsize=2, currsize=1)" ] }, - "execution_count": null, + "execution_count": 75, "metadata": {}, "output_type": "execute_result" } @@ -1419,7 +1474,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 76, "metadata": {}, "outputs": [ { @@ -1445,7 +1500,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 77, "metadata": {}, "outputs": [ { @@ -1454,7 +1509,7 @@ "CacheInfo(hits=0, misses=0, maxsize=2, currsize=0)" ] }, - "execution_count": null, + "execution_count": 77, "metadata": {}, "output_type": "execute_result" } @@ -1471,7 +1526,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 78, "metadata": {}, "outputs": [ { @@ -1504,16 +1559,16 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 79, "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "['h', 'b', 'e', 'g', 'a', 'd', 'f', 'c']" + "['b', 'f', 'h', 'a', 'g', 'c', 'e', 'd']" ] }, - "execution_count": null, + "execution_count": 79, "metadata": {}, "output_type": "execute_result" } @@ -1526,7 +1581,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 80, "metadata": {}, "outputs": [], "source": [ @@ -1546,7 +1601,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 81, "metadata": {}, "outputs": [], "source": [ @@ -1565,7 +1620,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 82, "metadata": {}, "outputs": [], "source": [ @@ -1608,7 +1663,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 83, "metadata": {}, "outputs": [ { @@ -1617,7 +1672,7 @@ "'https://github.com/fastai/fastcore/tree/master/fastcore/test.py#L34'" ] }, - "execution_count": null, + "execution_count": 83, "metadata": {}, "output_type": "execute_result" } @@ -1638,7 +1693,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 84, "metadata": {}, "outputs": [ { @@ -1647,7 +1702,7 @@ "'nbformat/converter.py#L11'" ] }, - "execution_count": null, + "execution_count": 84, "metadata": {}, "output_type": "execute_result" } @@ -1660,7 +1715,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 85, "metadata": {}, "outputs": [], "source": [ @@ -1672,7 +1727,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 86, "metadata": {}, "outputs": [], "source": [ @@ -1687,7 +1742,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 87, "metadata": {}, "outputs": [], "source": [ @@ -1697,7 +1752,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 88, "metadata": {}, "outputs": [], "source": [ @@ -1713,7 +1768,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 89, "metadata": {}, "outputs": [], "source": [ @@ -1729,7 +1784,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 90, "metadata": {}, "outputs": [ { @@ -1756,7 +1811,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 91, "metadata": {}, "outputs": [ { @@ -1765,7 +1820,7 @@ "'▂▅▇▇'" ] }, - "execution_count": null, + "execution_count": 91, "metadata": {}, "output_type": "execute_result" } @@ -1776,7 +1831,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 92, "metadata": {}, "outputs": [], "source": [ @@ -1793,7 +1848,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 93, "metadata": {}, "outputs": [], "source": [ @@ -1807,7 +1862,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 94, "metadata": {}, "outputs": [], "source": [ @@ -1821,7 +1876,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 95, "metadata": {}, "outputs": [], "source": [ @@ -1835,7 +1890,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 96, "metadata": {}, "outputs": [], "source": [ @@ -1859,7 +1914,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 97, "metadata": {}, "outputs": [], "source": [ @@ -1871,7 +1926,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 98, "metadata": {}, "outputs": [], "source": [ @@ -1899,7 +1954,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 99, "metadata": {}, "outputs": [], "source": [ @@ -1913,7 +1968,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 100, "metadata": {}, "outputs": [], "source": [ @@ -1934,7 +1989,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 101, "metadata": {}, "outputs": [], "source": [ @@ -1951,7 +2006,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 102, "metadata": {}, "outputs": [], "source": [ @@ -1982,7 +2037,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 103, "metadata": {}, "outputs": [ { @@ -2015,15 +2070,15 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 104, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "Num Events: 7, Freq/sec: 315.8\n", - "Most recent: ▇▁▁▂▅ 423.6 331.5 332.6 361.3 399.7\n" + "Num Events: 5, Freq/sec: 335.2\n", + "Most recent: ▃▇▅▁▅ 295.5 381.6 305.9 192.9 313.0\n" ] } ], @@ -2039,7 +2094,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 105, "metadata": {}, "outputs": [], "source": [ @@ -2049,7 +2104,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 106, "metadata": {}, "outputs": [], "source": [ @@ -2061,7 +2116,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 107, "metadata": {}, "outputs": [], "source": [ @@ -2071,7 +2126,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 108, "metadata": {}, "outputs": [], "source": [ @@ -2094,7 +2149,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 109, "metadata": {}, "outputs": [ { @@ -2120,7 +2175,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 110, "metadata": {}, "outputs": [], "source": [ @@ -2141,7 +2196,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 111, "metadata": {}, "outputs": [], "source": [ @@ -2153,7 +2208,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 112, "metadata": {}, "outputs": [], "source": [ @@ -2165,14 +2220,14 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 113, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "2000-01-01 12:00:00 UTC is 2000-01-01 22:00:00+10:00 local time\n" + "2000-01-01 12:00:00 UTC is 2000-01-01 04:00:00-08:00 local time\n" ] } ], @@ -2183,7 +2238,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 114, "metadata": {}, "outputs": [], "source": [ @@ -2195,14 +2250,14 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 115, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "2000-01-01 12:00:00 local is 2000-01-01 02:00:00+00:00 UTC time\n" + "2000-01-01 12:00:00 local is 2000-01-01 20:00:00+00:00 UTC time\n" ] } ], @@ -2212,7 +2267,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 116, "metadata": {}, "outputs": [], "source": [ @@ -2244,7 +2299,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 117, "metadata": {}, "outputs": [], "source": [ @@ -2264,7 +2319,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 118, "metadata": {}, "outputs": [], "source": [ @@ -2283,7 +2338,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 119, "metadata": {}, "outputs": [], "source": [ @@ -2297,7 +2352,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 120, "metadata": {}, "outputs": [ { @@ -2323,7 +2378,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 121, "metadata": {}, "outputs": [], "source": [ @@ -2344,7 +2399,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 122, "metadata": {}, "outputs": [ { @@ -2389,6 +2444,18 @@ "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.7" } }, "nbformat": 4, diff --git a/nbs/index.ipynb b/nbs/index.ipynb index aae3de82..485dcad9 100644 --- a/nbs/index.ipynb +++ b/nbs/index.ipynb @@ -790,11 +790,23 @@ "split_at_heading": true }, "kernelspec": { - "display_name": "Python 3", + "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.7" } }, "nbformat": 4, - "nbformat_minor": 2 + "nbformat_minor": 4 }