marimo-team / marimo

A reactive notebook for Python — run reproducible experiments, execute as a script, deploy as an app, and version with git.
https://marimo.io
Apache License 2.0
5.31k stars 155 forks source link

Multiple tabs in a single notebook #1646

Closed Eloitor closed 1 week ago

Eloitor commented 1 week ago

Description

I am hoping to be able to have multiple similar examples of some computations on a single document. Having one document for each example is very inefficient.

A single document for related examples makes it easier to share it.

Suggested solution

Each "Tab" could hold a separate example in an independent way.

Maybe some cells could be common to all tabs.

Silly example:

Common cell for all tabs: p=2 + More setup required.

Tab 1: a=1 + some other computations Tab 2: a=5 + Other computations needed in this case Tab 3: a=7 + Other computations needed in this case

Alternative

No response

Additional context

No response

mscolnick commented 1 week ago

Have you tried mo.ui.tabs? https://docs.marimo.io/api/inputs/tabs.html

Eloitor commented 1 week ago

My request is having some sort of "global" tabs. And in each tab there would be multiple cells, like a normal notebook.

The point is that the same variable could be defined in each tab with different values without getting an error.

mscolnick commented 1 week ago

that seems like it would get confusing to know which variable belongs to which.

we do plan to add notebook composition (you can import and embed one notebook in another). you will likely be able to achieve this much more easily with that feature. each notebook would have their own encapsulation of variables

Eloitor commented 1 week ago

ok that sounds similar than this request.