From 5b4f4b8d1511a91923981ed4b8b203500cfc74d3 Mon Sep 17 00:00:00 2001 From: Akshay Agrawal Date: Mon, 13 Jan 2025 21:11:02 -0800 Subject: [PATCH] link to autoreloader in jupyter doc --- docs/guides/coming_from/jupyter.md | 37 ++++++++++--------- .../editor_features/module_autoreloading.md | 8 ++-- 2 files changed, 24 insertions(+), 21 deletions(-) diff --git a/docs/guides/coming_from/jupyter.md b/docs/guides/coming_from/jupyter.md index 0fc135616df..8cb21d34ce6 100644 --- a/docs/guides/coming_from/jupyter.md +++ b/docs/guides/coming_from/jupyter.md @@ -164,24 +164,25 @@ subprocess.run(["ls", "-l"]) ### Common magic commands replacements -| Magic Command | Replacement | -|--------------|-------------| -| %cd | `os.chdir()`, see also [`mo.notebook_dir()`][marimo.notebook_dir] | -| %clear | Right-click or toggle the cell actions | -| %debug | Python's built-in debugger: `breakpoint()` | -| %env | `os.environ` | -| %load | N/A - use Python imports | -| %load_ext | N/A | -| %matplotlib | marimo auto-displays plots | -| %pwd | `os.getcwd()` | -| %who_ls | `dir()`, `globals()`, [`mo.refs()`][marimo.refs], [`mo.defs()`][marimo.defs] | -| %system | `subprocess.run()` | -| %%time | `time.perf_counter()` or Python's timeit module | -| %%timeit | Python's timeit module | -| %%writefile | `with open("file.txt", "w") as f: f.write()` | -| %%capture | [`mo.capture_stdout()`][marimo.capture_stdout], [`mo.capture_stderr()`][marimo.capture_stderr] | -| %%html | [`mo.Html()`][marimo.Html] or [`mo.md()`][marimo.md] | -| %%latex | [`mo.md(r'$$...$$')`][marimo.md] | +| Magic Command | Replacement | +| ------------- | ---------------------------------------------------------------------------------------------- | +| %cd | `os.chdir()`, see also [`mo.notebook_dir()`][marimo.notebook_dir] | +| %clear | Right-click or toggle the cell actions | +| %debug | Python's built-in debugger: `breakpoint()` | +| %env | `os.environ` | +| %load | N/A - use Python imports | +| %load_ext | N/A | +| %autoreload | marimo's [module autoreloader](../../editor_features/module_autoreloading/) | +| %matplotlib | marimo auto-displays plots | +| %pwd | `os.getcwd()` | +| %who_ls | `dir()`, `globals()`, [`mo.refs()`][marimo.refs], [`mo.defs()`][marimo.defs] | +| %system | `subprocess.run()` | +| %%time | `time.perf_counter()` or Python's timeit module | +| %%timeit | Python's timeit module | +| %%writefile | `with open("file.txt", "w") as f: f.write()` | +| %%capture | [`mo.capture_stdout()`][marimo.capture_stdout], [`mo.capture_stderr()`][marimo.capture_stderr] | +| %%html | [`mo.Html()`][marimo.Html] or [`mo.md()`][marimo.md] | +| %%latex | [`mo.md(r'$$...$$')`][marimo.md] | ### Installing packages with marimo's package manager diff --git a/docs/guides/editor_features/module_autoreloading.md b/docs/guides/editor_features/module_autoreloading.md index 0efe497686e..dbc1c00919b 100644 --- a/docs/guides/editor_features/module_autoreloading.md +++ b/docs/guides/editor_features/module_autoreloading.md @@ -6,9 +6,11 @@ When you make edits to Python modules that your notebook has imported, the module autoreloader will automatically mark cells that use them as stale and, optionally, automatically run them. -Autoreloading enables a workflow that many developers find -productive: develop complex logic in Python modules, and use the marimo -notebook as a DAG or main script that orchestrates your logic. +!!! question "Why autoreload?" + + Autoreloading enables a workflow that many developers find + productive: develop complex logic in Python modules, and use the marimo + notebook as a DAG or main script that orchestrates your logic. Based on static analysis, the reloader only runs cells affected by your edits. The reloader is recursive, meaning that marimo tracks modifications for modules