Skip to content

Commit

Permalink
link to autoreloader in jupyter doc
Browse files Browse the repository at this point in the history
  • Loading branch information
akshayka committed Jan 14, 2025
1 parent 1456b36 commit 5b4f4b8
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 21 deletions.
37 changes: 19 additions & 18 deletions docs/guides/coming_from/jupyter.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
8 changes: 5 additions & 3 deletions docs/guides/editor_features/module_autoreloading.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5b4f4b8

Please sign in to comment.