Skip to content

A reactive notebook for Python — run reproducible experiments, query with SQL, execute as a script, deploy as an app, and version with git. Stored as pure Python. All in a modern, AI-native editor.

chore: enable repo type inference and annotate notebooks (#11438)

Dylan Madisetti90c43f5a1065
diff --git a/examples/ai/chat/anthropic_example.py b/examples/ai/chat/anthropic_example.py
index 8e6875cfe1..1d9abde231 100644
--- a/examples/ai/chat/anthropic_example.py
+++ b/examples/ai/chat/anthropic_example.py
@@ -8,7 +8,7 @@
import marimo
-__generated_with = "0.19.7"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@@ -26,7 +26,6 @@ def _(mo):
This example shows how to use [`mo.ui.chat`](https://docs.marimo.io/api/inputs/chat.html#marimo.ui.chat) to make a chatbot backed by Anthropic.
""")
- return
@app.cell
@@ -40,7 +39,7 @@ def _(mo):
@app.cell
-def _(input_key, mo, os_key):
+def _(input_key, mo, os_key: None | str):
key = os_key or input_key.value
mo.stop(
@@ -51,7 +50,7 @@ def _(input_key, mo, os_key):
@app.cell
-def _(key, mo):
+def _(key: None | str, mo):
chatbot = mo.ui.chat(
mo.ai.llm.anthropic(
"claude-sonnet-5-5",
@@ -78,14 +77,12 @@ def _(mo):
mo.md("""
Access the chatbot's historical messages with [`chatbot.value`](https://docs.marimo.io/api/inputs/chat.html#accessing-chat-history).
""")
- return
@app.cell
def _(chatbot):
# chatbot.value is the list of chat messages
chatbot.value
- return
if __name__ == "__main__":
diff --git a/examples/ai/chat/bedrock_example.py b/examples/ai/chat/bedrock_example.py
index 7170132ced..6c42b47ef2 100644
--- a/examples/ai/chat/bedrock_example.py
+++ b/examples/ai/chat/bedrock_example.py
@@ -8,7 +8,7 @@
import marimo
-__generated_with = "0.19.7"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@@ -30,7 +30,6 @@ def _(mo):
⚠️ **Note:** You'll need an AWS account with access to the AWS Bedrock service and the specific model you want to use.
""")
- return
@app.cell(hide_code=True)
@@ -61,7 +60,7 @@ def _():
@app.cell
-def _(aws_config, mo):
+def _(aws_config: dict, mo):
# Display AWS configuration status
mo.stop(
not aws_config["has_credentials"],
@@ -84,7 +83,6 @@ def _(aws_config, mo):
3. Use an AWS profile in ~/.aws/credentials
"""),
)
- return
@app.cell(hide_code=True)
@@ -163,7 +161,6 @@ def _(mo):
mo.md(r"""
## AWS Bedrock Chat
""")
- return
@app.cell
@@ -222,7 +219,6 @@ def _(config_form, max_tokens, mo, temperature):
# Display the chat interface
chatbot = create_chat(config_form)
chatbot
- return
@app.cell
@@ -243,7 +239,6 @@ def _(mo):
- That you have requested model access in the AWS Bedrock console
- That you're using a region where the selected model is available
""")
- return
if __name__ == "__main__":
diff --git a/examples/ai/chat/dagger_code_interpreter.py b/examples/ai/chat/dagger_code_interpreter.py
index 9e8d4a448e..08a95ed61a 100644
--- a/examples/ai/chat/dagger_code_interpreter.py
+++ b/examples/ai/chat/dagger_code_interpreter.py
@@ -11,7 +11,7 @@
import marimo
-__generated_with = "0.19.7"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@@ -33,7 +33,6 @@ def _(mo):
This example requires Docker running on your computer.
""")
- return
@app.cell(hide_code=True)
@@ -117,7 +116,6 @@ def _(mo):
@app.cell
def _(files):
[file.name for file in files.value]
- return
@app.cell
@@ -169,7 +167,7 @@ def describe_file(file):
@app.cell
-def _(client, ell, execute_code, files, mo, model, packages):
+def _(client, ell, execute_code, files, mo, model: str, packages):
files_instructions = ""
packages_instructions = ""
if files.value:
@@ -225,7 +223,6 @@ def _(mo, my_model):
f"Can you sum this list using python: {list(range(1, 10))}",
],
)
- return
if __name__ == "__main__":
diff --git a/examples/ai/chat/deepseek_example.py b/examples/ai/chat/deepseek_example.py
index c721fdc23f..fa26934f84 100644
--- a/examples/ai/chat/deepseek_example.py
+++ b/examples/ai/chat/deepseek_example.py
@@ -8,7 +8,7 @@
import marimo
-__generated_with = "0.19.7"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@@ -26,7 +26,6 @@ def _(mo):
This example shows how to use [`mo.ui.chat`](https://docs.marimo.io/api/inputs/chat/?h=mo.ui.chat) to make a chatbot backed by [Deepseek](https://deepseek.com/).
""")
- return
@app.cell(hide_code=True)
@@ -42,7 +41,6 @@ def _(mo):
</a>
"""
).center()
- return
@app.cell
@@ -56,7 +54,7 @@ def _(mo):
@app.cell
-def _(input_key, mo, os_key):
+def _(input_key, mo, os_key: None | str):
key = os_key or input_key.value
mo.stop(
@@ -67,7 +65,7 @@ def _(input_key, mo, os_key):
@app.cell
-def _(key, mo):
+def _(key: None | str, mo):
chatbot = mo.ui.chat(
mo.ai.llm.openai(
model="deepseek-reasoner",
@@ -90,14 +88,12 @@ def _(mo):
mo.md("""
Access the chatbot's historical messages with [`chatbot.value`](https://docs.marimo.io/api/inputs/chat.html#accessing-chat-history).
""")
- return
@app.cell
def _(chatbot):
# chatbot.value is the list of chat messages
chatbot.value
- return
if __name__ == "__main__":
diff --git a/examples/ai/chat/gemini.py b/examples/ai/chat/gemini.py
index cef9c92e94..a58a507471 100644
--- a/examples/ai/chat/gemini.py
+++ b/examples/ai/chat/gemini.py
@@ -8,7 +8,7 @@
import marimo
-__generated_with = "0.19.7"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@@ -26,7 +26,6 @@ def _(mo):
This example shows how to use [`mo.ui.chat`](https://docs.marimo.io/api/inputs/chat.html#marimo.ui.chat) to make a chatbot backed by Gemini.
""")
- return
@app.cell
@@ -40,7 +39,7 @@ def _(mo):
@app.cell
-def _(input_key, mo, os_key):
+def _(input_key, mo, os_key: None | str):
key = os_key or input_key.value
mo.stop(
@@ -51,7 +50,7 @@ def _(input_key, mo, os_key):
@app.cell
-def _(key, mo):
+def _(key: None | str, mo):
chatbot = mo.ui.chat(
mo.ai.llm.google(
"gemini-3.8-flash",
@@ -73,14 +72,12 @@ def _(mo):
mo.md("""
Access the chatbot's historical messages with [`chatbot.value`](https://docs.marimo.io/api/inputs/chat.html#accessing-chat-history).
""")
- return
@app.cell
def _(chatbot):
# chatbot.value is the list of chat messages
chatbot.value
- return
if __name__ == "__main__":
diff --git a/examples/ai/chat/groq_example.py b/examples/ai/chat/groq_example.py
index e9956d3efa..059aab842e 100644
--- a/examples/ai/chat/groq_example.py
+++ b/examples/ai/chat/groq_example.py
@@ -8,7 +8,7 @@
import marimo
-__generated_with = "0.19.7"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@@ -26,7 +26,6 @@ def _(mo):
This example shows how to use [`mo.ui.chat`](https://docs.marimo.io/api/inputs/chat.html#marimo.ui.chat) to make a chatbot backed by [Groq](https://groq.com/).
""")
- return
@app.cell(hide_code=True)
@@ -43,7 +42,6 @@ def _(mo):
</a>
"""
).right()
- return
@app.cell
@@ -57,7 +55,7 @@ def _(mo):
@app.cell
-def _(input_key, mo, os_key):
+def _(input_key, mo, os_key: None | str):
key = os_key or input_key.value
mo.stop(
@@ -68,7 +66,7 @@ def _(input_key, mo, os_key):
@app.cell
-def _(key, mo):
+def _(key: None | str, mo):
chatbot = mo.ui.chat(
mo.ai.llm.groq(
model="llama-3.1-70b-versatile",
@@ -90,14 +88,12 @@ def _(mo):
mo.md("""
Access the chatbot's historical messages with [`chatbot.value`](https://docs.marimo.io/api/inputs/chat.html#accessing-chat-history).
""")
- return
@app.cell
def _(chatbot):
# chatbot.value is the list of chat messages
chatbot.value
- return
if __name__ == "__main__":
diff --git a/examples/ai/chat/openai_example.py b/examples/ai/chat/openai_example.py
index 2c2f879090..03267fe029 100644
--- a/examples/ai/chat/openai_example.py
+++ b/examples/ai/chat/openai_example.py
@@ -8,7 +8,7 @@
import marimo
-__generated_with = "0.19.7"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@@ -26,7 +26,6 @@ def _(mo):
This example shows how to use [`mo.ui.chat`](https://docs.marimo.io/api/inputs/chat.html#marimo.ui.chat) to make a chatbot backed by OpenAI.
""")
- return
@app.cell
@@ -40,7 +39,7 @@ def _(mo):
@app.cell
-def _(input_key, mo, os_key):
+def _(input_key, mo, os_key: None | str):
openai_key = os_key or input_key.value
mo.stop(
@@ -51,7 +50,7 @@ def _(input_key, mo, os_key):
@app.cell
-def _(mo, openai_key):
+def _(mo, openai_key: None | str):
chatbot = mo.ui.chat(
mo.ai.llm.openai(
"gpt-4o",
@@ -77,14 +76,12 @@ def _(mo):
mo.md("""
Access the chatbot's historical messages with [`chatbot.value`](https://docs.marimo.io/api/inputs/chat.html#accessing-chat-history).
""")
- return
@app.cell
def _(chatbot):
# chatbot.value is the list of chat messages
chatbot.value
- return
if __name__ == "__main__":
diff --git a/examples/ai/chat/pydantic-ai-chat.py b/examples/ai/chat/pydantic-ai-chat.py
index de2c373d57..ad586844ff 100644
--- a/examples/ai/chat/pydantic-ai-chat.py
+++ b/examples/ai/chat/pydantic-ai-chat.py
@@ -9,7 +9,7 @@
import marimo
-__generated_with = "0.23.10"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
with app.setup(hide_code=True):
@@ -50,7 +50,6 @@ def _():
The following example uses [`mo.ui.chat`](https://docs.marimo.io/api/inputs/chat.html#marimo.ui.chat) to build a chatbot backed by Pydantic-AI.
""")
- return
@app.cell(hide_code=True)
@@ -139,9 +138,9 @@ def _(
delete_file_tool,
fetch_dog_tool,
input_key,
- model_name,
+ model_name: None,
models,
- os_key,
+ os_key: None | str,
structured,
thinking,
):
@@ -197,11 +196,12 @@ def _(
def delete_file(path: str) -> str:
"""Pretend to delete the file at `path`."""
return f"File {path!r} deleted"
+
return (agent,)
@app.cell
-def _(agent):
+def _(agent: Agent):
chatbot = mo.ui.chat(
mo.ai.llm.pydantic_ai(agent),
prompts=[
@@ -221,7 +221,6 @@ def _(agent):
@app.cell
def _(chatbot):
chatbot.value
- return
@app.cell(hide_code=True)
@@ -237,7 +236,6 @@ def _():
Try the abort prompt to see the frontend’s “Generation stopped” notice.
""")
- return
@app.cell(hide_code=True)
@@ -581,7 +579,6 @@ def _():
@app.cell
def _(custom_chat):
custom_chat.value
- return
if __name__ == "__main__":
diff --git a/examples/ai/data/data_labeler.py b/examples/ai/data/data_labeler.py
index 23869914d0..75699c26f9 100644
--- a/examples/ai/data/data_labeler.py
+++ b/examples/ai/data/data_labeler.py
@@ -1,6 +1,6 @@
import marimo
-__generated_with = "0.19.7"
+__generated_with = "0.25.2"
app = marimo.App()
@@ -9,11 +9,10 @@ def _(mo):
mo.md("""
# Data Labeler
""")
- return
@app.cell
-def _(NUMBER_OF_EXAMPLES, mo):
+def _(NUMBER_OF_EXAMPLES: int, mo):
get_index, set_index = mo.state(0)
@@ -42,11 +41,10 @@ def _(mo):
mo.md(f"""
**Choose an example to label.**
""")
- return
@app.cell
-def _(NUMBER_OF_EXAMPLES, get_index, mo, set_index):
+def _(NUMBER_OF_EXAMPLES: int, get_index, mo, set_index):
index = mo.ui.number(
0,
NUMBER_OF_EXAMPLES - 1,
@@ -62,29 +60,26 @@ def _(NUMBER_OF_EXAMPLES, get_index, mo, set_index):
@app.cell
def _(index, mo, next_button, previous_button):
mo.hstack([index, previous_button, next_button], justify="start")
- return
@app.cell
def _(index, mo):
mo.md(f"![img](https://picsum.photos/id/{index.value}/700/400)").center()
- return
@app.cell
def _(mo):
mo.md("### Real or AI generated?").center()
- return
@app.cell
-def _(LABELS_PATH, NUMBER_OF_EXAMPLES, load_labels):
+def _(LABELS_PATH: str, NUMBER_OF_EXAMPLES: int, load_labels):
labels = load_labels(LABELS_PATH, NUMBER_OF_EXAMPLES)
return (labels,)
@app.cell
-def _(LABELS_PATH, labels, write_labels):
+def _(LABELS_PATH: str, labels: list[dict[str, str]], write_labels):
def update_label(value, index):
labels[index]["label"] = value
write_labels(labels, LABELS_PATH)
@@ -93,7 +88,7 @@ def _(LABELS_PATH, labels, write_labels):
@app.cell
-def _(LABELS_PATH, labels, write_labels):
+def _(LABELS_PATH: str, labels: list[dict[str, str]], write_labels):
def update_notes(value, index):
labels[index]["notes"] = value
write_labels(labels, LABELS_PATH)
@@ -112,11 +107,10 @@ def _(mo, notes):
Notes can't be longer than 100 characters. {_character_count}
"""
).callout(kind="alert")
- return
@app.cell
-def _(index, labels, mo, update_label, update_notes):
+def _(index, labels: list[dict[str, str]], mo, update_label, update_notes):
data = labels[index.value]
label_picker = mo.ui.radio(
diff --git a/examples/ai/data/model_comparison.py b/examples/ai/data/model_comparison.py
index 302f090cd4..3700e0470c 100644
--- a/examples/ai/data/model_comparison.py
+++ b/examples/ai/data/model_comparison.py
@@ -7,7 +7,7 @@
import marimo
-__generated_with = "0.19.7"
+__generated_with = "0.25.2"
app = marimo.App()
@@ -16,7 +16,6 @@ def _(mo):
mo.md("""
# Model Comparison
""")
- return
@app.cell(hide_code=True)
@@ -25,11 +24,10 @@ def _(mo):
!!! tip "This notebook is best viewed as an app."
Hit `Cmd/Ctrl+.` or click the "app view" button in the bottom right.
""")
- return
@app.cell(hide_code=True)
-def _(NUMBER_OF_EXAMPLES, mo):
+def _(NUMBER_OF_EXAMPLES: int, mo):
get_index, set_index = mo.state(0)
@@ -48,7 +46,7 @@ def _(NUMBER_OF_EXAMPLES, mo):
@app.cell(hide_code=True)
-def _(NUMBER_OF_EXAMPLES, get_index, mo, set_index):
+def _(NUMBER_OF_EXAMPLES: int, get_index, mo, set_index):
index = mo.ui.number(
0,
NUMBER_OF_EXAMPLES - 1,
@@ -66,11 +64,10 @@ def _(mo):
mo.md(f"""
_Models A and B both predict spans. Which do you prefer?_
""")
- return
@app.cell(hide_code=True)
-def _(NUMBER_OF_EXAMPLES, mo, num_a_preferred, num_b_preferred):
+def _(NUMBER_OF_EXAMPLES: int, mo, num_a_preferred: int, num_b_preferred: int):
mo.ui.table(
[
{"Model": "A", "Score": f"{num_a_preferred}/{NUMBER_OF_EXAMPLES}"},
@@ -78,22 +75,19 @@ def _(NUMBER_OF_EXAMPLES, mo, num_a_preferred, num_b_preferred):
],
selection=None,
)
- return
@app.cell
def _(index, mo, next_button, previous_button):
mo.hstack([index, previous_button, next_button], justify="center")
- return
@app.cell(hide_code=True)
-def _(CHOICES_PATH, get_choices, index, mo, write_choices):
+def _(CHOICES_PATH: str, get_choices, index, mo, write_choices):
preference = get_choices()[index.value]
mo.stop(preference is None, mo.md("**Choose the better model**.").center())
write_choices(get_choices(), CHOICES_PATH)
mo.md(f"You prefer **model {preference}**.").center()
- return
@app.cell(hide_code=True)
@@ -105,11 +99,10 @@ def _(mo):
],
justify="space-around",
)
- return
@app.cell(hide_code=True)
-def _(CHOICES_PATH, PARAGRAPHS, load_choices, mo):
+def _(CHOICES_PATH: str, PARAGRAPHS: list, load_choices, mo):
get_choices, set_choices = mo.state(
load_choices(CHOICES_PATH, len(PARAGRAPHS))
)
@@ -132,11 +125,10 @@ def _(index, mo, set_choices):
),
)
mo.hstack([model_A, model_B], justify="space-around")
- return
@app.cell(hide_code=True)
-def _(PARAGRAPHS, SPANS, index, mo):
+def _(PARAGRAPHS: list, SPANS: list, index, mo):
model_A_prediction = mo.md(
annotate(
PARAGRAPHS[index.value],
@@ -160,7 +152,6 @@ def _(mo, model_A_prediction, model_B_prediction):
mo.hstack(
[model_A_prediction, model_B_prediction], gap=2, justify="space-around"
)
- return
@app.cell
@@ -200,7 +191,7 @@ def _(json, os):
@app.cell
-def _(PARAGRAPHS, random):
+def _(PARAGRAPHS: list, random):
random.seed(0)
@@ -239,7 +230,7 @@ def annotate(text, span, color):
@app.cell
-def _(PARAGRAPHS):
+def _(PARAGRAPHS: list):
NUMBER_OF_EXAMPLES = len(PARAGRAPHS)
return (NUMBER_OF_EXAMPLES,)
diff --git a/examples/ai/misc/build_a_superhero.py b/examples/ai/misc/build_a_superhero.py
index 398911d12a..4c8044177a 100644
--- a/examples/ai/misc/build_a_superhero.py
+++ b/examples/ai/misc/build_a_superhero.py
@@ -8,7 +8,7 @@
import marimo
-__generated_with = "0.19.7"
+__generated_with = "0.25.2"
app = marimo.App()
@@ -17,7 +17,6 @@ def _(mo):
mo.md("""
## Build a Superhero with Generative AI
""")
- return
@app.cell
@@ -45,7 +44,7 @@ def _(item, mo):
@app.cell
-def _(content, item, mo, openai, openaikey):
+def _(content: str, item, mo, openai, openaikey):
openai.api_key = openaikey.value
result = None
@@ -137,7 +136,6 @@ def _(generate_image_button, mo, openai, superhero):
url = res["data"][0]["url"]
mo.image(src=url) if url else None
- return
@app.cell
diff --git a/examples/ai/misc/pdf_question_answer.py b/examples/ai/misc/pdf_question_answer.py
index 8cabeb5bbe..c7a1cef0d4 100644
--- a/examples/ai/misc/pdf_question_answer.py
+++ b/examples/ai/misc/pdf_question_answer.py
@@ -9,7 +9,7 @@
import marimo
-__generated_with = "0.19.7"
+__generated_with = "0.25.2"
app = marimo.App()
@@ -18,7 +18,6 @@ def _(mo):
mo.md("""
# PDF Q&A
""")
- return
@app.cell(hide_code=True)
@@ -26,7 +25,6 @@ def _(mo):
mo.md("""
This app lets you upload a PDF and ask questions about it.
""")
- return
@app.cell
@@ -42,7 +40,6 @@ def _(mo):
is processed by a GPT model.
"""
})
- return
@app.cell
@@ -119,7 +116,7 @@ def _(mo):
def _(
OpenAI,
get_openai_callback,
- knowledge_base,
+ knowledge_base: None,
load_qa_chain,
mo,
openaikey,
@@ -142,7 +139,6 @@ def _(
res = query_pdf()
mo.md(res)
- return
@app.cell
diff --git a/examples/ai/tools/chat_with_tools.py b/examples/ai/tools/chat_with_tools.py
index 2c125b6be0..42801d78b3 100644
--- a/examples/ai/tools/chat_with_tools.py
+++ b/examples/ai/tools/chat_with_tools.py
@@ -16,7 +16,7 @@
import marimo
-__generated_with = "0.19.7"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@@ -41,7 +41,6 @@ def _(mo):
This example shows how to use [`ell`](https://docs.ell.so/) with tools to analyze a dataset and return rich responses like charts and tables.
""")
- return
@app.cell
@@ -49,7 +48,6 @@ def _(mo):
mo.md(r"""
## Setup
""")
- return
@app.cell
@@ -67,7 +65,7 @@ def _(mo):
@app.cell
-def _(input_key, mo, os_key):
+def _(input_key, mo, os_key: None | str):
openai_key = os_key or input_key.value
import openai
@@ -110,7 +108,6 @@ def _(mo):
mo.md(r"""
## Defining tools
""")
- return
@app.function
@@ -238,7 +235,7 @@ def _(BeautifulSoup, alt, client, dataset_dropdown, df, ell, mo, requests):
@app.cell
-def _(TOOLS, client, df, ell, get_dataset, mo):
+def _(TOOLS: list, client, df, ell, get_dataset, mo):
@ell.complex(
model="gpt-5.6-sol",
tools=TOOLS,
@@ -285,7 +282,6 @@ def _(mo, model):
"Let's plot {{x}} vs {{y}}",
],
)
- return
if __name__ == "__main__":
diff --git a/examples/ai/tools/code_interpreter.py b/examples/ai/tools/code_interpreter.py
index fdae4aa2c0..aa7eb03061 100644
--- a/examples/ai/tools/code_interpreter.py
+++ b/examples/ai/tools/code_interpreter.py
@@ -9,7 +9,7 @@
import marimo
-__generated_with = "0.19.7"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@@ -29,7 +29,6 @@ def _(mo):
This example shows how to create a code-interpreter in a few lines of code.
""")
- return
@app.cell(hide_code=True)
@@ -65,7 +64,7 @@ def _(openai):
@app.cell(hide_code=True)
-def _(backend, input_key, mo, os_key):
+def _(backend, input_key, mo, os_key: None | str):
def _get_open_ai_client():
openai_key = os_key or input_key.value
@@ -161,7 +160,7 @@ def _(ell, mo):
@app.cell
-def _(client, ell, execute_code, mo, model):
+def _(client, ell, execute_code, mo, model: str):
@ell.complex(model=model, tools=[execute_code], client=client)
def custom_chatbot(messages, config) -> str:
"""You are data scientist with access to writing python code."""
@@ -193,7 +192,6 @@ def _(mo, my_model):
f"Can you sum this list using python: {numbers}",
],
)
- return
if __name__ == "__main__":
diff --git a/examples/ai/tools/dataset_analysis.py b/examples/ai/tools/dataset_analysis.py
index 167bd50a56..6d26bfa76c 100644
--- a/examples/ai/tools/dataset_analysis.py
+++ b/examples/ai/tools/dataset_analysis.py
@@ -16,7 +16,7 @@
import marimo
-__generated_with = "0.19.7"
+__generated_with = "0.25.2"
app = marimo.App()
@@ -41,7 +41,6 @@ def _(mo):
This example shows how to use [`ell`](https://docs.ell.so/) with tools to analyze a dataset and return rich responses like charts and tables.
""")
- return
@app.cell
@@ -55,7 +54,7 @@ def _(mo):
@app.cell
-def _(input_key, mo, os_key):
+def _(input_key, mo, os_key: None | str):
openai_key = os_key or input_key.value
import openai
@@ -153,7 +152,6 @@ def _(analyze_dataset, mo, text):
mo.output.replace(summary)
except Exception as e:
mo.output.replace(mo.callout(str(e)))
- return
if __name__ == "__main__":
diff --git a/examples/cloud/gcp/google_cloud_bigquery.py b/examples/cloud/gcp/google_cloud_bigquery.py
index 11d21ee8b7..6d9e949eaf 100644
--- a/examples/cloud/gcp/google_cloud_bigquery.py
+++ b/examples/cloud/gcp/google_cloud_bigquery.py
@@ -10,7 +10,7 @@
import marimo
-__generated_with = "0.19.7"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@@ -28,7 +28,6 @@ def _(mo):
mo.md("""
# Google Cloud BigQuery
""")
- return
@app.cell(hide_code=True)
@@ -75,7 +74,7 @@ def _(bigquery, credentials, mo, os, project):
@app.cell
-def _(datasets, mo):
+def _(datasets: list, mo):
# Dataset selection
selected_dataset = mo.ui.dropdown(
label="Select dataset", options=[d.dataset_id for d in datasets]
@@ -107,7 +106,6 @@ def _(client, dataset, mo):
def _(client, dataset, mo, selected_table):
results = client.list_rows(dataset.table(selected_table.value), max_results=10)
mo.ui.table(results.to_dataframe(), selection=None)
- return
if __name__ == "__main__":
diff --git a/examples/cloud/gcp/google_cloud_storage.py b/examples/cloud/gcp/google_cloud_storage.py
index d5311c5a43..6dea762045 100644
--- a/examples/cloud/gcp/google_cloud_storage.py
+++ b/examples/cloud/gcp/google_cloud_storage.py
@@ -9,7 +9,7 @@
import marimo
-__generated_with = "0.19.7"
+__generated_with = "0.25.2"
app = marimo.App(width="full")
@@ -110,11 +110,10 @@ def _(get_prefix, mo, set_prefix):
]
)
output
- return
@app.cell
-def _(blobs, bucket, mo, set_prefix):
+def _(blobs: list, bucket, mo, set_prefix):
# Display files in a table
_files = [
{
@@ -151,7 +150,6 @@ def _(bucket, file_table, mo):
mo.output.replace(mo.image(_blob.download_as_string()))
else:
mo.output.replace(mo.plain_text(_blob.download_as_text()))
- return
if __name__ == "__main__":
diff --git a/examples/frameworks/fastapi-endpoint/notebook.py b/examples/frameworks/fastapi-endpoint/notebook.py
index f786feccde..c737baa5da 100644
--- a/examples/frameworks/fastapi-endpoint/notebook.py
+++ b/examples/frameworks/fastapi-endpoint/notebook.py
@@ -9,7 +9,7 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App()
with app.setup:
@@ -70,15 +70,13 @@ def plot_dictionary(data: dict) -> None:
@app.cell(hide_code=True)
-def plot(plot_data):
+def plot(plot_data: dict[str, int]):
plot_dictionary(plot_data)
- return
@app.cell(hide_code=True)
-def _(sample_data):
+def _(sample_data: dict[str, int]):
plot_dictionary(sample_data)
- return
@app.function
diff --git a/examples/layouts/grid-dashboard.py b/examples/layouts/grid-dashboard.py
index d11e2fe8ec..5950b05a11 100644
--- a/examples/layouts/grid-dashboard.py
+++ b/examples/layouts/grid-dashboard.py
@@ -15,7 +15,7 @@
import marimo
-__generated_with = "0.19.7"
+__generated_with = "0.25.2"
app = marimo.App(
width="medium",
layout_file="layouts/grid-dashboard.grid.json",
@@ -27,7 +27,6 @@ def _(mo):
mo.md(r"""
# Gapminder Dashboard
""")
- return
@app.cell(hide_code=True)
@@ -44,7 +43,6 @@ def _(mo):
///
"""
)
- return
@app.cell(hide_code=True)
@@ -54,7 +52,6 @@ def _(mo):
This application is adapted from <https://examples.holoviz.org/gallery/gapminders/gapminders.html>
""")
- return
@app.cell(hide_code=True)
@@ -62,7 +59,6 @@ def _(mo):
mo.md(r"""
# Getting the data
""")
- return
@app.cell
@@ -119,7 +115,6 @@ def _(mo):
mo.md(r"""
# Charting the data
""")
- return
@app.cell
@@ -148,7 +143,18 @@ def _(dataset, np):
@app.cell
-def _(XLABEL, YLABEL, YLIM, alt, get_data, get_title, get_xlim, go, pio, plt):
+def _(
+ XLABEL: str,
+ YLABEL: str,
+ YLIM: tuple[int, int],
+ alt,
+ get_data,
+ get_title,
+ get_xlim,
+ go,
+ pio,
+ plt,
+):
# Charting functions
@@ -286,7 +292,7 @@ def _(XLABEL, YLABEL, YLIM, alt, get_data, get_title, get_xlim, go, pio, plt):
@app.cell
-def _(HEIGHT, altair_view, hvplot_view, mo, mpl_view, plotly_view):
+def _(HEIGHT: int, altair_view, hvplot_view, mo, mpl_view, plotly_view):
mo.ui.tabs(
{
"matplotlib": mpl_view(1952, True),
@@ -295,7 +301,6 @@ def _(HEIGHT, altair_view, hvplot_view, mo, mpl_view, plotly_view):
"hvplot": hvplot_view(),
}
)
- return
@app.cell(hide_code=True)
@@ -303,7 +308,6 @@ def _(mo):
mo.md(r"""
# Building a dashboard
""")
- return
@app.cell(hide_code=True)
@@ -311,17 +315,16 @@ def _(mo):
mo.md("""
## Creating widgets
""")
- return
@app.cell
-def _(YEARS, mo):
+def _(YEARS: list, mo):
get_year, set_year = mo.state(YEARS[-1])
return get_year, set_year
@app.cell
-def _(YEARS, get_year, mo, set_year):
+def _(YEARS: list, get_year, mo, set_year):
year = mo.ui.slider(
value=get_year(), steps=YEARS, full_width=True, on_change=set_year
)
@@ -338,7 +341,6 @@ def _(mo, show_legend, year):
show_legend,
]
)
- return
@app.cell
@@ -349,7 +351,7 @@ def _(mo):
@app.cell
-def _(YEARS, autoplay, set_year):
+def _(YEARS: list, autoplay, set_year):
autoplay
@@ -361,7 +363,6 @@ def _(YEARS, autoplay, set_year):
set_year(increment)
- return
@app.cell(hide_code=True)
@@ -369,31 +370,26 @@ def _(mo):
mo.md(r"""
## Creating the charts, reactive to the widgets
""")
- return
@app.cell
def _(mpl_view, show_legend, year):
mpl_view(year=year.value, show_legend=show_legend.value)
- return
@app.cell
def _(plotly_view, show_legend, year):
plotly_view(year=year.value, show_legend=show_legend.value)
- return
@app.cell
-def _(HEIGHT, altair_view, show_legend, year):
+def _(HEIGHT: int, altair_view, show_legend, year):
altair_view(year=year.value, show_legend=show_legend.value, height=HEIGHT - 100)
- return
@app.cell
def _(hvplot_view, show_legend, year):
hvplot_view(year=year.value, show_legend=show_legend.value)
- return
@app.cell(hide_code=True)
@@ -403,13 +399,11 @@ def _(mo):
Next we will toggle to "App view" (hit `Cmd/Ctrl+.` or click the "app view") in order to layout our dashboard with the grid layout editor.
""")
- return
@app.cell
def _(mo):
mo.image("https://marimo.io/logotype-wide.svg")
- return
@app.cell(hide_code=True)
@@ -421,7 +415,6 @@ def _(mo):
This application is inspired by [Panel](https://examples.holoviz.org/gallery/gapminders/gapminders.html).
""")
- return
if __name__ == "__main__":
diff --git a/examples/markdown/dynamic_markdown.py b/examples/markdown/dynamic_markdown.py
index f3b72e2f7b..05db4a67d6 100644
--- a/examples/markdown/dynamic_markdown.py
+++ b/examples/markdown/dynamic_markdown.py
@@ -1,6 +1,6 @@
import marimo
-__generated_with = "0.19.7"
+__generated_with = "0.25.2"
app = marimo.App()
@@ -9,7 +9,6 @@ def _(mo):
mo.md(r"""
Use `mo.md` with an `f-string` to create markdown that depends on the value of Python objects.
""")
- return
@app.cell
@@ -19,13 +18,12 @@ def _():
@app.cell
-def _(mo, name):
+def _(mo, name: str):
mo.md(
f"""
Hello, {name}!
"""
)
- return
@app.cell(hide_code=True)
@@ -33,7 +31,6 @@ def _(mo):
mo.md(r"""
Embed marimo UI elements in markdown directly:
""")
- return
@app.cell
@@ -51,7 +48,6 @@ def _(mo, text_input):
Hello, {text_input.value}!
"""
)
- return
@app.cell(hide_code=True)
@@ -59,7 +55,6 @@ def _(mo):
mo.md(r"""
Wrap plots and data structures in `mo.as_html()` to hook into marimo's rich media viewer:
""")
- return
@app.cell
@@ -71,7 +66,6 @@ def _(mo):
{mo.as_html([1, 2, 3])}
"""
)
- return
@app.cell
diff --git a/examples/misc/bayes_theorem.py b/examples/misc/bayes_theorem.py
index deeb5c9311..51c4701403 100644
--- a/examples/misc/bayes_theorem.py
+++ b/examples/misc/bayes_theorem.py
@@ -8,7 +8,7 @@
import marimo
-__generated_with = "0.19.7"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@@ -48,15 +48,14 @@ def _(mo):
P(E) = P(E \cap H) + P(E \cap \neg H).
\]
""")
- return
@app.cell(hide_code=True)
def _(
- bayes_result,
+ bayes_result: int | float,
construct_probability_plot,
mo,
- p_e,
+ p_e: int | float,
p_e_given_h,
p_e_given_not_h,
p_h,
@@ -98,7 +97,6 @@ def _(
align="start",
widths=[0.33, 0.5],
)
- return
@app.cell(hide_code=True)
diff --git a/examples/misc/create_your_own_shape.py b/examples/misc/create_your_own_shape.py
index 050eefd2ae..110a7f587d 100644
--- a/examples/misc/create_your_own_shape.py
+++ b/examples/misc/create_your_own_shape.py
@@ -7,7 +7,7 @@
import marimo
-__generated_with = "0.19.7"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@@ -18,7 +18,6 @@ def _(mo):
There are many way that a user can input with your notebook, such as text boxes, sliders, dates, and more.
""")
- return
@app.cell
@@ -26,7 +25,6 @@ def _(mo):
mo.md(r"""
## Text boxes
""")
- return
@app.cell
@@ -46,7 +44,6 @@ def _(mo, username):
mo.stop(not username.value, mo.md("What is your name?"))
mo.md(f"👋 Hello {username.value}, nice to meet you!")
- return
@app.cell
@@ -54,13 +51,11 @@ def _(mo):
mo.ui.text_area(
label="A space for your thoughts", full_width=True, max_length=1000
)
- return
@app.cell
def _(mo):
mo.ui.number(label="What is your favorite number?", start=0, stop=10)
- return
@app.cell
@@ -68,7 +63,6 @@ def _(mo):
mo.md(r"""
## Sliders
""")
- return
@app.cell
@@ -84,7 +78,6 @@ def _(mo):
0, 100, value=50, label="Vertical slider", orientation="vertical"
)
mo.vstack([slider, range_slider, custom_steps, vertical]).center()
- return
@app.cell
@@ -92,7 +85,6 @@ def _(mo):
mo.md(r"""
## Checkboxes and Radios
""")
- return
@app.cell
@@ -120,7 +112,7 @@ def _(mo):
@app.cell(hide_code=True)
-def _(COLORS, colors, mo, shape):
+def _(COLORS: list[str], colors, mo, shape):
selected_colors = [color for i, color in enumerate(COLORS) if colors.value[i]]
@@ -157,7 +149,6 @@ def _(COLORS, colors, mo, shape):
A {"/".join(selected_colors)} {shape.value}:
{draw_shape(shape.value, selected_colors)}
""").center()
- return
@app.cell
@@ -165,7 +156,6 @@ def _(mo):
mo.md("""
## Dates
""")
- return
@app.cell
@@ -193,7 +183,6 @@ def _(end_date, mo, start_date):
mo.md(f"From {start_date.value} to {end_date.value}"),
]
)
- return
@app.cell(hide_code=True)
@@ -201,7 +190,6 @@ def _(mo):
mo.md("""
## Dropdowns
""")
- return
@app.cell
@@ -216,7 +204,6 @@ def _(mo):
value=["Option 1", "Option 2"],
)
mo.hstack([single, multi])
- return
@app.cell
diff --git a/examples/misc/mortgage_calculator.py b/examples/misc/mortgage_calculator.py
index 94317eff4c..05c030f5c8 100644
--- a/examples/misc/mortgage_calculator.py
+++ b/examples/misc/mortgage_calculator.py
@@ -10,7 +10,7 @@
import marimo
-__generated_with = "0.19.7"
+__generated_with = "0.25.2"
app = marimo.App()
@@ -19,7 +19,6 @@ def _(mo):
mo.md("""
# Mortgage Calculator
""")
- return
@app.cell(hide_code=True)
@@ -27,7 +26,6 @@ def _(mo):
mo.md("""
## Income
""")
- return
@app.cell
@@ -62,7 +60,6 @@ def _(mo):
),
kind="warn",
)
- return
@app.cell
@@ -156,9 +153,8 @@ def _(mo):
@app.cell
-def _(home_expense_parameters, home_purchase_parameters, mo):
+def _(home_expense_parameters: list, home_purchase_parameters: list, mo):
mo.hstack([home_purchase_parameters, home_expense_parameters])
- return
@app.cell
@@ -178,8 +174,8 @@ def _(
home_price,
loan,
mo,
- net_cash,
- net_cash_per_month,
+ net_cash: int | float,
+ net_cash_per_month: float,
property_tax_rate,
rate,
utilities,
@@ -224,7 +220,6 @@ def _(mo):
mo.md("""
## Monthly Expenses
""")
- return
@app.cell
@@ -234,7 +229,6 @@ def _(mo):
necessities and entertainment. Let's estimate these to see how much
you'll save per month, after all expenses.
""")
- return
@app.cell
@@ -287,13 +281,12 @@ def _(
_row("miscellaneous", misc),
]
)
- return
@app.cell
def _(
car_payment,
- cash_less_housing,
+ cash_less_housing: None | int | float,
clothing,
dining_out,
entertainment,
@@ -324,7 +317,6 @@ def _(
or **${{annual_cash_saved:,.02f}}** annually.
"""
)
- return
@app.cell
@@ -334,7 +326,7 @@ def _(loan):
@app.cell
-def _(np, schedule):
+def _(np, schedule: list):
_interest, _principal = zip(
*[(payment.interest, payment.principal) for payment in schedule]
)
@@ -386,7 +378,6 @@ def _(interest_payments, mo, np, principal_payments, years):
{mo.as_html(fig)}
"""
)
- return
@app.cell
diff --git a/examples/misc/pixi_ffmpeg.py b/examples/misc/pixi_ffmpeg.py
index e7398d5cee..7dd15848aa 100644
--- a/examples/misc/pixi_ffmpeg.py
+++ b/examples/misc/pixi_ffmpeg.py
@@ -11,8 +11,8 @@
import marimo
-__generated_with = "0.25.0"
-app = marimo.App(width="compact")
+__generated_with = "0.25.2"
+app = marimo.App()
@app.cell(hide_code=True)
@@ -24,7 +24,6 @@ def _(mo):
marimo edit --sandbox=pixi examples/misc/pixi_ffmpeg.py
```
""")
- return
@app.cell
@@ -56,7 +55,6 @@ def _(mo, pitch):
check=True,
)
mo.audio(io.BytesIO(tone.stdout))
- return
if __name__ == "__main__":
diff --git a/examples/misc/pixi_r.py b/examples/misc/pixi_r.py
index ff571930a4..f91912d68d 100644
--- a/examples/misc/pixi_r.py
+++ b/examples/misc/pixi_r.py
@@ -19,7 +19,7 @@
import marimo
-__generated_with = "0.24.2"
+__generated_with = "0.25.2"
app = marimo.App()
with app.setup:
@@ -46,7 +46,6 @@ def _():
reactivity to run R code when a slider changes, and shares the resulting
Arrow table back to Python without copying its data.
""")
- return
@app.cell(hide_code=True)
@@ -58,7 +57,6 @@ def _():
marimo edit --sandbox=pixi examples/misc/pixi_r.py
```
""")
- return
@app.cell
@@ -85,7 +83,6 @@ def _(min_len):
df = pl.from_arrow(rpy2_arrow.arrow.rarrow_to_py_table(r_table))
df
- return (df,)
if __name__ == "__main__":
diff --git a/examples/misc/pixi_whisper.py b/examples/misc/pixi_whisper.py
index 95805144b4..14af7d5764 100644
--- a/examples/misc/pixi_whisper.py
+++ b/examples/misc/pixi_whisper.py
@@ -20,8 +20,8 @@
import marimo
-__generated_with = "0.25.0"
-app = marimo.App(width="compact")
+__generated_with = "0.25.2"
+app = marimo.App()
@app.cell(hide_code=True)
@@ -37,7 +37,6 @@ def _(mo):
PyTorch on Linux and Windows, and CPU PyTorch on macOS. The first run
downloads the model weights.
""")
- return
@app.cell
@@ -75,10 +74,9 @@ def _(files, mo, whisper):
@app.cell
-def _(audio, model):
+def _(audio: float, model):
result = model.transcribe(audio, language="en", fp16=model.device.type == "cuda")
result["text"]
- return
@app.cell(hide_code=True)
@@ -90,7 +88,6 @@ def _(mo):
*The Ashiel Mystery* is read by Garth Comira, *The Age of Chivalry*
by Anders Lankford, and *Sense and Sensibility* by Heather Barnett.
""")
- return
if __name__ == "__main__":
diff --git a/examples/misc/pokemon_stats.py b/examples/misc/pokemon_stats.py
index 890ce58001..6680aed6d8 100644
--- a/examples/misc/pokemon_stats.py
+++ b/examples/misc/pokemon_stats.py
@@ -13,7 +13,7 @@
import marimo
-__generated_with = "0.19.7"
+__generated_with = "0.25.2"
app = marimo.App(width="full")
@@ -22,7 +22,6 @@ def _(mo):
mo.md("""
# Pokémon Statistics 📊🔬
""")
- return
@app.cell(hide_code=True)
@@ -35,7 +34,6 @@ def _(clear_selection, mo, pokemon_types):
Start by choosing one or more types: {pokemon_types} {clear_selection}
"""
)
- return
@app.cell
@@ -53,7 +51,7 @@ def _(mo):
@app.cell
-def _(clear_selection, mo, types_name):
+def _(clear_selection, mo, types_name: list):
clear_selection
pokemon_types = mo.ui.multiselect(types_name)
return (pokemon_types,)
@@ -79,7 +77,6 @@ def _(mo):
@app.cell
def _(mo, pokemon_types):
mo.md("`selected types: " + ", ".join(pokemon_types.value) + "`") if pokemon_types.value else None
- return
@app.cell
@@ -90,7 +87,6 @@ def _(mo, pokemon_types):
into specific Pokémon's statistics 👇
"""
).callout(kind="info") if pokemon_types.value else None
- return
@app.cell
@@ -115,11 +111,18 @@ def _(distribution_plot, drilldown, mo, pokemon_types):
"**Drill down**": drilldown,
}
) if pokemon_types.value else None
- return
@app.cell
-def _(attribute, colors, filtered_pokemons, mo, plt, pokemon_types, sns):
+def _(
+ attribute,
+ colors: dict[str, str],
+ filtered_pokemons: dict,
+ mo,
+ plt,
+ pokemon_types,
+ sns,
+):
def plot():
plt.figure(figsize=(6.5, 4))
if attribute.value is not None:
@@ -149,7 +152,7 @@ def _(attribute, colors, filtered_pokemons, mo, plt, pokemon_types, sns):
@app.cell
-def _(filtered_pokemons, mo, pokemon_types):
+def _(filtered_pokemons: dict, mo, pokemon_types):
def make_table():
records = [
row
@@ -270,8 +273,6 @@ def _():
def _():
import plotly.express as px
- return
-
if __name__ == "__main__":
app.run()
diff --git a/examples/misc/seam_carving.py b/examples/misc/seam_carving.py
index 3bbb4e80fc..71426c1198 100644
--- a/examples/misc/seam_carving.py
+++ b/examples/misc/seam_carving.py
@@ -11,7 +11,7 @@
import marimo
-__generated_with = "0.19.7"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@@ -39,7 +39,6 @@ def _(mo):
Try it out by playing with the slider!
""")
- return
@app.cell(hide_code=True)
@@ -61,7 +60,6 @@ def _(mo):
mo.md("""
## Try it!
""")
- return
@app.cell
@@ -81,13 +79,12 @@ def _():
@app.cell
-def _(efficient_seam_carve, input_image, mo, slider):
+def _(efficient_seam_carve, input_image: str, mo, slider):
with mo.persistent_cache("seam_carves"):
scale_factor = slider.value
result = efficient_seam_carve(input_image, scale_factor)
mo.hstack([mo.image(input_image), mo.image(result)], justify="start")
- return
@app.cell
diff --git a/examples/outputs/live_raster.py b/examples/outputs/live_raster.py
index 29e7f3be85..a9d11d2127 100644
--- a/examples/outputs/live_raster.py
+++ b/examples/outputs/live_raster.py
@@ -6,16 +6,16 @@
# "traitlets==5.14.3",
# ]
# ///
+
import marimo
-__generated_with = "unknown"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@app.cell(hide_code=True)
def _(CounterWidget):
CounterWidget(count=42)
- return
@app.cell
diff --git a/examples/outputs/plots.py b/examples/outputs/plots.py
index 35d8a3a998..c62a12c627 100644
--- a/examples/outputs/plots.py
+++ b/examples/outputs/plots.py
@@ -9,7 +9,7 @@
import marimo
-__generated_with = "0.19.7"
+__generated_with = "0.25.2"
app = marimo.App()
@@ -32,7 +32,6 @@ def _(mo):
mo.md("""
Output a plot object, such as an axis or figure, to see the plot.
""")
- return
@app.cell
@@ -42,7 +41,7 @@ def _(plt):
x = np.linspace(0, 10)
plt.plot(x, x**2)
plt.gca()
- return (x,)
+ return np, x
@app.cell(hide_code=True)
@@ -51,14 +50,12 @@ def _(mo):
Calling `show()` methods displays the plot in the console area, which can be
helpful for debugging because console outputs do not show up in the "app" preview.
""")
- return
@app.cell
-def _(plt, x):
+def _(plt, x: tuple):
plt.plot(x, x**3)
plt.show()
- return
@app.cell(hide_code=True)
@@ -67,7 +64,6 @@ def _(mo):
Wrap an `Axes` in `mo.ui.matplotlib` to enable reactive selections.
Click-drag for box selection, shift-drag for lasso selection.
""")
- return
@app.cell
@@ -83,7 +79,6 @@ def _(mo, np, plt):
@app.cell
def _(scatter_fig):
scatter_fig.value
- return
if __name__ == "__main__":
diff --git a/examples/running_cells/basics.py b/examples/running_cells/basics.py
index ea0ce5be6f..103bdbdbd3 100644
--- a/examples/running_cells/basics.py
+++ b/examples/running_cells/basics.py
@@ -1,6 +1,6 @@
import marimo
-__generated_with = "0.19.7"
+__generated_with = "0.25.2"
app = marimo.App()
@@ -22,7 +22,6 @@ def _(mo):
Try updating the values of variables below and see what happens! You can also try deleting a cell.
""")
- return
@app.cell
@@ -34,13 +33,11 @@ def _():
@app.cell
def _():
y = 1
- return
@app.cell
-def _(x):
+def _(x: int):
x
- return
if __name__ == "__main__":
diff --git a/examples/slurm/submit_notebook.py b/examples/slurm/submit_notebook.py
index 8b2de0ee41..a3b1c1c0f2 100755
--- a/examples/slurm/submit_notebook.py
+++ b/examples/slurm/submit_notebook.py
@@ -15,7 +15,7 @@
import marimo
-__generated_with = "0.23.16"
+__generated_with = "0.25.2"
app = marimo.App(app_title="Slurm batch example")
with app.setup:
@@ -40,7 +40,6 @@ def _():
The `#SBATCH` directives, the dependencies (PEP 723), and the code all
live in this one file.
""")
- return
@app.cell
@@ -74,9 +73,8 @@ def _(n, seed):
@app.cell
-def _(elapsed, n, pi_estimate):
+def _(elapsed: float, n, pi_estimate: float):
print(f"pi ~= {pi_estimate:.6f} (n={n:,}, {elapsed:.2f}s)")
- return
if __name__ == "__main__":
diff --git a/examples/sql/connect_to_motherduck.py b/examples/sql/connect_to_motherduck.py
index c0a3b9b766..795b0e018a 100644
--- a/examples/sql/connect_to_motherduck.py
+++ b/examples/sql/connect_to_motherduck.py
@@ -11,7 +11,7 @@
import marimo
-__generated_with = "0.17.4"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@@ -24,11 +24,10 @@ def _(mo):
_You can expand the code of any cells to see how the output are being created._
""")
- return
@app.cell(hide_code=True)
-def _(md_token, mo):
+def _(md_token: None | str, mo):
callout = mo.md(f"""
There is no **MotherDuck** token found in your environment. To set one up, go to the [MotherDuck's settings page](https://app.motherduck.com/settings/general), create a token, and copy it below.
And re-run this notebook:
@@ -42,7 +41,6 @@ def _(md_token, mo):
mo.output.replace(
mo.accordion({"Tired of logging in to MotherDuck?": callout})
)
- return
@app.cell(hide_code=True)
@@ -60,7 +58,6 @@ def _(mo):
mo.md("""
Let's attach a remote MotherDuck database using `md:`
""")
- return
@app.cell
@@ -82,7 +79,6 @@ def _(mo):
!!! tip "Explore data sources"
If you open the "Explore data sources" panel on the left side bar (3rd icon), you will see all your tables including any news ones we will create below
""")
- return
@app.cell
@@ -90,7 +86,6 @@ def _(mo):
mo.md(r"""
## Let's make some queries 🦆
""")
- return
@app.cell
@@ -152,7 +147,6 @@ def _(mo):
-- Which can be used in Python to create charts
"""
)
- return
@app.cell(hide_code=True)
@@ -162,7 +156,6 @@ def _(mo):
Now that we have made some queries and named the results, we can chart those resulting dataframes in Python, using our favorite charting libraries (e.g [altair](https://altair-viz.github.io/), [matplotlib](https://matplotlib.org/), or [plotly](https://plotly.com/)).
""")
- return
@app.cell
@@ -193,11 +186,10 @@ def _(mo):
We can also parameterize our SQL using marimo UI elements. This not only makes our SQL reactive, but also any downstream logic, including our charts.
""")
- return
@app.cell
-def _(MONTHS, duckdb, mo):
+def _(MONTHS: dict[str, int], duckdb, mo):
month_select = mo.ui.multiselect(
MONTHS,
label="Month",
@@ -231,7 +223,7 @@ def _(hn_type_select, mo, month_select):
@app.cell(hide_code=True)
-def _(hn_type_select, mo, month_list):
+def _(hn_type_select, mo, month_list: str):
most_monthly_voted = mo.sql(
f"""
-- Most monthly voted
@@ -297,7 +289,6 @@ def _(alt, hn_type_select, most_monthly_voted):
)
)
_chart
- return
@app.cell(hide_code=True)
@@ -305,7 +296,6 @@ def _(mo):
mo.md("""
## Additional Reactivity ⚡⚡
""")
- return
@app.cell
@@ -316,7 +306,7 @@ def _(mo):
@app.cell
-def _(mo, search_value):
+def _(mo, search_value: str):
keyword_results = mo.sql(
f"""
SELECT
@@ -340,7 +330,7 @@ def _(search_input):
@app.cell(hide_code=True)
-def _(alt, keyword_results, mo, search_value):
+def _(alt, keyword_results, mo, search_value: str):
if keyword_results.is_empty():
mo.stop(True, f"No results for {search_value}")
@@ -372,7 +362,6 @@ def _(alt, keyword_results, mo, search_value):
)
_chart + _text
- return
@app.cell(hide_code=True)
diff --git a/examples/sql/connect_to_postgres.py b/examples/sql/connect_to_postgres.py
index 8eecb734a0..961aa23989 100644
--- a/examples/sql/connect_to_postgres.py
+++ b/examples/sql/connect_to_postgres.py
@@ -11,7 +11,7 @@
import marimo
-__generated_with = "0.17.2"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@@ -26,7 +26,6 @@ def _(mo):
For advanced usage, see [duckdb's documentation](https://duckdb.org/docs/extensions/postgres).
""")
- return
@app.cell(hide_code=True)
@@ -68,7 +67,6 @@ def _(mo):
)
}
)
- return
@app.cell
@@ -80,7 +78,7 @@ def _():
@app.cell
-def _(PASSWORD, mo):
+def _(PASSWORD: str, mo):
_df = mo.sql(
f"""
-- Boilerplate: detach the database so this cell works when you re-run it
@@ -97,7 +95,6 @@ def _(PASSWORD, mo):
SHOW ALL TABLES;
"""
)
- return
@app.cell(hide_code=True)
@@ -106,7 +103,6 @@ def _(mo):
Once the database is attached, you can query it with SQL. Note that this involves copying data from Postgres SQL and
executing it in duckdb. See later sections of this example on how to execute queries directly in Postgres.
""")
- return
@app.cell
@@ -117,7 +113,6 @@ def _(mo):
SELECT * FROM db.public.test_table;
"""
)
- return
@app.cell(hide_code=True)
@@ -128,7 +123,6 @@ def _(mo):
the {mo.icon("lucide:database")} icon in the left sidebar to open it.
"""
)
- return
@app.cell(hide_code=True)
@@ -138,7 +132,6 @@ def _(mo):
To prevent duckdb from continuously re-reading tables from PostgreSQL, you can copy the PostgreSQL databases into DuckDB. Note that this will consume your system's RAM.
""")
- return
@app.cell
@@ -150,7 +143,6 @@ def _(mo):
SELECT * FROM duckdb_table;
"""
)
- return
@app.cell(hide_code=True)
@@ -160,7 +152,6 @@ def _(mo):
Run queries directly in PostgreSQL using duckdb's `postgres_query` function. In some cases this may be faster than executing queries in duckdb.
""")
- return
@app.cell
@@ -170,7 +161,6 @@ def _(mo):
SELECT * FROM postgres_query('db', 'SELECT * FROM test_table');
"""
)
- return
if __name__ == "__main__":
diff --git a/examples/sql/histograms.py b/examples/sql/histograms.py
index 3e9ea73166..34642f0ad4 100644
--- a/examples/sql/histograms.py
+++ b/examples/sql/histograms.py
@@ -12,7 +12,7 @@
import marimo
-__generated_with = "0.19.7"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@@ -23,7 +23,6 @@ def _(mo):
This notebook shows how to create a histogram of a column using built-in duckdb aggregate functions.
""")
- return
@app.cell
@@ -44,13 +43,12 @@ def _():
@app.cell(hide_code=True)
-def _(URL, mo):
+def _(URL: str, mo):
mo.md(rf"""First we read the dataset at: **{URL}**""")
- return
@app.cell
-def _(URL, mo):
+def _(URL: str, mo):
dataset = mo.sql(
f"""
CREATE OR REPLACE VIEW dataset AS
@@ -59,7 +57,6 @@ def _(URL, mo):
FROM dataset
"""
)
- return
@app.cell
@@ -87,7 +84,6 @@ def _(mo):
mo.md(r"""
Now we will take the histogram result and plot it using [Altair](https://altair-viz.github.io/).
""")
- return
@app.cell
@@ -101,7 +97,6 @@ def _(alt, histogram):
)
.properties(width="container")
)
- return
if __name__ == "__main__":
diff --git a/examples/sql/misc/database_explorer.py b/examples/sql/misc/database_explorer.py
index 8d45b837f9..5d2008a4d1 100644
--- a/examples/sql/misc/database_explorer.py
+++ b/examples/sql/misc/database_explorer.py
@@ -13,7 +13,7 @@
import marimo
-__generated_with = "0.19.7"
+__generated_with = "0.25.2"
app = marimo.App(width="full")
@@ -34,7 +34,6 @@ def _(mo):
This notebook lets you explore the contents of a database. Start by providing a database URL.
""")
- return
@app.cell
@@ -60,13 +59,11 @@ def _(database_url, duckdb):
ATTACH DATABASE '{database_url.value}' AS my_db (TYPE postgres, READ_ONLY);
"""
)
- return
@app.cell
def _(duckdb):
duckdb.sql("SHOW DATABASES").show()
- return
@app.cell(hide_code=True)
@@ -74,7 +71,6 @@ def _(mo):
mo.md(r"""
## Tables
""")
- return
@app.cell
@@ -84,7 +80,6 @@ def _(mo):
SHOW ALL TABLES;
"""
)
- return
@app.cell(hide_code=True)
@@ -92,7 +87,6 @@ def _(mo):
mo.md(r"""
## Other meta table functions
""")
- return
@app.cell
@@ -119,7 +113,7 @@ def _():
@app.cell
-def _(FUNCTIONS, mo):
+def _(FUNCTIONS: list[str], mo):
function = mo.ui.dropdown(
label="Dropdown",
options=FUNCTIONS,
@@ -136,7 +130,6 @@ def _(function, mo):
SELECT * FROM {function.value} WHERE database_name == 'my_db'
"""
)
- return
@app.cell(hide_code=True)
@@ -144,7 +137,6 @@ def _(mo):
mo.md(r"""
## Interact with your tables
""")
- return
@app.cell
@@ -160,7 +152,7 @@ def _(duckdb, mo):
@app.cell
-def _(mo, table_names):
+def _(mo, table_names: list):
mo.stop(not table_names)
table_select = mo.ui.dropdown(
label="Table",
@@ -186,7 +178,7 @@ def _(mo, table_select):
@app.cell
-def _(limit, mo, table_select_value):
+def _(limit, mo, table_select_value: None):
selected_table = mo.sql(
f"""
select * from my_db.{table_select_value} LIMIT {limit.value};
@@ -198,7 +190,6 @@ def _(limit, mo, table_select_value):
@app.cell
def _(mo, selected_table):
mo.ui.data_explorer(selected_table)
- return
if __name__ == "__main__":
diff --git a/examples/sql/misc/sql_cars.py b/examples/sql/misc/sql_cars.py
index ddaa54de69..c8ac42b2d7 100644
--- a/examples/sql/misc/sql_cars.py
+++ b/examples/sql/misc/sql_cars.py
@@ -12,7 +12,7 @@
import marimo
-__generated_with = "0.19.7"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@@ -31,7 +31,6 @@ def _(cars_df, mo):
CREATE OR REPLACE TABLE cars AS SELECT * FROM cars_df;
"""
)
- return
@app.cell
@@ -56,11 +55,10 @@ def _(mo, origin, top_n):
mo.md(
f"""##Top {top_n.value} Cars {f"in {origin.value}" if origin.value != None else ""}"""
)
- return
@app.cell
-def _(mo, origin_filter, top_n, year_range):
+def _(mo, origin_filter: str, top_n, year_range):
_df = mo.sql(
f"""
SELECT Name, Year, Origin, Horsepower, Miles_per_Gallon,
@@ -72,7 +70,6 @@ def _(mo, origin_filter, top_n, year_range):
LIMIT {top_n.value}
"""
)
- return
@app.cell
@@ -80,7 +77,6 @@ def _(mo):
mo.md("""
### Breakdown by Origin
""")
- return
@app.cell
@@ -106,7 +102,6 @@ def _(cars, mo, year_range):
ORDER BY Avg_Horsepower DESC
"""
)
- return
@app.cell
@@ -142,7 +137,6 @@ def _(alt, duckdb, mo, year_range):
)
)
mo.ui.altair_chart(_chart, chart_selection=None)
- return
@app.cell(hide_code=True)
@@ -203,7 +197,6 @@ def _(aggs, aggs_selected, mo):
for column in aggs.columns
]
)
- return
@app.cell(hide_code=True)
diff --git a/examples/storage/general.py b/examples/storage/general.py
index 07acafd8ed..672d5a3c52 100644
--- a/examples/storage/general.py
+++ b/examples/storage/general.py
@@ -12,7 +12,7 @@
import marimo
-__generated_with = "0.19.11"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@@ -33,7 +33,6 @@ def _():
@app.cell
def _(LocalFileSystem):
local = LocalFileSystem(asynchronous=True)
- return
@app.cell
@@ -60,17 +59,15 @@ def _(GithubFileSystem):
@app.cell
def _(marimo_repo):
print(marimo_repo.read_text("github://AGENTS.md"))
- return
@app.cell
-def _(os, s3fs, url):
+def _(os, s3fs, url: None | str):
s3_client = s3fs.S3FileSystem(
endpoint_url=url,
key=os.getenv("CLOUDFLARE_ACCESS_KEY_ID"),
secret=os.getenv("CLOUDFLARE_SECRET_ACCESS_KEY"),
)
- return
if __name__ == "__main__":
diff --git a/examples/third_party/anywidget/tldraw_colorpicker.py b/examples/third_party/anywidget/tldraw_colorpicker.py
index 3a02482322..726c1185e3 100644
--- a/examples/third_party/anywidget/tldraw_colorpicker.py
+++ b/examples/third_party/anywidget/tldraw_colorpicker.py
@@ -10,7 +10,7 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@@ -40,13 +40,12 @@ def _():
@app.cell
-def _(mo, np, opacity, plt, sizes, widget, x, y):
+def _(mo, np, opacity, plt, sizes, widget, x: int, y: int):
fig, ax = plt.subplots()
fig.set_size_inches(3, 3)
ax.set(xlim=(0, 8), xticks=np.arange(1, 8), ylim=(0, 8), yticks=np.arange(1, 8))
ax.scatter(x, y, s=sizes*5, color=widget.color or None, alpha=opacity)
mo.hstack([widget, plt.gca()], justify="start", widths=[1, 1])
- return
if __name__ == "__main__":
diff --git a/examples/third_party/chroma/multimodal_retrieval.py b/examples/third_party/chroma/multimodal_retrieval.py
index b3eb4a5401..1c251130c3 100644
--- a/examples/third_party/chroma/multimodal_retrieval.py
+++ b/examples/third_party/chroma/multimodal_retrieval.py
@@ -13,7 +13,7 @@
import marimo
-__generated_with = "0.19.7"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@@ -33,7 +33,6 @@ def _(mo):
This notebook shows an example of how to create and query a collection with both text and images, using Chroma's built-in features.
""")
- return
@app.cell(hide_code=True)
@@ -45,7 +44,6 @@ def _(mo):
We download a small fraction of all the images in the dataset locally, and use it to create a multimodal collection.
""")
- return
@app.cell
@@ -73,7 +71,7 @@ def _(load_dataset, mo):
@app.cell
-def _(N_IMAGES, dataset, mo, os):
+def _(N_IMAGES: int, dataset, mo, os):
# Write the images to a folder
IMAGE_FOLDER = "images"
os.makedirs(IMAGE_FOLDER, exist_ok=True)
@@ -98,7 +96,7 @@ def _(mo):
@app.cell(hide_code=True)
-def _(all_images, img_width, mo):
+def _(all_images: list, img_width, mo):
import io
@@ -113,7 +111,6 @@ def _(all_images, img_width, mo):
[as_image(_img) for _img in all_images[10:]],
wrap=True,
)
- return
@app.cell(hide_code=True)
@@ -126,7 +123,6 @@ def _(mo):
For this example, we are only adding images, though you can also add text.
""")
- return
@app.cell(hide_code=True)
@@ -136,7 +132,6 @@ def _(mo):
First we create the default Chroma client.
""")
- return
@app.cell
@@ -154,7 +149,6 @@ def _(mo):
The built-in `OpenCLIPEmbeddingFunction` works with both text and image data. The `ImageLoader` is a simple data loader that loads images from a local directory.
""")
- return
@app.cell
@@ -172,11 +166,10 @@ def _(mo):
mo.md(r"""
We create a collection with the embedding function and data loader.
""")
- return
@app.cell
-def _(IMAGE_FOLDER, client, embedding_function, image_loader, os):
+def _(IMAGE_FOLDER: str, client, embedding_function, image_loader, os):
collection = client.create_collection(
name="multimodal_collection",
embedding_function=embedding_function,
@@ -204,7 +197,6 @@ def _(mo):
We add image data to the collection using the image URIs. The data loader and embedding functions we specified earlier will ingest data from the provided URIs automatically.
""")
- return
@app.cell(hide_code=True)
@@ -214,7 +206,6 @@ def _(mo):
We can query the collection using text as normal, since the `OpenCLIPEmbeddingFunction` works with both text and images.
""")
- return
@app.cell(hide_code=True)
@@ -234,7 +225,6 @@ def _(collection, mo, query):
)
[mo.image(img, height=200) for img in _retrieved["data"][0]]
- return
@app.cell(hide_code=True)
@@ -244,7 +234,6 @@ def _(mo):
We can also query by images directly, by using the `query_images` field in the `collection.query` method.
///
""")
- return
@app.cell
@@ -264,14 +253,14 @@ def _(collection, mo, selected_image):
@app.cell(hide_code=True)
-def _(IMAGE_FOLDER, mo):
+def _(IMAGE_FOLDER: str, mo):
selected_image = mo.ui.file_browser(IMAGE_FOLDER, multiple=False)
selected_image
return (selected_image,)
@app.cell(hide_code=True)
-def _(mo, results, selected):
+def _(mo, results: list, selected):
mo.hstack(
[
mo.vstack([mo.md("## Selected"), selected]),
@@ -280,7 +269,6 @@ def _(mo, results, selected):
widths="equal",
gap=4,
)
- return
@app.cell(hide_code=True)
@@ -288,7 +276,6 @@ def _(mo):
mo.md(r"""
This example was adapted from [multimodal_retrieval.ipynb](https://github.com/chroma-core/chroma/blob/main/examples/multimodal/multimodal_retrieval.ipynb), using `marimo convert`.
""")
- return
if __name__ == "__main__":
diff --git a/examples/third_party/cvxpy/regularization_and_sparsity.py b/examples/third_party/cvxpy/regularization_and_sparsity.py
index d3b0a65f27..8b986c20f2 100644
--- a/examples/third_party/cvxpy/regularization_and_sparsity.py
+++ b/examples/third_party/cvxpy/regularization_and_sparsity.py
@@ -10,7 +10,7 @@
import marimo
-__generated_with = "0.19.7"
+__generated_with = "0.25.2"
app = marimo.App()
@@ -19,7 +19,6 @@ def _(mo):
mo.md("""
# Regularization and Sparsity
""")
- return
@app.cell(hide_code=True)
@@ -55,7 +54,6 @@ def _(mo):
\|x\|_2 = \sqrt{x_1^2 + x_2^2 + \cdots + x_n^2}.
\]
""")
- return
@app.cell
@@ -66,7 +64,7 @@ def _():
@app.cell
-def _(m, n, np):
+def _(m: int, n: int, np):
np.random.seed(0)
A = np.random.randn(m, n)
b = np.random.randn(m)
@@ -97,7 +95,6 @@ def _(mo):
mo.md("""
## Parameter selection
""")
- return
@app.cell(hide_code=True)
@@ -111,7 +108,7 @@ def _(mo):
@app.cell(hide_code=True)
-def _(mo, n, number_of_zeros, sparsity_parameter, x_l1, x_l2):
+def _(mo, n: int, number_of_zeros, sparsity_parameter, x_l1: None, x_l2: None):
(
mo.md(
"""
@@ -136,17 +133,15 @@ def _(mo, n, number_of_zeros, sparsity_parameter, x_l1, x_l2):
"""
)
)
- return
@app.cell
-def _(cdf, plt, x_l1, x_l2):
+def _(cdf, plt, x_l1: None, x_l2: None):
cdf_figure, cdf_axs = plt.subplots(2, 1, sharex=True)
cdf(x_l1, cdf_axs[0]).set_title("$p=1$")
cdf(x_l2, cdf_axs[1]).set_title("$p=2$")
plt.tight_layout()
cdf_figure
- return
@app.cell
@@ -162,7 +157,6 @@ def _(mo):
of $x$ is $0$, then the corresponding feature or measurement
must not be important in making predictions.
""")
- return
@app.cell
@@ -174,7 +168,7 @@ def _(np):
@app.cell
-def _(np, x_min_max):
+def _(np, x_min_max: list[float]):
def cdf(x, ax):
heights = np.arange(1, x.size+1) / x.size
xs = np.sort(x)
diff --git a/examples/third_party/cvxpy/signals/app.py b/examples/third_party/cvxpy/signals/app.py
index 1209907f82..6d69fbfdf9 100644
--- a/examples/third_party/cvxpy/signals/app.py
+++ b/examples/third_party/cvxpy/signals/app.py
@@ -1,6 +1,6 @@
import marimo
-__generated_with = "0.19.7"
+__generated_with = "0.25.2"
app = marimo.App()
@@ -9,7 +9,6 @@ def _(mo):
mo.md("""
# Signal Decomposition
""")
- return
@app.cell
@@ -19,7 +18,6 @@ def _(mo):
age-old problem about breaking down a complex signal, also known as a
time series, into the sum of simpler interpretable ones.
""")
- return
@app.cell
@@ -32,7 +30,6 @@ def _(mo):
1. How many components do we want?
2. What kinds of components, or "component classes", do we want?
""")
- return
@app.cell
@@ -63,7 +60,7 @@ def _(complib, mo):
@app.cell
-def _(component_options, get_component_radio_tracker):
+def _(component_options: list[str], get_component_radio_tracker):
def user_tried_all_components():
return len(get_component_radio_tracker()) == len(component_options)
@@ -116,11 +113,10 @@ def _(get_show_third_component, mo):
{_three_component_text} component.
"""
)
- return
@app.cell
-def _(get_show_third_component, intro, mo, radios):
+def _(get_show_third_component, intro, mo, radios: list):
# Show radios
(
mo.hstack(
@@ -137,11 +133,10 @@ def _(get_show_third_component, intro, mo, radios):
if not get_show_third_component()
else mo.hstack(radios, justify="space-around")
)
- return
@app.cell
-def _(get_show_third_component, intro, mo, radios):
+def _(get_show_third_component, intro, mo, radios: list):
# Plot 3-component decomposition
(
None
@@ -157,18 +152,16 @@ def _(get_show_third_component, intro, mo, radios):
]
)
)
- return
@app.cell
-def _(explainer, get_show_third_component, mo, radios):
+def _(explainer, get_show_third_component, mo, radios: list):
# Component explainer callout
(
mo.md(explainer.explainer(radios[0].value)).callout(kind="neutral")
if not get_show_third_component() and radios[0].value is not None
else None
)
- return
@app.cell
@@ -215,7 +208,6 @@ def _(
and not solved.now
else None
)
- return
@app.cell
@@ -236,7 +228,7 @@ def _():
@app.cell
-def _(complib, radios, solved_ever):
+def _(complib, radios: list, solved_ever):
_chosen_components = set([r.value for r in radios])
@@ -283,7 +275,6 @@ def _(get_show_third_component, mo, solved):
if get_show_third_component() and solved.now
else None
)
- return
@app.cell
@@ -304,7 +295,6 @@ def _(mo, solved):
if solved.ever
else None
)
- return
@app.cell
@@ -333,7 +323,6 @@ def _(
and not solved.now
else None
)
- return
@app.cell
@@ -341,7 +330,6 @@ def _(mo):
mo.md("""
## Part 2: More Decompositions
""")
- return
@app.cell
@@ -385,7 +373,6 @@ def _(mo, selected_problem, solved):
"""
).callout(kind="alert")
)
- return
@app.cell
@@ -449,7 +436,6 @@ def _(data_uploader, mo, problems, selected_problem, show_csv_parameters):
{show_csv_parameters()}
"""
).callout()
- return
@app.cell
@@ -565,7 +551,6 @@ def _(mo, problem):
mo.stop(problem is None)
mo.md(f"### {problem.name()}")
- return
@app.cell
@@ -573,7 +558,6 @@ def _(mo, problem):
mo.stop(problem is None)
problem.description()
- return
@app.cell
@@ -585,7 +569,6 @@ def _(add_button, mo, problem, remove_button):
## {mo.md(f"{add_button} {remove_button}").center()}
"""
)
- return
@app.cell
@@ -593,7 +576,6 @@ def _(component_array, component_params, mo, problem):
mo.stop(problem is None)
mo.hstack([component_array, component_params])
- return
@app.cell
@@ -697,7 +679,7 @@ def _(component_array):
@app.cell
-def _(component_array, noise_component_selected, problem):
+def _(component_array, noise_component_selected: None, problem):
should_compute_decomposition = (
noise_component_selected
and sum(1 for v in component_array.value if v is not None) >= 2
@@ -709,10 +691,10 @@ def _(component_array, noise_component_selected, problem):
def _(
component_array,
mo,
- noise_component_selected,
+ noise_component_selected: None,
problem,
- rolled_up_params,
- should_compute_decomposition,
+ rolled_up_params: tuple,
+ should_compute_decomposition: None,
):
mo.stop(problem is None)
@@ -739,7 +721,6 @@ def _(
)
_feedback()
- return
@app.cell
@@ -777,8 +758,8 @@ def _(
mo,
plt,
problem,
- rolled_up_params,
- should_compute_decomposition,
+ rolled_up_params: tuple,
+ should_compute_decomposition: None,
):
mo.stop(not should_compute_decomposition)
@@ -795,7 +776,6 @@ def _(
_do_decomposition()
- return
@app.cell
@@ -815,7 +795,6 @@ def _(explainer_choice, mo, solved):
Tell me more about the {explainer_choice} component class.
"""
)
- return
@app.cell
@@ -823,7 +802,6 @@ def _(explainer, explainer_choice, mo):
mo.md(
explainer.explainer(explainer_choice.value)
).callout() if explainer_choice.value is not None else ""
- return
@app.cell
@@ -843,7 +821,6 @@ def _(mo, solved):
and fun.
"""
)
- return
@app.cell
diff --git a/examples/third_party/cvxpy/smallest_enclosing_circle.py b/examples/third_party/cvxpy/smallest_enclosing_circle.py
index df60757d0f..1133ad270a 100644
--- a/examples/third_party/cvxpy/smallest_enclosing_circle.py
+++ b/examples/third_party/cvxpy/smallest_enclosing_circle.py
@@ -10,7 +10,7 @@
import marimo
-__generated_with = "0.19.7"
+__generated_with = "0.25.2"
app = marimo.App()
@@ -28,7 +28,6 @@ def _(mo):
_Use the slider below to choose the number of circles to sample:_
""")
- return
@app.cell(hide_code=True)
@@ -73,13 +72,13 @@ def _(generate_circles, number_of_circles, resample_button):
@app.cell
-def _(circles, smallest_enclosing_circle):
+def _(circles: list, smallest_enclosing_circle):
center, radius = smallest_enclosing_circle(circles)
return center, radius
@app.cell
-def _(center, circles, plot_circle, plt, radius):
+def _(center: None, circles: list, plot_circle, plt, radius: None):
for (c_i, r_i) in circles:
plot_circle(c_i, r_i, color='gray')
plot_circle(center, radius, color='green', label='smallest enclosing circle')
@@ -88,7 +87,6 @@ def _(center, circles, plot_circle, plt, radius):
plt.legend(loc='upper right')
plt.gcf().set_size_inches((6, 6))
plt.gca()
- return
@app.cell
@@ -106,7 +104,6 @@ def _(mo):
mo.md("""
## The solution method
""")
- return
@app.cell
@@ -148,7 +145,6 @@ def _(mo):
return (center.value, radius.value)
```
""")
- return
@app.cell
diff --git a/examples/third_party/duckdb/duckdb_example.py b/examples/third_party/duckdb/duckdb_example.py
index b25fe78422..1629b4789d 100644
--- a/examples/third_party/duckdb/duckdb_example.py
+++ b/examples/third_party/duckdb/duckdb_example.py
@@ -10,7 +10,7 @@
import marimo
-__generated_with = "0.19.7"
+__generated_with = "0.25.2"
app = marimo.App(width="full")
@@ -22,7 +22,6 @@ def _(mo):
This notebook allows you to search and explore the datasets available on Hugging Face.
First you can search for a dataset using the filters provided. Then you can select a dataset and explore the parquet files that are available for that dataset. Finally you can use the SQL editor to query the parquet files and the dataframe editor to explore the results of your query.
""")
- return
@app.cell(hide_code=True)
@@ -54,7 +53,7 @@ def _(datasets, duckdb):
@app.cell(hide_code=True)
-def _(all_tags, dataset_date_range, dataset_length, mo):
+def _(all_tags, dataset_date_range: str, dataset_length: int, mo):
# Create stats cards
stats = mo.hstack(
[
@@ -157,7 +156,6 @@ def _(mo, selected_dataset):
You can select one of the parquet files below to load it into duckdb.
"""
)
- return
@app.cell
@@ -258,7 +256,6 @@ def _(has_selected_file, mo, render_sql_results, sql_editor):
mo.stop(not has_selected_file)
render_sql_results(sql_editor)
- return
@app.cell
@@ -279,7 +276,6 @@ def _(datasets, mo, render_dataframe_editor):
df_editor,
]
)
- return
@app.cell
diff --git a/examples/third_party/huggingface/chatbot.py b/examples/third_party/huggingface/chatbot.py
index 2e77b9c56a..301359d3a7 100644
--- a/examples/third_party/huggingface/chatbot.py
+++ b/examples/third_party/huggingface/chatbot.py
@@ -8,7 +8,7 @@
import marimo
-__generated_with = "0.19.7"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@@ -28,11 +28,10 @@ def _():
@app.cell(hide_code=True)
-def _(MODEL_NAME, mo):
+def _(MODEL_NAME: str, mo):
mo.md(f"""
# Chat with **{MODEL_NAME}**
""")
- return
@app.cell
@@ -43,7 +42,6 @@ def _(max_tokens, mo, system_message, temperature, top_p):
mo.vstack([temperature, top_p, max_tokens], align="end"),
],
)
- return
@app.cell
@@ -53,11 +51,10 @@ def _(mo, respond):
prompts=["Tell me a joke.", "What is the square root of {{number}}?"],
)
chat
- return
@app.cell
-def _(InferenceClient, MODEL_NAME, os):
+def _(InferenceClient, MODEL_NAME: str, os):
"""
For more information on `huggingface_hub` Inference API support, please check the docs: https://huggingface.co/docs/huggingface_hub/v0.26.2/en/guides/inference
"""
diff --git a/examples/third_party/huggingface/text-to-image.py b/examples/third_party/huggingface/text-to-image.py
index da8c61c3f5..f95ea46630 100644
--- a/examples/third_party/huggingface/text-to-image.py
+++ b/examples/third_party/huggingface/text-to-image.py
@@ -13,7 +13,7 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@@ -50,9 +50,8 @@ def _():
@app.cell
-def _(mo, model_repo_id):
+def _(mo, model_repo_id: str):
mo.md(f"""# HuggingFace Text-to-Image: **{model_repo_id}**""")
- return
@app.cell(hide_code=True)
@@ -66,7 +65,7 @@ def _():
@app.cell
-def _(DiffusionPipeline, MAX_SEED, mo, model_repo_id, random, torch):
+def _(DiffusionPipeline, MAX_SEED, mo, model_repo_id: str, random, torch):
device = "cuda" if torch.cuda.is_available() else "cpu"
if torch.cuda.is_available():
@@ -131,7 +130,7 @@ def _(get_prompt, mo, set_prompt):
@app.cell
-def _(examples, mo, set_prompt):
+def _(examples: list[str], mo, set_prompt):
def _on_click(example):
def handle(v):
set_prompt(example)
@@ -151,7 +150,7 @@ def _(examples, mo, set_prompt):
@app.cell
-def _(MAX_IMAGE_SIZE, MAX_SEED, example_options, mo, prompt):
+def _(MAX_IMAGE_SIZE: int, MAX_SEED, example_options, mo, prompt):
run_button = mo.ui.run_button(label="Run", kind="success", full_width=True)
negative_prompt = mo.ui.text_area(
@@ -242,13 +241,11 @@ def _(
)
set_image(_image)
mo.output.clear() # Clear loading tdqm
- return
@app.cell
def _(get_image):
get_image()
- return
if __name__ == "__main__":
diff --git a/examples/third_party/matplotlib/surfaces.py b/examples/third_party/matplotlib/surfaces.py
index af2f333742..4552d3697a 100644
--- a/examples/third_party/matplotlib/surfaces.py
+++ b/examples/third_party/matplotlib/surfaces.py
@@ -9,7 +9,7 @@
import marimo
-__generated_with = "0.19.7"
+__generated_with = "0.25.2"
app = marimo.App()
@@ -18,7 +18,6 @@ def _(mo):
mo.md("""
# Surfaces
""")
- return
@app.cell
@@ -33,7 +32,6 @@ def _(ax, xlim, ylim, zlim):
ax.set_ylim(ylim.value)
ax.set_zlim(zlim.value)
ax
- return
@app.cell(hide_code=True)
@@ -101,11 +99,10 @@ def _(
surface in $\mathbf{{R}}^3$ {_prose}
"""
)
- return
@app.cell
-def _(function, function_options):
+def _(function, function_options: dict):
selected_function = function_options[function.value]
return (selected_function,)
@@ -159,7 +156,6 @@ def _(mo):
mo.md("""
### Controls
""")
- return
@app.cell
diff --git a/examples/third_party/nvidia/nims.py b/examples/third_party/nvidia/nims.py
index 35e27448cf..c0a20b3dc8 100644
--- a/examples/third_party/nvidia/nims.py
+++ b/examples/third_party/nvidia/nims.py
@@ -8,7 +8,7 @@
import marimo
-__generated_with = "0.19.7"
+__generated_with = "0.25.2"
app = marimo.App()
@@ -31,10 +31,9 @@ def _(mo):
@app.cell
-def _(api_token, default_api_token):
+def _(api_token, default_api_token: None | str | list[str]):
api_token if not default_api_token else None
api_token
- return
@app.cell(hide_code=True)
@@ -65,7 +64,7 @@ def _(mo, uploaded_file):
@app.cell
-def _(base64_encoded, mo):
+def _(base64_encoded: str, mo):
data_uri = f"data:image/png;base64,{base64_encoded}"
mo.Html(f'<img src="{data_uri}" />')
return (data_uri,)
@@ -91,7 +90,16 @@ def _():
@app.cell
-def _(api_token, data_uri, mo, prompt, requests, temperature, top_p, url):
+def _(
+ api_token,
+ data_uri: str,
+ mo,
+ prompt,
+ requests,
+ temperature,
+ top_p,
+ url: str,
+):
mo.stop(not prompt.value)
payload = {
@@ -128,7 +136,6 @@ def _(mo, res):
content = res
mo.md(f"**Response:** \n{res}")
- return
if __name__ == "__main__":
diff --git a/examples/third_party/plotly/box_chart.py b/examples/third_party/plotly/box_chart.py
index 6c172e9cbc..87a45b292a 100644
--- a/examples/third_party/plotly/box_chart.py
+++ b/examples/third_party/plotly/box_chart.py
@@ -9,7 +9,7 @@
import marimo
-__generated_with = "0.20.2"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@@ -39,7 +39,6 @@ def _(mo):
The `customdata` field embeds the original row ID (`sample_id`) so selected
points map back to the source DataFrame without relying on raw indices.
""")
- return
@app.cell
@@ -69,44 +68,41 @@ def _(pd):
return (df,)
-def _():
- def selected_rows(selection, data):
- """Map a mo.ui.plotly selection back to rows in the source DataFrame."""
- empty = data.iloc[0:0].copy()
- if not selection:
- return empty
-
- # Prefer sample_id embedded via customdata.
- # Box-body clicks embed sample_id as customdata[0], not a top-level key.
- ids = []
- for row in selection:
- if isinstance(row.get("sample_id"), str):
- ids.append(row["sample_id"])
- else:
- cd = row.get("customdata")
- if isinstance(cd, (list, tuple)) and cd and isinstance(cd[0], str):
- ids.append(cd[0])
- if ids:
- return (
- data[data["sample_id"].isin(ids)]
- .drop_duplicates("sample_id")
- .sort_values("sample_id")
- )
-
- # Fall back to pointIndex
- indices = sorted({
- row["pointIndex"]
- for row in selection
- if isinstance(row.get("pointIndex"), int)
- and 0 <= row["pointIndex"] < len(data)
- })
- if indices:
- return data.iloc[indices].copy()
-
+def selected_rows(selection, data):
+ """Map a mo.ui.plotly selection back to rows in the source DataFrame."""
+ empty = data.iloc[0:0].copy()
+ if not selection:
return empty
- return (selected_rows,)
+ # Prefer sample_id embedded via customdata.
+ # Box-body clicks embed sample_id as customdata[0], not a top-level key.
+ ids = []
+ for row in selection:
+ if isinstance(row.get("sample_id"), str):
+ ids.append(row["sample_id"])
+ else:
+ cd = row.get("customdata")
+ if isinstance(cd, (list, tuple)) and cd and isinstance(cd[0], str):
+ ids.append(cd[0])
+ if ids:
+ return (
+ data[data["sample_id"].isin(ids)]
+ .drop_duplicates("sample_id")
+ .sort_values("sample_id")
+ )
+
+ # Fall back to pointIndex
+ indices = sorted({
+ row["pointIndex"]
+ for row in selection
+ if isinstance(row.get("pointIndex"), int)
+ and 0 <= row["pointIndex"] < len(data)
+ })
+ if indices:
+ return data.iloc[indices].copy()
+
+ return empty
@app.cell
@@ -147,7 +143,7 @@ def _(df, go, mo):
@app.cell
-def _(box_single, df, mo, selected_rows):
+def _(box_single, df, mo):
_sel = selected_rows(box_single.value, df)
_summary = (
@@ -165,13 +161,11 @@ def _(box_single, df, mo, selected_rows):
**Indices:** {box_single.indices}
""")
- return
@app.cell
-def _(box_single, df, mo, selected_rows):
+def _(box_single, df, mo):
mo.ui.table(selected_rows(box_single.value, df))
- return
@app.cell
@@ -207,7 +201,7 @@ def _(df, mo, px):
@app.cell
-def _(box_grouped, df, mo, selected_rows):
+def _(box_grouped, df, mo):
_sel_g = selected_rows(box_grouped.value, df)
_summary_g = (
@@ -229,13 +223,11 @@ def _(box_grouped, df, mo, selected_rows):
**Range:** {box_grouped.ranges}
""")
- return
@app.cell
-def _(box_grouped, df, mo, selected_rows):
+def _(box_grouped, df, mo):
mo.ui.table(selected_rows(box_grouped.value, df))
- return
@app.cell
@@ -277,7 +269,7 @@ def _(df, go, mo):
@app.cell
-def _(box_horizontal, df, mo, selected_rows):
+def _(box_horizontal, df, mo):
_sel_h = selected_rows(box_horizontal.value, df)
_summary_h = (
@@ -293,13 +285,11 @@ def _(box_horizontal, df, mo, selected_rows):
**Indices:** {box_horizontal.indices}
""")
- return
@app.cell
-def _(box_horizontal, df, mo, selected_rows):
+def _(box_horizontal, df, mo):
mo.ui.table(selected_rows(box_horizontal.value, df))
- return
if __name__ == "__main__":
diff --git a/examples/third_party/plotly/histogram.py b/examples/third_party/plotly/histogram.py
index 7dd9746ff5..46b6d2c6fb 100644
--- a/examples/third_party/plotly/histogram.py
+++ b/examples/third_party/plotly/histogram.py
@@ -8,7 +8,7 @@
import marimo
-__generated_with = "0.20.2"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@@ -32,7 +32,6 @@ def _(mo):
Select bins by dragging a box (or use lasso with Shift). Selections are
returned to Python as selected rows with `pointIndex` values.
""")
- return
@app.cell
@@ -64,7 +63,7 @@ def _(go, mo, random):
@app.cell
-def _(numeric_hist, values):
+def _(numeric_hist, values: list[float]):
selected_rows = numeric_hist.value or []
# Show first selected original values by pointIndex.
@@ -73,12 +72,16 @@ def _(numeric_hist, values):
for row in selected_rows[:10]
if isinstance(row.get("pointIndex"), int)
]
-
return mapped_original_values, selected_rows
@app.cell
-def _(mapped_original_values, mo, numeric_hist, selected_rows):
+def _(
+ mapped_original_values: list[float],
+ mo,
+ numeric_hist,
+ selected_rows: list,
+):
mo.md(f"""
### Numeric Selection Output
@@ -91,7 +94,6 @@ def _(mapped_original_values, mo, numeric_hist, selected_rows):
**First mapped original values (using pointIndex):**
{mapped_original_values}
""")
- return
@app.cell
@@ -137,7 +139,6 @@ def _(categorical_hist, mo):
**Preview:**
{categorical_hist.value[:10]}
""")
- return
@app.cell
@@ -183,7 +184,6 @@ def _(horizontal_hist, mo):
**Preview:**
{horizontal_hist.value[:10]}
""")
- return
if __name__ == "__main__":
diff --git a/examples/third_party/plotly/strip_chart.py b/examples/third_party/plotly/strip_chart.py
index 762e8449d2..f64da9c884 100644
--- a/examples/third_party/plotly/strip_chart.py
+++ b/examples/third_party/plotly/strip_chart.py
@@ -9,7 +9,7 @@
import marimo
-__generated_with = "0.20.2"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@@ -42,7 +42,6 @@ def _(mo):
The `customdata` field embeds `sample_id` so selected points map back to the
source DataFrame without relying on raw indices.
""")
- return
@app.cell
@@ -72,45 +71,42 @@ def _(pd):
return (df,)
-def _():
- def selected_rows(selection, data):
- """Map a mo.ui.plotly selection back to rows in the source DataFrame."""
- empty = data.iloc[0:0].copy()
- if not selection:
- return empty
-
- # Prefer sample_id embedded via customdata.
- # Fallback-path selections embed sample_id as customdata[0] (a
- # list/tuple), not as a parsed top-level key.
- ids = []
- for row in selection:
- if isinstance(row.get("sample_id"), str):
- ids.append(row["sample_id"])
- else:
- cd = row.get("customdata")
- if isinstance(cd, (list, tuple)) and cd and isinstance(cd[0], str):
- ids.append(cd[0])
- if ids:
- return (
- data[data["sample_id"].isin(ids)]
- .drop_duplicates("sample_id")
- .sort_values("sample_id")
- )
-
- # Fall back to pointIndex
- indices = sorted({
- row["pointIndex"]
- for row in selection
- if isinstance(row.get("pointIndex"), int)
- and 0 <= row["pointIndex"] < len(data)
- })
- if indices:
- return data.iloc[indices].copy()
-
+def selected_rows(selection, data):
+ """Map a mo.ui.plotly selection back to rows in the source DataFrame."""
+ empty = data.iloc[0:0].copy()
+ if not selection:
return empty
- return (selected_rows,)
+ # Prefer sample_id embedded via customdata.
+ # Fallback-path selections embed sample_id as customdata[0] (a
+ # list/tuple), not as a parsed top-level key.
+ ids = []
+ for row in selection:
+ if isinstance(row.get("sample_id"), str):
+ ids.append(row["sample_id"])
+ else:
+ cd = row.get("customdata")
+ if isinstance(cd, (list, tuple)) and cd and isinstance(cd[0], str):
+ ids.append(cd[0])
+ if ids:
+ return (
+ data[data["sample_id"].isin(ids)]
+ .drop_duplicates("sample_id")
+ .sort_values("sample_id")
+ )
+
+ # Fall back to pointIndex
+ indices = sorted({
+ row["pointIndex"]
+ for row in selection
+ if isinstance(row.get("pointIndex"), int)
+ and 0 <= row["pointIndex"] < len(data)
+ })
+ if indices:
+ return data.iloc[indices].copy()
+
+ return empty
@app.cell
@@ -145,7 +141,7 @@ def _(df, mo, px):
@app.cell
-def _(df, mo, selected_rows, strip_plot):
+def _(df, mo, strip_plot):
_sel = selected_rows(strip_plot.value, df)
_summary = (
@@ -165,13 +161,11 @@ def _(df, mo, selected_rows, strip_plot):
**Range:** {strip_plot.ranges}
""")
- return
@app.cell
-def _(df, mo, selected_rows, strip_plot):
+def _(df, mo, strip_plot):
mo.ui.table(selected_rows(strip_plot.value, df))
- return
@app.cell
@@ -214,7 +208,7 @@ def _(df, go, mo):
@app.cell
-def _(df, mo, selected_rows, strip_single):
+def _(df, mo, strip_single):
_sel_s = selected_rows(strip_single.value, df)
_summary_s = (
@@ -231,13 +225,11 @@ def _(df, mo, selected_rows, strip_single):
**Indices:** {strip_single.indices}
""")
- return
@app.cell
-def _(df, mo, selected_rows, strip_single):
+def _(df, mo, strip_single):
mo.ui.table(selected_rows(strip_single.value, df))
- return
@app.cell
@@ -281,7 +273,7 @@ def _(df, go, mo):
@app.cell
-def _(df, mo, selected_rows, strip_horizontal):
+def _(df, mo, strip_horizontal):
_sel_h = selected_rows(strip_horizontal.value, df)
_summary_h = (
@@ -297,13 +289,11 @@ def _(df, mo, selected_rows, strip_horizontal):
**Indices:** {strip_horizontal.indices}
""")
- return
@app.cell
-def _(df, mo, selected_rows, strip_horizontal):
+def _(df, mo, strip_horizontal):
mo.ui.table(selected_rows(strip_horizontal.value, df))
- return
if __name__ == "__main__":
diff --git a/examples/third_party/plotly/violin_chart.py b/examples/third_party/plotly/violin_chart.py
index 0171da653d..d56cd0a9d5 100644
--- a/examples/third_party/plotly/violin_chart.py
+++ b/examples/third_party/plotly/violin_chart.py
@@ -9,7 +9,7 @@
import marimo
-__generated_with = "0.20.2"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@@ -38,7 +38,6 @@ def _(mo):
The `customdata` field embeds the original row ID (`sample_id`) so selected
points map back to the source DataFrame without relying on raw indices.
""")
- return
@app.cell
@@ -68,40 +67,37 @@ def _(pd):
return (df,)
-def _():
- def selected_rows(selection, data):
- """Map a mo.ui.plotly selection back to rows in the source DataFrame."""
- empty = data.iloc[0:0].copy()
- if not selection:
- return empty
-
- # Prefer sample_id embedded via customdata
- ids = [
- row["sample_id"]
- for row in selection
- if isinstance(row.get("sample_id"), str)
- ]
- if ids:
- return (
- data[data["sample_id"].isin(ids)]
- .drop_duplicates("sample_id")
- .sort_values("sample_id")
- )
-
- # Fall back to pointIndex
- indices = sorted({
- row["pointIndex"]
- for row in selection
- if isinstance(row.get("pointIndex"), int)
- and 0 <= row["pointIndex"] < len(data)
- })
- if indices:
- return data.iloc[indices].copy()
-
+def selected_rows(selection, data):
+ """Map a mo.ui.plotly selection back to rows in the source DataFrame."""
+ empty = data.iloc[0:0].copy()
+ if not selection:
return empty
- return (selected_rows,)
+ # Prefer sample_id embedded via customdata
+ ids = [
+ row["sample_id"]
+ for row in selection
+ if isinstance(row.get("sample_id"), str)
+ ]
+ if ids:
+ return (
+ data[data["sample_id"].isin(ids)]
+ .drop_duplicates("sample_id")
+ .sort_values("sample_id")
+ )
+
+ # Fall back to pointIndex
+ indices = sorted({
+ row["pointIndex"]
+ for row in selection
+ if isinstance(row.get("pointIndex"), int)
+ and 0 <= row["pointIndex"] < len(data)
+ })
+ if indices:
+ return data.iloc[indices].copy()
+
+ return empty
@app.cell
@@ -145,7 +141,7 @@ def _(df, go, mo):
@app.cell
-def _(df, mo, selected_rows, violin_single):
+def _(df, mo, violin_single):
_sel = selected_rows(violin_single.value, df)
_summary = (
@@ -163,13 +159,11 @@ def _(df, mo, selected_rows, violin_single):
**Indices:** {violin_single.indices}
""")
- return
@app.cell
-def _(df, mo, selected_rows, violin_single):
+def _(df, mo, violin_single):
mo.ui.table(selected_rows(violin_single.value, df))
- return
@app.cell
@@ -207,7 +201,7 @@ def _(df, mo, px):
@app.cell
-def _(df, mo, selected_rows, violin_grouped):
+def _(df, mo, violin_grouped):
_sel_g = selected_rows(violin_grouped.value, df)
_summary_g = (
@@ -229,13 +223,11 @@ def _(df, mo, selected_rows, violin_grouped):
**Range:** {violin_grouped.ranges}
""")
- return
@app.cell
-def _(df, mo, selected_rows, violin_grouped):
+def _(df, mo, violin_grouped):
mo.ui.table(selected_rows(violin_grouped.value, df))
- return
@app.cell
@@ -280,7 +272,7 @@ def _(df, go, mo):
@app.cell
-def _(df, mo, selected_rows, violin_horizontal):
+def _(df, mo, violin_horizontal):
_sel_h = selected_rows(violin_horizontal.value, df)
_summary_h = (
@@ -296,13 +288,11 @@ def _(df, mo, selected_rows, violin_horizontal):
**Indices:** {violin_horizontal.indices}
""")
- return
@app.cell
-def _(df, mo, selected_rows, violin_horizontal):
+def _(df, mo, violin_horizontal):
mo.ui.table(selected_rows(violin_horizontal.value, df))
- return
if __name__ == "__main__":
diff --git a/examples/third_party/pyiceberg/data_catalog.py b/examples/third_party/pyiceberg/data_catalog.py
index 1982c14baf..ae9b3e5f51 100644
--- a/examples/third_party/pyiceberg/data_catalog.py
+++ b/examples/third_party/pyiceberg/data_catalog.py
@@ -9,7 +9,7 @@
import marimo
-__generated_with = "0.19.7"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@@ -28,7 +28,6 @@ def _(mo):
This notebook shows you how to connect to an Apache Iceberg data catalog over REST.
""")
- return
@app.cell(hide_code=True)
@@ -42,7 +41,6 @@ def _(mo):
///
""")
- return
@app.cell(hide_code=True)
@@ -50,7 +48,6 @@ def _(mo):
mo.md(r"""
## Connect to a data catalog
""")
- return
@app.cell(hide_code=True)
@@ -83,7 +80,7 @@ def _(catalog_input, mo, token_input, warehouse_input):
@app.cell
-def _(CATALOG_URI, TOKEN, WAREHOUSE):
+def _(CATALOG_URI: str, TOKEN: str, WAREHOUSE: str):
import pyarrow as pa
from pyiceberg.catalog.rest import RestCatalog
from pyiceberg.exceptions import NamespaceAlreadyExistsError
@@ -131,7 +128,6 @@ def _(add_button, clear_button, df, table):
if clear_button.value:
table.delete()
table.to_polars().collect()
- return
if __name__ == "__main__":
diff --git a/examples/third_party/pymde/debugging_embeddings.py b/examples/third_party/pymde/debugging_embeddings.py
index 0abaf26dd2..365f1805c8 100644
--- a/examples/third_party/pymde/debugging_embeddings.py
+++ b/examples/third_party/pymde/debugging_embeddings.py
@@ -7,7 +7,7 @@
import marimo
-__generated_with = "0.19.7"
+__generated_with = "0.25.2"
app = marimo.App()
@@ -19,7 +19,6 @@ def _(mo):
This notebook shows you the basics of sanity-checking an embedding made
with the `PyMDE` library. We'll use MNIST as a case study.
""")
- return
@app.cell
@@ -30,13 +29,11 @@ def _(mo):
a heuristic, and we'll tell PyMDE to place these pairs near each other in
the embedding.
""")
- return
@app.cell
def _(n_neighbors):
n_neighbors
- return
@app.cell
@@ -46,7 +43,7 @@ def _(n_neighbors):
@app.cell
-def _(mo, ready):
+def _(mo, ready: bool):
mo.md(
"""
Below, we've plotted an embedding along with a CDF of the distortions
@@ -55,11 +52,10 @@ def _(mo, ready):
that the rest. These will be interesting to examine up close.
"""
) if ready else None
- return
@app.cell
-def _(mnist, plt, quadratic_mde, ready):
+def _(mnist, plt, quadratic_mde, ready: bool):
def compute_embedding():
_ = quadratic_mde.embed(verbose=True)
quadratic_mde.plot(color_by=mnist.attributes["digits"])
@@ -87,7 +83,7 @@ def _(mo):
@app.cell
-def _(knn, n_neighbors, ready):
+def _(knn, n_neighbors, ready: bool):
knn_graph = knn(n_neighbors.value) if ready else None
return (knn_graph,)
@@ -104,7 +100,7 @@ def _(functools, mnist, pymde):
@app.cell
-def _(knn_graph, mnist, pymde, ready, torch):
+def _(knn_graph, mnist, pymde, ready: bool, torch):
def construct_mde_problem():
if torch.cuda.is_available():
device = "cuda"
@@ -125,7 +121,7 @@ def _(knn_graph, mnist, pymde, ready, torch):
@app.cell
-def _(mo, ready):
+def _(mo, ready: bool):
mo.md(
"""
## Pairs with highest and lowest distortion
@@ -136,18 +132,17 @@ def _(mo, ready):
them near each other).
"""
) if ready else None
- return
@app.cell
-def _(mo, ready):
+def _(mo, ready: bool):
n_pairs = mo.ui.slider(5, 10, label="number of pairs")
n_pairs if ready else None
return (n_pairs,)
@app.cell
-def _(mo, ready):
+def _(mo, ready: bool):
mo.md(
"""### Low distortion pairs
@@ -155,17 +150,15 @@ def _(mo, ready):
and that the embedding placed very near each other.
"""
) if ready else None
- return
@app.cell
-def _(n_pairs, pairs, plot_pairs, ready):
+def _(n_pairs, pairs, plot_pairs, ready: bool):
plot_pairs(pairs[-n_pairs.value :]) if ready else None
- return
@app.cell
-def _(mo, ready):
+def _(mo, ready: bool):
mo.md(
"""
### High distortion pairs
@@ -178,13 +171,11 @@ def _(mo, ready):
data.
"""
) if ready else None
- return
@app.cell
-def _(n_pairs, pairs, plot_pairs, ready):
+def _(n_pairs, pairs, plot_pairs, ready: bool):
plot_pairs(pairs[: n_pairs.value]) if ready else None
- return
@app.cell
diff --git a/examples/third_party/pymde/drawing_graphs.py b/examples/third_party/pymde/drawing_graphs.py
index 4bc2401ee3..41aeb86c54 100644
--- a/examples/third_party/pymde/drawing_graphs.py
+++ b/examples/third_party/pymde/drawing_graphs.py
@@ -7,7 +7,7 @@
import marimo
-__generated_with = "0.19.7"
+__generated_with = "0.25.2"
app = marimo.App()
@@ -16,7 +16,6 @@ def _(mo):
mo.md("""
# Drawing Graphs
""")
- return
@app.cell
@@ -28,13 +27,11 @@ def _(mo):
@app.cell
def _(mo, n_items):
mo.md(f"Embedding graphs on {n_items} **{n_items.value}** items")
- return
@app.cell
def _(draw_graphs, loss, n_items, penalty):
draw_graphs(n_items, penalty, loss)
- return
@app.cell
@@ -82,7 +79,7 @@ def _():
@app.cell
-def _(functools, penalties, pymde):
+def _(functools, penalties: dict[str, type], pymde):
@functools.cache
def complete_graph(n_items, penalty):
edges = pymde.all_edges(n_items)
@@ -100,7 +97,7 @@ def _(functools, penalties, pymde):
@app.cell
-def _(embedding_dim, functools, losses, pymde, torch):
+def _(embedding_dim: int, functools, losses: dict[str, type], pymde, torch):
@functools.cache
def tree(n_items, loss):
edges = []
diff --git a/examples/third_party/pymde/google_scholar.py b/examples/third_party/pymde/google_scholar.py
index 5e915c3802..efdf8b51eb 100644
--- a/examples/third_party/pymde/google_scholar.py
+++ b/examples/third_party/pymde/google_scholar.py
@@ -7,7 +7,7 @@
import marimo
-__generated_with = "0.19.7"
+__generated_with = "0.25.2"
app = marimo.App()
@@ -23,7 +23,6 @@ def _(mo):
It uses an academic co-authorship network collected from Google Scholar as
a case study.
""")
- return
@app.cell
@@ -47,7 +46,6 @@ def _(pymde):
def _(gscholar):
scholars_df = gscholar.other_data['dataframe']
scholars_df
- return
@app.cell
@@ -59,23 +57,20 @@ def _(gscholar):
@app.cell
def _(coauthorship_graph):
f'{coauthorship_graph.n_items:,} authors'
- return
@app.cell
def _(coauthorship_graph):
f'{coauthorship_graph.n_edges:,} edges'
- return
@app.cell
def _(coauthorship_graph):
print(f'edge density: {100*(coauthorship_graph.n_edges / (coauthorship_graph.n_all_edges)):.2f} percent')
- return
@app.cell
-def _(DEVICE, coauthorship_graph, pymde):
+def _(DEVICE: str, coauthorship_graph, pymde):
mde = pymde.preserve_distances(
data=coauthorship_graph,
loss=pymde.losses.Absolute,
@@ -97,20 +92,17 @@ def _(mde, np, plt):
plt.xticks(np.arange(1, 11))
plt.xlabel('graph distances')
plt.show()
- return
@app.cell
def _(mde):
mde.distortions_cdf()
- return
@app.cell
def _(gscholar, mde):
mde.plot(color_by=gscholar.attributes['coauthors'], color_map='viridis',
figsize_inches=(12., 12.), background_color='k')
- return
@app.cell
@@ -122,7 +114,6 @@ def _(coauthorship_graph, gscholar, mde, plt, torch):
_ax = mde.plot(edges=edges, color_by=gscholar.attributes['coauthors'], color_map='viridis', figsize_inches=(12, 12))
plt.tight_layout()
_ax
- return
@app.cell
@@ -143,10 +134,9 @@ def _(gscholar):
@app.cell
-def _(mde, pymde, scholar_disciplines_df, topic_colors):
+def _(mde, pymde, scholar_disciplines_df, topic_colors: list):
pymde.plot(mde.X[scholar_disciplines_df['node_id'].values], colors=topic_colors,
figsize_inches=(12, 12), background_color='black')
- return
@app.cell
diff --git a/examples/third_party/pymde/interactive_cluster_analysis.py b/examples/third_party/pymde/interactive_cluster_analysis.py
index 37a2e14aeb..5dabac0ba9 100644
--- a/examples/third_party/pymde/interactive_cluster_analysis.py
+++ b/examples/third_party/pymde/interactive_cluster_analysis.py
@@ -8,7 +8,7 @@
import marimo
-__generated_with = "0.19.7"
+__generated_with = "0.25.2"
app = marimo.App()
@@ -17,7 +17,6 @@ def _(mo):
mo.md("""
# Cluster analysis
""")
- return
@app.cell
@@ -26,11 +25,10 @@ def _(mo):
Here's an **embedding of MNIST**: each point represents a digit,
with similar digits close to each other.
""")
- return
@app.cell
-def _(compute_embedding, constraint, embedding_dimension):
+def _(compute_embedding, constraint, embedding_dimension: int):
embedding = compute_embedding(embedding_dimension, constraint)
return (embedding,)
@@ -83,7 +81,6 @@ def _(chart, mo, show_images, table):
{table}
"""
)
- return
@app.cell
diff --git a/examples/third_party/unsloth/llama_3_1_8b_2x_faster_finetuning.py b/examples/third_party/unsloth/llama_3_1_8b_2x_faster_finetuning.py
index 45e8a548b6..b92c04f24a 100644
--- a/examples/third_party/unsloth/llama_3_1_8b_2x_faster_finetuning.py
+++ b/examples/third_party/unsloth/llama_3_1_8b_2x_faster_finetuning.py
@@ -14,7 +14,7 @@
import marimo
-__generated_with = "0.19.7"
+__generated_with = "0.25.2"
app = marimo.App(width="full")
@@ -56,7 +56,6 @@ def _(mo):
**[NEW] Try 2x faster inference in a free Colab for Llama-3.1 8b Instruct [here](https://colab.research.google.com/drive/1T-YBVfnphoVc8E2E854qF3jdia2Ll2W2?usp=sharing)**
""")
- return
@app.cell(hide_code=True)
@@ -69,7 +68,6 @@ def _(mo):
* [**NEW**] To finetune and auto export to Ollama, try our [Ollama notebook](https://colab.research.google.com/drive/1WZDi7APtQ9VsvOrQSSC5DDtxq159j8iZ?usp=sharing)
* [**NEW**] We make Mistral NeMo 12B 2x faster and fit in under 12GB of VRAM! [Mistral NeMo notebook](https://colab.research.google.com/drive/17d3U-CAIwzmbDRqbZ9NnpHxCkmXB6LZ0?usp=sharing)
""")
- return
@app.cell
@@ -77,7 +75,6 @@ def _(mo):
mo.md("""
### Load the model
""")
- return
@app.cell(hide_code=True)
@@ -85,7 +82,6 @@ def _(mo):
mo.md("""
Start by choosing a couple of parameters:
""")
- return
@app.cell(hide_code=True)
@@ -111,11 +107,10 @@ def _(mo):
mo.md(r"""
We now add LoRA adapters so we only need to update 1 to 10% of all parameters!
""")
- return
@app.cell
-def _(FastLanguageModel, dtype, load_in_4bit, max_seq_length):
+def _(FastLanguageModel, dtype: None, load_in_4bit, max_seq_length):
model, tokenizer = FastLanguageModel.from_pretrained(
model_name="unsloth/Meta-Llama-3.1-8B",
max_seq_length=max_seq_length.value,
@@ -162,7 +157,6 @@ def _(mo):
For text completions like novel writing, try this [notebook](https://colab.research.google.com/drive/1ef-tab5bhkvWmBOObepl1WgJvfvSzn5Q?usp=sharing).
""")
- return
@app.cell
@@ -213,7 +207,6 @@ def _(mo):
### Train the model
Now let's use Huggingface TRL's `SFTTrainer`! More docs here: [TRL SFT docs](https://huggingface.co/docs/trl/sft_trainer). We do 60 steps to speed things up, but you can set `num_train_epochs=1` for a full run, and turn off `max_steps=None`. We also support TRL's `DPOTrainer`!
""")
- return
@app.cell(hide_code=True)
@@ -297,7 +290,6 @@ def _(max_memory, mo, start_gpu_memory, torch, trainer_stats):
print(
f"Peak reserved memory for training % of max memory = {lora_percentage} %."
)
- return
@app.cell(hide_code=True)
@@ -309,7 +301,6 @@ def _(mo):
**[NEW] Try 2x faster inference in a free Colab for Llama-3.1 8b Instruct [here](https://colab.research.google.com/drive/1T-YBVfnphoVc8E2E854qF3jdia2Ll2W2?usp=sharing)**
""")
- return
@app.cell
@@ -331,7 +322,14 @@ def _(mo):
@app.cell
-def _(FastLanguageModel, alpaca_prompt, inf_instr_inp, mo, model, tokenizer):
+def _(
+ FastLanguageModel,
+ alpaca_prompt: str,
+ inf_instr_inp,
+ mo,
+ model,
+ tokenizer,
+):
mo.stop(inf_instr_inp.value is None)
FastLanguageModel.for_inference(model) # Enable native 2x faster inference
@@ -348,7 +346,6 @@ def _(FastLanguageModel, alpaca_prompt, inf_instr_inp, mo, model, tokenizer):
outputs = model.generate(**_inputs, max_new_tokens=64, use_cache=True)
tokenizer.batch_decode(outputs)
- return
@app.cell(hide_code=True)
@@ -376,7 +373,6 @@ def _(mo):
<a href="https://ko-fi.com/unsloth"><img src="https://github.com/unslothai/unsloth/raw/main/images/Kofi button.png" width="145"></a></a> Support our work if you can! Thanks!
</div>
""")
- return
if __name__ == "__main__":
diff --git a/examples/ui/arrays_and_dicts.py b/examples/ui/arrays_and_dicts.py
index efd6f0a889..a69a419589 100644
--- a/examples/ui/arrays_and_dicts.py
+++ b/examples/ui/arrays_and_dicts.py
@@ -7,7 +7,7 @@
import marimo
-__generated_with = "0.19.7"
+__generated_with = "0.25.2"
app = marimo.App()
@@ -24,7 +24,6 @@ def _(mo):
mo.md("""
# Arrays and Dictionaries
""")
- return
@app.cell(hide_code=True)
@@ -37,7 +36,6 @@ def _(mo):
these functions are required when the set of elements to create is not
known until runtime.
""")
- return
@app.cell
@@ -49,7 +47,6 @@ def _(mo):
@app.cell
def _(create):
create.center()
- return
@app.cell
@@ -57,7 +54,6 @@ def _(mo):
mo.md("""
UI Elements ...
""")
- return
@app.cell
@@ -81,13 +77,11 @@ def _(mo):
mo.md("""
... and their values
""")
- return
@app.cell
def _(array, dictionary, mo):
mo.hstack([array.value, dictionary.value], justify="space-around")
- return
@app.cell(hide_code=True)
@@ -97,7 +91,6 @@ def _(mo):
The main reason to use `mo.ui.dictionary` is for reactive execution — when you interact with an element in a `mo.ui.dictionary`, all cells that reference the `mo.ui.dictionary` run automatically, just like all other ui elements. When you use a regular dictionary, you don't get this reactivity.
""")
- return
@app.cell(hide_code=True)
@@ -134,7 +127,7 @@ def _(create, mo):
@app.cell(hide_code=True)
-def _(mo, mo_d, py_d):
+def _(mo, mo_d, py_d: dict):
mo_d_ref = {k: mo_d[k].value for k in mo_d.value.keys()}
py_d_ref = {k: py_d[k].value for k in py_d.keys()}
mo.hstack(
@@ -144,7 +137,6 @@ def _(mo, mo_d, py_d):
],
justify="space-around",
)
- return
@app.cell(hide_code=True)
@@ -152,7 +144,6 @@ def _(mo):
mo.md(r"""
Notice that when you interact with the UI elements in the marimo dict, the reference of marimo dict updates automatically. However, when you interact with the elements in the python dict, you need to manually re-run the cell to see the updated values.
""")
- return
if __name__ == "__main__":
diff --git a/examples/ui/batch_and_form.py b/examples/ui/batch_and_form.py
index e4a8428125..da66b2e1ad 100644
--- a/examples/ui/batch_and_form.py
+++ b/examples/ui/batch_and_form.py
@@ -7,7 +7,7 @@
import marimo
-__generated_with = "0.19.7"
+__generated_with = "0.25.2"
app = marimo.App()
@@ -23,7 +23,6 @@ def _(mo):
mo.md("""
# Batch and Form
""")
- return
@app.cell
@@ -32,7 +31,6 @@ def _(mo):
Make custom UI elements using `batch()`, and turn any UI element
into a form with `form()`.
""")
- return
@app.cell
@@ -61,7 +59,7 @@ def _(mo, reset):
@app.cell
-def _(mo, reset, submitted_values, variables):
+def _(mo, reset, submitted_values: dict[str, set], variables):
if variables.value is not None:
submitted_values["x"].add(variables.value["x"])
submitted_values["y"].add(variables.value["y"])
@@ -80,7 +78,6 @@ def _(mo, reset, submitted_values, variables):
{mo.hstack([mo.tree(submitted_values), reset], align="center", gap=4)}
"""
).callout()
- return
@app.cell
diff --git a/examples/ui/data_editor.py b/examples/ui/data_editor.py
index 91cc3b6a3a..9ea90acf87 100644
--- a/examples/ui/data_editor.py
+++ b/examples/ui/data_editor.py
@@ -5,9 +5,10 @@
# "vega-datasets==0.9.0",
# ]
# ///
+
import marimo
-__generated_with = "0.19.7"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@@ -32,7 +33,7 @@ def _():
@app.cell
-def _(DATA_FILE, mo, os):
+def _(DATA_FILE: str, mo, os):
import polars as pl
if not os.path.exists(DATA_FILE):
@@ -50,15 +51,13 @@ def _(mo):
mo.md("""
The following cell writes the updated dataframe to disk when the submit button is clicked.
""")
- return
@app.cell
-def _(DATA_FILE, editor, mo):
+def _(DATA_FILE: str, editor, mo):
mo.stop(editor.value is None, mo.md("Submit your changes."))
editor.value.write_csv(DATA_FILE)
- return
if __name__ == "__main__":
diff --git a/examples/ui/image_comparison_demo.py b/examples/ui/image_comparison_demo.py
index 2b2a8178bd..1b8716ac4d 100644
--- a/examples/ui/image_comparison_demo.py
+++ b/examples/ui/image_comparison_demo.py
@@ -9,7 +9,7 @@
import marimo
-__generated_with = "0.19.7"
+__generated_with = "0.25.2"
app = marimo.App()
@@ -24,7 +24,6 @@ def _(mo):
The default orientation is horizontal, where you can slide left and right to compare images:
""")
- return
@app.cell
@@ -35,10 +34,9 @@ def _():
@app.cell
-def _(after_image_path, before_image_path, mo):
+def _(after_image_path: str, before_image_path: str, mo):
# Basic horizontal comparison with default settings
mo.image_compare(before_image=before_image_path, after_image=after_image_path)
- return
@app.cell(hide_code=True)
@@ -48,18 +46,16 @@ def _(mo):
You can set the initial position of the slider:
""")
- return
@app.cell
-def _(after_image_path, before_image_path, mo):
+def _(after_image_path: str, before_image_path: str, mo):
mo.image_compare(
before_image=before_image_path,
after_image=after_image_path,
direction="horizontal",
value=20, # Start at 25% position
)
- return
@app.cell(hide_code=True)
@@ -69,11 +65,10 @@ def _(mo):
You can also use a vertical comparison slider:
""")
- return
@app.cell
-def _(after_image_path, before_image_path, mo):
+def _(after_image_path: str, before_image_path: str, mo):
mo.image_compare(
before_image=before_image_path,
after_image=after_image_path,
@@ -81,7 +76,6 @@ def _(after_image_path, before_image_path, mo):
value=75, # Start at 75% position
height=400,
)
- return
@app.cell
diff --git a/examples/ui/layout.py b/examples/ui/layout.py
index 393d01ae4b..90201b16b8 100644
--- a/examples/ui/layout.py
+++ b/examples/ui/layout.py
@@ -7,7 +7,7 @@
import marimo
-__generated_with = "0.23.2"
+__generated_with = "0.25.2"
app = marimo.App()
@@ -16,7 +16,6 @@ def _(mo):
mo.md("""
# Stacks
""")
- return
@app.cell(hide_code=True)
@@ -24,7 +23,6 @@ def _(mo):
mo.md("""
Use `mo.hstack` and `mo.vstack` to layout outputs in rows and columns.
""")
- return
@app.cell
@@ -57,11 +55,10 @@ def _(mo):
mo.md("""
## Horizontal Stack: `hstack`
""")
- return
@app.cell
-def _(align, boxes, gap, justify, mo, wrap):
+def _(align, boxes: list, gap, justify, mo, wrap):
mo.hstack(
boxes,
align=align.value,
@@ -69,7 +66,6 @@ def _(align, boxes, gap, justify, mo, wrap):
gap=gap.value,
wrap=wrap.value,
)
- return
@app.cell
@@ -77,17 +73,15 @@ def _(mo):
mo.md("""
## Vertical Stack: `vstack`
""")
- return
@app.cell
-def _(align, boxes, gap, mo):
+def _(align, boxes: list, gap, mo):
mo.vstack(
boxes,
align=align.value,
gap=gap.value,
)
- return
@app.cell
diff --git a/examples/ui/table_advanced.py b/examples/ui/table_advanced.py
index 0d8e76f5dd..7d74006e32 100644
--- a/examples/ui/table_advanced.py
+++ b/examples/ui/table_advanced.py
@@ -7,7 +7,7 @@
import marimo
-__generated_with = "0.19.7"
+__generated_with = "0.25.2"
app = marimo.App()
@@ -26,7 +26,6 @@ def _(mo):
> “Sometimes I’ll start a sentence and I don’t even know where it’s going. I just hope I find it along the way.”
— Michael Scott
""")
- return
@app.cell(hide_code=True)
@@ -34,7 +33,6 @@ def _(mo):
mo.md("""
_Create rich tables with selectable rows using_ `mo.ui.table`.
""")
- return
@app.cell(hide_code=True)
@@ -42,11 +40,10 @@ def _(mo):
mo.md("""
**Single selection.**
""")
- return
@app.cell
-def _(mo, office_characters):
+def _(mo, office_characters: list):
single_select_table = mo.ui.table(
office_characters,
selection="single",
@@ -58,7 +55,6 @@ def _(mo, office_characters):
@app.cell
def _(mo, single_select_table):
mo.ui.tabs({"table": single_select_table, "selection": single_select_table.value})
- return
@app.cell(hide_code=True)
@@ -66,11 +62,10 @@ def _(mo):
mo.md("""
**Multi-selection.**
""")
- return
@app.cell
-def _(mo, office_characters):
+def _(mo, office_characters: list):
multi_select_table = mo.ui.table(
office_characters,
selection="multi",
@@ -82,7 +77,6 @@ def _(mo, office_characters):
@app.cell
def _(mo, multi_select_table):
mo.ui.tabs({"table": multi_select_table, "selection": multi_select_table.value})
- return
@app.cell(hide_code=True)
@@ -90,11 +84,10 @@ def _(mo):
mo.md("""
**No selection.**
""")
- return
@app.cell
-def _(mo, office_characters):
+def _(mo, office_characters: list):
table = mo.ui.table(
office_characters,
label="Employees",
@@ -102,7 +95,6 @@ def _(mo, office_characters):
)
table
- return
@app.cell(hide_code=True)
@@ -110,14 +102,12 @@ def _(mo):
mo.md("""
**Select individual cells**
""")
- return
@app.cell
def _(mo):
data = {str(col): [col * 10 + row for row in range(10)] for col in range(10)}
mo.ui.table(data, selection="multi-cell", initial_selection=[("3", "5"),("9","8")])
- return
@app.cell
@@ -125,7 +115,6 @@ def _(mo):
mo.md("""
**Style individual cells**
""")
- return
@app.cell
@@ -151,7 +140,6 @@ def _(mo):
data=colors, pagination=True, page_size=16, style_cell=apply_styling
)
color_table
- return
@app.cell
diff --git a/marimo/_smoke_tests/2d-cells.py b/marimo/_smoke_tests/2d-cells.py
index 2e40e9ef12..12af6dd501 100644
--- a/marimo/_smoke_tests/2d-cells.py
+++ b/marimo/_smoke_tests/2d-cells.py
@@ -1,6 +1,6 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="columns")
@@ -9,13 +9,13 @@ def _():
import marimo as mo
import altair as alt
from vega_datasets import data
+
return alt, data, mo
@app.cell
def _(dataset, mo, plot, x, y):
mo.vstack([dataset, x, y, plot])
- return
@app.cell
@@ -31,7 +31,6 @@ def _(plot_type, x, y):
x=x.value,
y=y.value,
).interactive().properties(width="container")
- return
@app.cell
diff --git a/marimo/_smoke_tests/_requests.py b/marimo/_smoke_tests/_requests.py
index 56174c8802..e715373ec6 100644
--- a/marimo/_smoke_tests/_requests.py
+++ b/marimo/_smoke_tests/_requests.py
@@ -1,12 +1,13 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@app.cell
def _():
import marimo as mo
+
return (mo,)
@@ -22,21 +23,18 @@ def _(mo, refresh):
refresh
user = mo.app_meta().request.user
[user]
- return
@app.cell
def _(mo, refresh):
refresh
list(mo.app_meta().request.keys())
- return
@app.cell
def _(mo, refresh):
refresh
mo.app_meta().request
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/admonitions.py b/marimo/_smoke_tests/admonitions.py
index d98f2fa400..07ff830965 100644
--- a/marimo/_smoke_tests/admonitions.py
+++ b/marimo/_smoke_tests/admonitions.py
@@ -8,13 +8,14 @@
import marimo
-__generated_with = "0.19.6"
+__generated_with = "0.25.2"
app = marimo.App()
@app.cell
def _():
import marimo as mo
+
return (mo,)
@@ -50,7 +51,6 @@ def _(mo):
mo.vstack([create(kind) for kind in kinds])
- return
@app.cell
@@ -58,7 +58,6 @@ def _(mo):
mo.md("""
# Misc
""")
- return
@app.cell
@@ -68,7 +67,6 @@ def _(mo):
This is an admonition box without a title.
///
""")
- return
@app.cell
@@ -86,7 +84,6 @@ def _(mo):
em que $A$ é uma matriz simétrica. No nosso caso, $A=X'X$ e $v=\hat{\boldsymbol{\beta}}$.
///
""")
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/ai/chat-variations.py b/marimo/_smoke_tests/ai/chat-variations.py
index 6de360a3aa..202ba3e495 100644
--- a/marimo/_smoke_tests/ai/chat-variations.py
+++ b/marimo/_smoke_tests/ai/chat-variations.py
@@ -1,6 +1,6 @@
import marimo
-__generated_with = "0.19.2"
+__generated_with = "0.25.2"
app = marimo.App(width="medium", auto_download=["html"])
@@ -10,6 +10,7 @@ def _():
import time
import asyncio
import pydantic_ai.ui.vercel_ai.response_types as vercel
+
return asyncio, time, uuid, vercel
@@ -49,13 +50,11 @@ def _(mo, model):
@app.cell
def _(chat):
chat.value
- return
@app.cell
def _(chat):
chat.value[1].content if len(chat.value) else None
- return
@app.cell
@@ -118,12 +117,14 @@ def _(uuid, vercel):
yield vercel.TextEndChunk(id=text_id)
yield vercel.FinishStepChunk()
yield vercel.FinishChunk()
+
return (async_streaming_chunks,)
@app.cell
def _():
import marimo as mo
+
return (mo,)
@@ -136,6 +137,7 @@ def _(asyncio):
yield " It does not include reasoning or tool calls."
await asyncio.sleep(1)
yield " Have a nice day!"
+
return (async_streaming_text,)
@@ -148,6 +150,7 @@ def _(time):
yield " is simple "
time.sleep(1)
yield " streaming."
+
return (sync_streaming_text,)
@@ -156,6 +159,7 @@ def _(asyncio):
async def async_no_streaming_text(messages, config):
await asyncio.sleep(1)
return f"**echo**: _{messages[-1].content}_"
+
return (async_no_streaming_text,)
@@ -164,6 +168,7 @@ def _(time):
def sync_no_streaming_text(messages, config):
time.sleep(1)
return f"**echo**: _{messages[-1].content}_"
+
return (sync_no_streaming_text,)
@@ -172,6 +177,7 @@ def _(mo, time):
def sync_no_streaming_object(messages, config):
time.sleep(1)
return mo.ui.table([1, 2, 3, messages[-1].content])
+
return (sync_no_streaming_object,)
diff --git a/marimo/_smoke_tests/ai/gemini_responses.py b/marimo/_smoke_tests/ai/gemini_responses.py
index 022dd61d20..16469f1ca8 100644
--- a/marimo/_smoke_tests/ai/gemini_responses.py
+++ b/marimo/_smoke_tests/ai/gemini_responses.py
@@ -1,6 +1,6 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@@ -8,13 +8,15 @@ app = marimo.App(width="medium")
def _():
import marimo as mo
import os
+
return mo, os
@app.cell(hide_code=True)
def _(mo):
- mo.md(r"""## Setup""")
- return
+ mo.md(r"""
+ ## Setup
+ """)
@app.cell(hide_code=True)
@@ -29,7 +31,6 @@ def _(mo, os):
@app.cell(hide_code=True)
def _(api_token, mo):
mo.callout("Missing API Key", kind="danger") if not api_token.value else None
- return
@app.cell(hide_code=True)
@@ -41,14 +42,16 @@ def _(mo):
@app.cell(hide_code=True)
def _(mo):
- mo.md("""## Run some queries""")
- return
+ mo.md("""
+ ## Run some queries
+ """)
@app.cell(hide_code=True)
def _(mo):
- mo.md("""### Streaming""")
- return
+ mo.md("""
+ ### Streaming
+ """)
@app.cell
@@ -61,8 +64,9 @@ def _(api_token):
@app.cell(hide_code=True)
def _(mo):
- mo.md(r"""### Non-streaming""")
- return
+ mo.md(r"""
+ ### Non-streaming
+ """)
@app.cell
@@ -74,7 +78,6 @@ def _(client, tools):
"tools": tools.value,
}
)
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/ai/model_check.py b/marimo/_smoke_tests/ai/model_check.py
index eef8aae447..f4c46bbafa 100644
--- a/marimo/_smoke_tests/ai/model_check.py
+++ b/marimo/_smoke_tests/ai/model_check.py
@@ -12,7 +12,7 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@@ -79,7 +79,7 @@ def _():
@app.cell
-def _(models_csv):
+def _(models_csv: str):
import polars as pl
import io
@@ -93,6 +93,7 @@ def _():
import any_llm
import marimo as mo
import anthropic
+
return any_llm, mo
@@ -118,6 +119,7 @@ def _(any_llm, mo):
messages=[{"role": "user", "content": "hi"}],
api_key=key,
)
+
return (query,)
@@ -137,7 +139,6 @@ def _(df, query):
print(res.choices[0].message.content)
except Exception as e:
print(f"❌ {e}")
- return
@app.cell
@@ -156,7 +157,6 @@ def _(query):
print(res.choices[0].message.content)
except Exception as e:
print(f"❌ {e}")
- return
@app.cell
@@ -172,7 +172,6 @@ def _():
print(f"Display name: {m.display_name}")
print(f"Description: {m.description}")
print("-" * 80)
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/ai/openai_responses.py b/marimo/_smoke_tests/ai/openai_responses.py
index 86e3e63c59..5f96013b46 100644
--- a/marimo/_smoke_tests/ai/openai_responses.py
+++ b/marimo/_smoke_tests/ai/openai_responses.py
@@ -1,6 +1,6 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@@ -8,13 +8,15 @@ app = marimo.App(width="medium")
def _():
import marimo as mo
import os
+
return mo, os
@app.cell(hide_code=True)
def _(mo):
- mo.md(r"""## Setup""")
- return
+ mo.md(r"""
+ ## Setup
+ """)
@app.cell(hide_code=True)
@@ -29,19 +31,20 @@ def _(mo, os):
@app.cell(hide_code=True)
def _(api_token, mo):
(mo.callout("Missing API Key", kind="danger") if not api_token.value else None)
- return
@app.cell(hide_code=True)
def _(mo):
- mo.md("""## Run some queries""")
- return
+ mo.md("""
+ ## Run some queries
+ """)
@app.cell(hide_code=True)
def _(mo):
- mo.md("""### Streaming""")
- return
+ mo.md("""
+ ### Streaming
+ """)
@app.cell
@@ -65,8 +68,9 @@ def _(api_token):
@app.cell(hide_code=True)
def _(mo):
- mo.md(r"""### Non-streaming""")
- return
+ mo.md(r"""
+ ### Non-streaming
+ """)
@app.cell
@@ -80,7 +84,6 @@ def _(client):
}
],
)
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/altair_examples/altair_brush.py b/marimo/_smoke_tests/altair_examples/altair_brush.py
index 99cd6eb27a..214a284c45 100644
--- a/marimo/_smoke_tests/altair_examples/altair_brush.py
+++ b/marimo/_smoke_tests/altair_examples/altair_brush.py
@@ -11,14 +11,15 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@app.cell
def _(mo):
- mo.md(r"""## Data""")
- return
+ mo.md(r"""
+ ## Data
+ """)
@app.cell
@@ -43,8 +44,9 @@ def _():
@app.cell
def _(mo):
- mo.md(r"""## Plain Altair""")
- return
+ mo.md(r"""
+ ## Plain Altair
+ """)
@app.cell
@@ -66,13 +68,13 @@ def _(alt, traces):
)
_chart_overview | _chart_detail
- return
@app.cell
def _(mo):
- mo.md(r"""## Example of the Or ( | ) operator""")
- return
+ mo.md(r"""
+ ## Example of the Or ( | ) operator
+ """)
@app.cell
@@ -101,8 +103,9 @@ def _(alt, mo, traces):
@app.cell
def _(mo):
- mo.md(r"""## Example of the Or ( | ) operator with selection""")
- return
+ mo.md(r"""
+ ## Example of the Or ( | ) operator with selection
+ """)
@app.cell
@@ -115,7 +118,6 @@ def _(chart_detail, chart_overview):
@app.cell
def _(combined):
combined.value
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/altair_examples/altair_charts.py b/marimo/_smoke_tests/altair_examples/altair_charts.py
index 2fb05316f8..bdf385bcb5 100644
--- a/marimo/_smoke_tests/altair_examples/altair_charts.py
+++ b/marimo/_smoke_tests/altair_examples/altair_charts.py
@@ -11,7 +11,7 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="full")
@@ -24,6 +24,7 @@ def _():
from vega_datasets import data
import marimo as mo
+
return data, mo, np, pd
@@ -70,7 +71,13 @@ def _(chart_selection_type, legend_selection_type, theme):
@app.cell
-def _(alt, cars, chart_selection_value, legend_selection_value, mo):
+def _(
+ alt,
+ cars,
+ chart_selection_value: None | bool | str,
+ legend_selection_value: bool,
+ mo,
+):
_chart = (
alt.Chart(cars)
.mark_point()
@@ -91,12 +98,19 @@ def _(alt, cars, chart_selection_value, legend_selection_value, mo):
@app.cell
def _(mo):
- mo.md("""# Basic Chart""")
- return
+ mo.md("""
+ # Basic Chart
+ """)
@app.cell
-def _(alt, chart1, chart_selection_value, legend_selection_value, mo):
+def _(
+ alt,
+ chart1,
+ chart_selection_value: None | bool | str,
+ legend_selection_value: bool,
+ mo,
+):
mo.vstack(
[
chart1,
@@ -118,11 +132,16 @@ def _(alt, chart1, chart_selection_value, legend_selection_value, mo):
chart1.value.head(),
]
)
- return
@app.cell
-def _(alt, chart_selection_value, employment, legend_selection_value, mo):
+def _(
+ alt,
+ chart_selection_value: None | bool | str,
+ employment: str,
+ legend_selection_value: bool,
+ mo,
+):
# _selection = alt.selection_point(fields=["series"], bind="legend")
_chart = (
@@ -148,20 +167,21 @@ def _(alt, chart_selection_value, employment, legend_selection_value, mo):
@app.cell
def _(mo):
- mo.md("""# Another Chart""")
- return
+ mo.md("""
+ # Another Chart
+ """)
@app.cell
def _(chart2, mo):
mo.vstack([chart2, chart2.value.head(10)])
- return
@app.cell
def _(mo):
- mo.md("""# Defined Width + Height""")
- return
+ mo.md("""
+ # Defined Width + Height
+ """)
@app.cell
@@ -183,11 +203,16 @@ def _(alt, iris, mo):
chart_selection=None,
legend_selection=None,
)
- return
@app.cell
-def _(alt, chart_selection_value, iris, legend_selection_value, mo):
+def _(
+ alt,
+ chart_selection_value: None | bool | str,
+ iris,
+ legend_selection_value: bool,
+ mo,
+):
# _color_sel = alt.selection_point(fields=["species"], bind="legend")
# _size_sel = alt.selection_point(fields=["petalWidth"], bind="legend")
@@ -216,42 +241,48 @@ def _(alt, chart_selection_value, iris, legend_selection_value, mo):
@app.cell
def _(mo):
- mo.md("""# Chart + Chart""")
- return
+ mo.md("""
+ # Chart + Chart
+ """)
@app.cell
def _(chart3, mo):
mo.hstack([chart3, chart3])
- return
@app.cell
def _(mo):
- mo.md("""# Chart + Table""")
- return
+ mo.md("""
+ # Chart + Table
+ """)
@app.cell
def _(chart3, mo):
mo.hstack([chart3, chart3.value.head(10)], widths="equal")
- return
@app.cell
def _(mo):
- mo.md("""# Chart + Table returned as an array""")
- return
+ mo.md("""
+ # Chart + Table returned as an array
+ """)
@app.cell
def _(chart3):
[chart3, chart3.value.head(10)]
- return
@app.cell
-def _(alt, cars, chart_selection_value, legend_selection_value, mo):
+def _(
+ alt,
+ cars,
+ chart_selection_value: None | bool | str,
+ legend_selection_value: bool,
+ mo,
+):
brush = alt.selection_interval()
points = (
alt.Chart(cars)
@@ -280,20 +311,21 @@ def _(alt, cars, chart_selection_value, legend_selection_value, mo):
@app.cell
def _(mo):
- mo.md("""# Chart with transform""")
- return
+ mo.md("""
+ # Chart with transform
+ """)
@app.cell
def _(chart4, mo):
mo.vstack([chart4, chart4.value.head(10)])
- return
@app.cell
def _(mo):
- mo.md("""# Bar chart""")
- return
+ mo.md("""
+ # Bar chart
+ """)
@app.cell
@@ -303,7 +335,6 @@ def _(alt, data, mo):
.mark_bar()
.encode(x=alt.X("Miles_per_Gallon:Q", bin=True), y="count()")
)
- return
@app.cell
@@ -322,7 +353,6 @@ def _(alt, cars, mo):
@app.cell
def _(mean, mo):
mo.vstack([mean, mean.value])
- return
@app.cell
@@ -339,13 +369,13 @@ def _(alt, data, mo):
@app.cell
def _(hist, mo):
mo.vstack([hist, hist.value])
- return
@app.cell
def _(mo):
- mo.md("""# Pivot and horizontal bar chart""")
- return
+ mo.md("""
+ # Pivot and horizontal bar chart
+ """)
@app.cell
@@ -379,7 +409,6 @@ def _(alt, mo, pd):
@app.cell
def _(mo, pivot):
mo.vstack([pivot, pivot.value.head()])
- return
@app.cell
@@ -402,7 +431,6 @@ def _(alt, data, mo):
@app.cell
def _(horizontal_bar, mo):
mo.vstack([horizontal_bar, horizontal_bar.value.head()])
- return
@app.cell
@@ -425,13 +453,13 @@ def _(alt, mo, pd):
@app.cell
def _(mo, pie):
mo.vstack([pie, pie.value])
- return
@app.cell
def _(mo):
- mo.md("""# Line Chart""")
- return
+ mo.md("""
+ # Line Chart
+ """)
@app.cell
@@ -450,13 +478,13 @@ def _(alt, mo, np, pd):
@app.cell
def _(line_chart, mo):
mo.hstack([line_chart.value, line_chart.selections])
- return
@app.cell
def _(mo):
- mo.md("""# Multi-Line Chart""")
- return
+ mo.md("""
+ # Multi-Line Chart
+ """)
@app.cell
@@ -485,7 +513,6 @@ def _(alt, data, mo):
@app.cell
def _(mo, multiline_chart):
mo.hstack([multiline_chart.value, multiline_chart.selections])
- return
@app.cell
@@ -521,18 +548,14 @@ def _(alt, mo, np, pd):
@app.cell
def _(facet_chart, mo):
mo.hstack([facet_chart.value, facet_chart.selections])
- return
@app.cell
def _(mo):
- mo.md(
- """
- # With `transform_filter`
- > Bug https://github.com/marimo-team/marimo/issues/727
- """
- )
- return
+ mo.md("""
+ # With `transform_filter`
+ > Bug https://github.com/marimo-team/marimo/issues/727
+ """)
@app.cell
@@ -556,13 +579,13 @@ def _(alt, data, mo):
@app.cell
def _(mo, with_transform):
mo.vstack([with_transform, with_transform.value])
- return
@app.cell
def _(mo):
- mo.md("""# Layers""")
- return
+ mo.md("""
+ # Layers
+ """)
@app.cell
@@ -609,13 +632,13 @@ def _(layered_chart, mo):
mo.hstack([layered_chart.value, layered_chart.selections]),
]
)
- return
@app.cell
def _(mo):
- mo.md(r"""# layered""")
- return
+ mo.md(r"""
+ # layered
+ """)
@app.cell
@@ -635,26 +658,26 @@ def _(alt, data, datum, mo):
@app.cell
def _(mo):
- mo.md(r"""# hconcat""")
- return
+ mo.md(r"""
+ # hconcat
+ """)
@app.cell
def _(base, mo):
mo.ui.altair_chart(base.mark_line() | base.mark_point())
- return
@app.cell
def _(mo):
- mo.md("""# vconcat""")
- return
+ mo.md("""
+ # vconcat
+ """)
@app.cell
def _(base, mo):
mo.ui.altair_chart(base.mark_line() & base.mark_point())
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/altair_examples/altair_geoshape.py b/marimo/_smoke_tests/altair_examples/altair_geoshape.py
index d71d77c9bb..7a79fef3d3 100644
--- a/marimo/_smoke_tests/altair_examples/altair_geoshape.py
+++ b/marimo/_smoke_tests/altair_examples/altair_geoshape.py
@@ -10,13 +10,14 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@app.cell
def _():
import marimo as mo
+
return (mo,)
@@ -51,13 +52,11 @@ def _(alt, gdf_sel):
@app.cell
def _(chart):
chart
- return
@app.cell
def _(chart):
chart.mark.type
- return
@app.cell
@@ -70,13 +69,11 @@ def _(chart, mo):
@app.cell
def _(mo, mo_chart):
mo.ui.table(mo_chart.value)
- return
@app.cell
def _(chart, mo):
mo.ui.altair_chart(chart, chart_selection=None)
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/altair_examples/altair_polars.py b/marimo/_smoke_tests/altair_examples/altair_polars.py
index d0e23332cd..4eb44b2f08 100644
--- a/marimo/_smoke_tests/altair_examples/altair_polars.py
+++ b/marimo/_smoke_tests/altair_examples/altair_polars.py
@@ -9,7 +9,7 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@@ -18,6 +18,7 @@ def _():
import altair as alt
import marimo as mo
+
return alt, mo
@@ -49,7 +50,6 @@ def _(alt, df, mo):
@app.cell
def _(chart):
chart.value
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/altair_examples/altair_svg_rendering.py b/marimo/_smoke_tests/altair_examples/altair_svg_rendering.py
index cc2e166a6d..957332e349 100644
--- a/marimo/_smoke_tests/altair_examples/altair_svg_rendering.py
+++ b/marimo/_smoke_tests/altair_examples/altair_svg_rendering.py
@@ -12,7 +12,7 @@
import marimo
-__generated_with = "0.23.1"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
with app.setup:
@@ -31,7 +31,7 @@ def _():
@app.cell
-def _(data):
+def _(data: pd.DataFrame):
alt.renderers.enable("svg")
chart = alt.Chart(data).mark_point().encode(x="x", y="y")
@@ -42,7 +42,6 @@ def _(data):
def _(chart):
# This works
chart
- return
@app.cell
@@ -51,11 +50,10 @@ def _(chart):
# (reported in Issue #9015 and fixed in PR #9043).
# For vstack, align="start" is needed to preserve the image size
mo.vstack([chart], align="start")
- return
@app.cell
-def _(data):
+def _(data: pd.DataFrame):
# Issue #9013: SVG rendering breaks image marks
chart_with_images = (
alt.Chart(data)
@@ -77,7 +75,6 @@ def _(chart_with_images):
# This works
alt.renderers.enable("default")
chart_with_images
- return
@app.cell
@@ -88,7 +85,6 @@ def _(chart_with_images):
# it warns the user to enable 'raw_svg=True' for correct rendering.
alt.renderers.enable("svg")
chart_with_images
- return
@app.cell
@@ -96,7 +92,6 @@ def _(chart_with_images):
# Image marks are correctly rendered when 'raw_svg=True' is enabled.
alt.renderers.enable("svg", raw_svg=True)
chart_with_images
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/altair_examples/binning.py b/marimo/_smoke_tests/altair_examples/binning.py
index 08a35ab90d..a00ee28b72 100644
--- a/marimo/_smoke_tests/altair_examples/binning.py
+++ b/marimo/_smoke_tests/altair_examples/binning.py
@@ -13,20 +13,22 @@
import marimo
-__generated_with = "0.17.2"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@app.cell(hide_code=True)
def _():
import marimo as mo
+
return (mo,)
@app.cell(hide_code=True)
def _(mo):
- mo.md(r"""# Binning Examples""")
- return
+ mo.md(r"""
+ # Binning Examples
+ """)
@app.cell
@@ -37,6 +39,7 @@ def _():
import polars as pl
import pyarrow
from vega_datasets import data
+
return alt, data, pl
@@ -50,8 +53,9 @@ def _(data, pl):
@app.cell(hide_code=True)
def _(mo):
- mo.md(r"""## Basic Histogram with Auto-binning""")
- return
+ mo.md(r"""
+ ## Basic Histogram with Auto-binning
+ """)
@app.cell
@@ -75,7 +79,6 @@ def _(alt, mo, movies):
@app.cell
def _(basic_histogram, mo):
mo.vstack([basic_histogram.value])
- return
@app.cell
@@ -86,8 +89,9 @@ def _():
@app.cell(hide_code=True)
def _(mo):
- mo.md(r"""## Histogram with Custom Bin Parameters""")
- return
+ mo.md(r"""
+ ## Histogram with Custom Bin Parameters
+ """)
@app.cell
@@ -115,13 +119,13 @@ def _(alt, cars, mo):
@app.cell
def _(custom_bins, mo):
mo.vstack([custom_bins.value])
- return
@app.cell(hide_code=True)
def _(mo):
- mo.md(r"""## Histogram with Fixed Bin Step""")
- return
+ mo.md(r"""
+ ## Histogram with Fixed Bin Step
+ """)
@app.cell
@@ -147,13 +151,13 @@ def _(alt, cars, mo):
@app.cell
def _(mo, step_bins):
mo.vstack([step_bins.value])
- return
@app.cell(hide_code=True)
def _(mo):
- mo.md(r"""## 2D Binning (Heatmap)""")
- return
+ mo.md(r"""
+ ## 2D Binning (Heatmap)
+ """)
@app.cell
@@ -184,13 +188,13 @@ def _(alt, mo, movies):
@app.cell
def _(heatmap, mo):
mo.vstack([heatmap.value])
- return
@app.cell(hide_code=True)
def _(mo):
- mo.md(r"""## Binned Color Encoding""")
- return
+ mo.md(r"""
+ ## Binned Color Encoding
+ """)
@app.cell
@@ -221,13 +225,13 @@ def _(alt, cars, mo):
@app.cell
def _(binned_color, mo):
mo.vstack([binned_color.value])
- return
@app.cell(hide_code=True)
def _(mo):
- mo.md(r"""## Binned Size Encoding""")
- return
+ mo.md(r"""
+ ## Binned Size Encoding
+ """)
@app.cell
@@ -259,13 +263,13 @@ def _(alt, cars, mo):
@app.cell
def _(binned_size, mo):
mo.vstack([binned_size.value])
- return
@app.cell(hide_code=True)
def _(mo):
- mo.md(r"""## Stacked Histogram with Binning""")
- return
+ mo.md(r"""
+ ## Stacked Histogram with Binning
+ """)
@app.cell
@@ -292,13 +296,13 @@ def _(alt, cars, mo):
@app.cell
def _(mo, stacked_histogram):
mo.vstack([stacked_histogram.value])
- return
@app.cell(hide_code=True)
def _(mo):
- mo.md(r"""## Binning with Selection""")
- return
+ mo.md(r"""
+ ## Binning with Selection
+ """)
@app.cell
@@ -325,13 +329,13 @@ def _(alt, mo, movies):
@app.cell
def _(binned_selection, mo):
mo.vstack([binned_selection.value, binned_selection.selections])
- return
@app.cell(hide_code=True)
def _(mo):
- mo.md(r"""## Custom Bin Extent""")
- return
+ mo.md(r"""
+ ## Custom Bin Extent
+ """)
@app.cell
@@ -361,7 +365,6 @@ def _(alt, cars, mo):
@app.cell
def _(extent_bins, mo):
mo.vstack([extent_bins.value])
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/altair_examples/boxplot.py b/marimo/_smoke_tests/altair_examples/boxplot.py
index ed8a8c0523..fc86b59e97 100644
--- a/marimo/_smoke_tests/altair_examples/boxplot.py
+++ b/marimo/_smoke_tests/altair_examples/boxplot.py
@@ -1,19 +1,21 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@app.cell(hide_code=True)
def _(mo):
- mo.md(r"""# Box plots""")
- return
+ mo.md(r"""
+ # Box plots
+ """)
@app.cell(hide_code=True)
def _(mo):
- mo.md(r"""## Example 1""")
- return
+ mo.md(r"""
+ ## Example 1
+ """)
@app.cell
@@ -44,13 +46,13 @@ def _():
@app.cell
def _(boxplot, mo):
mo.ui.altair_chart(boxplot)
- return
@app.cell(hide_code=True)
def _(mo):
- mo.md(r"""## Example 2""")
- return
+ mo.md(r"""
+ ## Example 2
+ """)
@app.cell
@@ -72,12 +74,12 @@ def _(pl):
@app.cell
def _(boxplot2, mo):
mo.ui.altair_chart(boxplot2)
- return
@app.cell
def _():
import marimo as mo
+
return (mo,)
diff --git a/marimo/_smoke_tests/altair_examples/chart_dates.py b/marimo/_smoke_tests/altair_examples/chart_dates.py
index 2733d167fb..f7a66271ed 100644
--- a/marimo/_smoke_tests/altair_examples/chart_dates.py
+++ b/marimo/_smoke_tests/altair_examples/chart_dates.py
@@ -1,12 +1,13 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@app.cell
def _():
import marimo as mo
+
return (mo,)
@@ -16,6 +17,7 @@ def _():
import altair as alt
import polars as pl
+
return alt, date, pl
@@ -35,21 +37,18 @@ def _(alt, df):
@app.cell
def _(chart, mo):
mo.ui.altair_chart(chart)
- return
@app.cell
def _(alt, chart, mo):
with alt.data_transformers.enable("marimo_csv"):
mo.output.append(chart)
- return
@app.cell
def _(alt, chart, mo):
with alt.data_transformers.enable("marimo_json"):
mo.output.append(chart)
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/altair_examples/column_facet.py b/marimo/_smoke_tests/altair_examples/column_facet.py
index cdc8f5f64d..b84891a373 100644
--- a/marimo/_smoke_tests/altair_examples/column_facet.py
+++ b/marimo/_smoke_tests/altair_examples/column_facet.py
@@ -1,12 +1,13 @@
import marimo
-__generated_with = "0.17.0"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@app.cell
def _():
import marimo as mo
+
return (mo,)
@@ -33,19 +34,16 @@ def _():
@app.cell
def _(chart, mo):
mo.ui.altair_chart(chart)
- return
@app.cell
def _(chart):
chart.encoding.column
- return
@app.cell
def _(chart):
type(chart).mro()
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/altair_examples/composite_legend_selection.py b/marimo/_smoke_tests/altair_examples/composite_legend_selection.py
index c2fb9870f5..8e328ab6be 100644
--- a/marimo/_smoke_tests/altair_examples/composite_legend_selection.py
+++ b/marimo/_smoke_tests/altair_examples/composite_legend_selection.py
@@ -1,6 +1,6 @@
import marimo
-__generated_with = "0.17.2"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@@ -9,22 +9,20 @@ def _():
import altair as alt
import pandas as pd
import marimo as mo
+
return alt, mo, pd
@app.cell(hide_code=True)
def _(mo):
- mo.md(
- r"""
+ mo.md(r"""
## Composite Chart Legend Selection Bug
Test case for https://github.com/marimo-team/marimo/issues/6676
Legend selection should work on composite charts created with the `+` operator.
Clicking legend items should filter the chart.
- """
- )
- return
+ """)
@app.cell
@@ -43,8 +41,9 @@ def _(pd):
@app.cell(hide_code=True)
def _(mo):
- mo.md(r"""### Composite chart with error bars and points""")
- return
+ mo.md(r"""
+ ### Composite chart with error bars and points
+ """)
@app.cell
@@ -96,13 +95,13 @@ def _(alt, mo, sample_df):
@app.cell
def _(sample_mo_chart):
sample_mo_chart.value
- return
@app.cell(hide_code=True)
def _(mo):
- mo.md(r"""### Simple layered chart (for comparison)""")
- return
+ mo.md(r"""
+ ### Simple layered chart (for comparison)
+ """)
@app.cell
@@ -130,13 +129,13 @@ def _(alt, mo, pd):
@app.cell
def _(simple_mo_chart):
simple_mo_chart.value
- return
@app.cell(hide_code=True)
def _(mo):
- mo.md(r"""### Workaround with explicit legend selection""")
- return
+ mo.md(r"""
+ ### Workaround with explicit legend selection
+ """)
@app.cell
@@ -193,13 +192,13 @@ def _(alt, mo, sample_df):
@app.cell
def _(workaround_mo_chart):
workaround_mo_chart.value
- return
@app.cell(hide_code=True)
def _(mo):
- mo.md(r"""### vconcat with legend selection""")
- return
+ mo.md(r"""
+ ### vconcat with legend selection
+ """)
@app.cell
@@ -232,13 +231,13 @@ def _(alt, mo, pd):
@app.cell
def _(vconcat_mo_chart):
vconcat_mo_chart.value
- return
@app.cell(hide_code=True)
def _(mo):
- mo.md(r"""### hconcat with legend selection""")
- return
+ mo.md(r"""
+ ### hconcat with legend selection
+ """)
@app.cell
@@ -271,7 +270,6 @@ def _(alt, mo, pd):
@app.cell
def _(hconcat_mo_chart):
hconcat_mo_chart.value
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/altair_examples/hconcat_vconcat.py b/marimo/_smoke_tests/altair_examples/hconcat_vconcat.py
index a62fc51bdf..2e65d33658 100644
--- a/marimo/_smoke_tests/altair_examples/hconcat_vconcat.py
+++ b/marimo/_smoke_tests/altair_examples/hconcat_vconcat.py
@@ -1,6 +1,6 @@
import marimo
-__generated_with = "0.16.2"
+__generated_with = "0.25.2"
app = marimo.App(width="full")
@@ -27,8 +27,9 @@ def _():
@app.cell(hide_code=True)
def _(mo):
- mo.md(r"""## vconcat with hconcat inside""")
- return
+ mo.md(r"""
+ ## vconcat with hconcat inside
+ """)
@app.cell
@@ -57,19 +58,18 @@ def _(alt, cars):
@app.cell
def _(stacked_chart):
stacked_chart
- return
@app.cell
def _(mo, stacked_chart):
mo.ui.altair_chart(stacked_chart.copy())
- return
@app.cell(hide_code=True)
def _(mo):
- mo.md(r"""## Nested vconcat""")
- return
+ mo.md(r"""
+ ## Nested vconcat
+ """)
@app.cell
@@ -100,13 +100,13 @@ def _(alt, cars):
@app.cell
def _(mo, stacked_chart1):
mo.ui.altair_chart(stacked_chart1.copy())
- return
@app.cell(hide_code=True)
def _(mo):
- mo.md(r"""## hconcat with vconcat inside""")
- return
+ mo.md(r"""
+ ## hconcat with vconcat inside
+ """)
@app.cell
@@ -137,13 +137,13 @@ def _(alt, cars):
@app.cell
def _(h_v_chart, mo):
mo.ui.altair_chart(h_v_chart.copy())
- return
@app.cell(hide_code=True)
def _(mo):
- mo.md(r"""## Nested hconcat""")
- return
+ mo.md(r"""
+ ## Nested hconcat
+ """)
@app.cell
@@ -174,13 +174,13 @@ def _(alt, cars):
@app.cell
def _(mo, nested_h_chart):
mo.ui.altair_chart(nested_h_chart.copy())
- return
@app.cell(hide_code=True)
def _(mo):
- mo.md(r"""## Complex nested combination""")
- return
+ mo.md(r"""
+ ## Complex nested combination
+ """)
@app.cell
@@ -218,7 +218,6 @@ def _(alt, cars):
@app.cell
def _(complex_chart, mo):
mo.ui.altair_chart(complex_chart.copy())
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/altair_examples/layered_charts.py b/marimo/_smoke_tests/altair_examples/layered_charts.py
index bdaf1c5b3a..2e49577a62 100644
--- a/marimo/_smoke_tests/altair_examples/layered_charts.py
+++ b/marimo/_smoke_tests/altair_examples/layered_charts.py
@@ -1,6 +1,6 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@@ -24,8 +24,9 @@ def _():
@app.cell
def _(mo):
- mo.md(r"""## Layered""")
- return
+ mo.md(r"""
+ ## Layered
+ """)
@app.cell
@@ -62,20 +63,19 @@ def _(alt, mo, test_counts):
@app.cell
def _(layered_chart):
layered_chart.value
- return
@app.cell
def _(mo):
- mo.md(r"""## Warnings""")
- return
+ mo.md(r"""
+ ## Warnings
+ """)
@app.cell
def _(alt, chart, mo, rule):
mo.ui.altair_chart(alt.layer(chart, rule), chart_selection="point")
None
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/altair_examples/map_selection.py b/marimo/_smoke_tests/altair_examples/map_selection.py
index 4ec1b3ef06..763afff645 100644
--- a/marimo/_smoke_tests/altair_examples/map_selection.py
+++ b/marimo/_smoke_tests/altair_examples/map_selection.py
@@ -1,13 +1,14 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="columns")
@app.cell(column=0, hide_code=True)
def _(mo):
- mo.md(r"""# Selections with altair maps""")
- return
+ mo.md(r"""
+ # Selections with altair maps
+ """)
@app.cell(hide_code=True)
@@ -15,13 +16,15 @@ def _():
import altair as alt
import geopandas as gpd
from vega_datasets import data
+
return alt, data, gpd
@app.cell(hide_code=True)
def _(mo):
- mo.md("""## Load the data""")
- return
+ mo.md("""
+ ## Load the data
+ """)
@app.cell(hide_code=True)
@@ -41,14 +44,11 @@ def _(data, gpd):
@app.cell(column=1, hide_code=True)
def _(mo):
- mo.md(
- r"""
- ## Example 1: Population map
+ mo.md(r"""
+ ## Example 1: Population map
- https://altair-viz.github.io/user_guide/marks/geoshape.html#interactions
- """
- )
- return
+ https://altair-viz.github.io/user_guide/marks/geoshape.html#interactions
+ """)
@app.cell(hide_code=True)
@@ -95,25 +95,27 @@ def _(alt, us_population, us_states):
)
return (choropleth & bars).add_params(click_state)
+
return (population_map,)
@app.cell(hide_code=True)
def _(mo):
- mo.md("""### Without `mo.ui.altair_chart`""")
- return
+ mo.md("""
+ ### Without `mo.ui.altair_chart`
+ """)
@app.cell
def _(population_map):
population_map()
- return
@app.cell(hide_code=True)
def _(mo):
- mo.md(r"""### With `mo.ui.altair_chart`""")
- return
+ mo.md(r"""
+ ### With `mo.ui.altair_chart`
+ """)
@app.cell
@@ -125,14 +127,14 @@ def _(mo, population_map):
@app.cell(hide_code=True)
def _(mo):
- mo.md("""Selecting the bar chart or map should filter the table below""")
- return
+ mo.md("""
+ Selecting the bar chart or map should filter the table below
+ """)
@app.cell
def _(chart, mo, us_population):
mo.hstack([chart.selections, chart.apply_selection(us_population)])
- return
@app.cell
@@ -143,6 +145,7 @@ def _():
@app.cell
def _():
import marimo as mo
+
return (mo,)
@@ -153,8 +156,9 @@ def _():
@app.cell(column=2)
def _(mo):
- mo.md("""## Example 2:""")
- return
+ mo.md("""
+ ## Example 2:
+ """)
@app.cell(hide_code=True)
@@ -218,25 +222,27 @@ def _(alt, gdf_quakies, gdf_world):
type="orthographic", rotate=alt.expr(f"[{rotate0.name}, 0, 0]")
)
return comb
+
return (world_map,)
@app.cell(hide_code=True)
def _(mo):
- mo.md("""### Without `mo.ui.altair_chart`""")
- return
+ mo.md("""
+ ### Without `mo.ui.altair_chart`
+ """)
@app.cell
def _(world_map):
world_map()
- return
@app.cell(hide_code=True)
def _(mo):
- mo.md(r"""### With `mo.ui.altair_chart`""")
- return
+ mo.md(r"""
+ ### With `mo.ui.altair_chart`
+ """)
@app.cell
@@ -248,16 +254,14 @@ def _(mo, world_map):
@app.cell(hide_code=True)
def _(mo):
- mo.md(
- """Hovering over an element on the map should filter the table below."""
- )
- return
+ mo.md("""
+ Hovering over an element on the map should filter the table below.
+ """)
@app.cell
def _(world):
str(world.selections)
- return
@app.cell
@@ -268,7 +272,6 @@ def _(gdf_quakies, gdf_world, mo, world):
world.apply_selection(gdf_world)["id"],
]
)
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/altair_examples/nans_infinity.py b/marimo/_smoke_tests/altair_examples/nans_infinity.py
index 1ee9359ceb..f6b5513b3b 100644
--- a/marimo/_smoke_tests/altair_examples/nans_infinity.py
+++ b/marimo/_smoke_tests/altair_examples/nans_infinity.py
@@ -10,7 +10,7 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@@ -22,6 +22,7 @@ def _():
import altair
import marimo as mo
+
return mo, pd, pl
@@ -46,7 +47,6 @@ def _(mo, pandas_df, polars_df):
[md, polars_df.plot.line(x="x", y="y"), pandas_df.plot.line(x="x", y="y")],
heights=[20, 50, 50],
)
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/altair_examples/narwhals_compat.py b/marimo/_smoke_tests/altair_examples/narwhals_compat.py
index c0d874ecbf..46a3af3466 100644
--- a/marimo/_smoke_tests/altair_examples/narwhals_compat.py
+++ b/marimo/_smoke_tests/altair_examples/narwhals_compat.py
@@ -1,6 +1,6 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@@ -11,6 +11,7 @@ def _():
import polars as pl
import marimo as mo
+
return alt, mo, pd, pl
@@ -41,25 +42,21 @@ def _(alt, df_selection, mo):
@app.cell
def _(chart):
chart.data
- return
@app.cell
-def _(chart, df):
+def _(chart, df: None):
["Types", type(df), type(chart.dataframe), type(chart.value)]
- return
@app.cell
def _(chart):
chart.value
- return
@app.cell
def _(chart):
chart.dataframe
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/altair_examples/special_chars.py b/marimo/_smoke_tests/altair_examples/special_chars.py
index 60a2623668..d7e540d207 100644
--- a/marimo/_smoke_tests/altair_examples/special_chars.py
+++ b/marimo/_smoke_tests/altair_examples/special_chars.py
@@ -7,7 +7,7 @@ escaped when generating Altair chart code.
import marimo
-__generated_with = "0.17.2"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@@ -17,13 +17,13 @@ def _():
import pandas as pd
import polars as pl
import altair as alt
+
return alt, mo, pd, pl
@app.cell(hide_code=True)
def _(mo):
- mo.md(
- """
+ mo.md("""
# Testing Altair Charts with Special Characters
This notebook tests column names with special characters:
@@ -32,9 +32,7 @@ def _(mo):
- Colons: `:`
These characters need to be escaped in Altair field names.
- """
- )
- return
+ """)
@app.cell
@@ -58,26 +56,21 @@ def _(pandas_df, pl):
# Create a Polars DataFrame with special column names
polars_df = pl.DataFrame(pandas_df)
polars_df
- return
@app.cell(hide_code=True)
def _(mo):
- mo.md(
- """
+ mo.md("""
Use the data table chart builder to create a chart using `value.data` column.
The generated Python code should escape the dot: `field='value\\.data'`
Repeat for all the other columns
- """
- )
- return
+ """)
@app.cell
def _(mo, pandas_df):
mo.ui.table(pandas_df, selection=None)
- return
@app.cell
@@ -91,7 +84,6 @@ def _(alt, pandas_df):
)
)
chart
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/altair_examples/text_selection.py b/marimo/_smoke_tests/altair_examples/text_selection.py
index 03fb1affe5..bb7e904c08 100644
--- a/marimo/_smoke_tests/altair_examples/text_selection.py
+++ b/marimo/_smoke_tests/altair_examples/text_selection.py
@@ -9,20 +9,22 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@app.cell
def _():
import marimo as mo
+
return (mo,)
@app.cell(hide_code=True)
def _(mo):
- mo.md(r"""## Basic Text""")
- return
+ mo.md(r"""
+ ## Basic Text
+ """)
@app.cell
@@ -47,13 +49,13 @@ def _(mo):
@app.cell
def _(chart, mo):
mo.vstack([chart, chart.value.head()])
- return
@app.cell(hide_code=True)
def _(mo):
- mo.md(r"""## Bar chart with text""")
- return
+ mo.md(r"""
+ ## Bar chart with text
+ """)
@app.cell(hide_code=True)
@@ -89,19 +91,15 @@ def _(alt, data, mo):
@app.cell
def _(chart2):
chart2.value
- return
@app.cell(hide_code=True)
def _(mo):
- mo.md(
- r"""
- # Bar chart with double text
+ mo.md(r"""
+ # Bar chart with double text
- This fails for another reason which is that `month(date)` field gets converted into `month_date` and breaks the backend filtering.
- """
- )
- return
+ This fails for another reason which is that `month(date)` field gets converted into `month_date` and breaks the backend filtering.
+ """)
@app.cell(hide_code=True)
@@ -155,7 +153,6 @@ def _(alt, data, mo):
@app.cell
def _(chart3):
chart3.selections
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/altair_examples/timestamp_with_no_timezone.py b/marimo/_smoke_tests/altair_examples/timestamp_with_no_timezone.py
index afc1f8ecbc..f71146c65a 100644
--- a/marimo/_smoke_tests/altair_examples/timestamp_with_no_timezone.py
+++ b/marimo/_smoke_tests/altair_examples/timestamp_with_no_timezone.py
@@ -1,6 +1,6 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="full")
@@ -21,17 +21,16 @@ def _(alt, df, mo):
@app.cell
def _(tmc):
tmc.value
- return
@app.cell
-def _(build_df, d):
+def _(build_df, d: str):
df = build_df(d)
return (df,)
@app.cell
-def _(StringIO, date_format, pd):
+def _(StringIO, date_format: str, pd):
def build_df(data: str):
res = pd.read_csv(StringIO(data))
res["timestamp"] = pd.to_datetime(
@@ -48,6 +47,7 @@ def _(StringIO, date_format, pd):
]
return res
+
return (build_df,)
@@ -82,6 +82,7 @@ def _():
import pandas as pd
import marimo as mo
+
return StringIO, alt, mo, pd
diff --git a/marimo/_smoke_tests/altair_examples/tooltip_images.py b/marimo/_smoke_tests/altair_examples/tooltip_images.py
index f8d23bceef..969ef10117 100644
--- a/marimo/_smoke_tests/altair_examples/tooltip_images.py
+++ b/marimo/_smoke_tests/altair_examples/tooltip_images.py
@@ -10,20 +10,20 @@
import marimo
-__generated_with = "0.17.2"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@app.cell
def _():
import marimo as mo
+
return (mo,)
@app.cell(hide_code=True)
def _(mo):
- mo.md(
- """
+ mo.md("""
# Altair Tooltip Images
This smoke test verifies that images in Altair tooltips render correctly
@@ -33,9 +33,7 @@ def _(mo):
1. External image URLs in tooltips
2. Base64-encoded images in tooltips
3. XSS vulnerability prevention
- """
- )
- return
+ """)
@app.cell
@@ -77,15 +75,12 @@ def _():
@app.cell(hide_code=True)
def _(mo):
- mo.md(
- r"""
+ mo.md(r"""
## Instructions
Hover over the circles to see the image tooltips.
The images should render in the tooltip, not just show URLs as text.
- """
- )
- return
+ """)
@app.cell
@@ -122,13 +117,11 @@ def _(alt, pd):
)
chart2
- return
@app.cell(hide_code=True)
def _(mo):
- mo.md(
- r"""
+ mo.md(r"""
## XSS Security Tests
These tests verify that the tooltip handler properly sanitizes
@@ -136,9 +129,7 @@ def _(mo):
**Expected behavior:** All XSS attempts should be neutralized.
No alert boxes or script execution should occur when hovering.
- """
- )
- return
+ """)
@app.cell
@@ -199,7 +190,6 @@ def _(alt, pd):
)
xss_chart
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/altair_examples/upset.py b/marimo/_smoke_tests/altair_examples/upset.py
index 309832040f..edee74894e 100644
--- a/marimo/_smoke_tests/altair_examples/upset.py
+++ b/marimo/_smoke_tests/altair_examples/upset.py
@@ -9,7 +9,7 @@
import marimo
-__generated_with = "0.17.2"
+__generated_with = "0.25.2"
app = marimo.App(width="medium", sql_output="polars")
@@ -19,6 +19,7 @@ def _():
import pandas as pd
import pyarrow
from altair_upset import UpSetAltair
+
return UpSetAltair, mo, pd
@@ -37,13 +38,11 @@ def _(UpSetAltair, df):
@app.cell
def _(chart):
chart
- return
@app.cell
def _(chart, mo):
mo.ui.altair_chart(chart.copy())
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/altair_examples/vegafusion_histograms.py b/marimo/_smoke_tests/altair_examples/vegafusion_histograms.py
index 9caa6122eb..e158b93c87 100644
--- a/marimo/_smoke_tests/altair_examples/vegafusion_histograms.py
+++ b/marimo/_smoke_tests/altair_examples/vegafusion_histograms.py
@@ -14,13 +14,14 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@app.cell
def _():
import marimo as mo
+
return (mo,)
@@ -36,13 +37,13 @@ def _(alt, flights):
.properties(width="container")
)
_chart
- return
@app.cell
def _(mo):
- mo.md(r"""# Histograms with vegafusion""")
- return
+ mo.md(r"""
+ # Histograms with vegafusion
+ """)
@app.cell
@@ -78,7 +79,6 @@ def _(alt, flights):
@app.cell
def _(flights, mo):
mo.ui.table(flights[0:100], show_column_summaries=True)
- return
@app.cell
@@ -120,7 +120,6 @@ def _(alt, flights, mo):
)
)
mo.hstack(charts)
- return
@app.cell
@@ -128,7 +127,6 @@ def _(delay_hist, mo):
mo.md(
f"Total buckets **{len(delay_hist.to_dict(format='vega')['data'][0]['values'])}**"
)
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/altair_examples/vegafusion_nb.py b/marimo/_smoke_tests/altair_examples/vegafusion_nb.py
index 5b456bf831..9b5bdc67f3 100644
--- a/marimo/_smoke_tests/altair_examples/vegafusion_nb.py
+++ b/marimo/_smoke_tests/altair_examples/vegafusion_nb.py
@@ -12,20 +12,22 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@app.cell
def _():
import marimo as mo
+
return (mo,)
@app.cell
def _(mo):
- mo.md(r"""# Basic examples""")
- return
+ mo.md(r"""
+ # Basic examples
+ """)
@app.cell
@@ -60,21 +62,18 @@ def _(alt, flights, mo):
def _(alt, delay_hist, mo):
alt.data_transformers.enable("vegafusion")
mo.as_html(delay_hist)
- return
@app.cell
def _(alt, delay_hist):
alt.data_transformers.enable("vegafusion")
delay_hist
- return
@app.cell
def _(alt, delay_hist, mo):
alt.data_transformers.enable("vegafusion")
mo.ui.altair_chart(delay_hist)
- return
@app.cell
@@ -86,29 +85,26 @@ def _(alt, delay_hist, mo):
mo.output.replace("No error found")
except Exception as e:
print(e)
- return
@app.cell(hide_code=True)
def _(mo):
- mo.md(
- r"""
- # Examples from vegafusion
+ mo.md(r"""
+ # Examples from vegafusion
- The examples below still hit `MARIMO_OUTPUT_MAX_BYTES` limitations, and require increasing this before running this notebook:
+ The examples below still hit `MARIMO_OUTPUT_MAX_BYTES` limitations, and require increasing this before running this notebook:
- ```
- export MARIMO_OUTPUT_MAX_BYTES=100_000_000
- ```
- """
- )
- return
+ ```
+ export MARIMO_OUTPUT_MAX_BYTES=100_000_000
+ ```
+ """)
@app.cell
def _(mo):
- mo.md(r"""## Interactive Cross-filter""")
- return
+ mo.md(r"""
+ ## Interactive Cross-filter
+ """)
@app.cell
@@ -144,6 +140,7 @@ def _(alt):
.transform_calculate("time", "hours(datum.date)")
.repeat(column=["distance", "delay", "time"])
)
+
return (make_cross_filter_chart,)
@@ -154,13 +151,13 @@ def _(alt, make_cross_filter_chart, pd):
"https://vegafusion-datasets.s3.amazonaws.com/vega/flights_200k.parquet"
)
make_cross_filter_chart(source_data)
- return
@app.cell
def _(mo):
- mo.md(r"""## Interactive average""")
- return
+ mo.md(r"""
+ ## Interactive average
+ """)
@app.cell
@@ -189,6 +186,7 @@ def _(alt):
)
return alt.layer(bars, line, data=source).properties(height=200)
+
return (make_average_chart,)
@@ -199,13 +197,13 @@ def _(alt, make_average_chart, pd):
"https://vegafusion-datasets.s3.amazonaws.com/vega/seattle_weather_200k.parquet"
)
make_average_chart(_source_data)
- return
@app.cell
def _(mo):
- mo.md(r"""## Interactive Chart with Cross-Highlight""")
- return
+ mo.md(r"""
+ ## Interactive Chart with Cross-Highlight
+ """)
@app.cell
@@ -257,6 +255,7 @@ def _(alt):
bar,
rect + circ,
).resolve_legend(color="independent", size="independent")
+
return (make_movie_chart,)
@@ -267,13 +266,13 @@ def _(alt, make_movie_chart, pd):
"https://vegafusion-datasets.s3.amazonaws.com/vega/movies_201k.parquet"
)
make_movie_chart(_source_data)
- return
@app.cell(hide_code=True)
def _(mo):
- mo.md(r"""# Vega fusion mimes""")
- return
+ mo.md(r"""
+ # Vega fusion mimes
+ """)
@app.cell
@@ -283,7 +282,6 @@ def _(alt, flights, vf):
alt.Chart(flights).mark_bar().encode(
alt.X("delay", bin=alt.Bin(maxbins=30)), alt.Y("count()")
)
- return
@app.cell
@@ -292,7 +290,6 @@ def _(alt, flights, vf):
alt.Chart(flights).mark_bar().encode(
alt.X("delay", bin=alt.Bin(maxbins=30)), alt.Y("count()")
)
- return
@app.cell
@@ -301,7 +298,6 @@ def _(alt, flights, vf):
alt.Chart(flights).mark_bar().encode(
alt.X("delay", bin=alt.Bin(maxbins=30)), alt.Y("count()")
)
- return
@app.cell
@@ -310,7 +306,6 @@ def _(alt, flights, vf):
alt.Chart(flights).mark_bar().encode(
alt.X("delay", bin=alt.Bin(maxbins=30)), alt.Y("count()")
)
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/ansi.py b/marimo/_smoke_tests/ansi.py
index 3deba7e3fa..294916e305 100644
--- a/marimo/_smoke_tests/ansi.py
+++ b/marimo/_smoke_tests/ansi.py
@@ -8,14 +8,13 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App()
@app.cell
def _():
import marimo as mo
- return
@app.cell
@@ -25,7 +24,6 @@ def _():
"\x1b[{}m{}\n\x1b[0m".format(31 + i, "Hello, World!") for i in range(8)
)
)
- return
@app.cell
@@ -33,7 +31,6 @@ def _():
txt = "\n\n\x1B[1;33;40m 33;40 \x1B[1;33;41m 33;41 \x1B[1;33;42m 33;42 \x1B[1;33;43m 33;43 \x1B[1;33;44m 33;44 \x1B[1;33;45m 33;45 \x1B[1;33;46m 33;46 \x1B[1m\x1B[0\n\n\x1B[1;33;42m >> Tests OK\n\n"
print(txt)
- return
@app.cell
@@ -41,21 +38,18 @@ def _():
import sys
print("Hello world", file=sys.stderr)
- return
@app.cell
def _():
# No ANSI conversion when not stdout or stderr
"".join("\x1b[{}m{}\n\x1b[0m".format(31 + i, "Hello, World!") for i in range(8))
- return
@app.cell
def _():
# Colors input()
input("\x1b[34mPress Enter to continue\x1b[0m")
- return
@app.cell
@@ -94,7 +88,6 @@ def _():
logger.warning("This is a warning message")
logger.error("This is an error message")
logger.critical("This is a critical message")
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/anywidget_compat.py b/marimo/_smoke_tests/anywidget_compat.py
index f5b89e8677..aa2be35430 100644
--- a/marimo/_smoke_tests/anywidget_compat.py
+++ b/marimo/_smoke_tests/anywidget_compat.py
@@ -12,13 +12,14 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@app.cell
def _():
import marimo as mo
+
return (mo,)
@@ -61,6 +62,7 @@ def _():
# Stateful property that can be accessed by JavaScript & Python
count = traitlets.Int(0).tag(sync=True)
+
return (CounterWidget,)
@@ -76,13 +78,11 @@ def _(CounterWidget):
def _(w):
# Non-reactive, but class is cached
w
- return
@app.cell
def _(w):
w.trait_values()["count"]
- return
@app.cell
@@ -95,25 +95,23 @@ def _(CounterWidget, mo):
@app.cell
def _(w_reactive):
w_reactive
- return
@app.cell
def _(w_reactive):
w_reactive.value
- return
@app.cell
def _(w_reactive):
w_reactive.widget.trait_values()["count"]
- return
@app.cell
def _():
import altair as alt
import pandas as pd
+
return alt, pd
@@ -132,7 +130,6 @@ def _(alt, dd_widget, mo, pd):
df = pd.DataFrame(dd_widget.value["data"])
chart = alt.Chart(df).mark_point().encode(x="x", y="y", color="color")
mo.ui.altair_chart(chart)
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/anywidget_examples/esm_rerender.py b/marimo/_smoke_tests/anywidget_examples/esm_rerender.py
index 13549b4e43..8282464a8f 100644
--- a/marimo/_smoke_tests/anywidget_examples/esm_rerender.py
+++ b/marimo/_smoke_tests/anywidget_examples/esm_rerender.py
@@ -9,7 +9,7 @@
import marimo
-__generated_with = "0.19.7"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@@ -18,6 +18,7 @@ def _():
import marimo as mo
import anywidget
import traitlets
+
return anywidget, mo, traitlets
@@ -56,6 +57,7 @@ def _(anywidget, traitlets):
# Stateful property that can be accessed by JavaScript & Python
count = traitlets.Int(0).tag(sync=True)
+
return (CounterWidget,)
@@ -68,19 +70,16 @@ def _(CounterWidget, mo):
@app.cell
def _(widget):
widget
- return
@app.cell
def _(widget):
widget.count
- return
@app.cell
def _(widget):
widget.value
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/anywidget_examples/lonboard_example.py b/marimo/_smoke_tests/anywidget_examples/lonboard_example.py
index a218e6ff4f..3146337399 100644
--- a/marimo/_smoke_tests/anywidget_examples/lonboard_example.py
+++ b/marimo/_smoke_tests/anywidget_examples/lonboard_example.py
@@ -14,7 +14,7 @@
import marimo
-__generated_with = "0.19.7"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@@ -31,6 +31,7 @@ def _():
from lonboard import Map, ScatterplotLayer
from lonboard.colormap import apply_continuous_cmap
+
return (
BrBG_10,
Map,
@@ -87,13 +88,11 @@ def _(BrBG_10, apply_continuous_cmap, gdf, layer, max_bound, min_bound):
layer.get_fill_color = apply_continuous_cmap(
normalized_download_speed, BrBG_10, alpha=0.7
)
- return
@app.cell
def _(layer):
layer.get_fill_color[0]
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/anywidget_smoke_tests/maplibre_example.py b/marimo/_smoke_tests/anywidget_smoke_tests/maplibre_example.py
index 4d2f120afe..9ea5d4a1d8 100644
--- a/marimo/_smoke_tests/anywidget_smoke_tests/maplibre_example.py
+++ b/marimo/_smoke_tests/anywidget_smoke_tests/maplibre_example.py
@@ -8,7 +8,7 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@@ -16,6 +16,7 @@ app = marimo.App(width="medium")
def _():
import marimo as mo
import functools
+
return (mo,)
@@ -23,6 +24,7 @@ def _():
def _():
from maplibre.controls import NavigationControl, ScaleControl
from maplibre.ipywidget import MapOptions, MapWidget
+
return MapOptions, MapWidget, NavigationControl, ScaleControl
@@ -55,7 +57,13 @@ def _(MapOptions):
@app.cell
-def _(MapWidget, NavigationControl, deck_grid_layer, map_options, mo):
+def _(
+ MapWidget,
+ NavigationControl,
+ deck_grid_layer: dict[str, int | str],
+ map_options,
+ mo,
+):
m = MapWidget(map_options)
m.use_message_queue(False)
m.add_control(NavigationControl())
@@ -76,19 +84,16 @@ def _(mo):
def _(ScaleControl, add_control_button, m):
if add_control_button.value:
m.add_control(ScaleControl())
- return
@app.cell
def _(m):
m.clicked
- return
@app.cell
def _(m):
m.center
- return
@app.cell
diff --git a/marimo/_smoke_tests/anywidget_smoke_tests/mosaic_example.py b/marimo/_smoke_tests/anywidget_smoke_tests/mosaic_example.py
index c9859be16c..032e0a1a66 100644
--- a/marimo/_smoke_tests/anywidget_smoke_tests/mosaic_example.py
+++ b/marimo/_smoke_tests/anywidget_smoke_tests/mosaic_example.py
@@ -13,7 +13,7 @@
import marimo
-__generated_with = "0.19.7"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@@ -46,7 +46,6 @@ def _():
@app.cell
def _(w):
w
- return
@app.cell
@@ -58,6 +57,7 @@ def _():
@app.cell
def _():
import quak
+
return (quak,)
@@ -80,13 +80,12 @@ def _():
@app.cell
-def _(q, thing):
+def _(q, thing: dict[str, int]):
# Check gets update only once
thing["a"] += 1
print(thing["a"])
q.data()
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/app_fn.py b/marimo/_smoke_tests/app_fn.py
index 13df35ee0b..78d4e9a95c 100644
--- a/marimo/_smoke_tests/app_fn.py
+++ b/marimo/_smoke_tests/app_fn.py
@@ -1,6 +1,6 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App()
with app.setup:
@@ -9,16 +9,13 @@ with app.setup:
@app.cell(hide_code=True)
def _():
- mo.md(
- r"""
- # @app.function smoke test
+ mo.md(r"""
+ # @app.function smoke test
- See [2293 for discussion](https://github.com/marimo-team/marimo/issues/2293)[^2293]
+ See [2293 for discussion](https://github.com/marimo-team/marimo/issues/2293)[^2293]
- [^2293]: https://github.com/marimo-team/marimo/issues/2293
- """
- )
- return
+ [^2293]: https://github.com/marimo-team/marimo/issues/2293
+ """)
@app.function
@@ -51,7 +48,6 @@ def multiply(a, b) -> int:
@app.cell
def _():
d = 13
- return
@app.function(hide_code=True)
@@ -74,13 +70,11 @@ def _():
print(addition(21, 56))
print(multiply(21, 56))
print(self_ref_fib(10))
- return
@app.cell
def _():
a = bad_divide_curry(1)
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/appcomp/double_nested/inner.py b/marimo/_smoke_tests/appcomp/double_nested/inner.py
index 842091e45a..e04e699a68 100644
--- a/marimo/_smoke_tests/appcomp/double_nested/inner.py
+++ b/marimo/_smoke_tests/appcomp/double_nested/inner.py
@@ -2,20 +2,22 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App()
@app.cell
def _():
import marimo as mo
+
return (mo,)
@app.cell
def _(mo):
- mo.md("# Innermost")
- return
+ mo.md("""
+ # Innermost
+ """)
@app.cell
@@ -27,7 +29,6 @@ def _(mo):
@app.cell
def _(x):
x
- return
@app.cell
@@ -39,13 +40,11 @@ def _(mo):
@app.cell
def _(y):
y
- return
@app.cell
def _(x, y):
x.value + y.value
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/appcomp/double_nested/main.py b/marimo/_smoke_tests/appcomp/double_nested/main.py
index 3dc0dd8565..fa25fc7975 100644
--- a/marimo/_smoke_tests/appcomp/double_nested/main.py
+++ b/marimo/_smoke_tests/appcomp/double_nested/main.py
@@ -2,13 +2,14 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@app.cell
def _():
from middle import app as middle
+
return (middle,)
@@ -22,7 +23,6 @@ async def _(middle):
@app.cell
def _(result):
result.defs["x_plus_y"]
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/appcomp/double_nested/middle.py b/marimo/_smoke_tests/appcomp/double_nested/middle.py
index af57d57c56..f2e6bc43da 100644
--- a/marimo/_smoke_tests/appcomp/double_nested/middle.py
+++ b/marimo/_smoke_tests/appcomp/double_nested/middle.py
@@ -2,33 +2,35 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@app.cell
def _():
import marimo as mo
+
return (mo,)
@app.cell
def _():
from inner import app
+
return (app,)
@app.cell
def _(mo):
- mo.md("# middle")
- return
+ mo.md("""
+ # middle
+ """)
@app.cell
def _(mo, result):
x_plus_y = result.defs['x'].value + result.defs['y'].value
mo.md(f"The middle app has calculated `x_plus_y` ... try retrieving it")
- return
@app.cell
diff --git a/marimo/_smoke_tests/appcomp/imperative_output/imperative_output.py b/marimo/_smoke_tests/appcomp/imperative_output/imperative_output.py
index c0b64a6236..074e51bd2d 100644
--- a/marimo/_smoke_tests/appcomp/imperative_output/imperative_output.py
+++ b/marimo/_smoke_tests/appcomp/imperative_output/imperative_output.py
@@ -2,20 +2,22 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@app.cell
def _():
import marimo as mo
+
return (mo,)
@app.cell
def _(mo):
- mo.md("# hello")
- return
+ mo.md("""
+ # hello
+ """)
@app.cell
@@ -23,7 +25,6 @@ def _(mo, time):
for i in mo.status.progress_bar(range(5)):
time.sleep(0.5)
print(i)
- return
@app.cell
diff --git a/marimo/_smoke_tests/appcomp/imperative_output/main.py b/marimo/_smoke_tests/appcomp/imperative_output/main.py
index 77e571b2cf..c2c413365f 100644
--- a/marimo/_smoke_tests/appcomp/imperative_output/main.py
+++ b/marimo/_smoke_tests/appcomp/imperative_output/main.py
@@ -2,26 +2,25 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@app.cell
def _():
from imperative_output import app
+
return (app,)
@app.cell
def _():
import marimo as mo
- return
@app.cell
async def _(app):
(await app.embed()).output
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/appcomp/inner.py b/marimo/_smoke_tests/appcomp/inner.py
index dfca30975d..ea518ee6ce 100644
--- a/marimo/_smoke_tests/appcomp/inner.py
+++ b/marimo/_smoke_tests/appcomp/inner.py
@@ -2,20 +2,22 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App()
@app.cell
def _():
import marimo as mo
+
return (mo,)
@app.cell
def _(mo):
- mo.md("# Innermost")
- return
+ mo.md("""
+ # Innermost
+ """)
@app.cell
@@ -23,8 +25,9 @@ def _():
x_initial_value = 1
return (x_initial_value,)
+
@app.cell
-def _(mo, x_initial_value):
+def _(mo, x_initial_value: int):
x = mo.ui.number(x_initial_value, 10)
return (x,)
@@ -32,7 +35,6 @@ def _(mo, x_initial_value):
@app.cell
def _(x):
x
- return
@app.cell
@@ -44,12 +46,11 @@ def _(mo):
@app.cell
def _(y):
y
- return
+
@app.cell
def _(x, y):
x.value + y.value
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/appcomp/main.py b/marimo/_smoke_tests/appcomp/main.py
index 60a651c6bb..54feff5a9c 100644
--- a/marimo/_smoke_tests/appcomp/main.py
+++ b/marimo/_smoke_tests/appcomp/main.py
@@ -2,13 +2,14 @@
import marimo
-__generated_with = "0.18.4"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@app.cell
def _():
from inner import app
+
return (app,)
@@ -17,7 +18,6 @@ def _(mo):
mo.md("""
## Render the same app multiple times
""")
- return
@app.cell
@@ -30,13 +30,11 @@ async def _(app):
@app.cell
def _(result):
result.defs["x"].value
- return
@app.cell
def _(result):
result.defs["y"].value
- return
@app.cell(hide_code=True)
@@ -44,7 +42,6 @@ def _(mo):
mo.md(r"""
## Clone an app
""")
- return
@app.cell
@@ -57,7 +54,6 @@ def _(app):
async def _(clone):
clone_result = await clone.embed()
clone_result.output
- return
@app.cell(hide_code=True)
@@ -65,7 +61,6 @@ def _(mo):
mo.md(r"""
## Parametrize an app
""")
- return
@app.cell
@@ -78,7 +73,6 @@ def _(app):
async def _(parametrized_app):
_result = await parametrized_app.embed(defs={"x_initial_value": 0})
_result.output
- return
@app.cell(hide_code=True)
@@ -86,14 +80,12 @@ def _(mo):
mo.md("""
## Render an app inside tabs
""")
- return
@app.cell
async def _(app, mo):
tabs = mo.ui.tabs({"🧮": (await app.embed()).output, "📝": mo.md("Hello world")})
tabs
- return
@app.cell
@@ -101,12 +93,12 @@ def _(mo):
mo.md(rf"""
## Render an app that uses function calls
""")
- return
@app.cell
def _():
from make_table import app as table_app
+
return (table_app,)
@@ -119,18 +111,17 @@ async def _(table_app):
@app.cell
def _(table_app_results):
table_app_results.output
- return
@app.cell
def _(table_app_results):
table_app_results.defs
- return
@app.cell
def _():
import marimo as mo
+
return (mo,)
diff --git a/marimo/_smoke_tests/appcomp/make_table.py b/marimo/_smoke_tests/appcomp/make_table.py
index 993b2db5cd..b41629c47c 100644
--- a/marimo/_smoke_tests/appcomp/make_table.py
+++ b/marimo/_smoke_tests/appcomp/make_table.py
@@ -2,13 +2,14 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@app.cell
def _():
import marimo as mo
+
return (mo,)
@@ -21,7 +22,6 @@ def _(mo):
@app.cell
def _(t):
t
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/appcomp/resetting_sliders/embed_test_a.py b/marimo/_smoke_tests/appcomp/resetting_sliders/embed_test_a.py
index cdbc2f0da3..51b03ded0e 100644
--- a/marimo/_smoke_tests/appcomp/resetting_sliders/embed_test_a.py
+++ b/marimo/_smoke_tests/appcomp/resetting_sliders/embed_test_a.py
@@ -1,18 +1,18 @@
import marimo
-__generated_with = "0.19.2"
+__generated_with = "0.25.2"
app = marimo.App()
@app.cell
def _():
import marimo as mo
- return
@app.cell
def _():
import embed_test_b
+
return (embed_test_b,)
@@ -47,7 +47,6 @@ async def _(clone_b, embed_a):
}
)
).output
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/appcomp/resetting_sliders/embed_test_b.py b/marimo/_smoke_tests/appcomp/resetting_sliders/embed_test_b.py
index 61454a68d1..d5732042ef 100644
--- a/marimo/_smoke_tests/appcomp/resetting_sliders/embed_test_b.py
+++ b/marimo/_smoke_tests/appcomp/resetting_sliders/embed_test_b.py
@@ -1,6 +1,6 @@
import marimo
-__generated_with = "0.19.2"
+__generated_with = "0.25.2"
app = marimo.App(width="full")
@@ -8,6 +8,7 @@ app = marimo.App(width="full")
def _():
import marimo as mo
import time
+
return (mo,)
@@ -27,11 +28,10 @@ def _(mo):
@app.cell
def _(slider):
slider
- return
@app.cell
-def _(slider, state):
+def _(slider, state: None):
value = slider.value if state is None else state()
label = "our"
return label, value
@@ -44,13 +44,12 @@ def _():
@app.cell
-def _(kind, label, mo, value):
+def _(kind: str, label: str, mo, value: int | float):
mo.callout(
mo.md(f"""
The value of *{label}* slider is **{value}**!
"""), kind
)
- return
@app.cell
diff --git a/marimo/_smoke_tests/appcomp/setup_embed_setup/inner_with_setup.py b/marimo/_smoke_tests/appcomp/setup_embed_setup/inner_with_setup.py
index 4b4972f91a..f69f5f08b2 100644
--- a/marimo/_smoke_tests/appcomp/setup_embed_setup/inner_with_setup.py
+++ b/marimo/_smoke_tests/appcomp/setup_embed_setup/inner_with_setup.py
@@ -2,10 +2,9 @@
import marimo
-__generated_with = "0.18.4"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
-
with app.setup:
import marimo as mo
@@ -18,9 +17,8 @@ def _():
@app.cell
-def _(inner_value):
+def _(inner_value: int):
mo.md(f"Inner value is: {inner_value}")
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/appcomp/setup_embed_setup/main.py b/marimo/_smoke_tests/appcomp/setup_embed_setup/main.py
index 406239c251..296f2680f6 100644
--- a/marimo/_smoke_tests/appcomp/setup_embed_setup/main.py
+++ b/marimo/_smoke_tests/appcomp/setup_embed_setup/main.py
@@ -12,7 +12,7 @@ Bug: The main app's setup cell should NOT rerun when the inner app is embedded.
import marimo
-__generated_with = "0.18.4"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
with app.setup:
@@ -32,7 +32,6 @@ def _():
The outer app's setup cell should only run **once**, not rerun when
the inner app is embedded.
""")
- return
@app.cell
@@ -55,11 +54,10 @@ def _(result):
mo.md(f"""
Inner app value: **{result.defs.get('inner_value')}**
""")
- return
@app.cell
-def _(setup_count_before_embed):
+def _(setup_count_before_embed: int):
setup_count_after_embed = setup_tracker["count"]
# This is the key assertion - setup should still be 1
@@ -74,7 +72,6 @@ def _(setup_count_before_embed):
Expected setup to run exactly **1** time.
""")
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/appcomp/state/main.py b/marimo/_smoke_tests/appcomp/state/main.py
index 7875d45ae4..393a40a13c 100644
--- a/marimo/_smoke_tests/appcomp/state/main.py
+++ b/marimo/_smoke_tests/appcomp/state/main.py
@@ -2,20 +2,20 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@app.cell
def _():
from state import app
+
return (app,)
@app.cell
async def _(app):
(await app.embed()).output
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/appcomp/state/state.py b/marimo/_smoke_tests/appcomp/state/state.py
index 87126b3be4..e2b3d36b88 100644
--- a/marimo/_smoke_tests/appcomp/state/state.py
+++ b/marimo/_smoke_tests/appcomp/state/state.py
@@ -2,13 +2,14 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@app.cell
def _():
import marimo as mo
+
return (mo,)
@@ -22,13 +23,11 @@ def _(mo):
def _(mo, set_state):
b = mo.ui.button(on_change=lambda x: set_state(True))
b
- return
@app.cell
def _(get_state):
"button was clicked" if get_state() else "button was not clicked"
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/appcomp/ui_elements_with_overrides/embed_test_a.py b/marimo/_smoke_tests/appcomp/ui_elements_with_overrides/embed_test_a.py
index b5b327b9a4..7ea7f0b58b 100644
--- a/marimo/_smoke_tests/appcomp/ui_elements_with_overrides/embed_test_a.py
+++ b/marimo/_smoke_tests/appcomp/ui_elements_with_overrides/embed_test_a.py
@@ -1,6 +1,6 @@
import marimo
-__generated_with = "0.19.2"
+__generated_with = "0.25.2"
app = marimo.App(width="full")
@@ -8,12 +8,12 @@ app = marimo.App(width="full")
def _():
# https://github.com/marimo-team/marimo/issues/7685
import marimo as mo
- return
@app.cell
def _():
import embed_test_b
+
return (embed_test_b,)
@@ -43,7 +43,6 @@ async def _(clone_b, embed_a):
defs={"value": embed_a.defs["value"], "label": "their", "kind": "warn"}
)
).output
- return
@app.cell
diff --git a/marimo/_smoke_tests/appcomp/ui_elements_with_overrides/embed_test_b.py b/marimo/_smoke_tests/appcomp/ui_elements_with_overrides/embed_test_b.py
index 5eb1739ce2..1fcdb71d06 100644
--- a/marimo/_smoke_tests/appcomp/ui_elements_with_overrides/embed_test_b.py
+++ b/marimo/_smoke_tests/appcomp/ui_elements_with_overrides/embed_test_b.py
@@ -1,12 +1,13 @@
import marimo
-__generated_with = "0.18.4"
+__generated_with = "0.25.2"
app = marimo.App(width="full")
@app.cell
def _():
import marimo as mo
+
return (mo,)
@@ -31,13 +32,12 @@ def _():
@app.cell
-def _(kind, label, mo, value):
+def _(kind: str, label: str, mo, value: int | float):
mo.callout(
mo.md(f"""
The value of *{label}* slider is **{value}**!
"""), kind
)
- return
@app.cell
@@ -46,4 +46,4 @@ def _():
if __name__ == "__main__":
- app.run()
\ No newline at end of file
+ app.run()
diff --git a/marimo/_smoke_tests/arrays_and_dicts.py b/marimo/_smoke_tests/arrays_and_dicts.py
index febd8865ec..38abce34a4 100644
--- a/marimo/_smoke_tests/arrays_and_dicts.py
+++ b/marimo/_smoke_tests/arrays_and_dicts.py
@@ -8,13 +8,14 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App()
@app.cell
def _():
import marimo as mo
+
return (mo,)
@@ -36,13 +37,11 @@ def _(mo):
@app.cell
def _(items):
items
- return
@app.cell
def _(items):
items.hstack(gap=2)
- return
@app.cell
@@ -63,13 +62,11 @@ def _(mo):
@app.cell
def _(dictionary):
dictionary
- return
@app.cell
def _(dictionary):
dictionary.vstack()
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/async/background_tasks.py b/marimo/_smoke_tests/async/background_tasks.py
index 39dec45f56..942dfab6e9 100644
--- a/marimo/_smoke_tests/async/background_tasks.py
+++ b/marimo/_smoke_tests/async/background_tasks.py
@@ -1,6 +1,6 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@@ -18,6 +18,7 @@ def _():
await asyncio.sleep(1)
print(f"Task {name} completed")
return f"{name} result"
+
return asyncio, background_task
@@ -25,7 +26,6 @@ def _():
def _(asyncio, background_task):
# Run this cell for a new background task
a = asyncio.create_task(background_task("A", 2))
- return
@app.cell
@@ -33,7 +33,6 @@ def _(asyncio, refresh):
# This list should have at least one task (the kernel). When creating tasks above, they should be added and then removed.
refresh
list(asyncio.all_tasks())
- return
@app.cell(hide_code=True)
diff --git a/marimo/_smoke_tests/auto_instantiate_off.py b/marimo/_smoke_tests/auto_instantiate_off.py
index 29a048be25..ff78199c05 100644
--- a/marimo/_smoke_tests/auto_instantiate_off.py
+++ b/marimo/_smoke_tests/auto_instantiate_off.py
@@ -1,19 +1,21 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@app.cell
def _():
import marimo as mo
+
return (mo,)
@app.cell
def _(mo):
- mo.md(r"""If you run this first, then this should run and the `import marimo` cell should run, but nothing else""")
- return
+ mo.md(r"""
+ If you run this first, then this should run and the `import marimo` cell should run, but nothing else
+ """)
@app.cell
@@ -25,11 +27,10 @@ def _():
@app.cell
-def _(x):
+def _(x: int):
# If you run this first, then this should run and `x = 2`
y = x + 2
y
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/bokeh_figure.py b/marimo/_smoke_tests/bokeh_figure.py
index 68bb3bed8b..42f40bbc6c 100644
--- a/marimo/_smoke_tests/bokeh_figure.py
+++ b/marimo/_smoke_tests/bokeh_figure.py
@@ -8,14 +8,13 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App()
@app.cell
def _():
import bokeh
- return
@app.cell
@@ -37,14 +36,12 @@ def _(figure):
@app.cell
def _(p, show):
show(p)
- return
@app.cell
def _(p):
# Shows plot
p
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/buttons.py b/marimo/_smoke_tests/buttons.py
index 2a1610683e..e7d7d70561 100644
--- a/marimo/_smoke_tests/buttons.py
+++ b/marimo/_smoke_tests/buttons.py
@@ -8,13 +8,14 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App()
@app.cell
def _():
import marimo as mo
+
return (mo,)
@@ -27,9 +28,8 @@ def _(mo):
@app.cell
-def _(kinds, mo):
+def _(kinds: list[str], mo):
mo.vstack([mo.ui.button(label=kind, kind=kind, disabled=True) for kind in kinds])
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/cache_kwargs.py b/marimo/_smoke_tests/cache_kwargs.py
index 97d18c6179..e2aaedb671 100644
--- a/marimo/_smoke_tests/cache_kwargs.py
+++ b/marimo/_smoke_tests/cache_kwargs.py
@@ -1,12 +1,13 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@app.cell
def _():
import marimo as mo
+
return (mo,)
@@ -20,7 +21,6 @@ def _():
@app.cell
def _():
1
- return
@app.cell
@@ -36,17 +36,15 @@ def _(mo):
@app.cell
-def _(kw, my_cached_func):
+def _(kw: dict[str, int], my_cached_func):
# Expect (persistent) caching correctly capture changes in kw, but it doesn't.
# breakpoint()
my_cached_func(**kw)
- return
@app.cell
def _(my_cached_func):
my_cached_func.hits
- return
@app.cell
diff --git a/marimo/_smoke_tests/cache_lazy_benchmark.py b/marimo/_smoke_tests/cache_lazy_benchmark.py
index 34048e257a..6794b88b4a 100644
--- a/marimo/_smoke_tests/cache_lazy_benchmark.py
+++ b/marimo/_smoke_tests/cache_lazy_benchmark.py
@@ -1,6 +1,6 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@@ -28,7 +28,7 @@ def _():
@app.cell
-def _(ARRAY_SIZE, mo, np, time):
+def _(ARRAY_SIZE: int, mo, np, time):
_start = time.perf_counter()
with mo.persistent_cache(name="bench_pickle", method="pickle"):
pickle_a = np.random.rand(ARRAY_SIZE)
@@ -43,7 +43,7 @@ def _(ARRAY_SIZE, mo, np, time):
@app.cell
-def _(ARRAY_SIZE, mo, np, time):
+def _(ARRAY_SIZE: int, mo, np, time):
_start = time.perf_counter()
with mo.persistent_cache(name="bench_lazy", method="lazy"):
lazy_a = np.random.rand(ARRAY_SIZE)
@@ -58,10 +58,9 @@ def _(ARRAY_SIZE, mo, np, time):
@app.cell
-def _(ARRAY_SIZE, lazy_time, pickle_time):
+def _(ARRAY_SIZE: int, lazy_time: float, pickle_time: float):
print(f"\nArray size: {ARRAY_SIZE} ({ARRAY_SIZE * 8 / 1e6:.1f}MB each)")
print(f"Pickle: {pickle_time * 1000:.1f}ms | Lazy: {lazy_time * 1000:.1f}ms")
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/charts/histograms.py b/marimo/_smoke_tests/charts/histograms.py
index 3885d5a3c8..ecf069a3ab 100644
--- a/marimo/_smoke_tests/charts/histograms.py
+++ b/marimo/_smoke_tests/charts/histograms.py
@@ -1,13 +1,14 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="full")
@app.cell(hide_code=True)
def _(mo):
- mo.md(r"""This is some experimental work to see if we can pre-aggregate column charts on the backend for performance. We are trying to use the dataframe of choice, to avoid additional dependencies.""")
- return
+ mo.md(r"""
+ This is some experimental work to see if we can pre-aggregate column charts on the backend for performance. We are trying to use the dataframe of choice, to avoid additional dependencies.
+ """)
@app.cell(hide_code=True)
@@ -18,7 +19,7 @@ def _(pl):
@app.cell(hide_code=True)
-def _(alt, charts, mo):
+def _(alt, charts: dict, mo):
_charts = []
for _col, data in charts.items():
chart = mo.ui.altair_chart(
@@ -34,7 +35,6 @@ def _(alt, charts, mo):
)
_charts.append(chart)
mo.hstack(_charts)
- return
@app.cell
@@ -53,7 +53,6 @@ def _(df, pl):
def _(df):
res = df["Weight"].hist().to_dicts()
res[0]
- return
@app.cell
@@ -61,6 +60,7 @@ def _():
import marimo as mo
import polars as pl
import altair as alt
+
return alt, mo, pl
diff --git a/marimo/_smoke_tests/chat/chatbot.py b/marimo/_smoke_tests/chat/chatbot.py
index dbb9f95010..ebe113ff09 100644
--- a/marimo/_smoke_tests/chat/chatbot.py
+++ b/marimo/_smoke_tests/chat/chatbot.py
@@ -11,26 +11,29 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@app.cell(hide_code=True)
def _():
import marimo as mo
+
return (mo,)
@app.cell(hide_code=True)
def _(mo):
- mo.md(r"""# Built-in chatbots""")
- return
+ mo.md(r"""
+ # Built-in chatbots
+ """)
@app.cell(hide_code=True)
def _(mo):
- mo.md(r"""## OpenAI""")
- return
+ mo.md(r"""
+ ## OpenAI
+ """)
@app.cell
@@ -47,13 +50,13 @@ def _(mo):
"What is 2 + {{number}}",
],
)
- return
@app.cell(hide_code=True)
def _(mo):
- mo.md(r"""## Anthropic""")
- return
+ mo.md(r"""
+ ## Anthropic
+ """)
@app.cell
@@ -67,13 +70,13 @@ def _(mo):
"What is 2 + {{number}}",
],
)
- return
@app.cell(hide_code=True)
def _(mo):
- mo.md(r"""## Google Gemini""")
- return
+ mo.md(r"""
+ ## Google Gemini
+ """)
@app.cell
@@ -87,13 +90,13 @@ def _(mo):
"What is 2 + {{number}}",
],
)
- return
@app.cell(hide_code=True)
def _(mo):
- mo.md(r"""# Custom chatbots""")
- return
+ mo.md(r"""
+ # Custom chatbots
+ """)
@app.cell(hide_code=True)
@@ -107,13 +110,13 @@ def _(mo):
@app.cell
-def _(input_key, os_key):
+def _(input_key, os_key: None | str):
openai_key = os_key or input_key.value
return (openai_key,)
@app.cell(hide_code=True)
-def _(mo, openai_key):
+def _(mo, openai_key: None | str):
# Initialize a client
mo.stop(
not openai_key,
@@ -130,8 +133,9 @@ def _(mo, openai_key):
@app.cell(hide_code=True)
def _(mo):
- mo.md(r"""## Simple""")
- return
+ mo.md(r"""
+ ## Simple
+ """)
@app.cell
@@ -143,13 +147,13 @@ def _(client, ell, mo):
mo.ui.chat(mo.ai.llm.simple(_my_model))
- return
@app.cell(hide_code=True)
def _(mo):
- mo.md(r"""## Complex""")
- return
+ mo.md(r"""
+ ## Complex
+ """)
@app.cell
@@ -227,6 +231,7 @@ def _(cars, client, ell):
del as_dict["datasets"]
return alt.Chart.from_dict(as_dict)
return response
+
return get_sample_prompts, my_complex_model
@@ -237,7 +242,6 @@ def _(cars, get_sample_prompts, mo, my_complex_model):
my_complex_model,
prompts=prompts,
)
- return
@app.cell
@@ -250,7 +254,6 @@ def _(mo):
@app.cell
def _(no_bot):
no_bot.value
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/cli_args.py b/marimo/_smoke_tests/cli_args.py
index f6822f5f4d..6ae5cbe844 100644
--- a/marimo/_smoke_tests/cli_args.py
+++ b/marimo/_smoke_tests/cli_args.py
@@ -8,34 +8,31 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App()
@app.cell
def _():
import marimo as mo
+
return (mo,)
@app.cell
def _(mo):
- mo.md(
- """
- Re-run this with notebook with the following command line:
+ mo.md("""
+ Re-run this with notebook with the following command line:
- ```bash
- marimo edit marimo/_smoke_tests/cli_args.py -- -a foo --b=bar -d 10 -d 20 -d false
- ```
- """
- )
- return
+ ```bash
+ marimo edit marimo/_smoke_tests/cli_args.py -- -a foo --b=bar -d 10 -d 20 -d false
+ ```
+ """)
@app.cell
def _(mo):
mo.cli_args().to_dict()
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/code_editor.py b/marimo/_smoke_tests/code_editor.py
index a4ae8fea97..a5c39937d1 100644
--- a/marimo/_smoke_tests/code_editor.py
+++ b/marimo/_smoke_tests/code_editor.py
@@ -8,24 +8,22 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App()
@app.cell
def _(mo):
mo.ui.code_editor("print(2 + 2)", min_height=50)
- return
@app.cell
def _(mo):
mo.ui.code_editor("SELECT * FROM table;", language="sql", theme="light")
- return
@app.cell(hide_code=True)
-def _(languages, mo):
+def _(languages: list[str], mo):
language_select = mo.ui.dropdown(
languages,
value="javascript",
@@ -38,13 +36,12 @@ def _(languages, mo):
@app.cell
-def _(language_select, mo, samples, theme_select):
+def _(language_select, mo, samples: dict[str, str], theme_select):
mo.ui.code_editor(
samples[language_select.value],
language=language_select.value,
theme=theme_select.value,
)
- return
@app.cell
@@ -67,6 +64,7 @@ def _():
@app.cell
def _():
import marimo as mo
+
return (mo,)
diff --git a/marimo/_smoke_tests/compat/ipython_display.py b/marimo/_smoke_tests/compat/ipython_display.py
index 4105982f8c..1c284fe0b4 100644
--- a/marimo/_smoke_tests/compat/ipython_display.py
+++ b/marimo/_smoke_tests/compat/ipython_display.py
@@ -9,7 +9,7 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@@ -33,6 +33,7 @@ def _():
Code,
IFrame,
)
+
return (
Audio,
Code,
@@ -56,7 +57,6 @@ def _():
def _(HTML):
html = HTML("<h1>Hello World</h1><p style='color: blue;'>This is HTML</p>")
html
- return
@app.cell
@@ -64,7 +64,6 @@ def _(Image):
# Using a sample image URL
image = Image(url="https://marimo.io/logo.png", width=100)
image
- return
@app.cell
@@ -77,7 +76,6 @@ def _(JSON):
}
)
json_data
- return
@app.cell
@@ -85,14 +83,12 @@ def _(Javascript):
# Not yet supported
js = Javascript("alert('Hello from JavaScript!');")
js
- return
@app.cell
def _(Latex):
latex = Latex(r"\begin{align}f(x) &= x^2\\g(x) &= \frac{1}{x}\end{align}")
latex
- return
@app.cell
@@ -101,7 +97,6 @@ def _(Math):
r"\frac{1}{\pi} = \frac{2\sqrt{2}}{9801} \sum_{k=0}^\infty \frac{(4k)!(1103+26390k)}{(k!)^4 396^{4k}}"
)
math
- return
@app.cell
@@ -109,7 +104,6 @@ def _(Pretty):
_data = '{"complex": [1, 2, {"nested": "structure"}]}'
pretty = Pretty(_data)
pretty
- return
@app.cell
@@ -118,7 +112,6 @@ def _(SVG):
'<svg height="100" width="100"><circle cx="50" cy="50" r="40" stroke="black" stroke-width="3" fill="red" /></svg>'
)
svg
- return
@app.cell
@@ -131,7 +124,6 @@ def _(Audio):
data = np.sin(2 * np.pi * 440 * t) # 440 Hz sine wave
audio = Audio(data=data, rate=sample_rate)
audio
- return
@app.cell
@@ -139,7 +131,6 @@ def _(Video):
# Using a sample video URL
video = Video("https://www.w3schools.com/html/mov_bbb.mp4")
video
- return
@app.cell
@@ -147,7 +138,6 @@ def _(YouTubeVideo):
# Example YouTube video
yt = YouTubeVideo("dQw4w9WgXcQ")
yt
- return
@app.cell
@@ -158,14 +148,12 @@ def _(Code):
language="python",
)
code
- return
@app.cell
def _(IFrame):
iframe = IFrame("https://marimo.io", width=800, height=450)
iframe
- return
@app.cell
@@ -182,20 +170,19 @@ def _(Markdown):
"""
)
markdown
- return
@app.cell(hide_code=True)
def _(mo):
- mo.md(r"""# Display Commands""")
- return
+ mo.md(r"""
+ # Display Commands
+ """)
@app.cell
def _(Markdown, display):
display(Markdown("**hello**"))
display(Markdown("_goodbye*"))
- return
@app.cell
@@ -212,6 +199,7 @@ def _():
display_javascript,
display_pdf,
)
+
return (
display_html,
display_javascript,
@@ -237,7 +225,6 @@ def _(display_html, display_jpeg, display_png, display_pretty, display_svg):
)
display_png("https://marimo.io/favicon.ico", raw=True)
display_jpeg("https://marimo.io/favicon.ico", raw=True)
- return
@app.cell
@@ -263,12 +250,12 @@ def _(
)
display_javascript("alert('Hello from JavaScript!');", raw=True)
display_pdf("https://marimo.io/logo.png", raw=True)
- return
@app.cell
def _():
import marimo as mo
+
return (mo,)
diff --git a/marimo/_smoke_tests/compat/python314.py b/marimo/_smoke_tests/compat/python314.py
index 0bdfcc3afd..cba874c985 100644
--- a/marimo/_smoke_tests/compat/python314.py
+++ b/marimo/_smoke_tests/compat/python314.py
@@ -1,6 +1,6 @@
import marimo
-__generated_with = "0.18.0"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@@ -11,6 +11,7 @@ def _():
def blocking():
return "done"
+
return asyncio, blocking, concurrent
@@ -19,7 +20,6 @@ async def _(asyncio, blocking, concurrent):
loop = asyncio.get_running_loop()
with concurrent.futures.ProcessPoolExecutor() as pool:
res = await loop.run_in_executor(pool, blocking)
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/data_explorer.py b/marimo/_smoke_tests/data_explorer.py
index cbf412dbb1..66dc8b1a73 100644
--- a/marimo/_smoke_tests/data_explorer.py
+++ b/marimo/_smoke_tests/data_explorer.py
@@ -9,7 +9,7 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="full")
@@ -17,6 +17,7 @@ app = marimo.App(width="full")
def _():
import marimo as mo
from vega_datasets import data
+
return data, mo
@@ -46,7 +47,6 @@ def _(df, mo):
@app.cell
def _(v):
v.value
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/dataframe.py b/marimo/_smoke_tests/dataframe.py
index c915145e9d..aa43362361 100644
--- a/marimo/_smoke_tests/dataframe.py
+++ b/marimo/_smoke_tests/dataframe.py
@@ -14,14 +14,15 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="full")
@app.cell(hide_code=True)
def _(mo):
- mo.md("""# 🤖 Lists/Dicts""")
- return
+ mo.md("""
+ # 🤖 Lists/Dicts
+ """)
@app.cell
@@ -38,7 +39,6 @@ def _(mo):
@app.cell
def _(as_list):
as_list.value
- return
@app.cell
@@ -56,7 +56,6 @@ def _(mo):
@app.cell
def _(as_dict):
as_dict.value
- return
@app.cell
@@ -70,19 +69,20 @@ def _(mo):
@app.cell
def _(as_primitives):
as_primitives.value
- return
@app.cell(hide_code=True)
def _(mo):
- mo.md("""# 🐼 Pandas""")
- return
+ mo.md("""
+ # 🐼 Pandas
+ """)
@app.cell(hide_code=True)
def _(mo):
- mo.md("""## mo.ui.dataframe""")
- return
+ mo.md("""
+ ## mo.ui.dataframe
+ """)
@app.cell
@@ -94,8 +94,9 @@ def _(cars, mo):
@app.cell(hide_code=True)
def _(mo):
- mo.md("""## mo.ui.table""")
- return
+ mo.md("""
+ ## mo.ui.table
+ """)
@app.cell
@@ -108,49 +109,49 @@ def _(dataframe, mo):
@app.cell
def _(t):
t.value
- return
@app.cell(hide_code=True)
def _(mo):
- mo.md("""## .value""")
- return
+ mo.md("""
+ ## .value
+ """)
@app.cell
def _(dataframe):
dataframe.value
- return
@app.cell
def _(dataframe):
dataframe.value["Cylinders"]
- return
@app.cell(hide_code=True)
def _(mo):
- mo.md("""## mo.ui.data_explorer""")
- return
+ mo.md("""
+ ## mo.ui.data_explorer
+ """)
@app.cell
def _(mo, pl_dataframe):
mo.ui.data_explorer(pl_dataframe)
- return
@app.cell(hide_code=True)
def _(mo):
- mo.md("""# 🐻‍❄️ Polars""")
- return
+ mo.md("""
+ # 🐻‍❄️ Polars
+ """)
@app.cell
def _(mo):
- mo.md("""## mo.ui.dataframe""")
- return
+ mo.md("""
+ ## mo.ui.dataframe
+ """)
@app.cell
@@ -163,13 +164,13 @@ def _(mo, pl_dataframe):
@app.cell
def _(pl_dataframe_prime):
pl_dataframe_prime.value
- return
@app.cell(hide_code=True)
def _(mo):
- mo.md("""## mo.ui.table""")
- return
+ mo.md("""
+ ## mo.ui.table
+ """)
@app.cell
@@ -181,20 +182,21 @@ def _(cars, mo, pl):
@app.cell(hide_code=True)
def _(mo):
- mo.md("""## mo.ui.data_explorer""")
- return
+ mo.md("""
+ ## mo.ui.data_explorer
+ """)
@app.cell
def _(mo, pl_dataframe):
mo.ui.data_explorer(pl_dataframe)
- return
@app.cell(hide_code=True)
def _(mo):
- mo.md("""# 🏹 Arrow""")
- return
+ mo.md("""
+ # 🏹 Arrow
+ """)
@app.cell
@@ -206,8 +208,9 @@ def _(cars, mo, pa):
@app.cell(hide_code=True)
def _(mo):
- mo.md("""## mo.ui.table""")
- return
+ mo.md("""
+ ## mo.ui.table
+ """)
@app.cell
@@ -219,31 +222,27 @@ def _(arrow_table, mo):
@app.cell(hide_code=True)
def _(mo):
- mo.md("""## .value""")
- return
+ mo.md("""
+ ## .value
+ """)
@app.cell
def _(arrow_table_el):
arrow_table_el.value
- return
@app.cell
def _(arrow_table, mo):
mo.ui.data_explorer(arrow_table)
- return
@app.cell
def _(mo):
- mo.md(
- rf"""
- # 💽 Dataframe protocol
- > See the [API](https://data-apis.org/dataframe-protocol/latest/API.html)
- """
- )
- return
+ mo.md(rf"""
+ # 💽 Dataframe protocol
+ > See the [API](https://data-apis.org/dataframe-protocol/latest/API.html)
+ """)
@app.cell
@@ -255,7 +254,6 @@ def _():
"https://raw.githubusercontent.com/mwaskom/seaborn-data/master/iris.csv"
)
dask_df
- return
@app.cell
@@ -274,14 +272,14 @@ def _():
@app.cell
def _(mo):
- mo.md(rf"## mo.ui.table")
- return
+ mo.md(rf"""
+ ## mo.ui.table
+ """)
@app.cell
def _(ibis_penguins):
ibis_penguins.value
- return
@app.cell
@@ -294,19 +292,18 @@ def _(ibis_data, mo):
@app.cell
def _(ibis_penguins):
ibis_penguins.value
- return
@app.cell(hide_code=True)
def _(mo):
- mo.md(rf"## mo.ui.data_explorer")
- return
+ mo.md(rf"""
+ ## mo.ui.data_explorer
+ """)
@app.cell
def _(ibis_data, mo):
mo.ui.data_explorer(ibis_data)
- return
@app.cell
@@ -323,13 +320,12 @@ def _():
@app.cell
-def _(mo):
+def _(cars, mo):
_df = mo.sql(
f"""
SELECT * FROM cars WHERE Cylinders > 6;
"""
)
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/dataframes/dicts_vs_dfs.py b/marimo/_smoke_tests/dataframes/dicts_vs_dfs.py
index 3c898792b8..ff472c92a4 100644
--- a/marimo/_smoke_tests/dataframes/dicts_vs_dfs.py
+++ b/marimo/_smoke_tests/dataframes/dicts_vs_dfs.py
@@ -1,12 +1,13 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@app.cell
def _():
import marimo as mo
+
return (mo,)
@@ -14,6 +15,7 @@ def _():
def _():
import polars as pl
import pandas as pd
+
return pd, pl
@@ -40,7 +42,6 @@ def _(mo, test_df):
@app.cell
def _(t1):
t1.value
- return
@app.cell
@@ -53,13 +54,11 @@ def _(mo, pd, test_df):
@app.cell
def _(t2):
t2.value
- return
@app.cell
def _(mo, test_df):
mo.ui.table(test_df.to_dicts())
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/datasources.py b/marimo/_smoke_tests/datasources.py
index 9e8ffcce11..1dd50608b8 100644
--- a/marimo/_smoke_tests/datasources.py
+++ b/marimo/_smoke_tests/datasources.py
@@ -11,7 +11,7 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="full")
@@ -20,19 +20,18 @@ def _():
import marimo as mo
from vega_datasets import data
import pandas as pd
+
return data, mo, pd
@app.cell
def _(pd):
editable_table = pd.DataFrame({"a": [2, 2, 12], "b": [2, 5, 6]})
- return
@app.cell
def _(pd):
df_with_list = pd.DataFrame([{"a": [1, 2, 3]}])
- return
@app.cell
@@ -69,41 +68,35 @@ def _(df):
@app.cell
def _(mo, polars_df):
mo.ui.table(polars_df)
- return
@app.cell
def _(mo, pyarrow_df):
mo.ui.table(pyarrow_df)
- return
@app.cell
def _(df, mo):
mo.ui.table(df)
- return
@app.cell
-def _(mo):
+def _(mo, polars_df):
_df = mo.sql(
f"""
SELECT * FROM polars_df
"""
)
- return
@app.cell
def _(mo):
mo.ui.table({"a": [2, 2, 12], "b": [2, 5, 6]})
- return
@app.cell
def _(mo, polars_df):
mo.plain(polars_df)
- return
@app.cell
@@ -111,7 +104,6 @@ def _(pd):
date_range = pd.date_range(start="2023-01-01", periods=10, freq="D")
date_indexed_df = pd.DataFrame({"Data": range(10)}, index=date_range)
date_indexed_df
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/dates.py b/marimo/_smoke_tests/dates.py
index 0bedfd958b..e3fd78eb41 100644
--- a/marimo/_smoke_tests/dates.py
+++ b/marimo/_smoke_tests/dates.py
@@ -7,13 +7,14 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@app.cell
def _():
import marimo as mo
+
return (mo,)
@@ -42,7 +43,6 @@ def _(end_date, mo, start_date):
mo.md(f"From {start_date.value} to {end_date.value}"),
]
)
- return
@app.cell
@@ -68,7 +68,6 @@ def _(end_datetime, mo, start_datetime):
mo.md(f"From {start_datetime.value} to {end_datetime.value}"),
]
)
- return
@app.cell
@@ -84,7 +83,6 @@ def _(datetime, mo):
@app.cell
def _(date_range_input, mo):
mo.hstack([date_range_input, date_range_input.value])
- return
@app.cell
@@ -92,7 +90,6 @@ def _(mo):
_date = mo.ui.date(label="Input")
_datetime = mo.ui.datetime(label="Input")
_date_range = mo.ui.date_range(label="Input")
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/debounce.py b/marimo/_smoke_tests/debounce.py
index b4875e003d..ddcece07d2 100644
--- a/marimo/_smoke_tests/debounce.py
+++ b/marimo/_smoke_tests/debounce.py
@@ -2,13 +2,14 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App()
@app.cell
def _():
import marimo as mo
+
return (mo,)
@@ -35,7 +36,6 @@ def _(debounced_number, debounced_slider, mo, number, slider):
{debounced_number}
""")
- return
@app.cell
@@ -50,7 +50,6 @@ def _(debounced_number, debounced_slider, mo, number, slider):
debounced number: {debounced_number.value}
""")
- return
@app.cell
@@ -66,7 +65,6 @@ def _(debounced_number, debounced_slider, mo, number, slider):
{debounced_number} -> {debounced_number.value}
""")
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/debounce_input.py b/marimo/_smoke_tests/debounce_input.py
index c2c2135c70..3f79730356 100644
--- a/marimo/_smoke_tests/debounce_input.py
+++ b/marimo/_smoke_tests/debounce_input.py
@@ -1,17 +1,18 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App()
@app.cell
def _(mo):
- mo.md(r"""[Debounce mo.ui.text and mo.ui.text_area #2218](https://github.com/marimo-team/marimo/issues/2218)""")
- return
+ mo.md(r"""
+ [Debounce mo.ui.text and mo.ui.text_area #2218](https://github.com/marimo-team/marimo/issues/2218)
+ """)
@app.cell
-def _(debounce, debounce_options, mo):
+def _(debounce: None | int | bool, debounce_options, mo):
name_input = mo.ui.text(
label="Enter your name for the greeting of a lifetime:", debounce=debounce
)
@@ -23,11 +24,10 @@ def _(debounce, debounce_options, mo):
def _(name_input):
if len(name_input.value) > 0:
print(f"Hello {name_input.value}!")
- return
@app.cell
-def _(debounce, debounce_options, mo):
+def _(debounce: None | int | bool, debounce_options, mo):
story_input = mo.ui.text_area(
label="Now tell me a story from your childhood:", debounce=debounce
)
@@ -39,7 +39,6 @@ def _(debounce, debounce_options, mo):
def _(story_input):
if (len(story_input.value) > 0):
print(story_input.value)
- return
@app.cell
@@ -65,6 +64,7 @@ def _(debounce_options):
@app.cell
def _():
import marimo as mo
+
return (mo,)
diff --git a/marimo/_smoke_tests/df_index.py b/marimo/_smoke_tests/df_index.py
index dc62a0f57b..6c197d6d5e 100644
--- a/marimo/_smoke_tests/df_index.py
+++ b/marimo/_smoke_tests/df_index.py
@@ -1,6 +1,6 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@@ -9,6 +9,7 @@ def _():
import marimo as mo
import pandas as pd
import numpy as np
+
return mo, np, pd
@@ -20,14 +21,13 @@ def _(np):
@app.cell
-def _(columns, data, pd):
+def _(columns: list[str], data, pd):
df_no_index = pd.DataFrame(data, columns=columns)
df_no_index
- return
@app.cell
-def _(columns, data, pd):
+def _(columns: list[str], data, pd):
_dates = pd.date_range(start="2023-01-01", periods=100, freq="D")
df_date_index = pd.DataFrame(data, index=_dates, columns=columns)
df_date_index
@@ -35,39 +35,35 @@ def _(columns, data, pd):
@app.cell
-def _(columns, data, pd):
+def _(columns: list[str], data, pd):
_dates = pd.date_range(start="2023-01-01", periods=100, freq="D")
df_date_index_with_name = pd.DataFrame(
data, index=pd.DatetimeIndex(_dates, name="date"), columns=columns
)
df_date_index_with_name
- return
@app.cell
-def _(columns, data, pd):
+def _(columns: list[str], data, pd):
_dates = pd.date_range(start="2023-01-01", periods=100, freq="D")
df_category_index = pd.DataFrame(
data, index=pd.CategoricalIndex(_dates), columns=columns
)
df_category_index
- return
@app.cell
-def _(columns, data, pd):
+def _(columns: list[str], data, pd):
index = pd.MultiIndex.from_tuples(
[(i, j) for i in range(5) for j in range(2)], names=["Level1", "Level2"]
)
df_multi_index = pd.DataFrame(data[:10], index=index, columns=columns)
df_multi_index
- return
@app.cell
def _(df_date_index, mo):
mo.ui.dataframe(df_date_index)
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/disabled_ancestor_error.py b/marimo/_smoke_tests/disabled_ancestor_error.py
index 339ba2c1bd..16ded4c7af 100644
--- a/marimo/_smoke_tests/disabled_ancestor_error.py
+++ b/marimo/_smoke_tests/disabled_ancestor_error.py
@@ -5,7 +5,7 @@
import marimo
-__generated_with = "0.23.1"
+__generated_with = "0.25.2"
app = marimo.App()
@@ -28,15 +28,14 @@ def _(toggle):
@app.cell(disabled=True)
-def _(x):
+def _(x: int):
y = x + 1
return (y,)
@app.cell
-def _(y):
+def _(y: int):
z = y + 1
- return
@app.cell
diff --git a/marimo/_smoke_tests/display_math_lists.py b/marimo/_smoke_tests/display_math_lists.py
index 9dbf199c77..34e5fe072a 100644
--- a/marimo/_smoke_tests/display_math_lists.py
+++ b/marimo/_smoke_tests/display_math_lists.py
@@ -2,13 +2,14 @@
import marimo
-__generated_with = "0.24.0"
+__generated_with = "0.25.2"
app = marimo.App()
@app.cell
def _():
import marimo as mo
+
return (mo,)
@@ -20,7 +21,6 @@ def _(mo):
Check that equations and following text stay inside their list items.
The numbered list should have three items.
""")
- return
@app.cell
@@ -34,7 +34,6 @@ def _(mo):
This text belongs to item two.
3. Third item.
""")
- return
@app.cell
@@ -49,7 +48,6 @@ def _(mo):
)
for _marker in ["-", "*", "+"]
])
- return
@app.cell
@@ -61,7 +59,6 @@ def _(mo):
block. Display math at this indentation still has a pre-existing rendering
issue; this check only verifies that the content does not become code.
""")
- return
@app.cell
@@ -76,7 +73,6 @@ def _(mo):
)
for _rule in ["- - -", "* * *", "- --", "* **"]
])
- return
@app.cell
@@ -92,7 +88,6 @@ def _(mo):
Text after the equation.
- Second item.
""")
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/docs/docstrings.py b/marimo/_smoke_tests/docs/docstrings.py
index e79857f9d2..ea371ce559 100644
--- a/marimo/_smoke_tests/docs/docstrings.py
+++ b/marimo/_smoke_tests/docs/docstrings.py
@@ -8,7 +8,7 @@
import marimo
-__generated_with = "0.18.4"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@@ -17,6 +17,7 @@ def _():
import docstring_to_markdown
import marimo as mo
from marimo._utils.docs import google_docstring_to_markdown
+
return docstring_to_markdown, google_docstring_to_markdown, mo
@@ -25,7 +26,6 @@ def _(mo):
mo.md("""
This notebook compares `docstring_to_markdown` to our internal `google_docstring_to_markdown`.
""")
- return
@app.cell(hide_code=True)
@@ -49,19 +49,16 @@ def _(mo):
@app.cell(hide_code=True)
def _(element, mo):
mo.accordion({"MD doc": mo.plain_text(element.value.__doc__)})
- return
@app.cell
def _(docstring_to_markdown, element, mo):
mo.md(docstring_to_markdown.convert(element.value.__doc__))
- return
@app.cell
def _(element, google_docstring_to_markdown, mo):
mo.md(google_docstring_to_markdown(element.value.__doc__))
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/doctests.py b/marimo/_smoke_tests/doctests.py
index 3995e31784..5f63b6eb07 100644
--- a/marimo/_smoke_tests/doctests.py
+++ b/marimo/_smoke_tests/doctests.py
@@ -1,12 +1,13 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App()
@app.cell
def _():
import marimo as mo
+
return (mo,)
@@ -34,7 +35,6 @@ def euclid_mcd(a: int, b: int) -> int:
@app.cell
def _():
euclid_mcd(42, 42)
- return
@app.function
@@ -58,7 +58,6 @@ def _(mo):
import doctest
failures, success = doctest.testmod(verbose=True)
mo.md(f"Success: {success}, Failures: {failures}")
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/dropdowns.py b/marimo/_smoke_tests/dropdowns.py
index f072b01e7a..fc3a787f93 100644
--- a/marimo/_smoke_tests/dropdowns.py
+++ b/marimo/_smoke_tests/dropdowns.py
@@ -1,18 +1,20 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@app.cell(hide_code=True)
def _(mo):
- mo.md(r"""# dropdown""")
- return
+ mo.md(r"""
+ # dropdown
+ """)
@app.cell
def _():
import marimo as mo
+
return (mo,)
@@ -53,7 +55,6 @@ def _(dropdown1, dropdown2, dropdown3, dropdown4):
dropdown3,
dropdown4,
]
- return
@app.cell
@@ -65,7 +66,6 @@ def _(mo):
searchable=True,
allow_select_none=True,
)
- return
@app.cell
@@ -79,13 +79,13 @@ def _(mo):
@app.cell
def _(dropdown_mixed_types, mo):
mo.hstack([dropdown_mixed_types, dropdown_mixed_types.value])
- return
@app.cell(hide_code=True)
def _(mo):
- mo.md(r"""# multiselect""")
- return
+ mo.md(r"""
+ # multiselect
+ """)
@app.cell
@@ -128,13 +128,11 @@ def _(multiselect1, multiselect2, multiselect3, multiselect4):
multiselect3,
multiselect4,
]
- return
@app.cell
def _(mo, multiselect_mixed_types):
mo.hstack([multiselect_mixed_types, multiselect_mixed_types.value])
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/editable_df.py b/marimo/_smoke_tests/editable_df.py
index 55437532f6..1072c319f8 100644
--- a/marimo/_smoke_tests/editable_df.py
+++ b/marimo/_smoke_tests/editable_df.py
@@ -1,6 +1,6 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@@ -23,7 +23,7 @@ def _():
@app.cell
-def _(params, pd, pl):
+def _(params: list[str], pd, pl):
row_oriented = [
dict(Model=i, **{param: 0 for param in params}) for i in range(1, 5)
]
@@ -35,12 +35,19 @@ def _(params, pd, pl):
@app.cell
def _(mo):
- mo.md(r"""## Editing different inputs (dicts, lists, polars, pandas)""")
- return
+ mo.md(r"""
+ ## Editing different inputs (dicts, lists, polars, pandas)
+ """)
@app.cell(hide_code=True)
-def _(column_oriented, mo, pandas_df, polars_df, row_oriented):
+def _(
+ column_oriented: dict[str],
+ mo,
+ pandas_df,
+ polars_df,
+ row_oriented: list[dict],
+):
df = mo.ui.dropdown(
{
"polars": polars_df,
@@ -70,7 +77,6 @@ def _(edited, mo):
flatten_edits(edited._edits["edits"]),
]
)
- return
@app.function
@@ -83,8 +89,9 @@ def flatten_edits(edits):
@app.cell
def _(mo):
- mo.md(r"""## Editing different data types""")
- return
+ mo.md(r"""
+ ## Editing different data types
+ """)
@app.cell
@@ -108,13 +115,12 @@ def _(pd):
@app.cell
-def _(pl, varying_data):
+def _(pl, varying_data: dict):
pl.DataFrame(varying_data).schema
- return
@app.cell
-def _(mo, pl, varying_data):
+def _(mo, pl, varying_data: dict):
edited_df = mo.ui.data_editor(pl.DataFrame(varying_data))
edited_df
return (edited_df,)
@@ -123,7 +129,6 @@ def _(mo, pl, varying_data):
@app.cell
def _(edited_df):
edited_df.value
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/errors.py b/marimo/_smoke_tests/errors.py
index fcffb84fea..9fe5028166 100644
--- a/marimo/_smoke_tests/errors.py
+++ b/marimo/_smoke_tests/errors.py
@@ -2,7 +2,7 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App()
@@ -26,20 +26,17 @@ def _(x):
@app.cell
-def _(b):
+def _(b: int):
a = 0
del b
c = 0
- return
app._unparsable_cell(
r"""
-
- a =
-
+ a =
""",
- name="_"
+ name="_",
)
diff --git a/marimo/_smoke_tests/errors/toasts.py b/marimo/_smoke_tests/errors/toasts.py
index 9ac4d65fc1..51e09afe03 100644
--- a/marimo/_smoke_tests/errors/toasts.py
+++ b/marimo/_smoke_tests/errors/toasts.py
@@ -1,6 +1,6 @@
import marimo
-__generated_with = "0.23.14"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@@ -18,7 +18,6 @@ def _(mo):
Trigger each case and check: wrapping, scrolling, text selection, and copy.
""")
- return
@app.cell
@@ -31,25 +30,25 @@ def cases(mo):
"chrome-headless-shell-mac-arm64/chrome-headless-shell"
)
PLAYWRIGHT_ERR = f"""\
-BrowserType.launch: Executable doesn't exist at {LONG_PATH}
-╔════════════════════════════════════════════════════════════╗
-║ Looks like Playwright was just installed or updated. ║
-║ Please run the following command to download new browsers: ║
-║ ║
-║ playwright install ║
-║ ║
-║ <3 Playwright Team ║
-╚════════════════════════════════════════════════════════════╝"""
+ BrowserType.launch: Executable doesn't exist at {LONG_PATH}
+ ╔════════════════════════════════════════════════════════════╗
+ ║ Looks like Playwright was just installed or updated. ║
+ ║ Please run the following command to download new browsers: ║
+ ║ ║
+ ║ playwright install ║
+ ║ ║
+ ║ <3 Playwright Team ║
+ ╚════════════════════════════════════════════════════════════╝"""
LONG_STACK = """\
-Traceback (most recent call last):
- File "/Users/example/src/marimo/marimo/_server/export/_pdf_raster.py", line 601, in rasterize
- async with async_playwright() as playwright:
- File "/Users/example/src/marimo/marimo/_server/api/endpoints/export.py", line 142, in export_as_pdf
- pdf_bytes = await export_pdf(request)
- File "/Users/example/.local/share/uv/tools/marimo/lib/python3.12/site-packages/playwright/_impl/_connection.py", line 59, in send
- return await self._inner_send(method, dict(params), False)
-playwright._impl._errors.Error: BrowserType.launch: Executable doesn't exist
-"""
+ Traceback (most recent call last):
+ File "/Users/example/src/marimo/marimo/_server/export/_pdf_raster.py", line 601, in rasterize
+ async with async_playwright() as playwright:
+ File "/Users/example/src/marimo/marimo/_server/api/endpoints/export.py", line 142, in export_as_pdf
+ pdf_bytes = await export_pdf(request)
+ File "/Users/example/.local/share/uv/tools/marimo/lib/python3.12/site-packages/playwright/_impl/_connection.py", line 59, in send
+ return await self._inner_send(method, dict(params), False)
+ playwright._impl._errors.Error: BrowserType.launch: Executable doesn't exist
+ """
def fire_toast(
title: str, description: str, *, as_html: bool = False, kind="danger"
@@ -78,7 +77,15 @@ playwright._impl._errors.Error: BrowserType.launch: Executable doesn't exist
@app.cell
-def trigger(LONG_PATH, LONG_STACK, PLAYWRIGHT_ERR, cases, fire, fire_toast, mo):
+def trigger(
+ LONG_PATH: str,
+ LONG_STACK: str,
+ PLAYWRIGHT_ERR: str,
+ cases,
+ fire,
+ fire_toast,
+ mo,
+):
if fire.value:
choice = cases.value
if choice == "short":
@@ -98,7 +105,6 @@ def trigger(LONG_PATH, LONG_STACK, PLAYWRIGHT_ERR, cases, fire, fire_toast, mo):
fire_toast("Failed to download", LONG_STACK, as_html=True)
elif choice == "success":
mo.status.toast("All good", "This is a short success toast.")
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/files/cloudpath_file_browser.py b/marimo/_smoke_tests/files/cloudpath_file_browser.py
index cadb31f136..8401df13ff 100644
--- a/marimo/_smoke_tests/files/cloudpath_file_browser.py
+++ b/marimo/_smoke_tests/files/cloudpath_file_browser.py
@@ -1,12 +1,13 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@app.cell
def _():
import marimo as mo
+
return (mo,)
@@ -14,7 +15,6 @@ def _():
def _(mo):
file_browser = mo.ui.file_browser()
file_browser
- return
@app.cell
@@ -26,7 +26,7 @@ def _():
@app.cell
-def _(BUCKET):
+def _(BUCKET: str):
from cloudpathlib import CloudPath
# dispatches to S3Path based on prefix
@@ -38,7 +38,6 @@ def _(BUCKET):
@app.cell
def _(cloud_file_browser):
cloud_file_browser.value
- return
@app.cell
@@ -51,25 +50,21 @@ def _(mo, root_dir):
@app.cell
def _(cloud_file_browser):
[f.path.is_dir() for f in cloud_file_browser.value]
- return
@app.cell
def _(cloud_file_browser):
[type(f.path) for f in cloud_file_browser.value]
- return
@app.cell
def _(cloud_file_browser):
[f.path for f in cloud_file_browser.value]
- return
@app.cell
def _(cloud_file_browser):
[f.path.read_text() for f in cloud_file_browser.value]
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/formatters/ibis_opinionated_formatters.py b/marimo/_smoke_tests/formatters/ibis_opinionated_formatters.py
index dd12168738..245b4f5d73 100644
--- a/marimo/_smoke_tests/formatters/ibis_opinionated_formatters.py
+++ b/marimo/_smoke_tests/formatters/ibis_opinionated_formatters.py
@@ -7,7 +7,7 @@
import marimo
-__generated_with = "0.17.7"
+__generated_with = "0.25.2"
app = marimo.App(width="medium", auto_download=["html", "ipynb"])
@@ -15,6 +15,7 @@ app = marimo.App(width="medium", auto_download=["html", "ipynb"])
def _():
import ibis
import marimo as mo
+
return ibis, mo
@@ -41,34 +42,29 @@ def _(con):
@app.cell
def _(t):
t.schema()
- return
@app.cell
def _(t):
t._find_backends()
- return
@app.cell
def _(t):
# This should render the opinionated table, somewhat fast, without fetching the full dataframe into memory
t
- return
@app.cell
def _(t):
# This should render the opinionated table, somewhat fast, without fetching the full dataframe into memory
t.limit(10)
- return
@app.cell
def _(mo, t):
# Should show a plain HTML table from ibis
mo.plain(t)
- return
@app.cell
diff --git a/marimo/_smoke_tests/formatters/inspect_things.py b/marimo/_smoke_tests/formatters/inspect_things.py
index b1389c66fb..1082228d8a 100644
--- a/marimo/_smoke_tests/formatters/inspect_things.py
+++ b/marimo/_smoke_tests/formatters/inspect_things.py
@@ -1,6 +1,6 @@
import marimo
-__generated_with = "0.16.2"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@@ -9,19 +9,18 @@ def _():
import marimo as mo
import numpy as np
import functools
+
return functools, mo, np
@app.cell
def _(mo):
mo.inspect(mo, value=False)
- return
@app.cell
def _(mo, np):
mo.inspect(np)
- return
@app.cell
@@ -38,7 +37,6 @@ def _():
fib
- return
@app.class_definition
@@ -59,37 +57,31 @@ class Foo:
@app.cell
def _():
Foo
- return
@app.cell
def _():
Foo.__init__
- return
@app.cell
def _():
Foo.__str__
- return
@app.cell
def _():
Foo.bar
- return
@app.cell
def _():
Foo().bar
- return
@app.cell
def _():
Foo._baz
- return
@app.cell
@@ -100,21 +92,18 @@ def _(functools):
square
- return
@app.cell
def _():
lambda_func = lambda x: x * 2
lambda_func
- return
@app.cell
def _():
# built in
len
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/forms.py b/marimo/_smoke_tests/forms.py
index 7591cfa949..514b918691 100644
--- a/marimo/_smoke_tests/forms.py
+++ b/marimo/_smoke_tests/forms.py
@@ -2,7 +2,7 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App()
@@ -10,13 +10,15 @@ app = marimo.App()
def _():
import marimo as mo
import random
+
return mo, random
@app.cell
def _(mo):
- mo.md("# Basic form")
- return
+ mo.md("""
+ # Basic form
+ """)
@app.cell
@@ -55,18 +57,15 @@ def _(form_1, mo, random):
form_1.value,
]
)
- return
@app.cell
def _(mo):
- mo.md(
- """
+ mo.md("""
-------
- # Validating forms"""
- )
- return
+ # Validating forms
+ """)
@app.cell
@@ -119,17 +118,14 @@ def _(form_2, mo, random):
form_2.value,
]
)
- return
@app.cell
def _(mo):
- mo.md(
- """
+ mo.md("""
------
- # Dictionary"""
- )
- return
+ # Dictionary
+ """)
@app.cell
@@ -159,7 +155,6 @@ def _(dict, mo):
dict.value,
]
)
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/from_series.py b/marimo/_smoke_tests/from_series.py
index 6cb46a86d8..adb6827428 100644
--- a/marimo/_smoke_tests/from_series.py
+++ b/marimo/_smoke_tests/from_series.py
@@ -9,7 +9,7 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@@ -17,6 +17,7 @@ app = marimo.App(width="medium")
def _():
import marimo as mo
from vega_datasets import data
+
return data, mo
@@ -30,37 +31,31 @@ def _(data):
@app.cell
def _(mo, polars_df):
mo.ui.slider.from_series(polars_df["Cylinders"])
- return
@app.cell
def _(mo, polars_df):
mo.ui.number.from_series(polars_df["Cylinders"])
- return
@app.cell
def _(mo, polars_df):
mo.ui.radio.from_series(polars_df["Origin"])
- return
@app.cell
def _(mo, polars_df):
mo.ui.dropdown.from_series(polars_df["Origin"])
- return
@app.cell
def _(mo, polars_df):
mo.ui.multiselect.from_series(polars_df["Origin"])
- return
@app.cell
def _(mo, polars_df):
mo.ui.date.from_series(polars_df["Year"])
- return
@app.cell
@@ -74,7 +69,6 @@ def _(data, mo):
mo.ui.multiselect.from_series(pandas_df["Origin"]),
mo.ui.date.from_series(pandas_df["Year"])
]
- return
@app.cell
diff --git a/marimo/_smoke_tests/full_width.py b/marimo/_smoke_tests/full_width.py
index b43a89f1ae..fbc411f648 100644
--- a/marimo/_smoke_tests/full_width.py
+++ b/marimo/_smoke_tests/full_width.py
@@ -8,13 +8,14 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App()
@app.cell
def _():
import marimo as mo
+
return (mo,)
@@ -28,43 +29,36 @@ def _(mo):
@app.cell
def _(checkbox, mo):
mo.ui.text(label="Text", full_width=checkbox.value)
- return
@app.cell
def _(checkbox, mo):
mo.ui.text_area(label="Text area", full_width=checkbox.value)
- return
@app.cell
def _(checkbox, mo):
mo.ui.number(0, 10, label="Number", full_width=checkbox.value)
- return
@app.cell
def _(checkbox, mo):
mo.ui.dropdown(label="Dropdown", options=["A", "B", "C"], full_width=checkbox.value)
- return
@app.cell
def _(checkbox, mo):
mo.ui.multiselect(label="Multiselect", options=["A", "B", "C"], full_width=checkbox.value)
- return
@app.cell
def _(checkbox, mo):
mo.ui.date(label="Date", full_width=checkbox.value)
- return
@app.cell
def _(checkbox, mo):
mo.ui.button(label="Button", full_width=checkbox.value)
- return
@app.cell
@@ -74,7 +68,6 @@ def _(checkbox, mo):
mo.ui.text(label="Input A", full_width=checkbox.value),
mo.ui.text(label="Input B", full_width=checkbox.value)
])
- return
@app.cell
@@ -83,7 +76,6 @@ def _(checkbox, mo):
mo.ui.text(label="Input A", full_width=checkbox.value),
mo.ui.text(label="Input B", full_width=checkbox.value)
])
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/grid.py b/marimo/_smoke_tests/grid.py
index 07f772e316..0b1cb86096 100644
--- a/marimo/_smoke_tests/grid.py
+++ b/marimo/_smoke_tests/grid.py
@@ -2,7 +2,7 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(layout_file="layouts/grid.grid.json")
@@ -25,12 +25,13 @@ def _(mo):
@app.cell
def _(mo):
- mo.md("""# Horizontal Stack: `hstack`""")
- return
+ mo.md("""
+ # Horizontal Stack: `hstack`
+ """)
@app.cell
-def _(align, boxes, gap, justify, mo, wrap):
+def _(align, boxes: list, gap, justify, mo, wrap):
mo.hstack(
boxes,
align=align.value,
@@ -38,23 +39,22 @@ def _(align, boxes, gap, justify, mo, wrap):
gap=gap.value,
wrap=wrap.value,
)
- return
@app.cell
def _(mo):
- mo.md("""# Vertical Stack: `vstack`""")
- return
+ mo.md("""
+ # Vertical Stack: `vstack`
+ """)
@app.cell
-def _(align, boxes, gap, mo):
+def _(align, boxes: list, gap, mo):
mo.vstack(
boxes,
align=align.value,
gap=gap.value,
)
- return
@app.cell
@@ -73,6 +73,7 @@ def _(mo, size):
@app.cell
def _():
import marimo as mo
+
return (mo,)
diff --git a/marimo/_smoke_tests/ibis_example.py b/marimo/_smoke_tests/ibis_example.py
index 741508b8d0..5d996bbc55 100644
--- a/marimo/_smoke_tests/ibis_example.py
+++ b/marimo/_smoke_tests/ibis_example.py
@@ -7,7 +7,7 @@
import marimo
-__generated_with = "0.16.3"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@@ -15,6 +15,7 @@ app = marimo.App(width="medium")
def _():
import marimo as mo
import ibis
+
return ibis, mo
@@ -32,13 +33,11 @@ def _(ibis):
def _(df, mo):
# Print Ibis data in a pretty table
mo.ui.table(df)
- return
@app.cell
def _(df):
df.to_polars()
- return
@app.cell
@@ -46,7 +45,6 @@ def _(df):
# Transform using the python API
_res = df.group_by("species", "island").agg(count=df.count()).order_by("count")
df.to_polars()
- return
@app.cell
@@ -56,14 +54,12 @@ def _(df):
"SELECT species, island, count(*) AS count FROM penguins GROUP BY 1, 2"
)
_res.to_polars()
- return
@app.cell
def _(df, mo):
# Transform using the ui.dataframe GUI
mo.ui.dataframe(df)
- return
@app.cell
@@ -75,7 +71,6 @@ def _(ibis):
"y": [["a", "b", "c"], [], [], ["d", "e"]],
}
).unnest("x").to_polars()
- return
@app.cell
@@ -84,7 +79,6 @@ def _(ibis):
ibis.memtable({"A": [{"foo": 1, "bar": "hello"}], "B": [1]}).unpack(
"A"
).to_polars()
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/ibis_formatting.py b/marimo/_smoke_tests/ibis_formatting.py
index 7dd42332c6..52ef8c7d0e 100644
--- a/marimo/_smoke_tests/ibis_formatting.py
+++ b/marimo/_smoke_tests/ibis_formatting.py
@@ -9,7 +9,7 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@@ -18,6 +18,7 @@ def _():
import ibis
import polars as pl
import marimo as mo
+
return ibis, pl
@@ -25,7 +26,6 @@ def _():
def _():
from ibis import _
from datetime import datetime
- return
@app.cell
@@ -41,7 +41,7 @@ def _():
@app.cell
-def _(ibis, test_data):
+def _(ibis, test_data: dict):
t = ibis.memtable(test_data)
return (t,)
@@ -52,7 +52,6 @@ def _(ibis, t):
ibis.options.interactive = False
t
- return
@app.cell
@@ -61,7 +60,6 @@ def _(ibis, t):
ibis.options.interactive = False
t.struct
- return
@app.cell
@@ -70,7 +68,6 @@ def _(ibis, t):
ibis.options.interactive = False
t.floats.min()
- return
@app.cell
@@ -79,7 +76,6 @@ def _(ibis, t):
ibis.options.interactive = True
t
- return
@app.cell
@@ -88,7 +84,6 @@ def _(ibis, t):
ibis.options.interactive = True
t.struct
- return
@app.cell
@@ -97,7 +92,6 @@ def _(ibis, t):
ibis.options.interactive = True
t.list.first()
- return
@app.cell
@@ -106,7 +100,6 @@ def _(ibis, t):
ibis.options.interactive = True
t.floats.min()
- return
@app.cell
@@ -130,7 +123,6 @@ def _(ibis, joined):
ibis.options.interactive = False
joined
- return
@app.cell
@@ -139,7 +131,6 @@ def _(ibis, joined):
ibis.options.interactive = True
joined
- return
@app.cell
@@ -162,7 +153,6 @@ def _(ibis, pl_connection):
ibis.options.interactive = False
pl_connection.table("band_members")
- return
@app.cell
@@ -171,7 +161,6 @@ def _(ibis, pl_connection):
ibis.options.interactive = False
pl_connection.table("band_members").name.first()
- return
@app.cell
@@ -180,7 +169,6 @@ def _(ibis, pl_connection):
ibis.options.interactive = True
pl_connection.table("band_members")
- return
@app.cell
@@ -189,7 +177,6 @@ def _(ibis, pl_connection):
ibis.options.interactive = True
pl_connection.table("band_members").name.first()
- return
@app.cell
@@ -205,7 +192,6 @@ def _(duckdb_table, ibis):
ibis.options.interactive = False
duckdb_table
- return
@app.cell
@@ -214,7 +200,6 @@ def _(duckdb_table, ibis):
ibis.options.interactive = True
duckdb_table
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/icons.py b/marimo/_smoke_tests/icons.py
index 78c503f862..fba0a18ccb 100644
--- a/marimo/_smoke_tests/icons.py
+++ b/marimo/_smoke_tests/icons.py
@@ -8,20 +8,22 @@
import marimo
-__generated_with = "0.17.3"
+__generated_with = "0.25.2"
app = marimo.App()
@app.cell
def _():
import marimo as mo
+
return (mo,)
@app.cell
def _(mo):
- mo.md(r"""::lucide:alarm-clock::""")
- return
+ mo.md(r"""
+ ::lucide:alarm-clock::
+ """)
@app.cell(hide_code=True)
@@ -37,7 +39,6 @@ def _(mo):
],
justify="start",
)
- return
@app.cell
@@ -52,7 +53,6 @@ def _(mo):
],
justify="start",
)
- return
@app.cell
@@ -67,7 +67,6 @@ def _(mo):
],
justify="start",
)
- return
@app.cell
@@ -87,13 +86,11 @@ def _(mo):
],
justify="start",
)
- return
@app.cell
def _(mo):
mo.md(f"""## {mo.icon('material-symbols:edit')} Icons in markdown""")
- return
@app.cell
@@ -105,7 +102,6 @@ def _(mo):
f"{mo.icon('material-symbols:group-remove')} Remove": mo.md("Tab 3"),
}
)
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/img_rerender.py b/marimo/_smoke_tests/img_rerender.py
index 1bd888e718..1defb4e3f2 100644
--- a/marimo/_smoke_tests/img_rerender.py
+++ b/marimo/_smoke_tests/img_rerender.py
@@ -12,7 +12,7 @@
import marimo
-__generated_with = "0.23.5"
+__generated_with = "0.25.2"
app = marimo.App()
@@ -47,14 +47,13 @@ def _(mo):
@app.cell
-def _(choice, mo, sets):
+def _(choice, mo, sets: dict[str, list[str]]):
urls = sets[choice.value]
imgs = "".join(
f'<img src="{u}" width="120" height="120" style="margin:4px"/>'
for u in urls
)
mo.Html(f'<div>{imgs}</div>')
- return
@app.cell
@@ -66,7 +65,6 @@ def _(mo):
- Open devtools and confirm the rendered `<img>` `src` attributes
match the selected set, and that the painted images match too.
""")
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/import_named_cells.py b/marimo/_smoke_tests/import_named_cells.py
index ec3b02e6b0..0d65170070 100644
--- a/marimo/_smoke_tests/import_named_cells.py
+++ b/marimo/_smoke_tests/import_named_cells.py
@@ -2,26 +2,29 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App()
@app.cell
def _():
import marimo as mo
+
return (mo,)
@app.cell
def _():
from named_cells import display_slider, display_element
+
return display_element, display_slider
@app.cell
def _(mo):
- mo.md("""**A cell that creates and shows a slider**""")
- return
+ mo.md("""
+ **A cell that creates and shows a slider**
+ """)
@app.cell
@@ -33,26 +36,26 @@ def _(display_slider):
@app.cell
def _(mo):
- mo.md("""_Notice that set-ui-element value requests make it into the defs_""")
- return
+ mo.md("""
+ _Notice that set-ui-element value requests make it into the defs_
+ """)
@app.cell
def _(slider_defs):
slider_defs
- return
@app.cell
def _(slider_defs):
slider_defs["slider"].value
- return
@app.cell
def _(mo):
- mo.md("""**A cell that shows a parametrizable UI element**""")
- return
+ mo.md("""
+ **A cell that shows a parametrizable UI element**
+ """)
@app.cell
@@ -66,7 +69,6 @@ def _(display_element, mo):
@app.cell
def _(text):
text.value
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/initial_table.py b/marimo/_smoke_tests/initial_table.py
index a76b072565..4240c8efd5 100644
--- a/marimo/_smoke_tests/initial_table.py
+++ b/marimo/_smoke_tests/initial_table.py
@@ -8,13 +8,14 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@app.cell
def _():
import marimo as mo
+
return (mo,)
@@ -38,7 +39,6 @@ def _(mo, sample_df):
mo.output.replace(sample_df)
time.sleep(5)
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/inline_theme_dark.py b/marimo/_smoke_tests/inline_theme_dark.py
index 3c86e5bd4c..199abf7371 100644
--- a/marimo/_smoke_tests/inline_theme_dark.py
+++ b/marimo/_smoke_tests/inline_theme_dark.py
@@ -11,7 +11,7 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App()
@@ -24,14 +24,11 @@ def _():
@app.cell
def _(mo):
- mo.md(
- """
- This notebook sets `theme = "dark"` via inline `[tool.marimo.display]`
- metadata. It should render in dark mode even when opened from a
- directory listing (`marimo run marimo/_smoke_tests`). See #10056.
- """
- )
- return
+ mo.md("""
+ This notebook sets `theme = "dark"` via inline `[tool.marimo.display]`
+ metadata. It should render in dark mode even when opened from a
+ directory listing (`marimo run marimo/_smoke_tests`). See #10056.
+ """)
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/inputs.py b/marimo/_smoke_tests/inputs.py
index 61fd8cf8c2..6d932d15f8 100644
--- a/marimo/_smoke_tests/inputs.py
+++ b/marimo/_smoke_tests/inputs.py
@@ -2,13 +2,14 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App()
@app.cell
def _():
import marimo as mo
+
return (mo,)
@@ -32,7 +33,6 @@ def _(disabled, mo):
),
]
)
- return
@app.cell
@@ -49,15 +49,13 @@ def _(mo):
@app.cell
-def _(mo, options):
+def _(mo, options: list[str]):
mo.ui.radio(options, label="Radio buttons")
- return
@app.cell
-def _(mo, options):
+def _(mo, options: list[str]):
mo.ui.radio(options, label="Radio buttons", inline=True)
- return
@app.cell
@@ -65,7 +63,6 @@ def _(mo):
slider = mo.ui.slider(0, 10, label="Horizontal slider")
vslider = mo.ui.slider(0, 10, orientation="vertical", label="Vertical slider")
mo.hstack([slider, vslider])
- return
@app.cell
@@ -75,7 +72,6 @@ def _(mo):
0, 100, orientation="vertical", label="Vertical slider", show_value=True
)
mo.hstack([_slider, _vslider])
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/inputs/keyboard_shortcuts.py b/marimo/_smoke_tests/inputs/keyboard_shortcuts.py
index 477d6d9001..e05dbbf2ad 100644
--- a/marimo/_smoke_tests/inputs/keyboard_shortcuts.py
+++ b/marimo/_smoke_tests/inputs/keyboard_shortcuts.py
@@ -13,7 +13,7 @@
import marimo
-__generated_with = "0.22.0"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@@ -33,7 +33,6 @@ def _(mo):
Pressing **K** while focused in any input should type the letter,
*not* trigger the button.
""")
- return
@app.cell
@@ -63,7 +62,6 @@ def _(fire_count, mo, trigger_button):
mo.md("---"),
]
)
- return
@app.cell
@@ -71,7 +69,6 @@ def _(mo):
mo.md("""
## Edge Case: Single-key shortcut vs text input
""")
- return
@app.cell
@@ -81,7 +78,6 @@ def _(mo):
placeholder="type here…",
)
text_input
- return
@app.cell
@@ -91,7 +87,6 @@ def _(mo):
placeholder="type here…",
)
text_area
- return
@app.cell
@@ -103,7 +98,6 @@ def _(mo):
value=42,
)
number_input
- return
@app.cell
@@ -113,7 +107,6 @@ def _(mo):
options=["apple", "kiwi", "kumquat"],
)
dropdown
- return
@app.cell
@@ -121,7 +114,6 @@ def _(mo):
mo.md("""
## Edge Case: Modifier-key shortcut
""")
- return
@app.cell
@@ -143,7 +135,7 @@ def _(mo):
@app.cell
-def _(key, mo, mod_button, mod_count):
+def _(key: str, mo, mod_button, mod_count):
mc = mod_count()
mo.vstack(
[
@@ -155,7 +147,6 @@ def _(key, mo, mod_button, mod_count):
),
]
)
- return
@app.cell
@@ -163,7 +154,6 @@ def _(mo):
mo.md("""
## Edge Case: Multiple buttons with different single-key shortcuts
""")
- return
@app.cell
@@ -198,7 +188,6 @@ def _(a_count, b_count, btn_a, btn_b, mo):
),
]
)
- return
@app.cell
@@ -208,7 +197,6 @@ def _(mo):
placeholder="type here…",
)
multi_text
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/inputs/numbers.py b/marimo/_smoke_tests/inputs/numbers.py
index 2b5f4b5730..330ca9f46d 100644
--- a/marimo/_smoke_tests/inputs/numbers.py
+++ b/marimo/_smoke_tests/inputs/numbers.py
@@ -1,37 +1,38 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@app.cell
def _():
import marimo as mo
+
return (mo,)
@app.cell
def _(mo):
- mo.md(r"""## Basic""")
- return
+ mo.md(r"""
+ ## Basic
+ """)
@app.cell
def _(mo):
mo.ui.number()
- return
@app.cell
def _(mo):
mo.ui.number(-10, 10)
- return
@app.cell
def _(mo):
- mo.md(r"""## Edge cases""")
- return
+ mo.md(r"""
+ ## Edge cases
+ """)
@app.cell
@@ -48,7 +49,6 @@ def _(mo):
@app.cell
def _(v):
v.value
- return
@app.cell
@@ -67,7 +67,6 @@ def _(mo, on_change):
# Cannot set infinity as range
mo.ui.number(start=-np.inf, stop=np.inf, value=5, on_change=on_change)
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/ipython/progress.py b/marimo/_smoke_tests/ipython/progress.py
index c61bd7b1c3..98e96b9d5b 100644
--- a/marimo/_smoke_tests/ipython/progress.py
+++ b/marimo/_smoke_tests/ipython/progress.py
@@ -1,6 +1,6 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@@ -9,6 +9,7 @@ def __1():
import time
from transformers.utils.notebook import NotebookProgressCallback
from transformers.training_args import IntervalStrategy
+
return IntervalStrategy, NotebookProgressCallback, time
@@ -59,7 +60,6 @@ def _(
simulate_transformers_training()
- return
@app.cell
@@ -82,6 +82,7 @@ def _(IntervalStrategy):
class MockTrainingControl:
def __init__(self):
pass
+
return MockTrainingArgs, MockTrainingControl, MockTrainingState
diff --git a/marimo/_smoke_tests/issues/1033.py b/marimo/_smoke_tests/issues/1033.py
index 5b438bd62d..753ef5fcf0 100644
--- a/marimo/_smoke_tests/issues/1033.py
+++ b/marimo/_smoke_tests/issues/1033.py
@@ -12,7 +12,7 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@@ -22,7 +22,6 @@ def _(az):
az.plot_autocorr(_data)
# [az.plot_autocorr(_data),
# type(az.plot_autocorr(_data))]
- return
@app.cell
@@ -32,7 +31,6 @@ def _(az, np):
az.plot_bf(_idata, var_name="a", ref_val=0)
# [az.plot_bf(_idata, var_name="a", ref_val=0),
# type(az.plot_bf(_idata, var_name="a", ref_val=0))]
- return
@app.cell
@@ -40,7 +38,6 @@ def _(az, np):
_data = az.load_arviz_data("regression1d")
# [az.plot_bpv(_data, kind="t_stat", t_stat=lambda x:np.percentile(x, q=50, axis=-1)), type(az.plot_bpv(_data, kind="t_stat", t_stat=lambda x:np.percentile(x, q=50, axis=-1)))]
az.plot_bpv(_data, kind="t_stat", t_stat=lambda x:np.percentile(x, q=50, axis=-1))
- return
@app.cell
@@ -49,7 +46,6 @@ def _(az):
'Non-centered 8 schools': az.load_arviz_data('non_centered_eight')})
# [az.plot_compare(_model_compare), type(az.plot_compare(_model_compare))]
az.plot_compare(_model_compare)
- return
@app.cell
@@ -58,7 +54,6 @@ def _(az):
_non_centered = az.load_arviz_data('non_centered_eight')
# [az.plot_density([_centered, _non_centered]), type(az.plot_density([_centered, _non_centered]))]
az.plot_density([_centered, _non_centered])
- return
@app.cell
@@ -74,7 +69,6 @@ def _(az, np):
_values = np.random.normal(0, 1, 500)
# [az.plot_dot(_values), type(az.plot_dot(_values))]
az.plot_dot(_values)
- return
@app.cell
@@ -83,7 +77,6 @@ def _(az, norm, np):
_npoints = 100
# [az.plot_ecdf(_sample, eval_points=np.linspace(_sample.min(), _sample.max(), _npoints)), type(az.plot_ecdf(_sample, eval_points=np.linspace(_sample.min(), _sample.max(), _npoints)))]
az.plot_ecdf(_sample, eval_points=np.linspace(_sample.min(), _sample.max(), _npoints))
- return
@app.cell
@@ -101,7 +94,6 @@ def _(az):
{"centered model": _idata1, "non centered model": _idata2},
xlabels=True
)
- return
@app.cell
@@ -109,7 +101,6 @@ def _(az):
_data = az.load_arviz_data('centered_eight')
# [az.plot_energy(_data), type(az.plot_energy(_data))]
az.plot_energy(_data)
- return
@app.cell
@@ -124,7 +115,6 @@ def _(az):
# ), type(az.plot_ess(
# _idata, kind="local", var_names=["mu", "theta"], coords=_coords
# ))]
- return
@app.cell
@@ -138,7 +128,6 @@ def _(az):
figsize=(9, 7))
_axes[0].set_title('Estimated theta for 8 schools model')
# [_axes, type(_axes)]
- return
@app.cell
@@ -152,7 +141,6 @@ def _(az, np):
_y_data = np.random.normal(2 + _mu * 0.5, 0.5, size = (2, 50, 100))
# [az.plot_hdi(_x_data, _y_data), type(az.plot_hdi(_x_data, _y_data))]
az.plot_hdi(_x_data, _y_data)
- return
@app.cell
@@ -162,7 +150,6 @@ def _(az, np):
_tau_posterior = np.concatenate(_non_centered.posterior["tau"].values)
# [az.plot_kde(_mu_posterior), type(az.plot_kde(_mu_posterior))]
az.plot_kde(_mu_posterior)
- return
@app.cell
@@ -171,7 +158,6 @@ def _(az):
_loo_radon = az.loo(_radon, pointwise=True)
# [az.plot_khat(_loo_radon, show_bins=True), type(az.plot_khat(_loo_radon, show_bins=True))]
az.plot_khat(_loo_radon, show_bins=True)
- return
@app.cell
@@ -179,7 +165,6 @@ def _(az):
_idata = az.load_arviz_data("radon")
# [az.plot_loo_pit(idata=_idata, y="y"), type(az.plot_loo_pit(idata=_idata, y="y"))]
az.plot_loo_pit(idata=_idata, y="y")
- return
@app.cell
@@ -190,7 +175,6 @@ def _(az, np, xr):
# [az.plot_lm(idata=_idata, y="y", x=_x), type(az.plot_lm(idata=_idata, y="y", x=_x))]
az.plot_lm(idata=_idata, y="y", x=_x)
- return
@app.cell
@@ -205,7 +189,6 @@ def _(az):
az.plot_mcse(
_idata, var_names=["mu", "theta"], coords=_coords
)
- return
@app.cell
@@ -229,7 +212,6 @@ def _(az):
coords=_coords,
divergences=True,
textsize=18)
- return
@app.cell
@@ -238,7 +220,6 @@ def _(az):
# [az.plot_parallel(_data, var_names=["mu", "tau"]), type(az.plot_parallel(_data, var_names=["mu", "tau"]))]
az.plot_parallel(_data, var_names=["mu", "tau"])
# plt.show()
- return
@app.cell
@@ -246,7 +227,6 @@ def _(az):
_data = az.load_arviz_data('centered_eight')
# [az.plot_posterior(_data), type(az.plot_posterior(_data))]
az.plot_posterior(_data)
- return
@app.cell
@@ -255,7 +235,6 @@ def _(az):
# [az.plot_ppc(_data, data_pairs={"y":"y"}), type(az.plot_ppc(_data, data_pairs={"y":"y"}))]
az.plot_ppc(_data, data_pairs={"y":"y"})
# plt.gca()
- return
@app.cell
@@ -264,7 +243,6 @@ def _(az, plt):
# [az.plot_rank(_data), type(az.plot_rank(_data))]
az.plot_rank(_data)
plt.gca()
- return
@app.cell
@@ -272,7 +250,6 @@ def _(az):
_idata = az.load_arviz_data('classification10d')
# [az.plot_separation(idata=_idata, y='outcome', y_hat='outcome', figsize=(8, 1)), type(az.plot_separation(idata=_idata, y='outcome', y_hat='outcome', figsize=(8, 1)))]
az.plot_separation(idata=_idata, y='outcome', y_hat='outcome', figsize=(8, 1))
- return
@app.cell
@@ -281,7 +258,6 @@ def _(az):
_coords = {'school': ['Choate', 'Lawrenceville']}
# [az.plot_trace(_data, var_names=('theta'), filter_vars="like", coords=_coords), type(az.plot_trace(_data, var_names=('theta'), filter_vars="like", coords=_coords))]
az.plot_trace(_data, var_names=('theta'), filter_vars="like", coords=_coords)
- return
@app.cell
@@ -308,14 +284,12 @@ def _(az, np):
ax = az.plot_ts(idata=_idata, y="y", y_holdout="z")
# [ax, type(ax)]
ax
- return
@app.cell
def _(az):
_data = az.load_arviz_data('centered_eight')
az.plot_violin(_data)
- return
@app.cell(hide_code=True)
@@ -327,6 +301,7 @@ def _():
import matplotlib.pyplot as plt
import xarray as xr
from scipy.stats import uniform, norm
+
return az, norm, np, plt, xr
diff --git a/marimo/_smoke_tests/issues/1055.py b/marimo/_smoke_tests/issues/1055.py
index bfe1b7d08a..8290f61faa 100644
--- a/marimo/_smoke_tests/issues/1055.py
+++ b/marimo/_smoke_tests/issues/1055.py
@@ -2,20 +2,18 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App()
@app.cell
def _():
import manim_slides
- return
@app.cell
def _():
print(1)
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/issues/1064.py b/marimo/_smoke_tests/issues/1064.py
index 8d02144596..7cd10e0508 100644
--- a/marimo/_smoke_tests/issues/1064.py
+++ b/marimo/_smoke_tests/issues/1064.py
@@ -2,7 +2,7 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="full")
@@ -10,13 +10,15 @@ app = marimo.App(width="full")
def _():
import marimo as mo
import plotly.express as px
+
return mo, px
@app.cell
def _(mo):
- mo.md("# Issue 1064")
- return
+ mo.md("""
+ # Issue 1064
+ """)
@app.cell
@@ -49,7 +51,6 @@ def _(mo, plot1, plot2, tabs):
mo.vstack([tabs.center(), render_tab_content()])
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/issues/1107.py b/marimo/_smoke_tests/issues/1107.py
index 11e5fa7ffc..1e773a5f30 100644
--- a/marimo/_smoke_tests/issues/1107.py
+++ b/marimo/_smoke_tests/issues/1107.py
@@ -2,13 +2,14 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App()
@app.cell
def _():
import marimo as mo
+
return (mo,)
@@ -22,7 +23,6 @@ def _(mo):
@app.cell
def _(v):
v.value
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/issues/1140.py b/marimo/_smoke_tests/issues/1140.py
index 9eee5572aa..ae7f6ca764 100644
--- a/marimo/_smoke_tests/issues/1140.py
+++ b/marimo/_smoke_tests/issues/1140.py
@@ -2,7 +2,7 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="full")
@@ -11,19 +11,17 @@ def _():
import pandas as pd
import numpy as np
import marimo as mo
+
return mo, np, pd
@app.cell
def _(mo):
- mo.md(
- """
+ mo.md("""
This highlights some of the differences between displaying data in different libraries: polars, pandas, pyarrow, and dictionaries.
These differences are due to how each library prints their data as CSVs.
- """
- )
- return
+ """)
@app.cell
@@ -85,23 +83,20 @@ def _(pd):
@app.cell
def _(df_with_date_index, mo):
mo.ui.table(df_with_date_index, label="Pandas with date index")
- return
@app.cell
def _(df_with_date_index):
df_with_date_index
- return
@app.cell
def _(df, mo):
mo.ui.table(df, label="Pandas")
- return
@app.cell
-def _(data, pd):
+def _(data: dict, pd):
df = pd.DataFrame(data)
df
return (df,)
@@ -110,24 +105,21 @@ def _(data, pd):
@app.cell
def _(df, mo):
mo.ui.dataframe(df)
- return
@app.cell
def _(df, mo):
mo.ui.table(df.to_dict(orient="records"), label="List of dictionaries")
- return
@app.cell
-def _(data_2, mo, pd):
+def _(data_2: dict, mo, pd):
# Arrow
import pyarrow as pa
import pyarrow.parquet as pq
table = pa.Table.from_pandas(pd.DataFrame(data_2))
mo.ui.table(table, label="Pyarrow")
- return
@app.cell
@@ -169,7 +161,7 @@ def _(np, pd):
@app.cell
-def _(data_2, mo):
+def _(data_2: dict, mo):
# Polars
import polars as pl
@@ -181,7 +173,6 @@ def _(data_2, mo):
@app.cell
def _(pl_df):
pl_df
- return
@app.cell
diff --git a/marimo/_smoke_tests/issues/1161.py b/marimo/_smoke_tests/issues/1161.py
index 28e60fab1f..b5fc90e7e0 100644
--- a/marimo/_smoke_tests/issues/1161.py
+++ b/marimo/_smoke_tests/issues/1161.py
@@ -2,13 +2,14 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App()
@app.cell
def _():
import marimo as mo
+
return (mo,)
@@ -39,7 +40,6 @@ def _(mo, slider):
@app.cell
def _(p):
p.value
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/issues/1165.py b/marimo/_smoke_tests/issues/1165.py
index 203c205256..65d1003c44 100644
--- a/marimo/_smoke_tests/issues/1165.py
+++ b/marimo/_smoke_tests/issues/1165.py
@@ -2,12 +2,12 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App()
@app.cell
-def _(css):
+def _(css: str):
import anywidget
import marimo as mo
@@ -36,7 +36,6 @@ def _(css):
IGVWidget()
- return
@app.cell
diff --git a/marimo/_smoke_tests/issues/1271.py b/marimo/_smoke_tests/issues/1271.py
index 148a9742d7..d90b188ceb 100644
--- a/marimo/_smoke_tests/issues/1271.py
+++ b/marimo/_smoke_tests/issues/1271.py
@@ -2,13 +2,14 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App()
@app.cell
def _():
import marimo as mo
+
return (mo,)
@@ -16,7 +17,6 @@ def _():
def _(mo):
with mo.status.spinner(remove_on_exit=False):
pass
- return
@app.cell
@@ -34,7 +34,6 @@ def _(counter_button, mo):
counter_button.value,
mo.status.spinner(remove_on_exit=False) if counter_button.value < 3 else mo.md("Done!"),
])
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/issues/1273.py b/marimo/_smoke_tests/issues/1273.py
index 9b0881d5eb..a46392bff8 100644
--- a/marimo/_smoke_tests/issues/1273.py
+++ b/marimo/_smoke_tests/issues/1273.py
@@ -2,7 +2,7 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="full")
@@ -10,6 +10,7 @@ app = marimo.App(width="full")
def _():
import marimo as mo
import plotly.express as px
+
return mo, px
@@ -21,22 +22,20 @@ def _(mo):
@app.cell
-def _(mo, px, s, x, y):
+def _(mo, px, s, x: list, y: list[int]):
# takes affect when using the slider
mo.vstack([
s,
px.scatter(x=x, y=y, range_x=s.value, title=f'range_x: {s.value}')
])
- return
@app.cell
-def _(mo, px, s, x, y):
+def _(mo, px, s, x: list, y: list[int]):
# takes affect when using the slider
# also is zoom/range is persisted across app view, but reset when the slider changes the range
plot = mo.ui.plotly(px.scatter(x=x, y=y, range_x=s.value, title=f'range_x: {s.value}'))
plot
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/issues/1311.py b/marimo/_smoke_tests/issues/1311.py
index 9702c6cfcc..fa1ab2b267 100644
--- a/marimo/_smoke_tests/issues/1311.py
+++ b/marimo/_smoke_tests/issues/1311.py
@@ -2,7 +2,7 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App()
@@ -10,6 +10,7 @@ app = marimo.App()
def _():
import marimo as mo
import pandas as pd
+
return mo, pd
@@ -24,13 +25,11 @@ def _(pd):
@app.cell
def _(all_flights, mo):
mo.ui.table(all_flights)
- return
@app.cell
def _(all_flights, mo):
mo.ui.table(all_flights[0:10])
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/issues/1312.py b/marimo/_smoke_tests/issues/1312.py
index 4285ae6f8a..5c0cad7036 100644
--- a/marimo/_smoke_tests/issues/1312.py
+++ b/marimo/_smoke_tests/issues/1312.py
@@ -2,7 +2,7 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App()
@@ -17,13 +17,13 @@ def _(pd):
@app.cell
def _(mo, renamed):
mo.ui.table(renamed)
- return
@app.cell
def _():
import marimo as mo
import pandas as pd
+
return mo, pd
diff --git a/marimo/_smoke_tests/issues/1319.py b/marimo/_smoke_tests/issues/1319.py
index 4bd6b786b8..71ca091611 100644
--- a/marimo/_smoke_tests/issues/1319.py
+++ b/marimo/_smoke_tests/issues/1319.py
@@ -2,19 +2,21 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App()
@app.cell
def _():
import marimo as mo
+
return (mo,)
@app.cell
def _():
import pandas as pd
+
return (pd,)
@@ -28,6 +30,7 @@ def _():
"".join(random.choices("abcdefghikjlmnopqrstuvwxyz", k=8)),
"".join(random.choices("abcdefghikjlmnopqrstuvwxyz", k=8)),
] + [random.randint(1000, 100000) for i in range(columns - 2)]
+
return (row,)
@@ -46,7 +49,6 @@ def _():
def _(df, mo):
uidf = mo.ui.dataframe(df)
uidf
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/issues/1351.py b/marimo/_smoke_tests/issues/1351.py
index 946b98a143..a2a7a6be0a 100644
--- a/marimo/_smoke_tests/issues/1351.py
+++ b/marimo/_smoke_tests/issues/1351.py
@@ -2,7 +2,7 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App()
@@ -33,7 +33,6 @@ def _(pl):
x="a",
y="b",
)
- return
@app.cell
@@ -49,12 +48,12 @@ def _(selected_theme):
p.line(x, y)
p
- return
@app.cell
def _():
import marimo as mo
+
return (mo,)
diff --git a/marimo/_smoke_tests/issues/1362.py b/marimo/_smoke_tests/issues/1362.py
index 9444584028..d2edffb662 100644
--- a/marimo/_smoke_tests/issues/1362.py
+++ b/marimo/_smoke_tests/issues/1362.py
@@ -2,7 +2,7 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App()
@@ -80,7 +80,7 @@ def _():
@app.cell
-def _(qwerty):
+def _(qwerty: int):
"""
hello, this is a cell
hello, this is a cell
@@ -153,9 +153,8 @@ def _(qwerty):
@app.cell
-def _(a):
+def _(a: str):
a
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/issues/1530.py b/marimo/_smoke_tests/issues/1530.py
index 64f6f264dc..c45f95fe5a 100644
--- a/marimo/_smoke_tests/issues/1530.py
+++ b/marimo/_smoke_tests/issues/1530.py
@@ -2,7 +2,7 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App()
@@ -10,6 +10,7 @@ app = marimo.App()
def _():
import marimo as mo
import pandas as pd
+
return mo, pd
@@ -37,25 +38,21 @@ def _(pd):
@app.cell
def _(df, mo):
mo.ui.table(df)
- return
@app.cell
def _(df, mo):
mo.ui.dataframe(df)
- return
@app.cell
def _(df, mo):
mo.ui.data_explorer(df)
- return
@app.cell
def _():
import altair as alt
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/issues/1545.py b/marimo/_smoke_tests/issues/1545.py
index 1c7c8fb574..9746abb9b4 100644
--- a/marimo/_smoke_tests/issues/1545.py
+++ b/marimo/_smoke_tests/issues/1545.py
@@ -2,7 +2,7 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="full")
@@ -11,6 +11,7 @@ def _():
import altair as alt
import marimo as mo
import pandas as pd
+
return alt, mo, pd
@@ -56,20 +57,17 @@ def _(alt, mo, scatter, y_line):
@app.cell
def _(layer_plot):
layer_plot.selections
- return
@app.cell
def _(layer_plot):
print(layer_plot.value)
- return
@app.cell
def _(df, layer_plot):
print(layer_plot.apply_selection(df))
# should return a table of selected points based on the scatter plot
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/issues/1602.py b/marimo/_smoke_tests/issues/1602.py
index 330a1352a0..b51609e485 100644
--- a/marimo/_smoke_tests/issues/1602.py
+++ b/marimo/_smoke_tests/issues/1602.py
@@ -2,7 +2,7 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@@ -19,9 +19,8 @@ def _():
@app.cell
-def _(b):
+def _(b: Boom):
callable(b.__dataframe__)
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/issues/1654-virtualize-multiselect.py b/marimo/_smoke_tests/issues/1654-virtualize-multiselect.py
index 8249fec7b4..0129ad1cb4 100644
--- a/marimo/_smoke_tests/issues/1654-virtualize-multiselect.py
+++ b/marimo/_smoke_tests/issues/1654-virtualize-multiselect.py
@@ -2,13 +2,14 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(app_title="1654 - Virtualize Multiselect")
@app.cell
def _():
import marimo as mo
+
return (mo,)
@@ -16,7 +17,6 @@ def _():
def _(mo):
fuzzy_match_test = ["foo bar", "bar foo", "foob", "foobar", "barfoo"]
mo.ui.multiselect(fuzzy_match_test, label="Fuzzy match test")
- return
@app.cell
@@ -25,11 +25,10 @@ def _(mo):
mo.ui.multiselect([], label="Empty"),
mo.ui.multiselect(["1", "2"], label="2 items"),
)
- return
@app.cell
-def _(mo, xs_list):
+def _(mo, xs_list: list[str]):
v = mo.ui.multiselect(xs_list, label="Extra small list with 10 items")
v
return (v,)
@@ -38,46 +37,39 @@ def _(mo, xs_list):
@app.cell
def _(v):
print(v.value)
- return
@app.cell
-def _(mo, sm_list):
+def _(mo, sm_list: list[str]):
mo.ui.multiselect(sm_list, label="Small list with 100 items")
- return
@app.cell
-def _(md_list, mo):
+def _(md_list: list[str], mo):
mo.ui.multiselect(md_list, label="Medium list with 500 items")
- return
@app.cell
-def _(lg_list, mo):
+def _(lg_list: list[str], mo):
mo.ui.multiselect(lg_list, label="Large list with 1K items")
- return
@app.cell
-def _(mo, xl_list):
+def _(mo, xl_list: list[str]):
mo.ui.multiselect(xl_list, label="XL list with 10K items")
- return
@app.cell
-def _(mo, xxl_list):
+def _(mo, xxl_list: list[str]):
mo.ui.multiselect(xxl_list, label="XXL list with 100K items")
- return
@app.cell
-def _(mo, xxxl_list):
+def _(mo, xxxl_list: list[str]):
try:
mo.ui.multiselect(xxxl_list, label="XXXL list with 200K items")
except ValueError as e:
print(e)
- return
@app.cell
diff --git a/marimo/_smoke_tests/issues/1684.py b/marimo/_smoke_tests/issues/1684.py
index 276af4465e..860eb6a804 100644
--- a/marimo/_smoke_tests/issues/1684.py
+++ b/marimo/_smoke_tests/issues/1684.py
@@ -2,28 +2,26 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@app.cell
def _(mo):
- mo.md(
- r"""
- $$
- \begin{align*}
- x &= 1 && \tag{Taylor} \\
- x &= 1123123123123123 && \tag{Taylor's rule} \\
- \end{align*}
- $$
- """
- )
- return
+ mo.md(r"""
+ $$
+ \begin{align*}
+ x &= 1 && \tag{Taylor} \\
+ x &= 1123123123123123 && \tag{Taylor's rule} \\
+ \end{align*}
+ $$
+ """)
@app.cell
def _():
import marimo as mo
+
return (mo,)
diff --git a/marimo/_smoke_tests/issues/1816.py b/marimo/_smoke_tests/issues/1816.py
index 5977cdf7f2..da4226cb0f 100644
--- a/marimo/_smoke_tests/issues/1816.py
+++ b/marimo/_smoke_tests/issues/1816.py
@@ -2,13 +2,14 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@app.cell
def _():
import marimo as mo
+
return (mo,)
@@ -23,7 +24,6 @@ def _(mo):
@app.cell
def _(dict2):
dict2.value
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/issues/1933.py b/marimo/_smoke_tests/issues/1933.py
index 20458604fd..fb7aecf7be 100644
--- a/marimo/_smoke_tests/issues/1933.py
+++ b/marimo/_smoke_tests/issues/1933.py
@@ -2,19 +2,21 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@app.cell
def _():
import marimo as mo
+
return (mo,)
@app.cell
def _():
from vega_datasets import data
+
return (data,)
@@ -36,7 +38,6 @@ def _(mo, t):
@app.cell
def _(dictionary):
dictionary.value["cars"]
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/issues/2000-explode-columns.py b/marimo/_smoke_tests/issues/2000-explode-columns.py
index a1653ebd00..7ef469e360 100644
--- a/marimo/_smoke_tests/issues/2000-explode-columns.py
+++ b/marimo/_smoke_tests/issues/2000-explode-columns.py
@@ -2,7 +2,7 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App()
@@ -11,6 +11,7 @@ def _():
import marimo as mo
import pandas as pd
import polars as pl
+
return mo, pd, pl
@@ -28,7 +29,7 @@ def _():
@app.cell
-def _(json_data, list_data, pd, pl):
+def _(json_data: list[dict[str, str]], list_data: list[list[str]], pd, pl):
df = pd.DataFrame()
df['list_data'] = list_data
df['json_data'] = json_data
@@ -43,8 +44,9 @@ def _(json_data, list_data, pd, pl):
@app.cell
def _(mo):
- mo.md("""### Transformations performed manually with pandas:""")
- return
+ mo.md("""
+ ### Transformations performed manually with pandas:
+ """)
@app.cell
@@ -52,31 +54,30 @@ def _(df, pd):
df3 = df.copy(deep=True)
df3 = df.join(pd.DataFrame(df.pop('json_data').values.tolist()))
df3.explode('list_data')
- return
@app.cell
def _(mo):
- mo.md("""### Transformations on pandas dataframe using `mo.ui.dataframe`:""")
- return
+ mo.md("""
+ ### Transformations on pandas dataframe using `mo.ui.dataframe`:
+ """)
@app.cell
def _(df2, mo):
mo.ui.dataframe(df2[['list_data', 'json_data']])
- return
@app.cell
def _(mo):
- mo.md(r"""### Transformations on polars dataframe using `mo.ui.dataframe`:""")
- return
+ mo.md(r"""
+ ### Transformations on polars dataframe using `mo.ui.dataframe`:
+ """)
@app.cell
def _(df4, mo):
mo.ui.dataframe(df4[['list_data', 'json_data']])
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/issues/2019-sql-refs.py b/marimo/_smoke_tests/issues/2019-sql-refs.py
index f3b21ebbad..de3907cbc4 100644
--- a/marimo/_smoke_tests/issues/2019-sql-refs.py
+++ b/marimo/_smoke_tests/issues/2019-sql-refs.py
@@ -1,29 +1,27 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@app.cell
-def _(mo):
+def _(mo, my_table):
_df = mo.sql(
f"""
SELECT * FROM my_table
"""
)
[mo.refs(), mo.defs()]
- return
@app.cell
-def _(mo):
+def _(mo, my_view):
_df = mo.sql(
f"""
SELECT * FROM my_view
"""
)
[mo.refs(), mo.defs()]
- return
@app.cell
@@ -35,24 +33,23 @@ def _(mo):
"""
)
[mo.refs(), mo.defs()]
- return
@app.cell
-def _(mo):
+def _(mo, my_table):
_df = mo.sql(
f"""
CREATE OR REPLACE VIEW my_view AS (SELECT * FROM my_table WHERE a LIKE 'f%o')
"""
)
[mo.refs(), mo.defs()]
- return
@app.cell(hide_code=True)
def _():
import marimo as mo
import pandas as pd
+
return (mo,)
diff --git a/marimo/_smoke_tests/issues/2070-latex-slides.py b/marimo/_smoke_tests/issues/2070-latex-slides.py
index faf745e33e..93a3160932 100644
--- a/marimo/_smoke_tests/issues/2070-latex-slides.py
+++ b/marimo/_smoke_tests/issues/2070-latex-slides.py
@@ -2,7 +2,7 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(
width="medium",
layout_file="layouts/2070-latex-slides.slides.json",
@@ -32,8 +32,9 @@ def _():
@app.cell
def _(mo):
- mo.md("""# 2""")
- return
+ mo.md("""
+ # 2
+ """)
@app.cell
@@ -43,8 +44,9 @@ def _():
@app.cell
def _(mo):
- mo.md("""# 3""")
- return
+ mo.md("""
+ # 3
+ """)
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/issues/2137-realtime-markdown.py b/marimo/_smoke_tests/issues/2137-realtime-markdown.py
index cf262073ca..9ab89c1afa 100644
--- a/marimo/_smoke_tests/issues/2137-realtime-markdown.py
+++ b/marimo/_smoke_tests/issues/2137-realtime-markdown.py
@@ -1,6 +1,6 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App()
@@ -8,39 +8,36 @@ app = marimo.App()
def _():
import marimo as mo
import time
+
return mo, time
@app.cell
def _(time):
time.sleep(10)
- return
@app.cell
def _(mo):
- mo.md(
- r"""
- ### Realtime Markdown Editing
- Everything you type should update the cell output in realtime, which is pretty cool!
-
- | Feature | Description |
- |-------------------|--------------------------------------------------------|
- | Compact Size | Small and versatile for display in various containers. |
- | Easy Maintenance | Requires minimal care and indirect sunlight. |
- | Unique Appearance | Spherical and soft, visually distinct. |
- | Oxygen Production | Helps oxygenate aquatic environments. |
- | Slow Growth | Grows about 5 mm per year, keeping size manageable. |
- | Longevity | Can live for many years, even over a century. |
- | Cultural Symbol | In Japan, seen as good luck charms. |
- | Adaptable | Thrives in various water conditions. |
- | Non-Invasive | Won't overtake the environment like other plants. |
- | Eco-Friendly | Sustainable and environmentally safe. |
-
- ![](https://marimo.io/apple-touch-icon.png)
- """
- )
- return
+ mo.md(r"""
+ ### Realtime Markdown Editing
+ Everything you type should update the cell output in realtime, which is pretty cool!
+
+ | Feature | Description |
+ |-------------------|--------------------------------------------------------|
+ | Compact Size | Small and versatile for display in various containers. |
+ | Easy Maintenance | Requires minimal care and indirect sunlight. |
+ | Unique Appearance | Spherical and soft, visually distinct. |
+ | Oxygen Production | Helps oxygenate aquatic environments. |
+ | Slow Growth | Grows about 5 mm per year, keeping size manageable. |
+ | Longevity | Can live for many years, even over a century. |
+ | Cultural Symbol | In Japan, seen as good luck charms. |
+ | Adaptable | Thrives in various water conditions. |
+ | Non-Invasive | Won't overtake the environment like other plants. |
+ | Eco-Friendly | Sustainable and environmentally safe. |
+
+ ![](https://marimo.io/apple-touch-icon.png)
+ """)
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/issues/2146-admonitions.py b/marimo/_smoke_tests/issues/2146-admonitions.py
index 4255f07ec2..b9d86ede7b 100644
--- a/marimo/_smoke_tests/issues/2146-admonitions.py
+++ b/marimo/_smoke_tests/issues/2146-admonitions.py
@@ -1,12 +1,13 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@app.cell
def _():
import marimo as mo
+
return (mo,)
@@ -23,27 +24,23 @@ def _(mo):
em que $A$ é uma matriz simétrica. No nosso caso, $A=X'X$ e $v=\hat{\boldsymbol{\beta}}$.
""").center().callout()
- return
@app.cell
def _(mo):
- mo.md(
- r"""
- !!! tip ""
+ mo.md(r"""
+ !!! tip ""
- Importa recordar as seguintes regras de diferenciação de matrizes:
+ Importa recordar as seguintes regras de diferenciação de matrizes:
- $$\frac{\partial\, u'v}{\partial\, v} = \frac{\partial\, v'u}{\partial\, v} = u$$
+ $$\frac{\partial\, u'v}{\partial\, v} = \frac{\partial\, v'u}{\partial\, v} = u$$
- sendo $u$ e $v$ dois vetores.
+ sendo $u$ e $v$ dois vetores.
- $$\frac{\partial\, v'Av}{\partial\, v}=2Av=2v'A$$
+ $$\frac{\partial\, v'Av}{\partial\, v}=2Av=2v'A$$
- em que $A$ é uma matriz simétrica. No nosso caso, $A=X'X$ e $v=\hat{\boldsymbol{\beta}}$.
- """
- )
- return
+ em que $A$ é uma matriz simétrica. No nosso caso, $A=X'X$ e $v=\hat{\boldsymbol{\beta}}$.
+ """)
@app.cell
@@ -63,7 +60,6 @@ def _(mo):
""").center()
}
)
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/issues/2173-accordion.py b/marimo/_smoke_tests/issues/2173-accordion.py
index 5f948fd581..805ac1ed36 100644
--- a/marimo/_smoke_tests/issues/2173-accordion.py
+++ b/marimo/_smoke_tests/issues/2173-accordion.py
@@ -7,7 +7,7 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@@ -20,12 +20,12 @@ def _(mo):
"""
}
)
- return
@app.cell
def _():
import marimo as mo
+
return (mo,)
diff --git a/marimo/_smoke_tests/issues/2216-accordions.py b/marimo/_smoke_tests/issues/2216-accordions.py
index 8cbd2a3eb2..dce7e83719 100644
--- a/marimo/_smoke_tests/issues/2216-accordions.py
+++ b/marimo/_smoke_tests/issues/2216-accordions.py
@@ -7,13 +7,14 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@app.cell
def _():
import marimo as mo
+
return (mo,)
@@ -31,7 +32,6 @@ def _(mo):
"""
}
)
- return
@app.cell
@@ -46,13 +46,13 @@ def _(mo):
)
}
)
- return
@app.cell
def _(mo):
- mo.md(r"""**b)** If the expected value of $X$ is the average of its two values mentioned in the previous part, what do you think the expected value of $Y$ will be? Confirm your answer using the law of iterated expectations.""")
- return
+ mo.md(r"""
+ **b)** If the expected value of $X$ is the average of its two values mentioned in the previous part, what do you think the expected value of $Y$ will be? Confirm your answer using the law of iterated expectations.
+ """)
@app.cell
@@ -66,7 +66,6 @@ def _(mo):
""")
}
)
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/issues/2327_table_staleness.py b/marimo/_smoke_tests/issues/2327_table_staleness.py
index c981726a01..8d3c8b2e5e 100644
--- a/marimo/_smoke_tests/issues/2327_table_staleness.py
+++ b/marimo/_smoke_tests/issues/2327_table_staleness.py
@@ -1,6 +1,6 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@@ -8,6 +8,7 @@ app = marimo.App(width="medium")
def _():
import marimo as mo
import datetime
+
return datetime, mo
@@ -18,7 +19,7 @@ def _():
@app.cell
-def _(initial_data, mo):
+def _(initial_data: list[dict[str, int]], mo):
get_data, set_data = mo.state(initial_data)
return get_data, set_data
@@ -40,7 +41,7 @@ def _(datetime, get_data, mo, set_data):
@app.cell
-def _(mo, table_list):
+def _(mo, table_list: list):
table = mo.ui.table(table_list)
return (table,)
@@ -61,19 +62,16 @@ def _(get_data, mo, set_data):
@app.cell
def _(add_row, mo, table):
mo.vstack([table, add_row])
- return
@app.cell
def _(get_data):
get_data()
- return
@app.cell
-def _(table_list):
+def _(table_list: list):
table_list[0]["x"].value
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/issues/2357-table-ui-elements.py b/marimo/_smoke_tests/issues/2357-table-ui-elements.py
index 315210e99f..1c89dbb622 100644
--- a/marimo/_smoke_tests/issues/2357-table-ui-elements.py
+++ b/marimo/_smoke_tests/issues/2357-table-ui-elements.py
@@ -1,12 +1,13 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@app.cell
def _():
import marimo as mo
+
return (mo,)
@@ -17,9 +18,8 @@ def _(mo):
@app.cell
-def _(data, mo):
+def _(data: list, mo):
mo.ui.table(data)
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/issues/2403_table_ui_staleness.py b/marimo/_smoke_tests/issues/2403_table_ui_staleness.py
index 5b628690b8..c20a70fd90 100644
--- a/marimo/_smoke_tests/issues/2403_table_ui_staleness.py
+++ b/marimo/_smoke_tests/issues/2403_table_ui_staleness.py
@@ -1,12 +1,13 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="full")
@app.cell
def _():
import marimo as mo
+
return (mo,)
@@ -26,16 +27,15 @@ def _(mo):
@app.cell
-def button(keys_1, keys_2, switch):
+def button(keys_1: list[str], keys_2: list[str], switch):
keys = keys_1 if switch.value else keys_2
return (keys,)
@app.cell
-def display(keys, mo):
+def display(keys: list[str], mo):
table = mo.ui.table({str(k): mo.ui.text(value=k) for k in keys})
table
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/issues/2506_anywidget_buffer_paths.py b/marimo/_smoke_tests/issues/2506_anywidget_buffer_paths.py
index c6dd34a108..01835a7820 100644
--- a/marimo/_smoke_tests/issues/2506_anywidget_buffer_paths.py
+++ b/marimo/_smoke_tests/issues/2506_anywidget_buffer_paths.py
@@ -1,6 +1,6 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@@ -12,7 +12,7 @@ def _():
@app.cell
-def _(CONTENT):
+def _(CONTENT: bytes):
import anywidget
import traitlets
@@ -40,21 +40,19 @@ def _(CONTENT):
@app.cell
-def _(CONTENT, mo):
+def _(CONTENT: bytes, mo):
# Not lossy
mo.image(CONTENT.decode("latin1").encode("latin1"))
- return
@app.cell
-def _(CONTENT, mo):
+def _(CONTENT: bytes, mo):
# Is lossy
mo.image(CONTENT.decode("utf-8", errors="replace").encode("utf-8"))
- return
@app.cell
-def _(CONTENT, anywidget, traitlets):
+def _(CONTENT: bytes, anywidget, traitlets):
import numpy as np
from pathlib import Path
@@ -77,12 +75,12 @@ def _(CONTENT, anywidget, traitlets):
# raises a TraitError
BytesWritesWidget(value=CONTENT)
- return
@app.cell
def _():
import marimo as mo
+
return (mo,)
diff --git a/marimo/_smoke_tests/issues/2526-plotly-refresh-on-data-change.py b/marimo/_smoke_tests/issues/2526-plotly-refresh-on-data-change.py
index 36da61ec7c..e37ba26820 100644
--- a/marimo/_smoke_tests/issues/2526-plotly-refresh-on-data-change.py
+++ b/marimo/_smoke_tests/issues/2526-plotly-refresh-on-data-change.py
@@ -2,7 +2,7 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@@ -24,7 +24,6 @@ def _(a, np, px):
@app.cell
def _(a):
a
- return
@app.cell
@@ -36,7 +35,6 @@ def _(mo, px, x, y):
@app.cell
def _(plot):
plot.value
- return
@app.cell
@@ -44,6 +42,7 @@ def _():
import plotly.express as px
import marimo as mo
import numpy as np
+
return mo, np, px
diff --git a/marimo/_smoke_tests/issues/2628_bar_container.py b/marimo/_smoke_tests/issues/2628_bar_container.py
index 42fd6a3ee7..ead4fbefcb 100644
--- a/marimo/_smoke_tests/issues/2628_bar_container.py
+++ b/marimo/_smoke_tests/issues/2628_bar_container.py
@@ -1,12 +1,13 @@
import marimo
-__generated_with = "0.18.4"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@app.cell
def _():
import matplotlib.pyplot as plt
+
return (plt,)
@@ -15,7 +16,6 @@ def _(plt):
import numpy as np
plt.hist(np.random.rand(1000), bins=10)
- return
@app.cell
@@ -36,7 +36,6 @@ def _():
)
[chart, "application/foo:bar"]
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/issues/2648_file_browser_reset.py b/marimo/_smoke_tests/issues/2648_file_browser_reset.py
index ace6fbc20b..e6e64194a7 100644
--- a/marimo/_smoke_tests/issues/2648_file_browser_reset.py
+++ b/marimo/_smoke_tests/issues/2648_file_browser_reset.py
@@ -1,12 +1,13 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@app.cell
def _():
import marimo as mo
+
return (mo,)
@@ -20,7 +21,6 @@ def _(mo):
@app.cell
def _(mo, source):
mo.ui.file_browser(initial_path=source.value)
- return
@app.cell
@@ -38,7 +38,6 @@ def _(mo):
def _(columns, df, mo, slider):
frozen = columns[: slider.value]
mo.ui.table(df, freeze_columns_left=frozen)
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/issues/2991-df-columns.py b/marimo/_smoke_tests/issues/2991-df-columns.py
index 8e0dcae83b..3937870933 100644
--- a/marimo/_smoke_tests/issues/2991-df-columns.py
+++ b/marimo/_smoke_tests/issues/2991-df-columns.py
@@ -9,7 +9,7 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@@ -18,19 +18,22 @@ def _():
import pandas as pd
import marimo as mo
import numpy as np
+
return mo, np, pd
@app.cell
def _(mo):
- mo.md(r"""## Lots of columns""")
- return
+ mo.md(r"""
+ ## Lots of columns
+ """)
@app.cell(hide_code=True)
def _(mo):
- mo.md("""Set cols to 10000 to crash the frontend. Number of rows appears to have no effect.""")
- return
+ mo.md("""
+ Set cols to 10000 to crash the frontend. Number of rows appears to have no effect.
+ """)
@app.cell
@@ -57,19 +60,15 @@ def _(data, pd):
@app.cell
def _(df):
df
- return
@app.cell
def _(mo):
- mo.md(
- r"""
- ## 20k rows, 40 columns
+ mo.md(r"""
+ ## 20k rows, 40 columns
- This is the default max to show column summaries
- """
- )
- return
+ This is the default max to show column summaries
+ """)
@app.cell
@@ -80,7 +79,6 @@ def _(np, pd):
{col: _data[:, i] for i, col in enumerate(column_names)}
)
large_df
- return
@app.cell
diff --git a/marimo/_smoke_tests/issues/3107-dataframe-perf.py b/marimo/_smoke_tests/issues/3107-dataframe-perf.py
index adaed2d414..2553aeacc8 100644
--- a/marimo/_smoke_tests/issues/3107-dataframe-perf.py
+++ b/marimo/_smoke_tests/issues/3107-dataframe-perf.py
@@ -1,6 +1,6 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@@ -65,6 +65,7 @@ def _():
unique_groups = df["group"].unique().to_list()
return df
+
return create_test_dataframe, pl
@@ -76,9 +77,8 @@ def _(create_test_dataframe):
@app.cell
-def _(df, pl):
+def _(df: tuple, pl):
x = df.filter(pl.col("group") == "group2")
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/issues/3141_update_completion.py b/marimo/_smoke_tests/issues/3141_update_completion.py
index b1154397a6..892644f732 100644
--- a/marimo/_smoke_tests/issues/3141_update_completion.py
+++ b/marimo/_smoke_tests/issues/3141_update_completion.py
@@ -1,6 +1,6 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@@ -8,6 +8,7 @@ app = marimo.App(width="medium")
def _():
import marimo as mo
from time import time
+
return mo, time
@@ -25,13 +26,11 @@ def _(mo):
@app.cell
def _(d):
d
- return
@app.cell
def _(d, time):
d.value, time()
- return
@app.cell
@@ -43,7 +42,6 @@ def _(d, time):
for n, b in d.items():
print(button.value, n)
d.value
- return
@app.cell
@@ -57,7 +55,6 @@ def _(mo):
def _(run_button, time):
if run_button.value:
print("Clicked run button at time ", time())
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/issues/3142-table-in-accordion.py b/marimo/_smoke_tests/issues/3142-table-in-accordion.py
index a31afc6bad..187258eaae 100644
--- a/marimo/_smoke_tests/issues/3142-table-in-accordion.py
+++ b/marimo/_smoke_tests/issues/3142-table-in-accordion.py
@@ -1,12 +1,13 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@app.cell
def _():
import marimo as mo
+
return (mo,)
@@ -29,7 +30,6 @@ def _(mo, table):
@app.cell
def _(mo, table, text):
mo.accordion({"fold down": mo.vstack([table, text])})
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/issues/3187_kernel_dies.py b/marimo/_smoke_tests/issues/3187_kernel_dies.py
index cf4d220db3..75ce77c80a 100644
--- a/marimo/_smoke_tests/issues/3187_kernel_dies.py
+++ b/marimo/_smoke_tests/issues/3187_kernel_dies.py
@@ -1,31 +1,31 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App()
@app.cell
def _():
import sys
+
return (sys,)
@app.cell
def _(sys):
sys.exit()
- return
@app.cell
def _():
import os
+
return (os,)
@app.cell
def _(os):
os._exit(1)
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/issues/3564_altair_timezone.py b/marimo/_smoke_tests/issues/3564_altair_timezone.py
index 1bf9ddba94..4bc4d322ac 100644
--- a/marimo/_smoke_tests/issues/3564_altair_timezone.py
+++ b/marimo/_smoke_tests/issues/3564_altair_timezone.py
@@ -1,6 +1,6 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@@ -11,6 +11,7 @@ def _():
import pandas as pd
import polars as pl
from datetime import datetime, timedelta, timezone
+
return alt, datetime, mo, pd, pl, timedelta, timezone
@@ -45,7 +46,7 @@ def _(datetime, timedelta, timezone):
@app.cell
-def _(alt, df_lib_select, mo, timedelta, to_display):
+def _(alt, df_lib_select, mo, timedelta, to_display: list):
df_lib = df_lib_select.value
df_buckets = df_lib.DataFrame(to_display)
@@ -77,39 +78,33 @@ def _(alt, df_lib_select, mo, timedelta, to_display):
@app.cell
def _(bars):
bars
- return
@app.cell
def _(chart):
chart
- return
@app.cell
def _(alt, bars, mo):
with alt.data_transformers.enable("marimo_json"):
mo.output.replace(bars)
- return
@app.cell
def _(alt, bars, mo):
with alt.data_transformers.enable("marimo_csv"):
mo.output.replace(bars)
- return
@app.cell
def _(bars, mo):
mo.ui.altair_chart(bars)
- return
@app.cell
def _(bars, mo):
mo.iframe(bars.to_html())
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/issues/3962-anywidget-partial-state-2.py b/marimo/_smoke_tests/issues/3962-anywidget-partial-state-2.py
index e327b53572..d24fda2bd8 100644
--- a/marimo/_smoke_tests/issues/3962-anywidget-partial-state-2.py
+++ b/marimo/_smoke_tests/issues/3962-anywidget-partial-state-2.py
@@ -1,6 +1,6 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@@ -9,6 +9,7 @@ def _():
import marimo as mo
import anywidget
import traitlets
+
return anywidget, mo, traitlets
@@ -35,6 +36,7 @@ def _(anywidget, traitlets):
"""
in_value = traitlets.Int(0).tag(sync=True)
out_value = traitlets.Int(123).tag(sync=True)
+
return (MyWidget,)
@@ -54,7 +56,6 @@ def _(mo, widget_instance):
@app.cell
def _(m):
m.widget.out_value
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/issues/3962-anywidget-partial-state.py b/marimo/_smoke_tests/issues/3962-anywidget-partial-state.py
index ec37d64fb0..c8191df8ea 100644
--- a/marimo/_smoke_tests/issues/3962-anywidget-partial-state.py
+++ b/marimo/_smoke_tests/issues/3962-anywidget-partial-state.py
@@ -1,6 +1,6 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@@ -10,6 +10,7 @@ def _():
import traitlets
import marimo as mo
from svg import SVG, Circle
+
return Circle, SVG, anywidget, mo, traitlets
@@ -30,6 +31,7 @@ def _(anywidget, traitlets):
"""
svg = traitlets.Unicode().tag(sync=True)
selected_id = traitlets.Any().tag(sync=True)
+
return (HoverWidget,)
@@ -51,7 +53,6 @@ def _(Circle, SVG):
def _(HoverWidget, mo, my_svg):
w = mo.ui.anywidget(HoverWidget(svg=my_svg.as_str(), selected_id=""))
[w]
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/issues/4544_flex.py b/marimo/_smoke_tests/issues/4544_flex.py
index fa0d5cef70..d1e39a1987 100644
--- a/marimo/_smoke_tests/issues/4544_flex.py
+++ b/marimo/_smoke_tests/issues/4544_flex.py
@@ -1,19 +1,21 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@app.cell
def _():
import marimo as mo
+
return (mo,)
@app.cell(hide_code=True)
def _(mo):
- mo.md(r"""## Buttons""")
- return
+ mo.md(r"""
+ ## Buttons
+ """)
@app.cell
@@ -33,19 +35,17 @@ def _(full_width, mo):
@app.cell
-def _(items, mo):
+def _(items: list, mo):
mo.vstack(items)
- return
@app.cell
-def _(items, mo):
+def _(items: list, mo):
mo.hstack(items)
- return
@app.cell
-def _(items, mo):
+def _(items: list, mo):
different_height_items = [
*items,
mo.ui.text_area(label="button"),
@@ -54,27 +54,25 @@ def _(items, mo):
@app.cell
-def _(different_height_items, mo):
+def _(different_height_items: list, mo):
mo.vstack(different_height_items)
- return
@app.cell
-def _(different_height_items, mo):
+def _(different_height_items: list, mo):
mo.hstack(different_height_items)
- return
@app.cell(hide_code=True)
def _(mo):
- mo.md(r"""## Sliders""")
- return
+ mo.md(r"""
+ ## Sliders
+ """)
@app.cell(hide_code=True)
def _(full_width):
full_width
- return
@app.cell
@@ -89,13 +87,11 @@ def _(full_width, mo):
@app.cell
def _(mo, range_slider):
mo.hstack([range_slider])
- return
@app.cell
def _(mo, range_slider):
mo.vstack([range_slider])
- return
@app.cell
@@ -108,13 +104,11 @@ def _(full_width, mo):
@app.cell
def _(mo, slider):
mo.hstack([slider])
- return
@app.cell
def _(mo, slider):
mo.vstack([slider])
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/issues/4624_markdown_max_width.py b/marimo/_smoke_tests/issues/4624_markdown_max_width.py
index 97292e3ec5..3098cd9285 100644
--- a/marimo/_smoke_tests/issues/4624_markdown_max_width.py
+++ b/marimo/_smoke_tests/issues/4624_markdown_max_width.py
@@ -1,79 +1,78 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="full")
@app.cell
def _():
import marimo as mo
+
return (mo,)
@app.cell
def _(mo):
- mo.md(
- r"""
- # Hello World in Markdown
+ mo.md(r"""
+ # Hello World in Markdown
- **Bold Text:** Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.
+ **Bold Text:** Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.
- *Italic Text:* Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.
+ *Italic Text:* Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.
- ~~Strikethrough~~: Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.
+ ~~Strikethrough~~: Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.
- **Underline Text:** Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.
+ **Underline Text:** Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.
- <u>Underline Another Way:</u> Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.
+ <u>Underline Another Way:</u> Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.
- [Link Example](https://www.example.com): Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.
+ [Link Example](https://www.example.com): Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.
- - **Unordered List:**
- - Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.
- - Item 2
- - Item 3
+ - **Unordered List:**
+ - Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.
+ - Item 2
+ - Item 3
- 1. **Ordered List:**
- 1. Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.
- 2. Second Item
- 3. Third Item
+ 1. **Ordered List:**
+ 1. Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.
+ 2. Second Item
+ 3. Third Item
- > **Blockquote:** Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.
+ > **Blockquote:** Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.
- `Inline Code:` Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.
+ `Inline Code:` Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.
- ```
- Code Block:
- For longer code examples, use triple backticks.
- def hello_world():
- print("Hello, World!")
- ```
+ ```
+ Code Block:
+ For longer code examples, use triple backticks.
+ def hello_world():
+ print("Hello, World!")
+ ```
- **Image:**
+ **Image:**
- ![Alt Text for Image](https://placehold.co/800x400)
+ ![Alt Text for Image](https://placehold.co/800x400)
- **Horizontal Rule:**
+ **Horizontal Rule:**
- ---
+ ---
- Use hyphens (`---`), asterisks (`***`), or underscores (`___`) to create horizontal rules.
+ Use hyphens (`---`), asterisks (`***`), or underscores (`___`) to create horizontal rules.
- **Table:**
+ **Table:**
- | Header 1 | Header 2 | Header 3 |
- |:--------:|:--------:|:--------:|
- | Row 1, Col 1 Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text | Row 1, Col 2 | Row 1, Col 3 |
- | Row 2, Col 1 | Row 2, Col 2 | Row 2, Col 3 |
- """
- )
- return
+ | Header 1 | Header 2 | Header 3 |
+ |:--------:|:--------:|:--------:|
+ | Row 1, Col 1 Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text | Row 1, Col 2 | Row 1, Col 3 |
+ | Row 2, Col 1 | Row 2, Col 2 | Row 2, Col 3 |
+ """)
@app.cell
def _(mo):
- mo.md(r"""This cell now contains a link to [marimo](https://docs.marimo.io/), and suddenly all sort of weird things are happening - line widths change, and there is no lie wrap anymore!""")
- return
+ mo.md(r"""
+ This cell now contains a link to [marimo](https://docs.marimo.io/), and suddenly all sort of weird things are happening - line widths change, and there is no lie wrap anymore!
+ """)
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/issues/4744-fixed-loading-indicator.py b/marimo/_smoke_tests/issues/4744-fixed-loading-indicator.py
index 8f4e3e68a8..b23aee46f4 100644
--- a/marimo/_smoke_tests/issues/4744-fixed-loading-indicator.py
+++ b/marimo/_smoke_tests/issues/4744-fixed-loading-indicator.py
@@ -1,25 +1,26 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App()
@app.cell
def _():
import marimo as mo
+
return (mo,)
@app.cell(hide_code=True)
def _(mo):
- mo.md(r"""When viewing this notebook in run mode, the hourglass loading indicator should be stickied to the top left even when scrolling down.""")
- return
+ mo.md(r"""
+ When viewing this notebook in run mode, the hourglass loading indicator should be stickied to the top left even when scrolling down.
+ """)
@app.cell
def _(mo):
mo.md("hello world" * 10000)
- return
@app.cell
@@ -27,7 +28,6 @@ def _():
import time
time.sleep(100)
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/issues/4970-unique-transform.py b/marimo/_smoke_tests/issues/4970-unique-transform.py
index f9b767c9a7..6d70dc1149 100644
--- a/marimo/_smoke_tests/issues/4970-unique-transform.py
+++ b/marimo/_smoke_tests/issues/4970-unique-transform.py
@@ -1,25 +1,22 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="columns")
@app.cell(column=0)
def _(df_pandas, mo):
mo.ui.dataframe(df_pandas)
- return
@app.cell
def _(df_polars, mo):
mo.ui.dataframe(df_polars)
- return
@app.cell
def _(df_ibis, mo):
mo.ui.dataframe(df_ibis)
- return
@app.cell
@@ -29,6 +26,7 @@ def _():
import polars as pl
import ibis as ib
from vega_datasets import data
+
return data, ib, mo, pd, pl
@@ -45,14 +43,12 @@ def _(data, ib, pd, pl):
def _(df_pandas):
df_pandas_next = df_pandas
df_pandas_next.drop_duplicates(["sepalLength"], keep="first")
- return
@app.cell
def _(df_polars):
df_polars_next = df_polars
df_polars_next.unique(subset=["sepalLength"], keep="first")
- return
@app.cell
@@ -60,7 +56,6 @@ def _(df_ibis, mo):
df_ibis_next = df_ibis
df_ibis_next = df_ibis_next.distinct(on=["sepalLength"], keep="first")
mo.ui.table(df_ibis_next)
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/issues/5361.py b/marimo/_smoke_tests/issues/5361.py
index 67079d8903..1c08948427 100644
--- a/marimo/_smoke_tests/issues/5361.py
+++ b/marimo/_smoke_tests/issues/5361.py
@@ -1,6 +1,6 @@
import marimo
-__generated_with = "0.13.0"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@@ -12,7 +12,7 @@ def _():
import os
mo.md("# Binary File Download Test (GH-5361)\n\nUse the **file explorer** panel on the left to navigate into the smoke test directory and try downloading the sample files. Binary files (`.prof`, `.bin`, `.pkl`, `.png`) should download as valid binary, not as base64 text.")
- return cProfile, mo, os, struct
+ return cProfile, os, struct
@app.cell
@@ -66,7 +66,6 @@ def _(cProfile, os, struct):
for name in ["sample.prof", "sample.bin", "sample.pkl", "sample.txt", "sample.png"]:
p = os.path.join(test_dir, name)
print(f" {name}: {os.path.getsize(p)} bytes")
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/issues/643.py b/marimo/_smoke_tests/issues/643.py
index 5a5a0bbe3d..f3ab923221 100644
--- a/marimo/_smoke_tests/issues/643.py
+++ b/marimo/_smoke_tests/issues/643.py
@@ -2,13 +2,14 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App()
@app.cell
def _():
import marimo as mo
+
return (mo,)
@@ -22,33 +23,28 @@ def _(mo):
@app.cell
def _(get_v, get_v2):
[get_v(), get_v2()]
- return
@app.cell
def _(get_v, mo, set_v):
x = mo.ui.checkbox(get_v(), on_change=set_v)
x
- return
@app.cell
def _(get_v, mo, set_v):
y = mo.ui.checkbox(get_v(), on_change=set_v)
y
- return
@app.cell
def _(get_v2, mo, set_v2):
mo.ui.checkbox(get_v2(), on_change=set_v2)
- return
@app.cell
def _(get_v2, mo, set_v2):
mo.ui.checkbox(get_v2(), on_change=set_v2)
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/issues/7345-dataframe-pivot-transform.py b/marimo/_smoke_tests/issues/7345-dataframe-pivot-transform.py
index 98af96c558..2ecf4ed614 100644
--- a/marimo/_smoke_tests/issues/7345-dataframe-pivot-transform.py
+++ b/marimo/_smoke_tests/issues/7345-dataframe-pivot-transform.py
@@ -1,6 +1,6 @@
import marimo
-__generated_with = "0.18.4"
+__generated_with = "0.25.2"
app = marimo.App(width="columns")
@@ -12,6 +12,7 @@ def _():
import ibis as ib
from vega_datasets import data
+
return data, ib, mo, pd, pl
@@ -27,19 +28,16 @@ def _(data, ib, pd, pl):
@app.cell(column=1)
def _(df_pandas, mo):
mo.ui.dataframe(df_pandas)
- return
@app.cell
def _(df_polars, mo):
mo.ui.dataframe(df_polars)
- return
@app.cell
def _(df_ibis, mo):
mo.ui.dataframe(df_ibis)
- return
@app.cell(column=2)
@@ -61,7 +59,6 @@ def _(df_pandas):
]
df_pandas_next = df_pandas_next.reset_index()
df_pandas_next
- return
@app.cell
@@ -80,7 +77,6 @@ def _(df_polars):
else col
)
df_polars_next
- return
@app.cell
@@ -101,7 +97,6 @@ def _(df_ibis):
}
)
df_ibis_next.to_polars()
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/issues/7661_point_selection.py b/marimo/_smoke_tests/issues/7661_point_selection.py
index 5fbb631980..4e921238a2 100644
--- a/marimo/_smoke_tests/issues/7661_point_selection.py
+++ b/marimo/_smoke_tests/issues/7661_point_selection.py
@@ -1,6 +1,6 @@
import marimo
-__generated_with = "0.18.4"
+__generated_with = "0.25.2"
app = marimo.App()
@@ -10,6 +10,7 @@ def _():
import pandas as pd
import numpy as np
import altair as alt
+
return alt, mo, np, pd
@@ -62,7 +63,6 @@ def _(alt, heatmap_df, mo):
def _(heatmap_ui):
# Display the selected points from the heatmap
heatmap_ui.value
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/issues/7668_altair_concat_interactions.py b/marimo/_smoke_tests/issues/7668_altair_concat_interactions.py
index bd4cbd0ed3..bb43d25087 100644
--- a/marimo/_smoke_tests/issues/7668_altair_concat_interactions.py
+++ b/marimo/_smoke_tests/issues/7668_altair_concat_interactions.py
@@ -1,6 +1,6 @@
import marimo
-__generated_with = "0.18.4"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@@ -11,6 +11,7 @@ def _():
import numpy as np
import pyarrow
import pandas as pd
+
return alt, mo, np, pd
@@ -39,14 +40,12 @@ def _(alt, np, pd):
def _(lower, mo, upper):
# Brush interaction (no longer) breaks:
mo.ui.altair_chart(upper & lower)
- return
@app.cell
def _(alt, lower, mo, upper):
# Brush interaction works:
mo.ui.altair_chart(alt.vconcat(upper & lower))
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/issues/8023_stale_table.py b/marimo/_smoke_tests/issues/8023_stale_table.py
index f475a723ff..732ebfb251 100644
--- a/marimo/_smoke_tests/issues/8023_stale_table.py
+++ b/marimo/_smoke_tests/issues/8023_stale_table.py
@@ -1,17 +1,23 @@
import marimo
+
+__generated_with = "0.25.2"
app = marimo.App()
+
@app.cell
def _():
import marimo as mo
import pandas as pd
+
return mo, pd
+
@app.cell
def _(mo):
data_version, set_data_version = mo.state(0)
return data_version, set_data_version
+
@app.cell
def _():
data = [
@@ -22,22 +28,25 @@ def _():
]
return (data,)
+
@app.cell
-def _(data, data_version, mo, pd):
+def _(data: list[dict[str, int | str]], data_version, mo, pd):
_ = data_version()
df = pd.DataFrame(data)
table = mo.ui.table(df, selection="single", page_size=3)
mo.output.replace(table)
return (table,)
+
@app.cell
def _(mo):
approve_btn = mo.ui.run_button(label="Approve")
mo.output.replace(approve_btn)
return (approve_btn,)
+
@app.cell
-def _(approve_btn, data, set_data_version, table):
+def _(approve_btn, data: list[dict[str, int | str]], set_data_version, table):
import time
if approve_btn.value:
_sel = table.value
@@ -48,7 +57,7 @@ def _(approve_btn, data, set_data_version, table):
item["status"] = "approved"
break
set_data_version(time.time())
- return
+
if __name__ == "__main__":
app.run()
diff --git a/marimo/_smoke_tests/issues/846.py b/marimo/_smoke_tests/issues/846.py
index 0dfd997711..994c2eceef 100644
--- a/marimo/_smoke_tests/issues/846.py
+++ b/marimo/_smoke_tests/issues/846.py
@@ -2,16 +2,15 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App()
@app.cell
def _(mo):
- mo.md(
- "This notebook covers a couple different cases for rendering plotly under different configs and with different renderers."
- )
- return
+ mo.md("""
+ This notebook covers a couple different cases for rendering plotly under different configs and with different renderers.
+ """)
@app.cell
@@ -28,13 +27,11 @@ def _():
@app.cell
def _(pio):
pio.renderers.default
- return
@app.cell
def _(pio):
pio.renderers[pio.renderers.default].config
- return
@app.cell
@@ -53,13 +50,11 @@ def _(mo, pio):
{"name": key, "config": get_config(pio.renderers[key])} for key in keys
]
mo.ui.table(printed_configs)
- return
@app.cell
def _(pio):
pio.renderers
- return
@app.cell
@@ -75,31 +70,26 @@ def _():
@app.cell
def _(fig):
fig # Uses the default renderer "notebook"
- return
@app.cell
def _(fig, mo):
mo.ui.plotly(fig) # Uses the default renderer "notebook"
- return
@app.cell
def _(fig, mo):
mo.ui.plotly(fig, config={}) # Uses the empty config
- return
@app.cell
def _(fig, mo):
mo.ui.plotly(fig, config={"staticPlot": True}) # Uses the passed config
- return
@app.cell
def _(fig, mo):
mo.ui.plotly(fig, renderer_name="browser") # Uses a pre-defined rendererer
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/issues/852.py b/marimo/_smoke_tests/issues/852.py
index 4c1e45a9b6..cf4ed7c1dd 100644
--- a/marimo/_smoke_tests/issues/852.py
+++ b/marimo/_smoke_tests/issues/852.py
@@ -2,26 +2,24 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App()
@app.cell
def _(mo):
- mo.md(
- """
+ mo.md("""
# Bug 852
Explanation: The table was rendering incorrectly due to javascript number precision.
- """
- )
- return
+ """)
@app.cell
def _():
import marimo as mo
import pandas as pd
+
return mo, pd
@@ -36,7 +34,6 @@ def _(pd):
def _(df, mo):
table = mo.ui.table(df)
table
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/issues/924.py b/marimo/_smoke_tests/issues/924.py
index eed8693db2..afd56511d9 100644
--- a/marimo/_smoke_tests/issues/924.py
+++ b/marimo/_smoke_tests/issues/924.py
@@ -2,21 +2,17 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="full")
@app.cell
def _(mo):
- mo.md(
- """
+ mo.md("""
# Scrollbar issue with iframed altair
There should be no vertical scrollbar within the iframed container.
-
- """
- )
- return
+ """)
@app.cell
diff --git a/marimo/_smoke_tests/issues/970-freeze-columns.py b/marimo/_smoke_tests/issues/970-freeze-columns.py
index 61ef398afe..d22f3d38ef 100644
--- a/marimo/_smoke_tests/issues/970-freeze-columns.py
+++ b/marimo/_smoke_tests/issues/970-freeze-columns.py
@@ -2,12 +2,12 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@app.cell
-def _(happiness_index, mo, pd):
+def _(happiness_index: str, mo, pd):
df = pd.read_csv(happiness_index)
mo.ui.table(
df,
@@ -20,7 +20,6 @@ def _(happiness_index, mo, pd):
@app.cell
def _(df, mo):
mo.ui.table(df)
- return
@app.cell
diff --git a/marimo/_smoke_tests/issues/altair_bug.py b/marimo/_smoke_tests/issues/altair_bug.py
index 329f731583..cda82c9943 100644
--- a/marimo/_smoke_tests/issues/altair_bug.py
+++ b/marimo/_smoke_tests/issues/altair_bug.py
@@ -2,7 +2,7 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App()
@@ -11,6 +11,7 @@ def _():
import marimo as mo
import altair as alt
from vega_datasets import data
+
return alt, data, mo
@@ -61,25 +62,21 @@ def _(alt, data, mo):
@app.cell
def _(chart):
chart
- return
@app.cell
def _(chart):
chart.selections
- return
@app.cell
def _(chart):
chart.value
- return
@app.cell
def _(chart):
chart.dataframe
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/issues/df-conversion.py b/marimo/_smoke_tests/issues/df-conversion.py
index a69573714e..32665f3db7 100644
--- a/marimo/_smoke_tests/issues/df-conversion.py
+++ b/marimo/_smoke_tests/issues/df-conversion.py
@@ -1,6 +1,6 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@@ -9,6 +9,7 @@ def _():
import pandas as pd
import marimo as mo
+
return mo, pd
@@ -25,15 +26,13 @@ def _():
@app.cell
-def _(data, mo, pd):
+def _(data: list[dict[str, int | str]], mo, pd):
mo.ui.table(pd.DataFrame(data))
- return
@app.cell
-def _(data, mo, pd):
+def _(data: list[dict[str, int | str]], mo, pd):
mo.ui.dataframe(pd.DataFrame(data))
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/issues/key_with_period.py b/marimo/_smoke_tests/issues/key_with_period.py
index 038e00fbdc..d46220b186 100644
--- a/marimo/_smoke_tests/issues/key_with_period.py
+++ b/marimo/_smoke_tests/issues/key_with_period.py
@@ -2,7 +2,7 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App()
@@ -10,6 +10,7 @@ app = marimo.App()
def _():
import marimo as mo
import pandas as pd
+
return mo, pd
@@ -20,21 +21,18 @@ def _():
@app.cell
-def _(json_list, mo):
+def _(json_list: list[dict[str, str]], mo):
mo.ui.table(json_list)
- return
@app.cell
-def _(json_list, mo, pd):
+def _(json_list: list[dict[str, str]], mo, pd):
mo.ui.data_explorer(pd.DataFrame(json_list))
- return
@app.cell
-def _(json_list, mo, pd):
+def _(json_list: list[dict[str, str]], mo, pd):
mo.ui.dataframe(pd.DataFrame(json_list))
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/json_viewer.py b/marimo/_smoke_tests/json_viewer.py
index f7260fd21d..47c7b0fa37 100644
--- a/marimo/_smoke_tests/json_viewer.py
+++ b/marimo/_smoke_tests/json_viewer.py
@@ -1,6 +1,6 @@
import marimo
-__generated_with = "0.24.0"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@@ -29,7 +29,6 @@ def _(mo):
`True`, `False`, and `None`. MIME-looking strings must remain literal
text in JSON mode. Expand the long string and check quotes and wrapping.
""")
- return
@app.cell
@@ -49,15 +48,13 @@ def _():
@app.cell
-def _(mo, sample):
+def _(mo, sample: dict):
mo.json(sample, label="JSON values")
- return
@app.cell
-def _(sample):
+def _(sample: dict):
sample
- return
@app.cell(hide_code=True)
@@ -69,7 +66,6 @@ def _(mo):
and non-string keys. Copies should preserve Python literal syntax.
HTML and Markdown leaves should render inline without a leaf copy button.
""")
- return
@app.cell
@@ -86,7 +82,6 @@ def _(mo):
"html": mo.Html("<strong>Rich HTML leaf</strong>"),
"markdown": mo.md("**Rich Markdown leaf**"),
}
- return
@app.cell(hide_code=True)
@@ -102,7 +97,6 @@ def _(mo):
Expanding `a.b` must not change pagination for `a` → `b`, or vice versa.
Empty keys and `__proto__` must remain visible as ordinary data keys.
""")
- return
@app.cell
@@ -117,7 +111,6 @@ def _(mo):
},
label="Independent pagination",
)
- return
@app.cell(hide_code=True)
@@ -129,13 +122,11 @@ def _(mo):
Copying it must include all 720 values. Expand the deep tree manually;
deeper levels should start collapsed and remain accessible.
""")
- return
@app.cell
def _(mo):
mo.json([[row * 100 + col for col in range(60)] for row in range(12)])
- return
@app.cell
@@ -144,7 +135,6 @@ def _(mo):
for _level in range(8, 0, -1):
_tree = {f"level_{_level}": _tree}
mo.json(_tree)
- return
@app.cell(hide_code=True)
@@ -155,7 +145,6 @@ def _(mo):
Empty containers and scalar JSON roots should render without errors.
JSON text passed to `mo.json` should parse into a tree.
""")
- return
@app.cell
@@ -171,7 +160,6 @@ def _(mo):
mo.json('{"parsed": [true, null, {"nested": 1}]}'),
]
)
- return
@app.cell(hide_code=True)
@@ -183,11 +171,10 @@ def _(mo):
and theme colors in each popover. The plain string should remain text.
The inspector should use consistent string colors.
""")
- return
@app.cell
-def _(json, mo, sample):
+def _(json, mo, sample: dict):
mo.ui.table(
[
{
@@ -199,7 +186,6 @@ def _(json, mo, sample):
],
selection=None,
)
- return
@app.cell
@@ -207,7 +193,6 @@ def _(mo):
from types import SimpleNamespace
mo.inspect(SimpleNamespace(name="Inspector string", values=[1, True, None]))
- return
@app.cell(hide_code=True)
@@ -219,7 +204,6 @@ def _(mo):
**Bad Data** alert. Open **View Data** and check that its JSON tree works.
This is an expected frontend validation error, not a Python cell failure.
""")
- return
@app.cell
@@ -235,7 +219,6 @@ def _(mo):
},
)
)
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/latex/704.py b/marimo/_smoke_tests/latex/704.py
index 9769193e8a..ae05d05934 100644
--- a/marimo/_smoke_tests/latex/704.py
+++ b/marimo/_smoke_tests/latex/704.py
@@ -1,12 +1,13 @@
import marimo
-__generated_with = "0.19.6"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@app.cell
def _():
import marimo as mo
+
return (mo,)
@@ -16,7 +17,6 @@ def _(mo):
# Incrementing functions
Bug from [#704](https://github.com/marimo-team/marimo/discussions/704)
""")
- return
@app.cell(hide_code=True)
@@ -28,7 +28,6 @@ def _(mo):
e^{\pi i} + 1 = 0
\end{align}
""")
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/latex/global_defs.py b/marimo/_smoke_tests/latex/global_defs.py
index 130b487d79..f849e300f4 100644
--- a/marimo/_smoke_tests/latex/global_defs.py
+++ b/marimo/_smoke_tests/latex/global_defs.py
@@ -1,6 +1,6 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@@ -15,20 +15,18 @@ def _():
@app.cell
def _(mo):
- mo.md(
- r"""
- $$
- c = \pm\root{a^2 + b^2}\in\RR
- $$
- """
- )
- return
+ mo.md(r"""
+ $$
+ c = \pm\root{a^2 + b^2}\in\RR
+ $$
+ """)
@app.cell
def _(mo):
- mo.md(r"""$c = \pm\root{a^2 + b^2}\in\RR$""")
- return
+ mo.md(r"""
+ $c = \pm\root{a^2 + b^2}\in\RR$
+ """)
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/latex/latex.md b/marimo/_smoke_tests/latex/latex.md
index af063541a9..ac4a6b4d29 100644
--- a/marimo/_smoke_tests/latex/latex.md
+++ b/marimo/_smoke_tests/latex/latex.md
@@ -1,8 +1,8 @@
---
-title: Latex
-marimo-version: 0.19.6
header: |-
# Copyright 2026 Marimo. All rights reserved.
+title: Latex
+marimo-version: 0.25.2
---
```python {.marimo}
diff --git a/marimo/_smoke_tests/latex/latex.py b/marimo/_smoke_tests/latex/latex.py
index 802431d7a0..e71856a34b 100644
--- a/marimo/_smoke_tests/latex/latex.py
+++ b/marimo/_smoke_tests/latex/latex.py
@@ -2,13 +2,14 @@
import marimo
-__generated_with = "0.19.6"
+__generated_with = "0.25.2"
app = marimo.App()
@app.cell
def _():
import marimo as mo
+
return (mo,)
@@ -19,7 +20,6 @@ def _(mo):
This notebook tests various LaTeX writing styles and configurations.
""")
- return
@app.cell(hide_code=True)
@@ -29,7 +29,6 @@ def _(mo):
Different ways to write inline math:
""")
- return
@app.cell
@@ -40,7 +39,6 @@ def _(mo):
- With spaces: $ a + b = c $ (spaces around content).
- Complex inline: $\frac{x^2}{y^2} + \sqrt{z}$ in a sentence.
""")
- return
@app.cell(hide_code=True)
@@ -50,7 +48,6 @@ def _(mo):
Different ways to write display/block math:
""")
- return
@app.cell
@@ -62,7 +59,6 @@ def _(mo):
f(x) = \int_{-\infty}^{\infty} e^{-x^2} dx = \sqrt{\pi}
$$
""")
- return
@app.cell
@@ -74,7 +70,6 @@ def _(mo):
\sum_{n=1}^{\infty} \frac{1}{n^2} = \frac{\pi^2}{6}
\]
""")
- return
@app.cell
@@ -82,7 +77,6 @@ def _(mo):
mo.md(r"""
Inline display (no newlines): \[ x^2 + y^2 = z^2 \]
""")
- return
@app.cell(hide_code=True)
@@ -90,7 +84,6 @@ def _(mo):
mo.md("""
## 3. LaTeX Environments
""")
- return
@app.cell
@@ -104,7 +97,6 @@ def _(mo):
e^{\pi i} + 1 &= 0
\end{align}
""")
- return
@app.cell
@@ -116,7 +108,6 @@ def _(mo):
\mathcal{L} = \int_\Omega \left( \frac{1}{2} |\nabla u|^2 - f u \right) dx
\end{equation}
""")
- return
@app.cell
@@ -132,7 +123,6 @@ def _(mo):
Determinant: $\begin{vmatrix} a & b \\ c & d \end{vmatrix} = ad - bc$
""")
- return
@app.cell
@@ -147,7 +137,6 @@ def _(mo):
\end{cases}
$$
""")
- return
@app.cell(hide_code=True)
@@ -155,7 +144,6 @@ def _(mo):
mo.md("""
## 4. Greek Letters and Symbols
""")
- return
@app.cell
@@ -169,7 +157,6 @@ def _(mo):
- Relations: $\leq, \geq, \neq, \approx, \equiv, \sim, \propto$
- Arrows: $\leftarrow, \rightarrow, \leftrightarrow, \Rightarrow, \Leftrightarrow$
""")
- return
@app.cell(hide_code=True)
@@ -177,7 +164,6 @@ def _(mo):
mo.md("""
## 5. Common Mathematical Expressions
""")
- return
@app.cell
@@ -189,7 +175,6 @@ def _(mo):
$$\sqrt{x}, \quad \sqrt[3]{x}, \quad \sqrt{x^2 + y^2}$$
""")
- return
@app.cell
@@ -199,7 +184,6 @@ def _(mo):
$$x_i, \quad x^2, \quad x_i^2, \quad x_{i,j}^{(n)}, \quad e^{i\pi}$$
""")
- return
@app.cell
@@ -211,7 +195,6 @@ def _(mo):
$$\iint_D f(x,y)\,dx\,dy, \quad \oint_C \vec{F} \cdot d\vec{r}$$
""")
- return
@app.cell
@@ -223,7 +206,6 @@ def _(mo):
$$\left\langle \psi | \phi \right\rangle, \quad \left\| \vec{v} \right\|, \quad \left\lfloor x \right\rfloor, \quad \left\lceil x \right\rceil$$
""")
- return
@app.cell(hide_code=True)
@@ -233,7 +215,6 @@ def _(mo):
Using the mhchem extension for chemical equations:
""")
- return
@app.cell
@@ -245,7 +226,6 @@ def _(mo):
- Equilibrium: $\ce{N2 + 3H2 <=> 2NH3}$
- Isotopes: $\ce{^{14}C}$, $\ce{^{238}U}$
""")
- return
@app.cell(hide_code=True)
@@ -253,7 +233,6 @@ def _(mo):
mo.md("""
## 7. Edge Cases
""")
- return
@app.cell
@@ -268,7 +247,6 @@ def _(mo):
- Bullet with math: $\vec{F} = m\vec{a}$
- Another: $\nabla \cdot \vec{E} = \frac{\rho}{\epsilon_0}$
""")
- return
@app.cell
@@ -279,7 +257,6 @@ def _(mo):
The function $f(x) = x^2$ has derivative $f'(x) = 2x$ and second derivative $f''(x) = 2$.
At $x = 0$, we have $f(0) = 0$, $f'(0) = 0$, and $f''(0) = 2 > 0$, so $x = 0$ is a local minimum.
""")
- return
@app.cell
@@ -294,7 +271,6 @@ def _(mo):
- Hat: $\hat{x}$, $\widehat{xyz}$
- Bar: $\bar{x}$, $\overline{xyz}$
""")
- return
@app.cell(hide_code=True)
@@ -302,7 +278,6 @@ def _(mo):
mo.md("""
## 8. Real-World Examples
""")
- return
@app.cell
@@ -312,7 +287,6 @@ def _(mo):
$$e^{i\pi} + 1 = 0$$
""")
- return
@app.cell
@@ -324,7 +298,6 @@ def _(mo):
$$x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}$$
""")
- return
@app.cell
@@ -334,7 +307,6 @@ def _(mo):
$$\int_{-\infty}^{\infty} e^{-x^2} dx = \sqrt{\pi}$$
""")
- return
@app.cell
@@ -349,7 +321,6 @@ def _(mo):
\nabla \times \vec{B} &= \mu_0 \vec{J} + \mu_0 \epsilon_0 \frac{\partial \vec{E}}{\partial t}
\end{align}
""")
- return
@app.cell
@@ -359,7 +330,6 @@ def _(mo):
$$i\hbar\frac{\partial}{\partial t}\Psi(\vec{r},t) = \hat{H}\Psi(\vec{r},t) = \left[-\frac{\hbar^2}{2m}\nabla^2 + V(\vec{r},t)\right]\Psi(\vec{r},t)$$
""")
- return
@app.cell
@@ -369,7 +339,6 @@ def _(mo):
$$P(A|B) = \frac{P(B|A) \cdot P(A)}{P(B)}$$
""")
- return
@app.cell
@@ -379,7 +348,6 @@ def _(mo):
$$f(x) = \sum_{n=0}^{\infty} \frac{f^{(n)}(a)}{n!}(x-a)^n = f(a) + f'(a)(x-a) + \frac{f''(a)}{2!}(x-a)^2 + \cdots$$
""")
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/layout.py b/marimo/_smoke_tests/layout.py
index da6e2748f0..860ffedd02 100644
--- a/marimo/_smoke_tests/layout.py
+++ b/marimo/_smoke_tests/layout.py
@@ -2,7 +2,7 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App()
@@ -25,12 +25,13 @@ def _(mo):
@app.cell
def _(mo):
- mo.md("""# Horizontal Stack: `hstack`""")
- return
+ mo.md("""
+ # Horizontal Stack: `hstack`
+ """)
@app.cell
-def _(align, boxes, gap, justify, mo, wrap):
+def _(align, boxes: list, gap, justify, mo, wrap):
mo.hstack(
boxes,
align=align.value,
@@ -38,23 +39,22 @@ def _(align, boxes, gap, justify, mo, wrap):
gap=gap.value,
wrap=wrap.value,
)
- return
@app.cell
def _(mo):
- mo.md("""# Vertical Stack: `vstack`""")
- return
+ mo.md("""
+ # Vertical Stack: `vstack`
+ """)
@app.cell
-def _(align, boxes, gap, mo):
+def _(align, boxes: list, gap, mo):
mo.vstack(
boxes,
align=align.value,
gap=gap.value,
)
- return
@app.cell
@@ -73,6 +73,7 @@ def _(mo, size):
@app.cell
def _():
import marimo as mo
+
return (mo,)
diff --git a/marimo/_smoke_tests/lazy.py b/marimo/_smoke_tests/lazy.py
index e1dd5555ad..f932b4437b 100644
--- a/marimo/_smoke_tests/lazy.py
+++ b/marimo/_smoke_tests/lazy.py
@@ -2,7 +2,7 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="full")
@@ -22,7 +22,6 @@ def _(generate_number, mo, slider, table):
}
)
tabs
- return
@app.cell
@@ -36,25 +35,21 @@ def _(generate_number, mo, slider, table):
lazy=True,
)
auto_lazy_tabs
- return
@app.cell
def _(generate_number, mo):
mo.accordion({"Open me": mo.lazy(generate_number, show_loading_indicator=True)})
- return
@app.cell
def _(generate_number, mo):
mo.accordion({"Open me": generate_number}, lazy=True)
- return
@app.cell
def _(generate_number_async, mo):
mo.accordion({"Lazy async function": mo.lazy(generate_number_async, show_loading_indicator=True)})
- return
@app.cell
@@ -66,6 +61,7 @@ def _(random):
print("Loaded!")
num = random.randint(0, 100)
return num
+
return (generate_number_async,)
@@ -77,6 +73,7 @@ def _(random, time):
print("Loaded!")
num = random.randint(0, 100)
return num
+
return (generate_number,)
diff --git a/marimo/_smoke_tests/lens_test.py b/marimo/_smoke_tests/lens_test.py
index 09f9e75360..80962721ce 100644
--- a/marimo/_smoke_tests/lens_test.py
+++ b/marimo/_smoke_tests/lens_test.py
@@ -2,13 +2,14 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App()
@app.cell
def _():
import marimo as mo
+
return (mo,)
@@ -53,19 +54,17 @@ def _(mo):
@app.cell
def _(mo, x):
mo.ui.table([{"data": "foo", "button": btn} for btn in x.values()])
- return
@app.cell
-def _(data, x):
+def _(data: list, x):
# x.value counts how many times each button has been clicked
# data is a log of button clicks
x.value, data
- return
@app.cell
-def _(dict_template, mo):
+def _(dict_template: dict[str], mo):
composite = mo.ui.array(
[
mo.ui.slider(1, 10),
@@ -79,25 +78,21 @@ def _(dict_template, mo):
@app.cell
def _():
10
- return
@app.cell
def _(composite):
composite[0], composite[1], composite[2]
- return
@app.cell
def _(composite, mo):
mo.accordion({"Push a button": composite[2]["0"]})
- return
@app.cell
def _(composite):
composite.value
- return
@app.function
@@ -108,7 +103,6 @@ def change_printer(v):
@app.cell
def _(checkboxes):
[_item for _item in checkboxes]
- return
@app.cell
diff --git a/marimo/_smoke_tests/logs.py b/marimo/_smoke_tests/logs.py
index ea007ece93..7f155343b4 100644
--- a/marimo/_smoke_tests/logs.py
+++ b/marimo/_smoke_tests/logs.py
@@ -8,13 +8,14 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App()
@app.cell
def _():
import marimo as mo
+
return (mo,)
@@ -53,7 +54,6 @@ def _(logger, mo):
result = 42
logger.debug(f"Result computed: {result}")
mo.md(f"The result is {result}")
- return
@app.cell
@@ -63,7 +63,6 @@ def _(logger):
x = 1 / 0
except ZeroDivisionError as e:
logger.error("Division by zero!", exc_info=True)
- return
@app.cell
@@ -93,7 +92,6 @@ def _(level_dropdown, logging):
template_logger.info(
"User %(name)s is %(age)d years old", {"name": name, "age": age}
)
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/lsp/ruff_errors.py b/marimo/_smoke_tests/lsp/ruff_errors.py
index 23aed1c8fd..782e337468 100644
--- a/marimo/_smoke_tests/lsp/ruff_errors.py
+++ b/marimo/_smoke_tests/lsp/ruff_errors.py
@@ -1,13 +1,12 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@app.cell
def _():
import marimo as mo
- return
@app.cell
@@ -23,96 +22,94 @@ def _():
app._unparsable_cell(
r"""
+ # fmt: off
+ import os
+ import sys
+ from typing import List, Dict
+ import random
- # fmt: off
- import os
- import sys
- from typing import List, Dict
- import random
-
- # undefined variable
- result = undefined_var + 10
+ # undefined variable
+ result = undefined_var + 10
- # unused import
- import json
+ # unused import
+ import json
- # unused variable
- unused_variable = 42
+ # unused variable
+ unused_variable = 42
- # missing type hints
- def add_numbers(a, b):
- return a + b
+ # missing type hints
+ def add_numbers(a, b):
+ return a + b
- # undefined name
- print(nonexistent_variable)
+ # undefined name
+ print(nonexistent_variable)
- # too many blank lines
+ # too many blank lines
- # missing docstring
- class MyClass:
- def __init__(self):
- self.value = 10
+ # missing docstring
+ class MyClass:
+ def __init__(self):
+ self.value = 10
- # unused method parameter
- def process_data(data, unused_param):
- return data * 2
+ # unused method parameter
+ def process_data(data, unused_param):
+ return data * 2
- # variable shadowing
- def shadow_test():
- x = 5
- for x in range(3):
- print(x)
+ # variable shadowing
+ def shadow_test():
+ x = 5
+ for x in range(3):
+ print(x)
- # mutable default argument
- def risky_function(items=[]):
- items.append(1)
- return items
+ # mutable default argument
+ def risky_function(items=[]):
+ items.append(1)
+ return items
- # star imports
- from os import *
+ # star imports
+ from os import *
- # too many arguments
- def too_many_args(a,b,c,d,e,f,g,h,i,j,k):
- return a+b
+ # too many arguments
+ def too_many_args(a,b,c,d,e,f,g,h,i,j,k):
+ return a+b
- # bare except
- try:
- risky_operation()
- except:
- pass
+ # bare except
+ try:
+ risky_operation()
+ except:
+ pass
- # redefining built-in
- list = []
- str = \\"hello\\"
- def print():
- pass
+ # redefining built-in
+ list = []
+ str = \\"hello\\"
+ def print():
+ pass
- # missing final newline
+ # missing final newline
- # line too long
- very_long_variable_name = \\"This is an extremely long line that exceeds the recommended maximum line length and should trigger a linting warning\\"
+ # line too long
+ very_long_variable_name = \\"This is an extremely long line that exceeds the recommended maximum line length and should trigger a linting warning\\"
- # multiple statements on one line
- x = 5; y = 10; z = 15
+ # multiple statements on one line
+ x = 5; y = 10; z = 15
- # complex boolean expression
- if x == True and y == False and z == True and zz == False:
- pass
+ # complex boolean expression
+ if x == True and y == False and z == True and zz == False:
+ pass
- # wrong variable name style
- camelCaseVariable = 123
+ # wrong variable name style
+ camelCaseVariable = 123
- # undefined name in type annotation
- def process_items(items: InvalidType) -> None:
- pass
+ # undefined name in type annotation
+ def process_items(items: InvalidType) -> None:
+ pass
- # fmt: on
-
+ # fmt: on
""",
- name="_"
+ name="_",
)
diff --git a/marimo/_smoke_tests/markdown/anchor_links.py b/marimo/_smoke_tests/markdown/anchor_links.py
index 58173eb737..b968758ec9 100644
--- a/marimo/_smoke_tests/markdown/anchor_links.py
+++ b/marimo/_smoke_tests/markdown/anchor_links.py
@@ -9,23 +9,23 @@ To test:
import marimo
-__generated_with = "0.16.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@app.cell
def _():
import marimo as mo
+
return (mo,)
@app.cell(hide_code=True)
def _(mo):
- mo.md(
- """
+ mo.md("""
# Anchor Link Test
- This document tests that anchor links preserve query parameters when
+ This document tests that anchor links preserve query parameters when
navigating between sections.
## Table of Contents
@@ -33,54 +33,43 @@ def _(mo):
- [Go to Section 1](#section-1)
- [Go to Section 2](#section-2)
- [Go to Section 3](#section-3)
- """
- )
- return
+ """)
@app.cell(hide_code=True)
def _(mo):
- mo.md(
- """
+ mo.md("""
# Section 1
This is the first section. You can navigate to:
- [Section 2](#section-2)
- [Section 3](#section-3)
- [Back to top](#anchor-link-test)
- """
- )
- return
+ """)
@app.cell(hide_code=True)
def _(mo):
- mo.md(
- """
+ mo.md("""
# Section 2
This is the second section. You can navigate to:
- [Section 1](#section-1)
- [Section 3](#section-3)
- [Back to top](#anchor-link-test)
- """
- )
- return
+ """)
@app.cell(hide_code=True)
def _(mo):
- mo.md(
- """
+ mo.md("""
# Section 3
This is the third section. You can navigate to:
- [Section 1](#section-1)
- [Section 2](#section-2)
- [Back to top](#anchor-link-test)
- """
- )
- return
+ """)
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/markdown/caret.py b/marimo/_smoke_tests/markdown/caret.py
index 4f77dc9490..0dc285f965 100644
--- a/marimo/_smoke_tests/markdown/caret.py
+++ b/marimo/_smoke_tests/markdown/caret.py
@@ -1,6 +1,6 @@
import marimo
-__generated_with = "0.17.7"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@@ -17,7 +17,6 @@ def _(mo):
This is text^with\ superscript^ in the middle.
""")
- return
@app.cell
@@ -31,7 +30,6 @@ def _(mo):
Here is some ^^newly added content^^ in the document.
""")
- return
@app.cell
@@ -47,12 +45,12 @@ def _(mo):
CH~3~CH~2~OH with H^2^O
""")
- return
@app.cell
def _():
import marimo as mo
+
return (mo,)
diff --git a/marimo/_smoke_tests/markdown/codeblocks.py b/marimo/_smoke_tests/markdown/codeblocks.py
index 10fd64aba7..6f01725435 100644
--- a/marimo/_smoke_tests/markdown/codeblocks.py
+++ b/marimo/_smoke_tests/markdown/codeblocks.py
@@ -1,25 +1,26 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@app.cell
def _(mo):
- mo.md(r"""# hello""")
- return
+ mo.md(r"""
+ # hello
+ """)
@app.cell
def _(mo):
- mo.md(r"""This is `inline code`""")
- return
+ mo.md(r"""
+ This is `inline code`
+ """)
@app.cell(hide_code=True)
def _(mo):
- mo.md(
- r"""
+ mo.md(r"""
```python
def fibonacci(n):
if n <= 0:
@@ -35,9 +36,7 @@ def _(mo):
return fib_sequence
```
- """
- )
- return
+ """)
@app.cell(hide_code=True)
@@ -53,7 +52,6 @@ def _(code_block, mo):
{code_block}
"""
)
- return
@app.cell(hide_code=True)
@@ -70,6 +68,7 @@ def _(mo):
@app.cell
def _():
import marimo as mo
+
return (mo,)
diff --git a/marimo/_smoke_tests/markdown/cross_cell_md.py b/marimo/_smoke_tests/markdown/cross_cell_md.py
index 4d9f5d5b2b..6f152cf104 100644
--- a/marimo/_smoke_tests/markdown/cross_cell_md.py
+++ b/marimo/_smoke_tests/markdown/cross_cell_md.py
@@ -1,12 +1,13 @@
import marimo
-__generated_with = "0.19.6"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@app.cell
def _():
import marimo as mo
+
return (mo,)
@@ -22,7 +23,6 @@ def _(mo, title):
title,
mo.md("This should display above this text."),
])
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/markdown/highlight.py b/marimo/_smoke_tests/markdown/highlight.py
index c4f1483ec4..0de6e5fe0c 100644
--- a/marimo/_smoke_tests/markdown/highlight.py
+++ b/marimo/_smoke_tests/markdown/highlight.py
@@ -1,13 +1,12 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@app.cell
def _(mo):
- mo.md(
- """
+ mo.md("""
```
>>> # pycon (omitted)
>>> def foo():
@@ -32,15 +31,12 @@ def _(mo):
pass
x + y
```
- """
- )
- return
+ """)
@app.cell
def _(mo):
- mo.md(
- r"""
+ mo.md(r"""
```js
// js
const myVar = "";
@@ -51,14 +47,13 @@ def _(mo):
// js omitted
var myVar = "";
```
- """
- )
- return
+ """)
@app.cell
def _():
import marimo as mo
+
return (mo,)
diff --git a/marimo/_smoke_tests/markdown/latex_highlighting.py b/marimo/_smoke_tests/markdown/latex_highlighting.py
index df8a0d697e..f10fafcc51 100644
--- a/marimo/_smoke_tests/markdown/latex_highlighting.py
+++ b/marimo/_smoke_tests/markdown/latex_highlighting.py
@@ -1,13 +1,12 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@app.cell
def _(mo):
- mo.md(
- """
+ mo.md("""
## Markdown / Latex Highlighting
```ts
@@ -37,14 +36,13 @@ def _(mo):
\[ \sigma\sqrt{100} \]
\( \sigma\sqrt{100} \)
- """
- )
- return
+ """)
@app.cell
def _():
import marimo as mo
+
return (mo,)
diff --git a/marimo/_smoke_tests/markdown/markdown_pymdownx.py b/marimo/_smoke_tests/markdown/markdown_pymdownx.py
index f640f0c5da..6a5aa49767 100644
--- a/marimo/_smoke_tests/markdown/markdown_pymdownx.py
+++ b/marimo/_smoke_tests/markdown/markdown_pymdownx.py
@@ -1,6 +1,6 @@
import marimo
-__generated_with = "0.19.6"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@@ -22,7 +22,6 @@ def _(mo):
- [ ] item 2
- [ ] item 3
""")
- return
@app.cell
@@ -32,7 +31,6 @@ def _(mo):
![picture](../../docs/_static/docs-settings.png)
""")
- return
@app.cell
@@ -44,7 +42,6 @@ def _(mo):
This is an admonition box without a title.
///
""")
- return
@app.cell
@@ -63,7 +60,6 @@ def _(mo):
Fruit Count
///
""")
- return
@app.cell
@@ -79,7 +75,6 @@ def _(mo):
Tab 2 content
///
""")
- return
@app.cell
@@ -129,7 +124,6 @@ def _(mo):
3. Three
///
""")
- return
@app.cell
@@ -145,7 +139,6 @@ def _(mo):
***I'm bold and italic!** I am just italic.*
""")
- return
@app.cell
@@ -186,7 +179,6 @@ def _(mo):
++}
""")
- return
@app.cell
@@ -196,7 +188,6 @@ def _(mo):
:smile: :heart: :thumbsup:
""")
- return
@app.cell
@@ -206,7 +197,6 @@ def _(mo):
++ctrl+alt+delete++
""")
- return
@app.cell
@@ -217,7 +207,6 @@ def _(mo):
- Just paste links directly in the document like this: https://google.com.
- Or even an email address: [email protected].
""")
- return
@app.cell
@@ -231,12 +220,12 @@ def _(mo):
text~a\ subscript~
""")
- return
@app.cell
def _():
import marimo as mo
+
return (mo,)
diff --git a/marimo/_smoke_tests/markdown/markdown_quotes.py b/marimo/_smoke_tests/markdown/markdown_quotes.py
index cc0dc0803a..fb33eb43b7 100644
--- a/marimo/_smoke_tests/markdown/markdown_quotes.py
+++ b/marimo/_smoke_tests/markdown/markdown_quotes.py
@@ -2,63 +2,63 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@app.cell
def _(mo):
- mo.md("""Markdown""")
- return
+ mo.md("""
+ Markdown
+ """)
@app.cell
def _(mo):
- mo.md(r"""Markdown with an escaped \"""quote\"""!!""")
- return
+ mo.md(r"""
+ Markdown with an escaped \"""quote\"""!!
+ """)
@app.cell
def _(mo):
- mo.md(
- """
- Markdown with a trailing "quote"
- """
- )
- return
+ mo.md("""
+ Markdown with a trailing "quote"
+ """)
@app.cell
def _(mo):
- mo.md(
- """
- "Markdown" with a leading quote
- """
- )
- return
+ mo.md("""
+ "Markdown" with a leading quote
+ """)
@app.cell
def _(mo):
- mo.md("""Markdown with a trailing 'single quote'""")
- return
+ mo.md("""
+ Markdown with a trailing 'single quote'
+ """)
@app.cell
def _(mo):
- mo.md("""'Markdown' with a leading single quote""")
- return
+ mo.md("""
+ 'Markdown' with a leading single quote
+ """)
@app.cell
def _(mo):
- mo.md("""Markdown with an triple-single '''quote'''!!""")
- return
+ mo.md("""
+ Markdown with an triple-single '''quote'''!!
+ """)
@app.cell
def _():
import marimo as mo
+
return (mo,)
diff --git a/marimo/_smoke_tests/markdown/markdown_size.py b/marimo/_smoke_tests/markdown/markdown_size.py
index 497483e628..f51437d50c 100644
--- a/marimo/_smoke_tests/markdown/markdown_size.py
+++ b/marimo/_smoke_tests/markdown/markdown_size.py
@@ -2,7 +2,7 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@@ -26,9 +26,8 @@ def _(mo):
@app.cell
-def _(mo, size, sizes):
+def _(mo, size, sizes: list[str]):
mo.md(f"""{size} **{sizes[size.value]}**""")
- return
@app.cell
@@ -91,7 +90,6 @@ def _(cars, mo):
`inline code`
""",
)
- return
@app.cell
@@ -101,12 +99,12 @@ def _():
"int": 10,
"float": 10.5,
}
- return
@app.cell
def _():
import marimo as mo
+
return (mo,)
diff --git a/marimo/_smoke_tests/markdown/rerendering_latex.py b/marimo/_smoke_tests/markdown/rerendering_latex.py
index ee8aeb975c..633072b664 100644
--- a/marimo/_smoke_tests/markdown/rerendering_latex.py
+++ b/marimo/_smoke_tests/markdown/rerendering_latex.py
@@ -1,6 +1,6 @@
import marimo
-__generated_with = "0.17.4"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@@ -19,6 +19,7 @@ def _(mo):
@app.cell
def _():
import marimo as mo
+
return (mo,)
@@ -26,7 +27,6 @@ def _():
def _(a, mo):
md = mo.md(f"$a={a.value["a"][0]}$")
md
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/markdown/stacked.py b/marimo/_smoke_tests/markdown/stacked.py
index deefcb82b8..5ed29fa4e2 100644
--- a/marimo/_smoke_tests/markdown/stacked.py
+++ b/marimo/_smoke_tests/markdown/stacked.py
@@ -1,12 +1,13 @@
import marimo
-__generated_with = "0.17.0"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@app.cell
def _():
import marimo as mo
+
return (mo,)
@@ -22,19 +23,17 @@ def _(mo):
@app.cell
-def _(items, mo):
+def _(items: list, mo):
mo.hstack(items)
- return
@app.cell
-def _(items, mo):
+def _(items: list, mo):
mo.vstack(items)
- return
@app.cell
-def _(items, mo):
+def _(items: list, mo):
_items = [
mo.md("a" * 200),
mo.md("b" * 180),
@@ -47,7 +46,6 @@ def _(items, mo):
*_items,
]
)
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/md.py b/marimo/_smoke_tests/md.py
index 8db2eaecba..df86f80f1d 100644
--- a/marimo/_smoke_tests/md.py
+++ b/marimo/_smoke_tests/md.py
@@ -8,91 +8,83 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App()
@app.cell
def _():
import marimo as mo
+
return (mo,)
@app.cell
def _(mo):
- mo.md("""# Tables""")
- return
+ mo.md("""
+ # Tables
+ """)
@app.cell
def _(mo):
- mo.md(
- """
- First Header | Second Header
- ------------- | -------------
- Content Cell | Content Cell
- $f(x)$ | Content Cell
- """
- )
- return
+ mo.md("""
+ First Header | Second Header
+ ------------- | -------------
+ Content Cell | Content Cell
+ $f(x)$ | Content Cell
+ """)
@app.cell
def _(mo):
- mo.md(
- """
- | Tables | Are | Cool |
- | ------------- |:-------------:| -----:|
- | col 3 is | right-aligned | $1600 |
- | col 2 is | centered | $12 |
- | zebra stripes | are neat | $1 |
- """
- )
- return
+ mo.md("""
+ | Tables | Are | Cool |
+ | ------------- |:-------------:| -----:|
+ | col 3 is | right-aligned | $1600 |
+ | col 2 is | centered | $12 |
+ | zebra stripes | are neat | $1 |
+ """)
@app.cell
def _(mo):
- mo.md("""# Footnotes""")
- return
+ mo.md("""
+ # Footnotes
+ """)
@app.cell
def _(mo):
- mo.md(
- """
- Here's a short footnote,[^1] and here's a longer one.[^longnote]
+ mo.md("""
+ Here's a short footnote,[^1] and here's a longer one.[^longnote]
- [^1]: This is a short footnote.
+ [^1]: This is a short footnote.
- [^longnote]: This is a longer footnote with paragraphs, and code.
+ [^longnote]: This is a longer footnote with paragraphs, and code.
- Indent paragraphs to include them in the footnote.
+ Indent paragraphs to include them in the footnote.
- `{ my code }` add some code, if you like.
+ `{ my code }` add some code, if you like.
- Add as many paragraphs as you need.
- """
- )
- return
+ Add as many paragraphs as you need.
+ """)
@app.cell
def _(mo):
- mo.md("""# External links""")
- return
+ mo.md("""
+ # External links
+ """)
@app.cell
def _(mo):
- mo.md(
- """
- This is [an example](http://example.com/ "Title") inline link.
-
- [This link](http://example.net/) has no title attribute.
- """
- )
- return
+ mo.md("""
+ This is [an example](http://example.com/ "Title") inline link.
+
+ [This link](http://example.net/) has no title attribute.
+ """)
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/mimes.py b/marimo/_smoke_tests/mimes.py
index 5a61b11f8c..aacd52ada4 100644
--- a/marimo/_smoke_tests/mimes.py
+++ b/marimo/_smoke_tests/mimes.py
@@ -10,14 +10,13 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@app.cell
def _():
import marimo as mo
- return
@app.cell
@@ -86,7 +85,6 @@ def _():
PngMime()
- return
@app.cell
@@ -192,7 +190,6 @@ def _(
@app.cell
def _(HTMLMime, ReprMimeBundle):
ReprMimeBundle(HTMLMime())
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/mpl/basic_image.py b/marimo/_smoke_tests/mpl/basic_image.py
index dca86d1732..8d1d5a2fe2 100644
--- a/marimo/_smoke_tests/mpl/basic_image.py
+++ b/marimo/_smoke_tests/mpl/basic_image.py
@@ -1,13 +1,12 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@app.cell
def _():
import marimo as mo
- return
@app.cell
@@ -24,7 +23,6 @@ def _():
plt.ylabel("sin(x)")
plt.gca()
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/named_cells.py b/marimo/_smoke_tests/named_cells.py
index 418cfc09bd..3f96a658bc 100644
--- a/marimo/_smoke_tests/named_cells.py
+++ b/marimo/_smoke_tests/named_cells.py
@@ -2,13 +2,14 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App()
@app.cell
def _():
import marimo as mo
+
return (mo,)
@@ -16,7 +17,6 @@ def _():
def display_slider(mo):
slider = mo.ui.slider(1, 10)
mo.md(f"Here is a slider: {slider}")
- return
@app.cell
@@ -28,7 +28,6 @@ def _(mo):
@app.cell
def display_element(element, mo):
mo.md(f"Here is an element: {element}")
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/nav_menu_submenu_positioning.py b/marimo/_smoke_tests/nav_menu_submenu_positioning.py
index c208ebabc6..8c4445471b 100644
--- a/marimo/_smoke_tests/nav_menu_submenu_positioning.py
+++ b/marimo/_smoke_tests/nav_menu_submenu_positioning.py
@@ -1,12 +1,13 @@
import marimo
-__generated_with = "0.18.2"
+__generated_with = "0.25.2"
app = marimo.App(width="full")
@app.cell
def _():
import marimo as mo
+
return (mo,)
@@ -26,7 +27,6 @@ def _(mo):
relative to their parent menu item, especially when the parent is on the
right side of the menu.
""")
- return
@app.cell
@@ -44,7 +44,6 @@ def _(mo, orientation):
},
orientation=orientation.value,
)
- return
@app.cell
@@ -52,7 +51,6 @@ def _(mo):
mo.md("""
---
""")
- return
@app.cell
@@ -63,7 +61,6 @@ def _(mo):
This example shows multiple submenu items to better demonstrate the issue.
Try hovering over items on the right side.
""")
- return
@app.cell
@@ -110,7 +107,6 @@ def _(mo, orientation):
},
orientation=orientation.value,
)
- return
@app.cell
@@ -118,7 +114,6 @@ def _(mo):
mo.md("""
---
""")
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/nav_menus.py b/marimo/_smoke_tests/nav_menus.py
index fb4e91c040..54a8aba7d5 100644
--- a/marimo/_smoke_tests/nav_menus.py
+++ b/marimo/_smoke_tests/nav_menus.py
@@ -2,14 +2,15 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App()
@app.cell
def _(mo):
- mo.md("""# Horizontal""")
- return
+ mo.md("""
+ # Horizontal
+ """)
@app.cell
@@ -21,13 +22,13 @@ def _(mo):
"#products": f"{mo.icon('lucide:package')} Products",
}
)
- return
@app.cell
def _(mo):
- mo.md("""-----""")
- return
+ mo.md("""
+ -----
+ """)
@app.cell
@@ -53,13 +54,13 @@ def _(mo):
},
}
)
- return
@app.cell
def _(mo):
- mo.md("""# Vertical""")
- return
+ mo.md("""
+ # Vertical
+ """)
@app.cell
@@ -72,13 +73,13 @@ def _(mo):
},
orientation="vertical",
)
- return
@app.cell
def _(mo):
- mo.md("""-----""")
- return
+ mo.md("""
+ -----
+ """)
@app.cell
@@ -105,12 +106,12 @@ def _(mo):
},
orientation="vertical",
)
- return
@app.cell
def _():
import marimo as mo
+
return (mo,)
diff --git a/marimo/_smoke_tests/nb_dir.py b/marimo/_smoke_tests/nb_dir.py
index 7e3940d35d..1aae02e9ad 100644
--- a/marimo/_smoke_tests/nb_dir.py
+++ b/marimo/_smoke_tests/nb_dir.py
@@ -1,25 +1,24 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@app.cell
def _():
import marimo as mo
+
return (mo,)
@app.cell
def _():
print("__file__", __file__)
- return
@app.cell
def _(mo):
print("mo.notebook_dir()", mo.notebook_dir())
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/no_mutating.py b/marimo/_smoke_tests/no_mutating.py
index f98280c442..6813fb26f2 100644
--- a/marimo/_smoke_tests/no_mutating.py
+++ b/marimo/_smoke_tests/no_mutating.py
@@ -2,13 +2,14 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@app.cell
def _():
import marimo as mo
+
return (mo,)
@@ -21,19 +22,16 @@ def _(mo):
@app.cell
def _(text):
text.on_change
- return
@app.cell
def _(text):
text.value = ""
- return
@app.cell
def _(text):
text.on_change = ""
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/outline.py b/marimo/_smoke_tests/outline.py
index 832bd02623..3f973a97e1 100644
--- a/marimo/_smoke_tests/outline.py
+++ b/marimo/_smoke_tests/outline.py
@@ -2,56 +2,58 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@app.cell
def _():
import marimo as mo
+
return (mo,)
@app.cell
def _(mo):
- mo.md("# Heading 1")
- return
+ mo.md("""
+ # Heading 1
+ """)
@app.cell
def _(mo):
mo.carousel([mo.md("# Carousel Heading")])
- return
@app.cell
def _(mo):
- mo.md("# Heading 2 \n\n Headings between carousel and tabs are detected")
- return
+ mo.md("""
+ # Heading 2 \n\n Headings between carousel and tabs are detected
+ """)
@app.cell
def _(mo):
mo.ui.tabs({"Tab 1": mo.md("# Tabs Heading")})
- return
@app.cell
def _(mo):
- mo.md("# Heading 3 \n\n Headings between tabs and accordion are detected")
- return
+ mo.md("""
+ # Heading 3 \n\n Headings between tabs and accordion are detected
+ """)
@app.cell
def _(mo):
mo.accordion({"Accordion 1": mo.md("# Accordion Heading")})
- return
@app.cell
def _(mo):
- mo.md("# Heading 4")
- return
+ mo.md("""
+ # Heading 4
+ """)
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/outputs/console_with_links.py b/marimo/_smoke_tests/outputs/console_with_links.py
index 4e8ea01164..77dd5cb1a3 100644
--- a/marimo/_smoke_tests/outputs/console_with_links.py
+++ b/marimo/_smoke_tests/outputs/console_with_links.py
@@ -1,6 +1,6 @@
import marimo
-__generated_with = "0.18.4"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@@ -29,25 +29,23 @@ def _():
.interactive()
)
_chart
- return
@app.cell
def _():
import marimo as mo
- return
@app.cell
def _():
import sys
+
return (sys,)
@app.cell
def _(sys):
sys.stdout.write("Here is a link in stdout: https://marimo.io\n")
- return
@app.cell
@@ -55,13 +53,11 @@ def _(sys):
sys.stderr.write(
"Here is a link in stderr: https://github.com/marimo-team/marimo\n"
)
- return
@app.cell
def _():
print("Here is a link in a print statement: https://docs.marimo.io")
- return
@app.cell
@@ -71,13 +67,11 @@ def _(sys):
)
sys.stderr.write("Here is a command in stderr: pip install pandas\n")
print("Here is a command in a print statement: pip install polars")
- return
@app.cell
def _():
print("You need to: pip install polars")
- return
@app.cell
@@ -95,7 +89,6 @@ def _():
print("Flags after package: uv add polars -U")
print("Flags after package: pip install pandas --upgrade")
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/outputs/dict_formatter.py b/marimo/_smoke_tests/outputs/dict_formatter.py
index 5bce1e564d..d0cfc7da58 100644
--- a/marimo/_smoke_tests/outputs/dict_formatter.py
+++ b/marimo/_smoke_tests/outputs/dict_formatter.py
@@ -1,6 +1,6 @@
import marimo
-__generated_with = "0.23.2"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@@ -25,7 +25,6 @@ def _(mo):
Relevant issues: #9288, #2667.
""")
- return
@app.cell
@@ -64,21 +63,18 @@ def _(mo):
render with their native types. Empty dict, single-entry dict, and a
record-shaped dict.
""")
- return
@app.cell
def _():
empty = {}
empty
- return
@app.cell
def _():
single = {"only": 1}
single
- return
@app.cell
@@ -91,7 +87,6 @@ def _():
"spouse": None,
}
record
- return
@app.cell(hide_code=True)
@@ -104,7 +99,6 @@ def _(mo):
decimals, bigints at full precision, sets with `{}`, tuples with `()`,
`None` as `None`, bools as `True`/`False`.
""")
- return
@app.cell
@@ -128,7 +122,6 @@ def _():
"bytes": b"raw bytes",
}
values
- return
@app.cell(hide_code=True)
@@ -142,7 +135,6 @@ def _(mo):
each entry survives, keys render unquoted in the appropriate Python form,
and collision-prone cases (`"2"` vs `2`, `"true"` vs `True`) stay distinct.
""")
- return
@app.cell
@@ -158,9 +150,8 @@ def _():
@app.cell(hide_code=True)
-def _(collision, serialized):
+def _(collision: dict[int | str, str], serialized):
serialized(collision)
- return
@app.cell
@@ -175,7 +166,6 @@ def _():
None: "None key",
}
primitives
- return
@app.cell
@@ -187,7 +177,6 @@ def _():
"normal": 1.5,
}
nan_inf
- return
@app.cell
@@ -200,7 +189,6 @@ def _():
frozenset(): "empty frozenset",
}
composites
- return
@app.cell(hide_code=True)
@@ -218,7 +206,6 @@ def _(mo):
- Nested tuples: a tuple containing a 1-tuple key should round-trip
the inner trailing comma too.
""")
- return
@app.cell
@@ -230,7 +217,6 @@ def _():
((1,), 2): "nested 1-tuple inside a 2-tuple",
}
tuple_edges
- return
@app.cell(hide_code=True)
@@ -243,7 +229,6 @@ def _(mo):
to the original literal string on the frontend (quoted, as expected).
Below, four similar-looking entries stay distinct.
""")
- return
@app.cell
@@ -255,7 +240,6 @@ def _():
"text/plain+tuple:[1, 2]": "another lookalike",
}
lookalike
- return
@app.cell(hide_code=True)
@@ -266,7 +250,6 @@ def _(mo):
Encoding applies recursively at every level. Mixed-key nesting,
dicts inside lists, and tuples of dicts all walk correctly.
""")
- return
@app.cell
@@ -292,7 +275,6 @@ def _():
{(0, 0): ("origin",)},
],
}
- return
@app.cell
@@ -306,7 +288,6 @@ def _():
],
]
in_containers
- return
@app.cell(hide_code=True)
@@ -316,7 +297,6 @@ def _(mo):
Subclasses and dict-likes should go through the same formatter path.
""")
- return
@app.cell
@@ -328,14 +308,12 @@ def _(defaultdict):
dd[(0, 0)].append("origin")
dd[None].append("none")
dd
- return
@app.cell
def _(OrderedDict):
od = OrderedDict([("first", 1), ("second", 2), ("third", 3)])
od
- return
@app.cell(hide_code=True)
@@ -351,7 +329,6 @@ def _(mo):
This is Python semantics, not a serializer concern; the encoder
faithfully round-trips what Python actually stored.
""")
- return
@app.cell
@@ -362,7 +339,6 @@ def _():
collapsed[1.0] = "third" # still True
collapsed["distinct"] = "fourth"
collapsed # 2 entries total
- return
@app.cell(hide_code=True)
@@ -375,7 +351,6 @@ def _(mo):
`frozenset({...})`, `None`/`True`/`False`, and `float('nan')` — ready
to paste back into code.
""")
- return
@app.cell
@@ -395,7 +370,6 @@ def _():
"text/plain+int:99": "escaped lookalike",
}
copy_target
- return
@app.cell(hide_code=True)
@@ -421,7 +395,6 @@ def _(mo):
}
```
""")
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/pandas/pint_tables.py b/marimo/_smoke_tests/pandas/pint_tables.py
index 77f93a2bba..165e5adbba 100644
--- a/marimo/_smoke_tests/pandas/pint_tables.py
+++ b/marimo/_smoke_tests/pandas/pint_tables.py
@@ -10,7 +10,7 @@
import marimo
-__generated_with = "0.23.14"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@@ -26,7 +26,6 @@ def _(mo):
Values should be human-readable (e.g. `1.0 meter`, `1 second`), not nested
`_magnitude` / `_units` / `_non_int_type` blobs.
""")
- return
@app.cell
@@ -46,7 +45,6 @@ def _(mo):
`meters` uses `pint[meter]`; `mixed` is object-dtype bare `pint.Quantity`.
""")
- return
@app.cell
@@ -64,7 +62,6 @@ def _(mo, pd, pint):
}
)
mo.vstack([df_mixed, mo.plain(df_mixed)])
- return (df_mixed,)
@app.cell(hide_code=True)
@@ -72,7 +69,6 @@ def _(mo):
mo.md("""
## Computed pint-pandas columns
""")
- return
@app.cell
@@ -85,7 +81,6 @@ def _(mo, pd):
)
df_power["power"] = df_power["torque"] * df_power["angular_velocity"]
mo.vstack([df_power, mo.plain(df_power), df_power.dtypes])
- return
@app.cell(hide_code=True)
@@ -96,7 +91,6 @@ def _(mo):
Bare pint values and containers that go through `enc_hook` / default tables.
Expect readable strings, not nested dict dumps.
""")
- return
@app.cell
@@ -132,7 +126,6 @@ def _(mo, pint):
],
]
)
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/pandas_smoke_tests/datetime_index_columns.py b/marimo/_smoke_tests/pandas_smoke_tests/datetime_index_columns.py
index 6858cccf39..38029d7ddb 100644
--- a/marimo/_smoke_tests/pandas_smoke_tests/datetime_index_columns.py
+++ b/marimo/_smoke_tests/pandas_smoke_tests/datetime_index_columns.py
@@ -8,20 +8,22 @@
import marimo
-__generated_with = "0.17.0"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@app.cell
def _():
import marimo as mo
+
return (mo,)
@app.cell(hide_code=True)
def _(mo):
- mo.md("""# Issue #6898: DatetimeIndex Lost Across Cells""")
- return
+ mo.md("""
+ # Issue #6898: DatetimeIndex Lost Across Cells
+ """)
@app.cell
@@ -51,15 +53,12 @@ def _():
@app.cell(hide_code=True)
def _(mo):
- mo.md(
- """
+ mo.md("""
## Test Case 1: DataFrame with DatetimeIndex columns using pipe()
This reproduces the exact issue from #6898 where `.pipe()` is used
to set DatetimeIndex on columns.
- """
- )
- return
+ """)
@app.cell
@@ -82,15 +81,12 @@ def _(df_subset, pd):
@app.cell(hide_code=True)
def _(mo):
- mo.md(
- """
+ mo.md("""
## Test Case 2: Check column type in NEXT cell (reproduces bug)
This is where the bug manifests - the DatetimeIndex is lost when
the DataFrame is passed to the next cell.
- """
- )
- return
+ """)
@app.cell
@@ -101,7 +97,6 @@ def _(df_with_datetime_cols, pd):
print(
f"Is DatetimeIndex in next cell: {isinstance(df_with_datetime_cols.columns, pd.DatetimeIndex)}"
)
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/pandas_smoke_tests/pandas_multi_idx.py b/marimo/_smoke_tests/pandas_smoke_tests/pandas_multi_idx.py
index 5216114aab..105921d73d 100644
--- a/marimo/_smoke_tests/pandas_smoke_tests/pandas_multi_idx.py
+++ b/marimo/_smoke_tests/pandas_smoke_tests/pandas_multi_idx.py
@@ -1,6 +1,6 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@@ -8,6 +8,7 @@ app = marimo.App(width="medium")
def _():
import marimo as mo
import pandas as pd
+
return mo, pd
@@ -22,7 +23,6 @@ def _(mo, pd):
named_indexes = pd.Series([1, 2], index=index)
mo.vstack([mo.md("## Named indexes (works)"), named_indexes])
- return
@app.cell
@@ -42,7 +42,6 @@ def _(mo, pd):
### Using reset_index works but changes structure
{mo.ui.table(unnamed_indexes.reset_index())}
""")
- return
@app.cell
@@ -61,7 +60,6 @@ def _(mo, pd):
_multi_col_stack,
]
)
- return
@app.cell
@@ -83,7 +81,6 @@ def _(column_multi_idx, mo):
column_multi_idx,
]
)
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/pandas_smoke_tests/pandas_subplots.py b/marimo/_smoke_tests/pandas_smoke_tests/pandas_subplots.py
index 0187883908..8ea2fc55ed 100644
--- a/marimo/_smoke_tests/pandas_smoke_tests/pandas_subplots.py
+++ b/marimo/_smoke_tests/pandas_smoke_tests/pandas_subplots.py
@@ -8,20 +8,20 @@
import marimo
-__generated_with = "0.17.0"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@app.cell
def _():
import marimo as mo
+
return (mo,)
@app.cell(hide_code=True)
def _(mo):
- mo.md(
- """
+ mo.md("""
# Issue #6893: Pandas Subplots Not Displaying
This smoke test reproduces the issue where pandas DataFrame box plots
@@ -33,9 +33,7 @@ def _(mo):
The issue occurs because `df.plot.box(subplots=True)` returns a numpy
ndarray of matplotlib Axes objects, which marimo doesn't currently format.
- """
- )
- return
+ """)
@app.cell
@@ -54,40 +52,37 @@ def _():
@app.cell(hide_code=True)
def _(mo):
- mo.md("""## Test Case 1: Box plot WITHOUT subplots (works correctly)""")
- return
+ mo.md("""
+ ## Test Case 1: Box plot WITHOUT subplots (works correctly)
+ """)
@app.cell
def _(df):
# This should work - returns a single Axes object
df[["distance", "total"]].plot.box()
- return
@app.cell(hide_code=True)
def _(mo):
- mo.md(
- """
+ mo.md("""
## Test Case 2: Box plot WITH subplots (reproduces issue #6893)
This is the exact scenario from the bug report.
- """
- )
- return
+ """)
@app.cell
def _(df):
# This reproduces the issue - returns ndarray of Axes
df[["distance", "total"]].plot.box(subplots=True)
- return
@app.cell(hide_code=True)
def _(mo):
- mo.md("""## Test Case 3: Multiple subplots with custom layout""")
- return
+ mo.md("""
+ ## Test Case 3: Multiple subplots with custom layout
+ """)
@app.cell
@@ -96,26 +91,21 @@ def _(df):
df[["distance", "total", "fare", "tip"]].plot.box(
subplots=True, layout=(2, 2), figsize=(10, 8)
)
- return
@app.cell(hide_code=True)
def _(mo):
- mo.md(
- """
+ mo.md("""
## Test Case 4: 1D array of subplots
Test with a single row of subplots.
- """
- )
- return
+ """)
@app.cell
def _(df):
# Returns 1D ndarray of Axes
df[["fare", "tip", "tolls"]].plot.box(subplots=True, layout=(1, 3))
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/parse/classes.py b/marimo/_smoke_tests/parse/classes.py
index a623764853..6edb07064a 100644
--- a/marimo/_smoke_tests/parse/classes.py
+++ b/marimo/_smoke_tests/parse/classes.py
@@ -1,6 +1,6 @@
import marimo
-__generated_with = "0.18.0"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@@ -43,6 +43,7 @@ def _(C):
def run(a: C = 1) -> int:
return a
+
return
@@ -55,17 +56,19 @@ def _(C):
def run(a: B = 1) -> int:
return a
+
return
@app.cell
-def _(value):
+def _(value: int):
# This should NOT be reusable (depends on value)
class Five:
A: int = 1
def run(a: A = value) -> int:
return a
+
return
diff --git a/marimo/_smoke_tests/pdf.py b/marimo/_smoke_tests/pdf.py
index abb0a0d353..0096629d5f 100644
--- a/marimo/_smoke_tests/pdf.py
+++ b/marimo/_smoke_tests/pdf.py
@@ -2,7 +2,7 @@
import marimo
-__generated_with = "0.18.4"
+__generated_with = "0.25.2"
app = marimo.App(width="full")
@@ -11,6 +11,7 @@ def _():
import marimo as mo
import requests
import io
+
return io, mo, requests
@@ -19,7 +20,6 @@ def _(mo):
mo.md("""
# PDFs
""")
- return
@app.cell
@@ -37,7 +37,6 @@ def _(mo, page):
width="100%",
height="60vh",
)
- return
@app.cell
@@ -58,7 +57,6 @@ def _(io, mo, page, requests):
@app.cell
def _(pdf):
pdf
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/pdf_export/basic_example.py b/marimo/_smoke_tests/pdf_export/basic_example.py
index 5c725ba367..94befb4759 100644
--- a/marimo/_smoke_tests/pdf_export/basic_example.py
+++ b/marimo/_smoke_tests/pdf_export/basic_example.py
@@ -1,6 +1,6 @@
import marimo
-__generated_with = "0.19.6"
+__generated_with = "0.25.2"
app = marimo.App(auto_download=["ipynb"])
@@ -9,6 +9,7 @@ def _():
import marimo as mo
import matplotlib.pyplot as plt
import plotly.express as px
+
return mo, plt, px
@@ -29,26 +30,22 @@ def _(mo):
g(x) = 0
$$
""")
- return
@app.cell
def _(mo):
mo.ui.text(label="$f(x)$")
- return
@app.cell
def _():
# How are errors serialized?
1 / 0
- return
@app.cell
def _():
print("This is console output")
- return
@app.cell
@@ -66,13 +63,11 @@ def _(df, plt):
plt.scatter(x=df["sepal_width"], y=df["sepal_length"])
print("Plot in console output")
plt.show()
- return
@app.cell
def _(df, plt):
plt.scatter(x=df["sepal_width"], y=df["sepal_length"])
- return
@app.cell
@@ -96,7 +91,6 @@ def _(mo):
@app.cell
def _(iframe, mo):
mo.Html(iframe.text)
- return
@app.cell
@@ -104,7 +98,6 @@ def _(mo):
mo.iframe(
'<iframe src="demo_iframe.html" height="200" width="300" title="Iframe Example"></iframe>'
)
- return
@app.cell
@@ -112,13 +105,11 @@ def _(mo):
mo.iframe(
'<iframe id="inlineFrameExample" title="Inline Frame Example" width="800" height="600" src="https://www.openstreetmap.org/export/embed.html?bbox=-0.004017949104309083%2C51.47612752641776%2C0.00030577182769775396%2C51.478569861898606&amp;layer=mapnik"></iframe>'
)
- return
@app.cell
def _(df):
df
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/pdf_export/lazy_outputs.py b/marimo/_smoke_tests/pdf_export/lazy_outputs.py
index bde280c698..d5ba9219cb 100644
--- a/marimo/_smoke_tests/pdf_export/lazy_outputs.py
+++ b/marimo/_smoke_tests/pdf_export/lazy_outputs.py
@@ -1,37 +1,40 @@
import marimo
-__generated_with = "0.23.5"
+__generated_with = "0.25.2"
app = marimo.App()
@app.cell
def _():
import marimo as mo
+
return (mo,)
@app.cell
def _(mo):
- mo.md("# `mo.lazy` export smoke test")
- return
+ mo.md("""
+ # `mo.lazy` export smoke test
+ """)
@app.cell
def _(mo):
- mo.md("## 1) Eager value (non-callable)")
- return
+ mo.md("""
+ ## 1) Eager value (non-callable)
+ """)
@app.cell
def _(mo):
mo.lazy("EAGER_VALUE_MARKER")
- return
@app.cell
def _(mo):
- mo.md("## 2) Sync function")
- return
+ mo.md("""
+ ## 2) Sync function
+ """)
@app.cell
@@ -40,13 +43,13 @@ def _(mo):
return "SYNC_FUNCTION_MARKER"
mo.lazy(make_sync)
- return
@app.cell
def _(mo):
- mo.md("## 3) Async function")
- return
+ mo.md("""
+ ## 3) Async function
+ """)
@app.cell
@@ -55,7 +58,6 @@ def _(mo):
return "ASYNC_FUNCTION_MARKER"
mo.lazy(make_async)
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/plain.py b/marimo/_smoke_tests/plain.py
index 8b66165126..163a02bb48 100644
--- a/marimo/_smoke_tests/plain.py
+++ b/marimo/_smoke_tests/plain.py
@@ -10,7 +10,7 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@@ -19,6 +19,7 @@ def _():
import marimo as mo
from vega_datasets import data
import polars as pl
+
return data, mo, pl
@@ -32,25 +33,21 @@ def _(data, pl):
@app.cell
def _(df, mo):
mo.ui.table(df)
- return
@app.cell
def _(df, mo):
mo.plain(df)
- return
@app.cell
def _(df, mo):
mo.hstack(["hstack", mo.vstack(["vstack", df])])
- return
@app.cell
def _(df, mo):
mo.hstack(["hstack", mo.vstack(["vstack", mo.plain(df)])])
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/plotly/shapes.py b/marimo/_smoke_tests/plotly/shapes.py
index 2e5b50ef49..1219d52958 100644
--- a/marimo/_smoke_tests/plotly/shapes.py
+++ b/marimo/_smoke_tests/plotly/shapes.py
@@ -1,12 +1,13 @@
import marimo
-__generated_with = "0.19.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium", auto_download=["html"])
@app.cell
def _():
import marimo as mo
+
return (mo,)
@@ -14,6 +15,7 @@ def _():
def _():
import plotly.express as px
import numpy as np
+
return np, px
@@ -26,7 +28,6 @@ def _(mo):
@app.cell
def _(plot_boxes):
plot_boxes
- return
@app.cell
@@ -55,7 +56,6 @@ def _(np, plot_boxes, px):
@app.cell
def _(fig):
fig.layout.shapes
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/polars/polars_duration.py b/marimo/_smoke_tests/polars/polars_duration.py
index 0b960931b3..36301bbfc4 100644
--- a/marimo/_smoke_tests/polars/polars_duration.py
+++ b/marimo/_smoke_tests/polars/polars_duration.py
@@ -1,6 +1,6 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@@ -8,13 +8,15 @@ app = marimo.App(width="medium")
def _():
import marimo as mo
import polars as pl
+
return mo, pl
@app.cell
def _(mo):
- mo.md(r"""## Polars""")
- return
+ mo.md(r"""
+ ## Polars
+ """)
@app.cell
@@ -32,25 +34,23 @@ def _(pl):
@app.cell
def _(df, mo):
mo.plain(df)
- return
@app.cell
def _(mo):
- mo.md(r"""## Pandas""")
- return
+ mo.md(r"""
+ ## Pandas
+ """)
@app.cell
def _(df):
df.to_pandas()
- return
@app.cell
def _(df, mo):
mo.plain(df.to_pandas())
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/polars/timezones.py b/marimo/_smoke_tests/polars/timezones.py
index a12959b637..5f5a4669a6 100644
--- a/marimo/_smoke_tests/polars/timezones.py
+++ b/marimo/_smoke_tests/polars/timezones.py
@@ -1,6 +1,6 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@@ -25,24 +25,22 @@ def _():
@app.cell
def _(df):
df
- return
@app.cell
def _(df, mo):
mo.plain(df)
- return
@app.cell
def _(df):
df.to_dicts()
- return
@app.cell
def _():
import marimo as mo
+
return (mo,)
diff --git a/marimo/_smoke_tests/primitives/_decimal.py b/marimo/_smoke_tests/primitives/_decimal.py
index 8f1b4a191c..f365d3c1b4 100644
--- a/marimo/_smoke_tests/primitives/_decimal.py
+++ b/marimo/_smoke_tests/primitives/_decimal.py
@@ -1,12 +1,13 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@app.cell
def _():
import marimo as mo
+
return (mo,)
@@ -22,12 +23,12 @@ def _(alt, df):
.properties(width="container")
)
_chart
- return
@app.cell
def _():
import altair as alt
+
return (alt,)
diff --git a/marimo/_smoke_tests/process_isolation/app1.py b/marimo/_smoke_tests/process_isolation/app1.py
index d05f839a6e..18f6abda4a 100644
--- a/marimo/_smoke_tests/process_isolation/app1.py
+++ b/marimo/_smoke_tests/process_isolation/app1.py
@@ -5,9 +5,10 @@
# "humanize",
# ]
# ///
+
import marimo
-__generated_with = "0.13.0"
+__generated_with = "0.25.2"
app = marimo.App()
@@ -28,7 +29,7 @@ def _():
import shared_module # noqa: E402
identity = shared_module.get_identity()
- return (identity, shared_module)
+ return identity, shared_module, sys
@app.cell
@@ -82,11 +83,11 @@ def _(identity, shared_module):
print("HELLO FROM APP 1")
status
- return
+ return (mo,)
@app.cell
-def _():
+def _(mo, sys):
in_sandbox = sys.prefix != sys.base_prefix
# Try importing the sandbox-only dep for this app
@@ -147,14 +148,13 @@ def _():
).callout(kind="warn")
sandbox_status
- return
@app.cell
def _(mo):
slider = mo.ui.slider(1, 20)
slider
- return slider,
+ return (slider,)
@app.cell
diff --git a/marimo/_smoke_tests/process_isolation/app2.py b/marimo/_smoke_tests/process_isolation/app2.py
index d11b64ea5b..fea7f831ea 100644
--- a/marimo/_smoke_tests/process_isolation/app2.py
+++ b/marimo/_smoke_tests/process_isolation/app2.py
@@ -5,9 +5,10 @@
# "pyfiglet",
# ]
# ///
+
import marimo
-__generated_with = "0.13.0"
+__generated_with = "0.25.2"
app = marimo.App()
@@ -28,7 +29,7 @@ def _():
import shared_module # noqa: E402
identity = shared_module.get_identity()
- return (identity, shared_module)
+ return identity, shared_module, sys
@app.cell
@@ -80,11 +81,11 @@ def _(identity, shared_module):
).callout(kind="danger")
status
- return
+ return (mo,)
@app.cell
-def _():
+def _(mo, sys):
# Detect sandbox mode by checking if we're in a venv
in_sandbox = sys.prefix != sys.base_prefix
@@ -146,7 +147,6 @@ def _():
).callout(kind="warn")
sandbox_status
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/process_isolation/virtual_files.py b/marimo/_smoke_tests/process_isolation/virtual_files.py
index 4f0dd62b79..cbffe69700 100644
--- a/marimo/_smoke_tests/process_isolation/virtual_files.py
+++ b/marimo/_smoke_tests/process_isolation/virtual_files.py
@@ -1,6 +1,6 @@
import marimo
-__generated_with = "0.23.1"
+__generated_with = "0.25.2"
app = marimo.App()
with app.setup:
@@ -32,7 +32,6 @@ def _():
sections below render correctly (not broken images / empty iframes),
virtual file serving across process boundaries is working.
""")
- return
@app.cell
@@ -68,7 +67,6 @@ def _():
),
mo.image(src=png_bytes, width=64, height=64),
])
- return
@app.cell
@@ -91,7 +89,6 @@ def _():
),
table,
])
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/pyg_walker.py b/marimo/_smoke_tests/pyg_walker.py
index c3072244cf..d83db565a1 100644
--- a/marimo/_smoke_tests/pyg_walker.py
+++ b/marimo/_smoke_tests/pyg_walker.py
@@ -10,7 +10,7 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@@ -20,6 +20,7 @@ def _():
import pygwalker as pyg
import marimo as mo
+
return mo, pd, pyg
@@ -35,7 +36,6 @@ def _(pd):
def _(df, mo, pyg):
walker = pyg.walk(df, kernel_computation=True)
mo.Html(walker.to_html())
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/pygwalker_test.py b/marimo/_smoke_tests/pygwalker_test.py
index cc3b747110..a53b066133 100644
--- a/marimo/_smoke_tests/pygwalker_test.py
+++ b/marimo/_smoke_tests/pygwalker_test.py
@@ -1,6 +1,6 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@@ -9,6 +9,7 @@ def _():
import pygwalker
from vega_datasets import data
+
return data, pygwalker
@@ -16,7 +17,6 @@ def _():
def _(data, pygwalker):
df = data.iris()
pygwalker.walk(df)
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/quak-demo.py b/marimo/_smoke_tests/quak-demo.py
index 553ac67be8..fe8a68b0c3 100644
--- a/marimo/_smoke_tests/quak-demo.py
+++ b/marimo/_smoke_tests/quak-demo.py
@@ -11,7 +11,7 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@@ -21,6 +21,7 @@ def _():
import polars as pl
import quak
from vega_datasets import data
+
return data, mo, quak
@@ -35,7 +36,6 @@ def _(df, mo, quak):
qwidget = quak.Widget(df)
w = mo.ui.anywidget(qwidget)
w
- return
@app.cell
diff --git a/marimo/_smoke_tests/query_params.py b/marimo/_smoke_tests/query_params.py
index f2f1f42390..f4479738bf 100644
--- a/marimo/_smoke_tests/query_params.py
+++ b/marimo/_smoke_tests/query_params.py
@@ -8,7 +8,7 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App()
@@ -26,7 +26,6 @@ def _(mo, query_params):
on_change=lambda v: query_params.set("search", v),
)
search
- return
@app.cell
@@ -40,7 +39,6 @@ def _(mo):
def _(query_params, toggle):
# change the value of a query param, and watch the next cell run automatically
query_params["has_run"] = toggle.value
- return
@app.cell
@@ -60,7 +58,6 @@ def _(mo, new_value, query_params):
on_click=lambda _: query_params.set("list", new_value.value),
)
mo.hstack([new_value, append_button, replace_button])
- return
@app.cell
@@ -70,19 +67,20 @@ def _(mo, query_params):
for key, value in query_params.to_dict().items()
]
mo.ui.table(items, selection=None, label="Query params")
- return
@app.cell
def _(mo):
- mo.md("""You can also initialized with query params. Open this URL [/?foo=1&bar=2&bar=3&baz=4](/?foo=1&bar=2&bar=3&baz=4) and restart the kernel""")
- return
+ mo.md("""
+ You can also initialized with query params. Open this URL [/?foo=1&bar=2&bar=3&baz=4](/?foo=1&bar=2&bar=3&baz=4) and restart the kernel
+ """)
@app.cell
def _():
import marimo as mo
import random
+
return (mo,)
diff --git a/marimo/_smoke_tests/raise_error_on_output.py b/marimo/_smoke_tests/raise_error_on_output.py
index 57de36369a..52387818b1 100644
--- a/marimo/_smoke_tests/raise_error_on_output.py
+++ b/marimo/_smoke_tests/raise_error_on_output.py
@@ -2,7 +2,7 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App()
@@ -19,9 +19,8 @@ def _():
@app.cell
-def _(mischief):
+def _(mischief: Mischief):
mischief
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/raise_exception_on_change.py b/marimo/_smoke_tests/raise_exception_on_change.py
index dd116b11ec..077fa03244 100644
--- a/marimo/_smoke_tests/raise_exception_on_change.py
+++ b/marimo/_smoke_tests/raise_exception_on_change.py
@@ -2,13 +2,14 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App()
@app.cell
def _():
import marimo as mo
+
return (mo,)
@@ -21,7 +22,6 @@ def error(v):
def _(mo):
s = mo.ui.slider(1, 10, on_change=lambda v: error(v))
s
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/refresh.py b/marimo/_smoke_tests/refresh.py
index bf13b4faca..801202b5d3 100644
--- a/marimo/_smoke_tests/refresh.py
+++ b/marimo/_smoke_tests/refresh.py
@@ -2,7 +2,7 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App()
@@ -10,6 +10,7 @@ app = marimo.App()
def _():
import marimo as mo
import random
+
return mo, random
@@ -36,7 +37,7 @@ def _(mo):
@app.cell
-def _(mo, my_pick, random, refresh):
+def _(mo, my_pick: int, random, refresh):
refresh
guess = random.randint(0, 10)
mo.stop(
@@ -47,7 +48,6 @@ def _(mo, my_pick, random, refresh):
mo.md(f"Not correct, your guess was {random.randint(0, 10)}").callout(
kind="warn"
)
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/routes.py b/marimo/_smoke_tests/routes.py
index b73ca546a3..973b950c9e 100644
--- a/marimo/_smoke_tests/routes.py
+++ b/marimo/_smoke_tests/routes.py
@@ -8,13 +8,14 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App()
@app.cell
def _():
import marimo as mo
+
return (mo,)
@@ -33,7 +34,6 @@ def _(mo):
),
]
)
- return
@app.cell
@@ -60,6 +60,7 @@ def _(mo):
</p>
""")
+
return (render_home,)
@@ -99,6 +100,7 @@ def _(mo):
"""
)
+
return (render_about,)
@@ -138,6 +140,7 @@ def _(mo, slider):
{mo.as_html(mo.ui.altair_chart(chart))}
"""
)
+
return (render_sales,)
@@ -151,7 +154,6 @@ def _(mo, render_about, render_home, render_sales):
mo.routes.CATCH_ALL: render_home,
}
)
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/run_button.py b/marimo/_smoke_tests/run_button.py
index a3240e7fe0..fcd8235321 100644
--- a/marimo/_smoke_tests/run_button.py
+++ b/marimo/_smoke_tests/run_button.py
@@ -8,7 +8,7 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App()
@@ -31,7 +31,6 @@ def _(b, mo, s):
mo.stop(not b.value, "Click `run` to submit the slider's value")
s.value
- return
@app.cell
@@ -40,12 +39,12 @@ def _(b, mo):
import random
random.randint(0, 1000)
- return
@app.cell
def _():
import marimo as mo
+
return (mo,)
diff --git a/marimo/_smoke_tests/sandbox/git_source.py b/marimo/_smoke_tests/sandbox/git_source.py
index d4804447ef..323ceba583 100644
--- a/marimo/_smoke_tests/sandbox/git_source.py
+++ b/marimo/_smoke_tests/sandbox/git_source.py
@@ -11,21 +11,19 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App()
@app.cell
def foo():
import marimo as mo
- return
@app.cell
def _():
import python_gcode
help(python_gcode)
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/scale.py b/marimo/_smoke_tests/scale.py
index 26c9dccf59..e374918325 100644
--- a/marimo/_smoke_tests/scale.py
+++ b/marimo/_smoke_tests/scale.py
@@ -8,14 +8,15 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App()
@app.cell
def _(mo):
- mo.md("""# Scale""")
- return
+ mo.md("""
+ # Scale
+ """)
@app.cell
@@ -56,7 +57,6 @@ def _(mo, s):
"As Flat Tree": sliders_as_tree,
"As Nested Tree": sliders_as_nested_tree,
})
- return
@app.cell
@@ -75,13 +75,11 @@ def _(mo):
"As Tree": button_as_tree,
}
)
- return
@app.cell
def _(s):
[s, s.value]
- return
@app.cell
@@ -129,7 +127,6 @@ def _(mo):
)
mo.hstack([same, distinct])
- return
@app.cell
@@ -139,45 +136,43 @@ def _():
@app.cell
def _(mo):
- mo.md(
- """
- ---
+ mo.md("""
+ ---
- # h1 Heading
- ## h2 Heading
- ### h3 Heading
- #### h4 Heading
- ##### h5 Heading
- ###### h6 Heading
+ # h1 Heading
+ ## h2 Heading
+ ### h3 Heading
+ #### h4 Heading
+ ##### h5 Heading
+ ###### h6 Heading
- ## Emphasis
+ ## Emphasis
- **This is bold text**
+ **This is bold text**
- __This is bold text__
+ __This is bold text__
- *This is italic text*
+ *This is italic text*
- _This is italic text_
+ _This is italic text_
- ~~Strikethrough~~
+ ~~Strikethrough~~
- ## Blockquotes
+ ## Blockquotes
- > Blockquotes can also be nested...
- >> ...by using additional greater-than signs right next to each other...
- > > > ...or with spaces between arrows.
- """
- )
- return
+ > Blockquotes can also be nested...
+ >> ...by using additional greater-than signs right next to each other...
+ > > > ...or with spaces between arrows.
+ """)
@app.cell
def _():
import marimo as mo
+
return (mo,)
diff --git a/marimo/_smoke_tests/scripting.py b/marimo/_smoke_tests/scripting.py
index c63e90b35f..e2be87b533 100644
--- a/marimo/_smoke_tests/scripting.py
+++ b/marimo/_smoke_tests/scripting.py
@@ -8,26 +8,27 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App()
@app.cell
def _():
import marimo as mo
+
return (mo,)
@app.cell
def _(mo):
- mo.md("""hello""")
- return
+ mo.md("""
+ hello
+ """)
@app.cell
def _(mo):
mo.Html("<script>console.log(document.querySelectorAll('p')[0].textContent)</script>")
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/scripts/logging_in_scripts.py b/marimo/_smoke_tests/scripts/logging_in_scripts.py
index a08572299e..ad4a05d9b6 100644
--- a/marimo/_smoke_tests/scripts/logging_in_scripts.py
+++ b/marimo/_smoke_tests/scripts/logging_in_scripts.py
@@ -1,6 +1,6 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@@ -9,6 +9,7 @@ def _():
import marimo as mo
import sys
import time
+
return mo, sys, time
@@ -20,7 +21,6 @@ def _(mo, sys, time):
else:
print(f"Step {i}")
time.sleep(1)
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/series_formatting.py b/marimo/_smoke_tests/series_formatting.py
index 9177bb821f..79b63cc752 100644
--- a/marimo/_smoke_tests/series_formatting.py
+++ b/marimo/_smoke_tests/series_formatting.py
@@ -9,7 +9,7 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@@ -18,6 +18,7 @@ def _():
import marimo as mo
import pandas as pd
import polars as pl
+
return mo, pd, pl
@@ -33,7 +34,6 @@ def _(num_range, pd):
# Pandas Series with name
pd_named = pd.Series(list(range(num_range.value)), name="numbers")
pd_named
- return
@app.cell
@@ -41,7 +41,6 @@ def _(num_range, pd):
# Pandas Series without name
pd_unnamed = pd.Series(list(range(num_range.value)))
pd_unnamed
- return
@app.cell
@@ -49,7 +48,6 @@ def _(num_range, pl):
# Polars Series with name
pl_named = pl.Series("numbers", list(range(num_range.value)))
pl_named
- return
@app.cell
@@ -57,7 +55,6 @@ def _(num_range, pl):
# Polars Series without name
pl_unnamed = pl.Series(list(range(num_range.value)))
pl_unnamed
- return
@app.cell
@@ -65,7 +62,6 @@ def _(num_range, pl):
# Polars Series with empty string name
pl_empty_name = pl.Series("", list(range(num_range.value)))
pl_empty_name
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/sidebar.py b/marimo/_smoke_tests/sidebar.py
index 6a0d977602..4631ecd93c 100644
--- a/marimo/_smoke_tests/sidebar.py
+++ b/marimo/_smoke_tests/sidebar.py
@@ -2,7 +2,7 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="full")
@@ -37,7 +37,6 @@ def _(mo):
],
width="500px",
)
- return
@app.cell
@@ -50,12 +49,12 @@ def _(mo):
label=f"{mo.icon('lucide:home')} Home {mo.icon('lucide:external-link')}",
),
]
- return
@app.cell
def _():
import marimo as mo
+
return (mo,)
@@ -69,7 +68,6 @@ def _(mo):
},
orientation="vertical",
)
- return
@app.cell
@@ -81,7 +79,6 @@ def _(mo):
"#contact": f"{mo.icon('lucide:phone')} Contact",
}
)
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/slides.py b/marimo/_smoke_tests/slides.py
index e3e647d57b..62358f118b 100644
--- a/marimo/_smoke_tests/slides.py
+++ b/marimo/_smoke_tests/slides.py
@@ -10,20 +10,22 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(layout_file="layouts/slides.slides.json")
@app.cell
def _(mo):
- mo.md("""# A Presentation on `Iris` Data""")
- return
+ mo.md("""
+ # A Presentation on `Iris` Data
+ """)
@app.cell
def _(mo):
- mo.md("""## By the marimo team (`@marimo_io`)""")
- return
+ mo.md("""
+ ## By the marimo team (`@marimo_io`)
+ """)
@app.cell
@@ -31,6 +33,7 @@ def _():
import marimo as mo
import pandas as pd
import altair as alt
+
return alt, mo, pd
@@ -47,7 +50,6 @@ def _(pd):
def _(df, mo):
table = mo.ui.table(df, label="Wide Iris Data in a table")
table
- return
@app.cell
@@ -59,13 +61,13 @@ def _(alt, df, mo):
label="Iris Data in chart",
)
chart
- return
@app.cell
def _(mo):
- mo.md("""# Thank you!""")
- return
+ mo.md("""
+ # Thank you!
+ """)
@app.cell
@@ -76,41 +78,32 @@ def _():
@app.cell
def _(mo):
- mo.md(
- r"""
- # H1 (`H1`)
- ## H2 (`H2`)
- ### H3 (`H3`)
- #### H4 (`H4`)
- ##### H5 (`H5`)
- ###### H6 (`H6`)
- """
- )
- return
+ mo.md(r"""
+ # H1 (`H1`)
+ ## H2 (`H2`)
+ ### H3 (`H3`)
+ #### H4 (`H4`)
+ ##### H5 (`H5`)
+ ###### H6 (`H6`)
+ """)
@app.cell
def _(mo):
- mo.md(
- r"""
- - Item 1
- - `Item 2`
- - **Item 3**
- - _Item 4_
- """
- )
- return
+ mo.md(r"""
+ - Item 1
+ - `Item 2`
+ - **Item 3**
+ - _Item 4_
+ """)
@app.cell
def _(mo):
- mo.md(
- r"""
- !!! note "Callouts"
- This is a callout
- """
- )
- return
+ mo.md(r"""
+ !!! note "Callouts"
+ This is a callout
+ """)
@app.cell
@@ -118,7 +111,6 @@ def _(mo):
mo.callout("""
This is another callout
""")
- return
@app.cell
@@ -128,20 +120,19 @@ def _():
@app.cell
def _(mo):
- mo.md(r"""## Items that don't quite work in slides""")
- return
+ mo.md(r"""
+ ## Items that don't quite work in slides
+ """)
@app.cell
def _(mo):
mo.accordion({"Accodrions too small": mo.md("Content")})
- return
@app.cell
def _(mo):
mo.ui.tabs({"Tabs to small": mo.md("Content")})
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/slides_examples/nested_slides.py b/marimo/_smoke_tests/slides_examples/nested_slides.py
index c6471e74ab..0e9c7bd2fb 100644
--- a/marimo/_smoke_tests/slides_examples/nested_slides.py
+++ b/marimo/_smoke_tests/slides_examples/nested_slides.py
@@ -1,6 +1,6 @@
import marimo
-__generated_with = "0.23.8"
+__generated_with = "0.25.2"
app = marimo.App(
width="medium",
layout_file="layouts/nested_slides.slides.json",
@@ -29,7 +29,6 @@ def _(mo):
A deck exercising slides, sub-slides (stacks), fragments, and skip cells.
""")
- return
@app.cell(hide_code=True)
@@ -38,7 +37,6 @@ def _(mo):
mo.md("""
- Built with `@revealjs/react`
""")
- return
@app.cell(hide_code=True)
@@ -46,7 +44,6 @@ def _(mo):
mo.md(r"""
- Composed from flat marimo cells
""")
- return
@app.cell(hide_code=True)
@@ -59,14 +56,12 @@ def _(mo):
2. Section B — layouts across a stack
3. Section C — fragments only
""")
- return
@app.cell(hide_code=True)
def _(mo):
# Cell 6 (slide) — start of Section A stack.
mo.md("# Section A").center()
- return
@app.cell(hide_code=True)
@@ -75,7 +70,6 @@ def _(mo):
mo.md("""
## A.1 — Plain text
""")
- return
@app.cell(hide_code=True)
@@ -84,7 +78,6 @@ def _(mo):
mo.md("""
- Fragments reveal incrementally
""")
- return
@app.cell(hide_code=True)
@@ -93,7 +86,6 @@ def _(mo):
mo.md("""
- Each `fragment` cell is one reveal step
""")
- return
@app.cell(hide_code=True)
@@ -102,7 +94,6 @@ def _(mo):
mo.md("""
## A.2 — Continuation cells
""")
- return
@app.cell(hide_code=True)
@@ -111,7 +102,6 @@ def _(mo):
mo.md("""
Cells with no slide type are treated as slides.
""")
- return
@app.cell(hide_code=True)
@@ -126,14 +116,12 @@ def _(mo):
mo.plain_text(f"sin(x) sampled at {len(x)} points"),
]
)
- return
@app.cell(hide_code=True)
def _(mo):
# Cell 13 (slide) — start of Section B stack.
mo.md("# Section B").center()
- return
@app.cell(hide_code=True)
@@ -147,7 +135,6 @@ def _(mo):
),
]
)
- return
@app.cell(hide_code=True)
@@ -156,7 +143,6 @@ def _(mo):
mo.md("""
_hstack items sized equally_
""")
- return
@app.cell(hide_code=True)
@@ -177,7 +163,6 @@ def _(mo):
),
]
)
- return
@app.cell
@@ -198,7 +183,6 @@ def _(mo):
def _(mo):
# Cell 18 (slide) — Section C title.
mo.md("# Section C — Fragments").center()
- return
@app.cell(hide_code=True)
@@ -207,7 +191,6 @@ def _(mo):
mo.md("""
### First reveal
""")
- return
@app.cell(hide_code=True)
@@ -216,14 +199,12 @@ def _(mo):
mo.md("""
### Second reveal
""")
- return
@app.cell(hide_code=True)
-def _(mo, secret):
+def _(mo, secret: int):
# Cell 21 (fragment) — pulls in the skipped cell's value.
mo.md(f"### Third reveal — secret is **{secret}**")
- return
@app.cell
@@ -286,7 +267,6 @@ def _(mo):
tbl = mo.ui.table(_bios_df)
tbl
- return
@app.cell
@@ -348,7 +328,6 @@ def _(mo):
}
mo.ui.table(_bios_df)
- return
@app.cell
@@ -410,7 +389,6 @@ def _(mo):
}
mo.ui.table(_bios_df)
- return
@app.cell
@@ -472,7 +450,6 @@ def _(mo):
}
mo.ui.table(_bios_df)
- return
@app.cell(hide_code=True)
@@ -485,7 +462,6 @@ def _(mo):
Questions?
"""
).center()
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/sql.py b/marimo/_smoke_tests/sql.py
index 6252894819..be9dbd0f78 100644
--- a/marimo/_smoke_tests/sql.py
+++ b/marimo/_smoke_tests/sql.py
@@ -11,7 +11,7 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@@ -21,13 +21,15 @@ def _():
from vega_datasets import data
import duckdb
import marimo as mo
+
return alt, data, duckdb, mo
@app.cell(hide_code=True)
def _(mo):
- mo.md("""## Cars""")
- return
+ mo.md("""
+ ## Cars
+ """)
@app.cell
@@ -36,11 +38,11 @@ def _(data, mo):
cars = data.cars()
cylinders = mo.ui.slider.from_series(cars["Cylinders"])
cylinders
- return (cylinders,)
+ return cars, cylinders
@app.cell
-def _(cylinders, mo):
+def _(cars, cylinders, mo):
df = mo.sql(
f"""
SELECT "Name", "Miles_per_Gallon", "Cylinders", "Horsepower"
@@ -60,23 +62,23 @@ def _(alt, df, mo):
.encode(x="Miles_per_Gallon", y="Horsepower")
.properties(height=200)
)
- return
@app.cell(hide_code=True)
def _(mo):
- mo.md("""## Airports""")
- return
+ mo.md("""
+ ## Airports
+ """)
@app.cell
def _(data):
airports = data.airports()
- return
+ return (airports,)
@app.cell
-def _(mo):
+def _(airports, mo):
less_airports = mo.sql(
f"""
select * from airports limit 2
@@ -88,13 +90,13 @@ def _(mo):
@app.cell
def _(less_airports):
len(less_airports)
- return
@app.cell
def _(mo):
- mo.md("""## Google Sheets""")
- return
+ mo.md("""
+ ## Google Sheets
+ """)
@app.cell
@@ -104,7 +106,7 @@ def _():
@app.cell
-def _(mo, sheet):
+def _(mo, sheet: str):
job_types = mo.sql(
f"""
SELECT DISTINCT current_job_title
@@ -122,7 +124,7 @@ def _(job_types, mo):
@app.cell
-def _(job_title, mo, sheet):
+def _(job_title, mo, sheet: str):
_df = mo.sql(
f"""
SELECT *
@@ -130,13 +132,13 @@ def _(job_title, mo, sheet):
WHERE current_job_title == '{job_title.value}'
"""
)
- return
@app.cell(hide_code=True)
def _(mo):
- mo.md("""Debug""")
- return
+ mo.md("""
+ Debug
+ """)
@app.cell(hide_code=True)
@@ -147,11 +149,10 @@ def _(duckdb):
FROM cars
"""
)
- return
@app.cell(hide_code=True)
-def _(duckdb, job_title, sheet):
+def _(duckdb, job_title, sheet: str):
duckdb.get_table_names(
f"""
SELECT *
@@ -159,11 +160,10 @@ def _(duckdb, job_title, sheet):
WHERE current_job_title == '{job_title.value}'
"""
)
- return
@app.cell
-def _(mo):
+def _(cars, mo):
grouped_cars_by_origin = mo.sql(
f"""
SELECT "Origin", COUNT(*) AS "Count"
@@ -172,7 +172,6 @@ def _(mo):
LIMIT 100
"""
)
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/sql/dbapi_sqlite.py b/marimo/_smoke_tests/sql/dbapi_sqlite.py
index aeb295e918..66a71fbfa0 100644
--- a/marimo/_smoke_tests/sql/dbapi_sqlite.py
+++ b/marimo/_smoke_tests/sql/dbapi_sqlite.py
@@ -1,18 +1,20 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@app.cell
def _():
import marimo as mo
+
return (mo,)
@app.cell
def _():
import sqlite3
+
return (sqlite3,)
@@ -36,14 +38,13 @@ def _(sqlite3):
@app.cell
-def _(conn, mo):
+def _(conn, mo, test):
_df = mo.sql(
f"""
select * FROM test
""",
engine=conn
)
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/sql/duckdb_discovery.py b/marimo/_smoke_tests/sql/duckdb_discovery.py
index 15b1a25333..083163a79b 100644
--- a/marimo/_smoke_tests/sql/duckdb_discovery.py
+++ b/marimo/_smoke_tests/sql/duckdb_discovery.py
@@ -4,7 +4,7 @@
import marimo
-__generated_with = "0.25.0"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@@ -39,7 +39,6 @@ def _(duckdb, mo):
through the engine. They verify query counts, not remote Iceberg latency.
One check deliberately simulates an unavailable column-metadata query.
""")
- return
@app.cell
@@ -138,7 +137,7 @@ def _(
@app.cell(hide_code=True)
-def _(discovered_catalogs, mo, msgspec, observed_engine):
+def _(discovered_catalogs: list, mo, msgspec, observed_engine):
mo.vstack(
[
mo.md(f"**Metadata queries: {len(observed_engine.queries)}**"),
@@ -152,7 +151,6 @@ def _(discovered_catalogs, mo, msgspec, observed_engine):
),
]
)
- return
@app.cell
@@ -298,7 +296,7 @@ def _(ObservedDuckDBEngine, create_smoke_connection, product):
@app.cell(hide_code=True)
-def _(check_results, mo):
+def _(check_results: list[dict[str, str]], mo):
_failures = [
result for result in check_results if result["status"] == "FAIL"
]
@@ -310,15 +308,13 @@ def _(check_results, mo):
mo.ui.table(check_results, selection=None),
]
)
- return
@app.cell
-def _(check_results):
+def _(check_results: list[dict[str, str]]):
assert all(result["status"] == "PASS" for result in check_results), [
result for result in check_results if result["status"] == "FAIL"
]
- return
@app.cell(hide_code=True)
@@ -341,7 +337,6 @@ def _(mo):
REST catalog with credentials is needed for that measurement; a public CSV
would exercise data reads rather than catalog discovery.
""")
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/sql/duckdb_engine.py b/marimo/_smoke_tests/sql/duckdb_engine.py
index 9aa611cb78..1880331cca 100644
--- a/marimo/_smoke_tests/sql/duckdb_engine.py
+++ b/marimo/_smoke_tests/sql/duckdb_engine.py
@@ -1,12 +1,13 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@app.cell
def _():
import marimo as mo
+
return (mo,)
@@ -28,7 +29,6 @@ def _(connection_one, mo):
""",
engine=connection_one
)
- return
@app.cell
@@ -40,7 +40,6 @@ def _(connection_two, mo):
""",
engine=connection_two
)
- return
@app.cell
@@ -51,7 +50,6 @@ def _(connection_one, mo):
""",
engine=connection_one
)
- return
@app.cell
@@ -62,7 +60,6 @@ def _(connection_two, mo):
""",
engine=connection_two
)
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/sql/duckdb_interrupt.py b/marimo/_smoke_tests/sql/duckdb_interrupt.py
index d2c2a272ee..33367f0c9e 100644
--- a/marimo/_smoke_tests/sql/duckdb_interrupt.py
+++ b/marimo/_smoke_tests/sql/duckdb_interrupt.py
@@ -1,6 +1,6 @@
import marimo
-__generated_with = "0.16.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@@ -13,6 +13,7 @@ def _():
@app.cell
def _():
import marimo as mo
+
return (mo,)
@@ -24,13 +25,11 @@ def _(mo):
LOAD spatial;
"""
)
- return
@app.cell
def _():
10
- return
@app.cell
@@ -40,11 +39,10 @@ def _(mo):
SELECT 1;
"""
)
- return
@app.cell
-def _(FILE, mo, null):
+def _(FILE: str, mo):
_df = mo.sql(
f"""
CREATE TABLE gdf AS
@@ -52,7 +50,6 @@ def _(FILE, mo, null):
FROM '{FILE}'
"""
)
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/sql/duckdb_tokenize.py b/marimo/_smoke_tests/sql/duckdb_tokenize.py
index bba84d92ae..2a6ebea074 100644
--- a/marimo/_smoke_tests/sql/duckdb_tokenize.py
+++ b/marimo/_smoke_tests/sql/duckdb_tokenize.py
@@ -9,7 +9,7 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@@ -18,6 +18,7 @@ def _():
import marimo as mo
import duckdb
import re
+
return duckdb, mo, re
@@ -41,13 +42,11 @@ def _(code, duckdb):
print("Number of statements: " + str(len(statements)))
print(duckdb.tokenize(code.value))
- return
@app.cell
def _(code, find_created_tables):
find_created_tables(code.value)
- return
@app.cell
@@ -131,6 +130,7 @@ def _(re):
i += 1
return created_tables
+
return (find_created_tables,)
diff --git a/marimo/_smoke_tests/sql/ibis_backend.py b/marimo/_smoke_tests/sql/ibis_backend.py
index c40aedbe57..dee32f8477 100644
--- a/marimo/_smoke_tests/sql/ibis_backend.py
+++ b/marimo/_smoke_tests/sql/ibis_backend.py
@@ -15,7 +15,7 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@@ -25,13 +25,15 @@ def _():
import polars as pl
import pyarrow as pa
import ibis
+
return ibis, mo, pa
@app.cell(hide_code=True)
def _(mo):
- mo.md(r"""## DataFusion Connection""")
- return
+ mo.md(r"""
+ ## DataFusion Connection
+ """)
@app.cell
@@ -65,13 +67,11 @@ def _(con, mo):
""",
engine=con
)
- return
@app.cell(hide_code=True)
def _(mo):
- mo.md(
- r"""
+ mo.md(r"""
## PySpark Connection
Spin up a spark cluster using docker. We will use Spark Connect to communicate with this cluster.
@@ -86,9 +86,7 @@ def _(mo):
```
Notice I have commented out mounting a local volume, you can opt to ignore that line. Include this to read your local filesystem.
- """
- )
- return
+ """)
@app.cell
@@ -107,18 +105,16 @@ def _(ibis):
def _(data, pyspark_conn):
# pyspark_conn.read_csv("/mounted_data/order_details.csv").to_polars()
pyspark_conn.create_table("my_data", obj=data, overwrite=True)
- return
@app.cell
-def _(mo, pyspark_conn):
+def _(mo, my_data, pyspark_conn):
_df = mo.sql(
f"""
SELECT * FROM my_data
""",
engine=pyspark_conn
)
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/sql/ibis_backend_catalog.py b/marimo/_smoke_tests/sql/ibis_backend_catalog.py
index 1e086eca3f..33ddf499ac 100644
--- a/marimo/_smoke_tests/sql/ibis_backend_catalog.py
+++ b/marimo/_smoke_tests/sql/ibis_backend_catalog.py
@@ -10,7 +10,7 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@@ -27,14 +27,16 @@ def _():
@app.cell(hide_code=True)
def _(mo):
- mo.md(r"""# Multi-Catalog Ibis Backend Tests""")
- return
+ mo.md(r"""
+ # Multi-Catalog Ibis Backend Tests
+ """)
@app.cell(hide_code=True)
def _(mo):
- mo.md(r"""## DuckDB Multi-Catalog with Temp Tables""")
- return
+ mo.md(r"""
+ ## DuckDB Multi-Catalog with Temp Tables
+ """)
@app.cell
@@ -68,7 +70,6 @@ def _(duckdb_con):
.select(_.product, _.price, _.quantity, _.total_value)
.order_by(_.total_value.desc())
)
- return
@app.cell
@@ -76,13 +77,13 @@ def _(duckdb_con):
# Query the temp table using Ibis API with deferred API
temp_customers_table = duckdb_con.table("temp_customers")
temp_query = temp_customers_table.order_by(_.customer_id)
- return
@app.cell(hide_code=True)
def _(mo):
- mo.md(r"""## DuckDB Attached Catalogs""")
- return
+ mo.md(r"""
+ ## DuckDB Attached Catalogs
+ """)
@app.cell
@@ -99,7 +100,6 @@ def _(duckdb_con, ibis):
# Create tables in specific catalogs using dot notation
duckdb_con.create_table("inventory", obj=inventory_data, database="catalog_a.main", overwrite=True)
duckdb_con.create_table("orders", obj=orders_data, database="catalog_b.main", overwrite=True)
- return
@app.cell
@@ -115,13 +115,13 @@ def _(duckdb_con):
)
cross_catalog_query
- return
@app.cell(hide_code=True)
def _(mo):
- mo.md(r"""## DataFusion Backend""")
- return
+ mo.md(r"""
+ ## DataFusion Backend
+ """)
@app.cell
@@ -152,7 +152,6 @@ def _(datafusion_con):
)
datafusion_con.create_table("electronics", electronics_query, overwrite=True)
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/sql/iceberg_catalog.py b/marimo/_smoke_tests/sql/iceberg_catalog.py
index ff329fbb33..d94a3ccc1d 100644
--- a/marimo/_smoke_tests/sql/iceberg_catalog.py
+++ b/marimo/_smoke_tests/sql/iceberg_catalog.py
@@ -10,7 +10,7 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@@ -19,6 +19,7 @@ def _():
import marimo as mo
import pyarrow as pa
from pyiceberg.catalog import load_catalog
+
return load_catalog, pa
@@ -68,9 +69,8 @@ def _(catalog, pa):
@app.cell
-def _(catalog, test_table):
+def _(catalog, test_table: tuple[str, str]):
catalog.load_table(test_table).to_polars().collect()
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/sql/limits.py b/marimo/_smoke_tests/sql/limits.py
index f23953a394..b693d20cd5 100644
--- a/marimo/_smoke_tests/sql/limits.py
+++ b/marimo/_smoke_tests/sql/limits.py
@@ -8,20 +8,22 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@app.cell
def _():
import marimo as mo
+
return (mo,)
@app.cell
def _(mo):
- mo.md(r"""## Small table""")
- return
+ mo.md(r"""
+ ## Small table
+ """)
@app.cell
@@ -31,73 +33,67 @@ def _(mo):
CREATE OR REPLACE TABLE small_table AS SELECT * FROM range(1000)
"""
)
- return
@app.cell
-def _(mo):
+def _(mo, small_table):
_df = mo.sql(
f"""
SELECT * FROM small_table;
"""
)
- return
@app.cell
-def _(mo):
+def _(mo, small_table):
_df = mo.sql(
f"""
SELECT * FROM small_table LIMIT 10;
"""
)
- return
@app.cell
-def _(mo):
+def _(mo, small_table):
_df = mo.sql(
f"""
SELECT * FROM small_table LIMIT 1000;
"""
)
- return
@app.cell
-def _(mo):
+def _(mo, small_table):
_df = mo.sql(
f"""
SELECT * FROM small_table LIMIT 300;
"""
)
- return
@app.cell
-def _(mo):
+def _(mo, small_table):
_df = mo.sql(
f"""
SELECT * FROM small_table LIMIT 301;
"""
)
- return
@app.cell
-def _(mo):
+def _(mo, small_table):
_df = mo.sql(
f"""
SELECT * FROM small_table LIMIT 1100;
"""
)
- return
@app.cell
def _(mo):
- mo.md(r"""## Large table""")
- return
+ mo.md(r"""
+ ## Large table
+ """)
@app.cell
@@ -107,37 +103,33 @@ def _(mo):
CREATE OR REPLACE TABLE large_table AS SELECT * FROM range(30_000);
"""
)
- return
@app.cell
-def _(mo):
+def _(large_table, mo):
_df = mo.sql(
f"""
SELECT * FROM large_table;
"""
)
- return
@app.cell
-def _(mo):
+def _(large_table, mo):
_df = mo.sql(
f"""
SELECT * FROM large_table LIMIT 25_000;
"""
)
- return
@app.cell
-def _(mo):
+def _(large_table, mo):
_df = mo.sql(
f"""
SELECT * FROM large_table LIMIT 20_000;
"""
)
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/sql/local_db_deps.py b/marimo/_smoke_tests/sql/local_db_deps.py
index 6ca7b7a899..ef0f1c5943 100644
--- a/marimo/_smoke_tests/sql/local_db_deps.py
+++ b/marimo/_smoke_tests/sql/local_db_deps.py
@@ -1,12 +1,13 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@app.cell
def _():
import marimo as mo
+
return (mo,)
@@ -17,7 +18,6 @@ def _(mo):
ATTACH 'my_db.db' as my_db;
"""
)
- return
@app.cell
@@ -27,7 +27,6 @@ def _(mo):
CREATE OR REPLACE TABLE my_db.my_table as (SELECT 42);
"""
)
- return
@app.cell
@@ -37,7 +36,6 @@ def _(mo):
SELECT * FROM my_db.main.my_table LIMIT 100
"""
)
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/sql/numpy_sql.py b/marimo/_smoke_tests/sql/numpy_sql.py
index 0b3e4eeca4..271ad6bafc 100644
--- a/marimo/_smoke_tests/sql/numpy_sql.py
+++ b/marimo/_smoke_tests/sql/numpy_sql.py
@@ -1,6 +1,6 @@
import marimo
-__generated_with = "0.17.0"
+__generated_with = "0.25.2"
app = marimo.App(width="medium", sql_output="native")
@@ -11,6 +11,7 @@ def _():
import numpy as np
import sqlglot
import pyarrow
+
return np, pd
@@ -36,7 +37,6 @@ def _(example_df):
""",
)
print(res)
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/sql/parse_errors.py b/marimo/_smoke_tests/sql/parse_errors.py
index 27dd2d5043..0818ac1bfa 100644
--- a/marimo/_smoke_tests/sql/parse_errors.py
+++ b/marimo/_smoke_tests/sql/parse_errors.py
@@ -1,6 +1,6 @@
import marimo
-__generated_with = "0.16.2"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@@ -17,6 +17,7 @@ def _():
return json.loads(
duckdb.execute(JSON_SERIALIZE_QUERY, [query]).fetchone()[0]
)
+
return mo, parse
@@ -37,7 +38,7 @@ def _():
@app.cell
-def _(mo, queries):
+def _(mo, queries: list[str]):
table = mo.ui.table(queries, selection="single")
table
return (table,)
@@ -47,7 +48,6 @@ def _(mo, queries):
def _(mo, parse, table):
mo.stop(not table.value)
parse(table.value[0])
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/sql/polars_sql.py b/marimo/_smoke_tests/sql/polars_sql.py
index 726ea4f630..70678557bb 100644
--- a/marimo/_smoke_tests/sql/polars_sql.py
+++ b/marimo/_smoke_tests/sql/polars_sql.py
@@ -10,7 +10,7 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@@ -26,18 +26,18 @@ def _():
@app.cell
-def _(mo, pl, uri):
+def _(mo, pl, uri: None | str):
mo.stop(not uri)
query = "SELECT * FROM pg_catalog.pg_tables;"
df = pl.read_database_uri(query=query, uri=uri)
df
- return
@app.cell
def _():
import marimo as mo
+
return (mo,)
diff --git a/marimo/_smoke_tests/sql/redshift_example.py b/marimo/_smoke_tests/sql/redshift_example.py
index 134abe2312..3f1fcddbeb 100644
--- a/marimo/_smoke_tests/sql/redshift_example.py
+++ b/marimo/_smoke_tests/sql/redshift_example.py
@@ -11,7 +11,7 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@@ -20,13 +20,13 @@ def _():
import marimo as mo
import redshift_connector
import os
+
return mo, os, redshift_connector
@app.cell
def _(mo):
- mo.md(
- r"""
+ mo.md(r"""
# Connecting to Redshift via redshift_connector
Steps:
@@ -34,9 +34,7 @@ def _(mo):
1. Make sure the instance is publicly accessible
2. Check VPC/subnets is public traffic is allowed
3. Navigate to redshift -> workgroup -> obtain connection details
- """
- )
- return
+ """)
@app.cell
@@ -91,7 +89,6 @@ def _(cursor):
('sarah_jones', '[email protected]', '2024-04-05'),
('alex_brown', '[email protected]', '2024-05-12');
""")
- return
@app.cell
@@ -102,7 +99,6 @@ def _(conn, mo):
""",
engine=conn
)
- return
@app.function
@@ -124,8 +120,7 @@ def close_prepared_statements_sample():
@app.cell
def _(mo):
- mo.md(
- r"""
+ mo.md(r"""
## Introspection
get_tables() ->
@@ -201,9 +196,7 @@ def _(mo):
4. column_name
5. key_sequence
6. pk_name
- """
- )
- return
+ """)
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/sql/sql_alchemy.py b/marimo/_smoke_tests/sql/sql_alchemy.py
index a74e77d831..349d795f93 100644
--- a/marimo/_smoke_tests/sql/sql_alchemy.py
+++ b/marimo/_smoke_tests/sql/sql_alchemy.py
@@ -1,18 +1,20 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App()
@app.cell(hide_code=True)
def _(mo):
- mo.md("""# SQLAlchemy Demo""")
- return
+ mo.md("""
+ # SQLAlchemy Demo
+ """)
@app.cell
def _():
import marimo as mo
+
return (mo,)
@@ -22,6 +24,7 @@ def _():
from sqlalchemy.orm import declarative_base, Session
from sqlalchemy.orm import Mapped, mapped_column
import polars as pl
+
return Mapped, Session, declarative_base, mapped_column, pl, sa
@@ -59,13 +62,13 @@ def _(Session, User, engine):
]
_session.add_all(users)
_session.commit()
- return
@app.cell(hide_code=True)
def _(mo):
- mo.md("""### All Users""")
- return
+ mo.md("""
+ ### All Users
+ """)
@app.cell
@@ -92,13 +95,13 @@ def _(Session, User, engine, mo, pl):
),
]
)
- return
@app.cell(hide_code=True)
def _(mo):
- mo.md("""### Users under 30 (ordered by name)""")
- return
+ mo.md("""
+ ### Users under 30 (ordered by name)
+ """)
@app.cell
@@ -113,13 +116,13 @@ def _(Session, User, engine, mo):
mo.ui.table(
[{"Name": u.name, "Age": u.age} for u in young_users], selection=None
)
- return
@app.cell(hide_code=True)
def _(mo):
- mo.md("""### Age Statistics""")
- return
+ mo.md("""
+ ### Age Statistics
+ """)
@app.cell
@@ -139,7 +142,6 @@ def _(Session, User, engine, sa):
("Youngest", age_stats.min_age),
("Oldest", age_stats.max_age),
]
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/sql/sql_alchemy_engine.py b/marimo/_smoke_tests/sql/sql_alchemy_engine.py
index 4a640f27b9..6f59803848 100644
--- a/marimo/_smoke_tests/sql/sql_alchemy_engine.py
+++ b/marimo/_smoke_tests/sql/sql_alchemy_engine.py
@@ -1,31 +1,35 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@app.cell
def _():
import marimo as mo
+
return (mo,)
@app.cell(hide_code=True)
def _(mo):
- mo.md("""# SQL Alchemy with `mo.sql()`""")
- return
+ mo.md("""
+ # SQL Alchemy with `mo.sql()`
+ """)
@app.cell
def _():
from sqlalchemy import text, create_engine
+
return (create_engine,)
@app.cell(hide_code=True)
def _(mo):
- mo.md("""## sqlite""")
- return
+ mo.md("""
+ ## sqlite
+ """)
@app.cell
@@ -63,7 +67,7 @@ def _(create_engine, mo):
@app.cell
-def _(mo, sqlite):
+def _(mo, products, sqlite):
products_df = mo.sql(
f"""
SELECT name, price, category
@@ -77,8 +81,9 @@ def _(mo, sqlite):
@app.cell(hide_code=True)
def _(mo):
- mo.md("""### All Products (sorted by price)""")
- return
+ mo.md("""
+ ### All Products (sorted by price)
+ """)
@app.cell(hide_code=True)
@@ -95,17 +100,17 @@ def _(mo, products_df):
),
]
)
- return
@app.cell(hide_code=True)
def _(mo):
- mo.md(r"""### Category Summary""")
- return
+ mo.md(r"""
+ ### Category Summary
+ """)
@app.cell
-def _(mo, sqlite):
+def _(mo, products, sqlite):
_df = mo.sql(
f"""
-- Category summary
@@ -121,7 +126,6 @@ def _(mo, sqlite):
""",
engine=sqlite
)
- return
@app.cell(hide_code=True)
@@ -135,7 +139,7 @@ def _(mo):
@app.cell
-def _(mo, price_threshold, sqlite):
+def _(mo, price_threshold, products, sqlite):
mo.sql(
f"""
SELECT name, price, category
@@ -145,13 +149,13 @@ def _(mo, price_threshold, sqlite):
""",
engine=sqlite,
)
- return
@app.cell(hide_code=True)
def _(mo):
- mo.md(r"""## postgresql""")
- return
+ mo.md(r"""
+ ## postgresql
+ """)
@app.cell
@@ -189,7 +193,6 @@ def _(mo, my_postgres):
""",
engine=my_postgres
)
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/sql/sqlmodel_engine.py b/marimo/_smoke_tests/sql/sqlmodel_engine.py
index fe1d50597a..2b2ac28517 100644
--- a/marimo/_smoke_tests/sql/sqlmodel_engine.py
+++ b/marimo/_smoke_tests/sql/sqlmodel_engine.py
@@ -13,7 +13,7 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@@ -21,25 +21,29 @@ app = marimo.App(width="medium")
def _():
import altair as alt
import marimo as mo
+
return (mo,)
@app.cell(hide_code=True)
def _(mo):
- mo.md("""# SQLModel with `mo.sql()`""")
- return
+ mo.md("""
+ # SQLModel with `mo.sql()`
+ """)
@app.cell
def _():
from sqlmodel import text, create_engine
+
return (create_engine,)
@app.cell(hide_code=True)
def _(mo):
- mo.md("""## sqlite""")
- return
+ mo.md("""
+ ## sqlite
+ """)
@app.cell
@@ -77,7 +81,7 @@ def _(create_engine, mo):
@app.cell
-def _(mo, sqlite):
+def _(mo, products, sqlite):
products_df = mo.sql(
f"""
SELECT name, price, category
@@ -91,8 +95,9 @@ def _(mo, sqlite):
@app.cell(hide_code=True)
def _(mo):
- mo.md("""### All Products (sorted by price)""")
- return
+ mo.md("""
+ ### All Products (sorted by price)
+ """)
@app.cell(hide_code=True)
@@ -109,17 +114,17 @@ def _(mo, products_df):
),
]
)
- return
@app.cell(hide_code=True)
def _(mo):
- mo.md(r"""### Category Summary""")
- return
+ mo.md(r"""
+ ### Category Summary
+ """)
@app.cell
-def _(mo, sqlite):
+def _(mo, products, sqlite):
_df = mo.sql(
f"""
-- Category summary
@@ -135,7 +140,6 @@ def _(mo, sqlite):
""",
engine=sqlite
)
- return
@app.cell(hide_code=True)
@@ -149,7 +153,7 @@ def _(mo):
@app.cell
-def _(mo, price_threshold, sqlite):
+def _(mo, price_threshold, products, sqlite):
_df = mo.sql(
f"""
SELECT name, price, category
@@ -159,13 +163,13 @@ def _(mo, price_threshold, sqlite):
""",
engine=sqlite
)
- return
@app.cell(hide_code=True)
def _(mo):
- mo.md(r"""## postgresql""")
- return
+ mo.md(r"""
+ ## postgresql
+ """)
@app.cell
@@ -205,7 +209,6 @@ def _(mo, my_postgres):
""",
engine=my_postgres
)
- return
@app.cell
@@ -216,18 +219,16 @@ def _(connection, mo):
""",
engine=connection
)
- return
@app.cell
-def _(mo, sqlite):
+def _(mo, products, sqlite):
_df = mo.sql(
f"""
SELECT * FROM products LIMIT 100
""",
engine=sqlite
)
- return
@app.cell
@@ -238,7 +239,6 @@ def _(mo):
FROM 'hf://datasets/julien040/hacker-news-posts/story.parquet' LIMIT 500
"""
)
- return
@app.cell
@@ -248,7 +248,6 @@ def _(mo):
SELECT "id" FROM memory.main.foo LIMIT 100
"""
)
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/sql_error_handling.py b/marimo/_smoke_tests/sql_error_handling.py
index 4dfb0fcb6d..0cc16742b8 100644
--- a/marimo/_smoke_tests/sql_error_handling.py
+++ b/marimo/_smoke_tests/sql_error_handling.py
@@ -9,7 +9,7 @@
import marimo
-__generated_with = "0.16.1"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
with app.setup(hide_code=True):
@@ -19,27 +19,21 @@ with app.setup(hide_code=True):
@app.cell(hide_code=True)
def _():
- mo.md(
- """
+ mo.md("""
# SQL Error Handling Smoke Test
This notebook demonstrates marimo's SQL error handling capabilities across different types of SQL errors.
Each section shows how marimo gracefully handles SQL errors with helpful error messages.
- """
- )
- return
+ """)
@app.cell(hide_code=True)
def _():
- mo.md(
- """
+ mo.md("""
## Setup Test Data
First, let's create some test data to work with.
- """
- )
- return
+ """)
@app.cell
@@ -55,7 +49,6 @@ def _():
)
"""
)
- return (users,)
@app.cell
@@ -68,19 +61,15 @@ def _(users):
(3, 'Charlie', '[email protected]', 35)
"""
)
- return
@app.cell(hide_code=True)
def _():
- mo.md(
- """
+ mo.md("""
## 1. Table Not Found Errors
DuckDB provides helpful suggestions when table names don't exist.
- """
- )
- return
+ """)
@app.cell
@@ -91,7 +80,6 @@ def _(user):
select * from user
"""
)
- return
@app.cell
@@ -102,19 +90,15 @@ def _(user_table):
SELECT * FROM user_table
"""
)
- return
@app.cell(hide_code=True)
def _():
- mo.md(
- """
+ mo.md("""
## 2. Column Not Found Errors
Column reference errors with candidate suggestions.
- """
- )
- return
+ """)
@app.cell
@@ -126,7 +110,6 @@ def _(users):
SELECT user_name FROM users
"""
)
- return
@app.cell
@@ -138,19 +121,15 @@ def _(users):
SELECT id, fullname, email FROM users
"""
)
- return
@app.cell(hide_code=True)
def _():
- mo.md(
- """
+ mo.md("""
## 3. SQL Syntax Errors
Various syntax errors with position information.
- """
- )
- return
+ """)
@app.cell
@@ -161,7 +140,6 @@ def _():
SELECT * FRM users
"""
)
- return
@app.cell
@@ -172,7 +150,6 @@ def _():
SELECT ( FROM users
"""
)
- return
@app.cell
@@ -183,7 +160,6 @@ def _():
SELECT * FROM users WHERE
"""
)
- return
@app.cell
@@ -194,19 +170,15 @@ def _():
SELECT * FROM users FROM users
"""
)
- return
@app.cell(hide_code=True)
def _():
- mo.md(
- """
+ mo.md("""
## 4. Data Type Errors
Type mismatch and conversion errors.
- """
- )
- return
+ """)
@app.cell
@@ -217,7 +189,6 @@ def _(users):
SELECT age / 'invalid_string' FROM users
"""
)
- return
@app.cell
@@ -228,19 +199,15 @@ def _(users):
SELECT * FROM users WHERE name > 123
"""
)
- return
@app.cell(hide_code=True)
def _():
- mo.md(
- """
+ mo.md("""
## 5. Function Errors
Function call errors and argument mismatches.
- """
- )
- return
+ """)
@app.cell
@@ -251,7 +218,6 @@ def _(users):
SELECT INVALID_FUNCTION(name) FROM users
"""
)
- return
@app.cell
@@ -263,19 +229,15 @@ def _(users):
SELECT SUBSTRING(name) FROM users
"""
)
- return
@app.cell(hide_code=True)
def _():
- mo.md(
- """
+ mo.md("""
## 6. Aggregate Function Errors
GROUP BY and aggregate function errors.
- """
- )
- return
+ """)
@app.cell
@@ -287,7 +249,6 @@ def _(users):
SELECT name, COUNT(*) FROM users
"""
)
- return
@app.cell
@@ -298,19 +259,15 @@ def _(users):
SELECT * FROM users HAVING COUNT(*) > 1
"""
)
- return
@app.cell(hide_code=True)
def _():
- mo.md(
- """
+ mo.md("""
## 7. Complex Query Errors
More complex SQL errors that might occur in real scenarios.
- """
- )
- return
+ """)
@app.cell
@@ -322,7 +279,6 @@ def _(users):
WHERE id IN (SELECT invalid_column FROM users)
"""
)
- return
@app.cell
@@ -335,19 +291,15 @@ def _(nonexistent_table, users):
JOIN nonexistent_table p ON u.id = p.user_id
"""
)
- return
@app.cell(hide_code=True)
def _():
- mo.md(
- """
+ mo.md("""
## 8. Very Long SQL Statements
Testing error handling with long SQL that gets truncated.
- """
- )
- return
+ """)
@app.cell
@@ -360,19 +312,15 @@ def _(nonexistent_table):
FROM nonexistent_table
"""
)
- return
@app.cell(hide_code=True)
def _():
- mo.md(
- """
+ mo.md("""
## 9. SQL with Special Characters
Testing error handling with special characters and edge cases.
- """
- )
- return
+ """)
@app.cell
@@ -383,7 +331,6 @@ def _():
SELECT * FROM 'table with spaces and quotes'
"""
)
- return
@app.cell
@@ -394,18 +341,15 @@ def _(用户表):
SELECT * FROM 用户表
"""
)
- return
+
@app.cell(hide_code=True)
def _():
- mo.md(
- r"""
+ mo.md(r"""
## 11. Multiple Statements
Test sql cells with multiple queries
- """
- )
- return
+ """)
@app.cell
@@ -416,19 +360,15 @@ def _(users):
SELECT names FROM users
"""
)
- return
@app.cell(hide_code=True)
def _():
- mo.md(
- """
+ mo.md("""
## 12. Successful Query for Comparison
Here's a working query to show the contrast with error handling.
- """
- )
- return
+ """)
@app.cell
@@ -442,13 +382,11 @@ def _(users):
ORDER BY age DESC
"""
)
- return
@app.cell(hide_code=True)
def _():
- mo.md(
- """
+ mo.md("""
## Summary
This notebook demonstrates marimo's comprehensive SQL error handling:
@@ -462,9 +400,7 @@ def _():
Each SQL cell above will display a structured error in marimo's error UI, showing how
different types of SQL errors are handled gracefully with actionable feedback.
- """
- )
- return
+ """)
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/state.py b/marimo/_smoke_tests/state.py
index ff1b4503c5..0629511293 100644
--- a/marimo/_smoke_tests/state.py
+++ b/marimo/_smoke_tests/state.py
@@ -8,32 +8,32 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App()
@app.cell
def _():
import marimo as mo
+
return (mo,)
@app.cell
def _():
import math
+
return (math,)
@app.cell
def _():
import random
- return
@app.cell
def _():
import time
- return
@app.cell
@@ -46,13 +46,11 @@ def _(mo):
def _(get_state, set_state):
# No self-loops: shouldn't be a cycle
set_state(get_state())
- return
@app.cell
def _(get_state):
get_state()
- return
@app.cell
@@ -62,7 +60,6 @@ def _(mo, set_state):
value=0, on_click=_on_click
)
button
- return
@app.cell
@@ -96,7 +93,6 @@ def _(get_angle, math, mo, set_angle):
@app.cell
def _(degrees, radians):
degrees, radians
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/stats.py b/marimo/_smoke_tests/stats.py
index 3c778d1c35..8d91588222 100644
--- a/marimo/_smoke_tests/stats.py
+++ b/marimo/_smoke_tests/stats.py
@@ -2,7 +2,7 @@
import marimo
-__generated_with = "0.18.2"
+__generated_with = "0.25.2"
app = marimo.App()
@@ -11,6 +11,7 @@ def _():
import marimo as mo
import polars as pl
import altair as alt
+
return alt, mo, pl
@@ -35,7 +36,6 @@ def _(mo):
),
]
mo.hstack(_stats)
- return
@app.cell
@@ -73,7 +73,6 @@ def _(mo):
),
]
mo.hstack(_stats, widths="equal", gap=1)
- return
@app.cell(hide_code=True)
@@ -169,7 +168,6 @@ def _(alt, mo, pl):
_second = mo.hstack(_rich, widths="equal", gap=1)
mo.vstack([_first, _second])
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/status/status.py b/marimo/_smoke_tests/status/status.py
index 1599022445..8718a6b9bc 100644
--- a/marimo/_smoke_tests/status/status.py
+++ b/marimo/_smoke_tests/status/status.py
@@ -8,7 +8,7 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App()
@@ -16,6 +16,7 @@ app = marimo.App()
def _():
import marimo as mo
import time
+
return mo, time
@@ -42,7 +43,7 @@ def _(mo):
@app.cell
-def _(disabled_switch, mo, sleep_time, time):
+def _(disabled_switch, mo, sleep_time: float, time):
for _ in mo.status.progress_bar(
range(10),
title="Loading",
@@ -50,11 +51,10 @@ def _(disabled_switch, mo, sleep_time, time):
disabled=disabled_switch.value,
):
time.sleep(sleep_time)
- return
@app.cell
-def _(disabled_switch, mo, sleep_time, time):
+def _(disabled_switch, mo, sleep_time: float, time):
for _ in mo.status.progress_bar(
range(10),
title="Loading",
@@ -64,11 +64,10 @@ def _(disabled_switch, mo, sleep_time, time):
disabled=disabled_switch.value,
):
time.sleep(sleep_time)
- return
@app.cell
-def _(disabled_switch, mo, sleep_time, time):
+def _(disabled_switch, mo, sleep_time: float, time):
with mo.status.progress_bar(
title="Loading",
subtitle="Please wait",
@@ -78,37 +77,33 @@ def _(disabled_switch, mo, sleep_time, time):
for _ in range(10):
time.sleep(sleep_time)
bar.update()
- return
@app.cell
-def _(mo, sleep_time, time):
+def _(mo, sleep_time: float, time):
with mo.status.spinner(title="Loading...", remove_on_exit=True) as _spinner:
time.sleep(0.1)
_spinner.update("Almost done")
time.sleep(sleep_time)
- return
@app.cell
-def _(mo, sleep_time, time):
+def _(mo, sleep_time: float, time):
with mo.status.spinner(title="Loading...", remove_on_exit=True) as _spinner:
time.sleep(sleep_time)
_spinner.update("Almost done")
time.sleep(sleep_time)
mo.ui.table([1, 2, 3])
- return
@app.cell
-def _(disabled_switch, mo, sleep_time, time):
+def _(disabled_switch, mo, sleep_time: float, time):
# Fast updates should be debounced for performance
for i in mo.status.progress_bar(
range(1000),
disabled=disabled_switch.value,
):
time.sleep(sleep_time / 10)
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/stdin.py b/marimo/_smoke_tests/stdin.py
index 5c08beb2ef..772e1673d7 100644
--- a/marimo/_smoke_tests/stdin.py
+++ b/marimo/_smoke_tests/stdin.py
@@ -8,13 +8,14 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App()
@app.cell
def _():
import marimo as mo
+
return (mo,)
@@ -25,21 +26,18 @@ def _():
@app.cell
-def _(mo, value):
+def _(mo, value: str):
mo.md(f"## 👋 Hi {value}")
- return
@app.cell
def _():
print('hi')
- return
@app.cell
def _():
print('there')
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/stop.py b/marimo/_smoke_tests/stop.py
index cf65dffe27..7ea5aa1a39 100644
--- a/marimo/_smoke_tests/stop.py
+++ b/marimo/_smoke_tests/stop.py
@@ -8,7 +8,7 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App()
@@ -16,6 +16,7 @@ app = marimo.App()
def _():
import marimo as mo
import time
+
return (mo,)
@@ -51,7 +52,7 @@ def _(mo, secret):
@app.cell
-def _(mo, secret, success_1):
+def _(mo, secret, success_1: bool):
# Validation 3
# This cell depends on the secret and first validation
mo.stop(
@@ -64,13 +65,12 @@ def _(mo, secret, success_1):
@app.cell
-def _(mo, success_1, success_2, success_3):
+def _(mo, success_1: bool, success_2: bool, success_3: bool):
# This depends on all the validations, and not the secret
_success = success_1 and success_2 and success_3
mo.stop(not _success)
mo.md("Secret is correct!").callout(kind="success")
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/structures.py b/marimo/_smoke_tests/structures.py
index d5d12df6b1..5954014107 100644
--- a/marimo/_smoke_tests/structures.py
+++ b/marimo/_smoke_tests/structures.py
@@ -1,11 +1,11 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@app.cell
-def _(mo, x):
+def _(mo, x: int):
import datetime
[
@@ -31,7 +31,6 @@ def _(mo, x):
"time": datetime.time(1, 2, 3),
}
]
- return
@app.cell
@@ -48,7 +47,6 @@ def _():
random_data[f"key_{i}"].extend(random.sample(range(100), 5))
random_data
- return
@app.cell
@@ -59,12 +57,12 @@ def _():
CustomList(1)
- return
@app.cell
def _():
import marimo as mo
+
return (mo,)
@@ -80,32 +78,27 @@ def _():
@app.cell
def _(sys):
repr(sys.version_info)
- return
@app.cell
def _(sys):
# Nested, so it is not preserved
(sys.version_info,)
- return
@app.cell
def _(sys):
{1, 2, 3, sys.version_info}
- return
@app.cell
def _():
(1, 2, 3)
- return
@app.cell
def _(mo):
mo.refs()
- return
@app.cell
diff --git a/marimo/_smoke_tests/table_urls.py b/marimo/_smoke_tests/table_urls.py
index ec66c1f92e..cb15d2864a 100644
--- a/marimo/_smoke_tests/table_urls.py
+++ b/marimo/_smoke_tests/table_urls.py
@@ -8,13 +8,14 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@app.cell
def _():
import marimo as mo
+
return (mo,)
@@ -36,7 +37,6 @@ def _(mo):
},
],
)
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/tables/big_ints.py b/marimo/_smoke_tests/tables/big_ints.py
index 77b638b079..51a6efe9fd 100644
--- a/marimo/_smoke_tests/tables/big_ints.py
+++ b/marimo/_smoke_tests/tables/big_ints.py
@@ -1,6 +1,6 @@
import marimo
-__generated_with = "0.17.6"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@@ -9,7 +9,6 @@ def _(mo):
mo.md(r"""
## Big Ints
""")
- return
@app.cell(hide_code=True)
@@ -36,24 +35,23 @@ def _():
@app.cell
-def _(data, mo):
+def _(data: dict[str, list[int]], mo):
import pandas as pd
mo.vstack([mo.plain(pd.DataFrame(data)), pd.DataFrame(data)])
- return
@app.cell
-def _(data, mo):
+def _(data: dict[str, list[int]], mo):
import polars as pl
mo.vstack([mo.plain(pl.DataFrame(data)), pl.DataFrame(data)])
- return
@app.cell
def _():
import marimo as mo
+
return (mo,)
diff --git a/marimo/_smoke_tests/tables/booleans.py b/marimo/_smoke_tests/tables/booleans.py
index 31cee8b167..7ca6e0c966 100644
--- a/marimo/_smoke_tests/tables/booleans.py
+++ b/marimo/_smoke_tests/tables/booleans.py
@@ -9,7 +9,7 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@@ -18,6 +18,7 @@ def _():
import marimo as mo
import pandas as pd
import polars as pl
+
return mo, pd, pl
@@ -34,13 +35,12 @@ def _(pd):
@app.cell
-def _(data, pl):
+def _(data: dict, pl):
pl.DataFrame(data)
- return
@app.cell
-def _(data, mo):
+def _(data: dict, mo):
t = mo.ui.table(data)
t
return (t,)
@@ -49,7 +49,6 @@ def _(data, mo):
@app.cell
def _(t):
t.value
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/tables/columnar_tables.py b/marimo/_smoke_tests/tables/columnar_tables.py
index 6a3d6a36ae..c11b05c391 100644
--- a/marimo/_smoke_tests/tables/columnar_tables.py
+++ b/marimo/_smoke_tests/tables/columnar_tables.py
@@ -1,18 +1,20 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@app.cell
def _():
import marimo as mo
+
return (mo,)
@app.cell
def _():
import polars as pl
+
return (pl,)
@@ -32,14 +34,12 @@ def _(mo, test_df):
@app.cell
def _(table):
table.value
- return
@app.cell
def test_is_dict_of_lists(table):
assert "num" in table.value
assert isinstance(table.value["num"], list)
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/tables/dictionary_table.py b/marimo/_smoke_tests/tables/dictionary_table.py
index 8488738ea1..9e56d5a9ee 100644
--- a/marimo/_smoke_tests/tables/dictionary_table.py
+++ b/marimo/_smoke_tests/tables/dictionary_table.py
@@ -8,7 +8,7 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@@ -16,6 +16,7 @@ app = marimo.App(width="medium")
def _():
import os
import marimo as mo
+
return mo, os
@@ -37,13 +38,11 @@ def _(mo):
"value": lambda x: x + 1,
},
)
- return
@app.cell
def _(v):
v.value
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/tables/ibis_example.py b/marimo/_smoke_tests/tables/ibis_example.py
index 6f54d1f5fc..45eb0dff58 100644
--- a/marimo/_smoke_tests/tables/ibis_example.py
+++ b/marimo/_smoke_tests/tables/ibis_example.py
@@ -1,12 +1,13 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@app.cell
def _():
import marimo as mo
+
return (mo,)
@@ -32,19 +33,16 @@ def _(mo):
@app.cell
def _(table):
table
- return
@app.cell
def _(mo, table):
mo.ui.table(table.value)
- return
@app.cell
def _(table):
table.value
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/tables/ibis_interactive.py b/marimo/_smoke_tests/tables/ibis_interactive.py
index 1dbb3f7379..ab065ae257 100644
--- a/marimo/_smoke_tests/tables/ibis_interactive.py
+++ b/marimo/_smoke_tests/tables/ibis_interactive.py
@@ -1,6 +1,6 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@@ -9,6 +9,7 @@ def _():
import marimo as mo
import polars as pl
import numpy as np
+
return (mo,)
@@ -43,14 +44,12 @@ def _(execution_timer, ibis_table):
# Takes a while, loads data into memory when `ibis.options.interactive = True`
with execution_timer("ibis_table"):
print(ibis_table)
- return
@app.cell
def _(ibis_table):
# Takes a while, loads data into memory when `ibis.options.interactive = True`
ibis_table
- return
@app.cell
@@ -58,7 +57,6 @@ def _(execution_timer, ibis_table):
# This should be fast (lazy)
with execution_timer("t.head(10)"):
ibis_head = ibis_table.head(10)
- return
@app.cell(hide_code=True)
@@ -85,6 +83,7 @@ def _():
print(
f"\033[91m[SLOW]\033[0m {self.name} time: {duration} seconds"
)
+
return (execution_timer,)
diff --git a/marimo/_smoke_tests/tables/lazy.py b/marimo/_smoke_tests/tables/lazy.py
index 212d760ad0..8079ab8273 100644
--- a/marimo/_smoke_tests/tables/lazy.py
+++ b/marimo/_smoke_tests/tables/lazy.py
@@ -1,6 +1,6 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@@ -9,13 +9,15 @@ def _():
import marimo as mo
import polars as pl
import numpy as np
+
return mo, np, pl
@app.cell
def _(mo):
- mo.md(r"""# Lazy polars""")
- return
+ mo.md(r"""
+ # Lazy polars
+ """)
@app.cell
@@ -41,13 +43,15 @@ def _(lazy_df):
@app.cell
def _(mo):
- mo.md(r"""# Lazy ibis""")
- return
+ mo.md(r"""
+ # Lazy ibis
+ """)
@app.cell
def _():
import ibis
+
return (ibis,)
@@ -67,7 +71,6 @@ def _(execution_timer, ibis, ibis_table, mo):
ibis.options.interactive = False
with execution_timer("as_html, interactive = False"):
mo.output.replace(ibis_table)
- return
@app.cell
@@ -77,7 +80,6 @@ def _(execution_timer, ibis, ibis_table, mo):
with execution_timer("as_html, interactive = True"):
mo.output.replace(ibis_table)
ibis.options.interactive = False
- return
@app.cell
@@ -93,7 +95,6 @@ def _(execution_timer, ibis_table):
# This should be ~300-500ms
with execution_timer("t.count().execute()"):
count = ibis_table.count().execute()
- return
@app.cell
@@ -127,6 +128,7 @@ def _(execution_timer, ibis):
with execution_timer("to_sql"):
if "ibis" in str(type(tm)).lower():
ibis.to_sql(tm.take(100, 0).take(10, 0).data.count())
+
return (time_things,)
@@ -134,14 +136,12 @@ def _(execution_timer, ibis):
def _(ibis_table, time_things):
# Ibis
time_things(ibis_table)
- return
@app.cell
def _(polars_df, time_things):
# Polars
time_things(polars_df)
- return
@app.cell
@@ -150,7 +150,6 @@ def _(execution_timer, ibis_table, mo):
with execution_timer("mo.ui.dataframe"):
_df_viewer = mo.ui.dataframe(ibis_table)
_df_viewer
- return
@app.cell
@@ -159,7 +158,6 @@ def _(execution_timer, ibis_table, mo):
with execution_timer("mo.ui.dataframe(limit=10)"):
_df_viewer = mo.ui.dataframe(ibis_table, limit=10)
_df_viewer
- return
@app.cell(hide_code=True)
@@ -186,6 +184,7 @@ def _():
print(
f"\033[91m[SLOW]\033[0m {self.name} time: {duration} seconds"
)
+
return (execution_timer,)
diff --git a/marimo/_smoke_tests/tables/lazy_polars.py b/marimo/_smoke_tests/tables/lazy_polars.py
index bf5f6e2f62..4d148dc27e 100644
--- a/marimo/_smoke_tests/tables/lazy_polars.py
+++ b/marimo/_smoke_tests/tables/lazy_polars.py
@@ -1,6 +1,6 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@@ -8,13 +8,15 @@ app = marimo.App(width="medium")
def _():
import marimo as mo
import polars as pl
+
return mo, pl
@app.cell(hide_code=True)
def _(mo):
- mo.md(r"""Load data""")
- return
+ mo.md(r"""
+ Load data
+ """)
@app.cell
@@ -28,53 +30,53 @@ def _(pl):
@app.cell(hide_code=True)
def _(mo):
- mo.md(r"""`mo.plain`""")
- return
+ mo.md(r"""
+ `mo.plain`
+ """)
@app.cell
def _(df, mo):
# ~100-300ms
mo.plain(df)
- return
@app.cell(hide_code=True)
def _(mo):
- mo.md(r"""**default formatter**""")
- return
+ mo.md(r"""
+ **default formatter**
+ """)
@app.cell
def _(df):
# ~100-300ms
df
- return
@app.cell(hide_code=True)
def _(mo):
- mo.md(r"""`mo.ui.table.lazy`""")
- return
+ mo.md(r"""
+ `mo.ui.table.lazy`
+ """)
@app.cell
def _(df, mo):
# 50ms
mo.ui.table.lazy(df)
- return
@app.cell
def _(df):
df.collect_schema()
- return
@app.cell(hide_code=True)
def _(mo):
- mo.md(r"""Using with `mo.ui.table`""")
- return
+ mo.md(r"""
+ Using with `mo.ui.table`
+ """)
@app.cell
@@ -128,7 +130,7 @@ def _(mo):
@app.cell(hide_code=True)
-def _(create_chart, df, emotions, mo):
+def _(create_chart, df, emotions: list[str], mo):
mo.stop(not create_chart.value)
import altair as alt
@@ -156,7 +158,6 @@ def _(create_chart, df, emotions, mo):
alt.data_transformers.enable("marimo_csv")
chart
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/tables/markdown_example.py b/marimo/_smoke_tests/tables/markdown_example.py
index d15357e709..5c395e4464 100644
--- a/marimo/_smoke_tests/tables/markdown_example.py
+++ b/marimo/_smoke_tests/tables/markdown_example.py
@@ -1,17 +1,18 @@
import marimo
-__generated_with = "0.17.8"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@app.cell
def _():
import marimo as mo
+
return (mo,)
@app.cell
-def _(markdown_sample, mo):
+def _(markdown_sample: str, mo):
mo.ui.table(
{
"heading": ["### Hello" * 8],
@@ -20,7 +21,6 @@ def _(markdown_sample, mo):
"markdown_sample": [markdown_sample],
}
)
- return
@app.cell
diff --git a/marimo/_smoke_tests/tables/milliseconds.py b/marimo/_smoke_tests/tables/milliseconds.py
index a80e28ab34..c8bc213df1 100644
--- a/marimo/_smoke_tests/tables/milliseconds.py
+++ b/marimo/_smoke_tests/tables/milliseconds.py
@@ -1,12 +1,13 @@
import marimo
-__generated_with = "0.18.0"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@app.cell
def _():
import marimo as mo
+
return (mo,)
@@ -36,7 +37,6 @@ def _(pandas_dates_df):
import polars as pl
pl.DataFrame(pandas_dates_df)
- return
@app.cell
@@ -58,7 +58,6 @@ def _(mo):
) AS t(raw)
"""
)
- return
@app.cell(hide_code=True)
@@ -72,7 +71,6 @@ def _(mo):
Also created an equivalent SQL result (df_sql_dates) using an inline VALUES list and TRY_CAST to show parsed timestamps and a simple LIKE check to detect milliseconds.
""")
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/tables/nans.py b/marimo/_smoke_tests/tables/nans.py
index 2ab2c21253..cd2dff9800 100644
--- a/marimo/_smoke_tests/tables/nans.py
+++ b/marimo/_smoke_tests/tables/nans.py
@@ -1,6 +1,6 @@
import marimo
-__generated_with = "0.18.2"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@@ -10,6 +10,7 @@ def _():
import polars as pl
import pandas as pd
import numpy as np
+
return mo, np, pd, pl
@@ -17,7 +18,6 @@ def _():
def _(mo, np, pl):
polars_df = pl.DataFrame({"nans": [1.0, np.nan, np.inf, -np.inf, None]})
mo.vstack([mo.plain(polars_df), polars_df])
- return
@app.cell
@@ -26,7 +26,6 @@ def _(np, pd, pl):
{"nans_not_strict": [1.0, np.nan, np.inf, -np.inf, None, pd.NA, pd.NaT]},
strict=False,
)
- return
@app.cell
@@ -35,7 +34,6 @@ def _(mo, np, pd):
{"nans": [1, None, pd.NaT, np.nan, pd.NA, np.inf, -np.inf]}
)
mo.vstack([mo.plain(pandas_df_obj), pandas_df_obj])
- return
@app.cell
@@ -43,7 +41,6 @@ def _(pd):
# Filtering NaNs work for float types
pandas_nan_float = pd.DataFrame({"nans": [1, 2, 3, 4, float("nan")]})
pandas_nan_float
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/tables/rich_elements.py b/marimo/_smoke_tests/tables/rich_elements.py
index 4740a54a5b..09abf1e543 100644
--- a/marimo/_smoke_tests/tables/rich_elements.py
+++ b/marimo/_smoke_tests/tables/rich_elements.py
@@ -1,6 +1,6 @@
import marimo
-__generated_with = "0.17.6"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@@ -10,6 +10,7 @@ def _():
import pandas as pd
import polars as pl
import altair as alt
+
return alt, mo, pd, pl
@@ -18,7 +19,6 @@ def _(mo):
mo.md(r"""
# Printing Rich Elements
""")
- return
@app.cell(hide_code=True)
@@ -146,13 +146,12 @@ def _(alt, mo, pd):
@app.cell
-def _(data, mo):
+def _(data: dict, mo):
mo.vstack([mo.md("## Table"), mo.ui.table(data, page_size=20)])
- return
@app.cell
-def _(data, mo, pd):
+def _(data: dict, mo, pd):
pandas_rich = pd.DataFrame(data).transpose()
mo.vstack([mo.md("## Pandas dataframe"), pandas_rich])
return (pandas_rich,)
@@ -161,11 +160,10 @@ def _(data, mo, pd):
@app.cell
def _(mo, pandas_rich):
mo.vstack([mo.md("## Table containing pandas df"), mo.ui.table(pandas_rich)])
- return
@app.cell
-def _(data, mo, pl):
+def _(data: dict, mo, pl):
data.pop("arrays", None)
data.pop("batch", None)
data.pop("mixed", None)
@@ -180,13 +178,11 @@ def _(mo, password):
mo.md(f"""
### Password value: {password.value}
""")
- return
@app.cell
def _(mo, pl_df):
mo.vstack([mo.md("## Table containing polars dataframe"), mo.ui.table(pl_df)])
- return
@app.cell
@@ -197,7 +193,6 @@ def _(mo):
`pl.DataFrame(data).transpose()`
""")
# pl.DataFrame(data).transpose()
- return
@app.cell
@@ -206,19 +201,16 @@ def _(mo, pd, pl):
pl.DataFrame({"button": mo.ui.button()})
mo.ui.table({"button": mo.ui.button()})
- return
@app.cell
-def _(data, mo):
+def _(data: dict, mo):
mo.ui.data_editor(data=data, label="Edit Data")
- return
@app.cell
-def _(data, mo):
+def _(data: dict, mo):
mo.ui.data_explorer(data)
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/tables/selection.py b/marimo/_smoke_tests/tables/selection.py
index a5e88ca8b8..ed40af915d 100644
--- a/marimo/_smoke_tests/tables/selection.py
+++ b/marimo/_smoke_tests/tables/selection.py
@@ -1,6 +1,6 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@@ -8,6 +8,7 @@ app = marimo.App(width="medium")
def _():
import marimo as mo
import polars as pl
+
return mo, pl
@@ -28,7 +29,6 @@ def _(data, mo):
@app.cell
def _(t1):
t1.value
- return
@app.cell
@@ -41,7 +41,6 @@ def _(data, mo):
@app.cell
def _(t2):
t2.value
- return
@app.cell
@@ -54,7 +53,6 @@ def _(data, mo):
@app.cell
def _(t3):
t3.value
- return
@app.cell
@@ -67,7 +65,6 @@ def _(data, mo):
@app.cell
def _(t4):
t4.value
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/tables/server_pagination.py b/marimo/_smoke_tests/tables/server_pagination.py
index 6f48b77a54..16b505c3fc 100644
--- a/marimo/_smoke_tests/tables/server_pagination.py
+++ b/marimo/_smoke_tests/tables/server_pagination.py
@@ -9,7 +9,7 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@@ -17,6 +17,7 @@ app = marimo.App(width="medium")
def _():
import marimo as mo
from vega_datasets import data
+
return data, mo
@@ -37,28 +38,24 @@ def _(cars, mo):
@app.cell
def _(default):
default._value_frontend
- return
@app.cell
def _(cars, mo):
# JSON
mo.ui.table(cars.to_dict(orient="records"))
- return
@app.cell
def _(cars, mo):
# No pagination
mo.ui.table(cars[0:20], pagination=False)
- return
@app.cell
def _(cars, mo):
# Trimmed, no pagination
mo.ui.table(cars[0:9])
- return
@app.cell
@@ -73,7 +70,6 @@ def _(cars, mo):
@app.cell
def _(more_cars):
more_cars.value
- return
@app.cell
@@ -81,13 +77,11 @@ def _(cars):
# 1m cars, above DEFAULT_SUMMARY_STATS_ROW_LIMIT
one_mil_cars = cars.sample(1_000_000 + 1, replace=True)
# mo.ui.table(one_mil_cars)
- return
@app.cell
def _(cars, mo):
mo.ui.dataframe(cars)
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/tables/subseconds.py b/marimo/_smoke_tests/tables/subseconds.py
index 16339ded28..64d5bb9eb8 100644
--- a/marimo/_smoke_tests/tables/subseconds.py
+++ b/marimo/_smoke_tests/tables/subseconds.py
@@ -1,6 +1,6 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@@ -10,13 +10,15 @@ def _():
import marimo as mo
import pandas as pd
+
return datetime, mo, pd
@app.cell
def _(mo):
- mo.md(r"""## Datetime""")
- return
+ mo.md(r"""
+ ## Datetime
+ """)
@app.cell
@@ -28,13 +30,13 @@ def _(datetime, pd):
"timestamp": [_start + n * _slice for n in range(5)],
}
)
- return
@app.cell
def _(mo):
- mo.md(r"""## Seconds""")
- return
+ mo.md(r"""
+ ## Seconds
+ """)
@app.cell
@@ -46,13 +48,13 @@ def _(datetime, pd):
"timestamp": [_start + n * _slice for n in range(5)],
}
)
- return
@app.cell
def _(mo):
- mo.md(r"""## Milliseconds""")
- return
+ mo.md(r"""
+ ## Milliseconds
+ """)
@app.cell
@@ -71,13 +73,13 @@ def _(datetime, pd):
def _(mo, test_df):
# Nanoseconds are still missing, because JavaScript (browsers) don't support nanoseconds.
mo.hstack([mo.plain(test_df), test_df])
- return
@app.cell
def _(mo):
- mo.md(r"""## Nanoseconds""")
- return
+ mo.md(r"""
+ ## Nanoseconds
+ """)
@app.cell
@@ -85,7 +87,6 @@ def _(test_df):
nano_df = test_df.copy()
nano_df["timestamp"] = nano_df["timestamp"].astype(str)
nano_df
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/theming/bokeh_theme.py b/marimo/_smoke_tests/theming/bokeh_theme.py
index 9aa06a2096..4f19e6596b 100644
--- a/marimo/_smoke_tests/theming/bokeh_theme.py
+++ b/marimo/_smoke_tests/theming/bokeh_theme.py
@@ -7,7 +7,7 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@@ -15,6 +15,7 @@ app = marimo.App(width="medium")
def _():
from bokeh.plotting import figure, show
from bokeh.io import curdoc
+
return curdoc, figure
@@ -37,7 +38,7 @@ def _(curdoc, figure):
@app.cell
-def _(counts, curdoc, figure, fruits):
+def _(counts: list[int], curdoc, figure, fruits: list[str]):
curdoc().theme = "light_minimal"
p3 = figure(x_range=fruits, height=350, title="Fruit Counts",
@@ -48,11 +49,10 @@ def _(counts, curdoc, figure, fruits):
p3.xgrid.grid_line_color = None
p3.y_range.start = 0
p3
- return
@app.cell
-def _(counts, curdoc, figure, fruits):
+def _(counts: list[int], curdoc, figure, fruits: list[str]):
curdoc().theme = "dark_minimal"
p2 = figure(x_range=fruits, height=350, title="Fruit Counts",
@@ -63,7 +63,6 @@ def _(counts, curdoc, figure, fruits):
p2.xgrid.grid_line_color = None
p2.y_range.start = 0
p2
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/theming/custom_css.py b/marimo/_smoke_tests/theming/custom_css.py
index 8d140fb69d..b9003624c1 100644
--- a/marimo/_smoke_tests/theming/custom_css.py
+++ b/marimo/_smoke_tests/theming/custom_css.py
@@ -8,7 +8,7 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium", css_file="custom.css")
@@ -16,13 +16,13 @@ app = marimo.App(width="medium", css_file="custom.css")
def _():
import marimo as mo
from vega_datasets import data
+
return data, mo
@app.cell
def _(data):
data.cars()
- return
@app.cell
@@ -34,26 +34,21 @@ def _(mo):
This font should be styled
""")
)
- return
@app.cell
def _(mo):
- mo.md(
- r"""
+ mo.md(r"""
# heading
Here is a paragraph
- """
- )
- return
+ """)
@app.cell
def _(mo):
# This text should be aligned-right
mo.ui.number(value=50)
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/theming/custom_head.py b/marimo/_smoke_tests/theming/custom_head.py
index f5a088347d..0aa5c4a845 100644
--- a/marimo/_smoke_tests/theming/custom_head.py
+++ b/marimo/_smoke_tests/theming/custom_head.py
@@ -8,7 +8,7 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium", html_head_file="head.html")
@@ -16,13 +16,13 @@ app = marimo.App(width="medium", html_head_file="head.html")
def _():
import marimo as mo
from vega_datasets import data
+
return data, mo
@app.cell
def _(data):
data.cars()
- return
@app.cell
@@ -34,19 +34,15 @@ def _(mo):
This font should be styled
""")
)
- return
@app.cell
def _(mo):
- mo.md(
- r"""
- # heading
+ mo.md(r"""
+ # heading
- Here is a paragraph
- """
- )
- return
+ Here is a paragraph
+ """)
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/theming/matplotlib_theme.py b/marimo/_smoke_tests/theming/matplotlib_theme.py
index b9621c408c..a373c2224d 100644
--- a/marimo/_smoke_tests/theming/matplotlib_theme.py
+++ b/marimo/_smoke_tests/theming/matplotlib_theme.py
@@ -9,7 +9,7 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@@ -18,27 +18,25 @@ def _():
import matplotlib.pyplot as plt
import numpy as np
import marimo as mo
+
return mo, np, plt
@app.cell
def _(mo, plt):
mo.ui.table(plt.style.available, selection=None, page_size=2)
- return
@app.cell
def _(create_plot, plt):
plt.style.use('default')
create_plot().gca()
- return
@app.cell
def _(create_plot, plt):
plt.style.use('dark_background')
create_plot().gca()
- return
@app.cell
@@ -70,6 +68,7 @@ def _(np, plt):
ax.grid(True, linestyle='--', alpha=0.7)
return plt
+
return (create_plot,)
diff --git a/marimo/_smoke_tests/third_party/altair_example.py b/marimo/_smoke_tests/third_party/altair_example.py
index 59a111647b..c046d83a35 100644
--- a/marimo/_smoke_tests/third_party/altair_example.py
+++ b/marimo/_smoke_tests/third_party/altair_example.py
@@ -9,7 +9,7 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App()
@@ -34,7 +34,6 @@ def _(alt, source):
angle=alt.Angle("dir", scale=alt.Scale(domain=[0, 360], range=[180, 540])),
size=alt.Size("speed", scale=alt.Scale(rangeMax=500)),
).project("equalEarth")
- return
@app.cell
@@ -59,11 +58,10 @@ def _(alt, cars, mo):
that was an altair plot
"""
)
- return
@app.cell
-def _(alt, stocks):
+def _(alt, stocks: str):
base = (
alt.Chart(stocks)
.encode(x="date:T", y="price:Q", color="symbol:N")
@@ -71,12 +69,12 @@ def _(alt, stocks):
)
(base.mark_line() + base.mark_point())
- return
@app.cell
def _():
import marimo as mo
+
return (mo,)
@@ -84,6 +82,7 @@ def _():
def _():
import altair as alt
from vega_datasets import data
+
return alt, data
diff --git a/marimo/_smoke_tests/third_party/arviz_html.py b/marimo/_smoke_tests/third_party/arviz_html.py
index 31cd63e71c..4e4b8e5a09 100644
--- a/marimo/_smoke_tests/third_party/arviz_html.py
+++ b/marimo/_smoke_tests/third_party/arviz_html.py
@@ -1,13 +1,12 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@app.cell
def _():
import marimo as mo
- return
@app.cell
@@ -16,7 +15,6 @@ def _():
centered_data = az.load_arviz_data("centered_eight")
centered_data
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/third_party/databricks_connect.py b/marimo/_smoke_tests/third_party/databricks_connect.py
index b7da42ba67..7aa2abda78 100644
--- a/marimo/_smoke_tests/third_party/databricks_connect.py
+++ b/marimo/_smoke_tests/third_party/databricks_connect.py
@@ -1,13 +1,12 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@app.cell
def _():
import marimo as mo
- return
@app.cell
@@ -32,13 +31,11 @@ def _(df_taxi):
# As of 1.35.0, this is currently False
print(nw.dependencies.is_pyspark_dataframe(df_taxi))
print(nw.__version__)
- return
@app.cell
def _(df_taxi):
df_taxi
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/third_party/holoviews_example.py b/marimo/_smoke_tests/third_party/holoviews_example.py
index e9d3924428..a7539cc44f 100644
--- a/marimo/_smoke_tests/third_party/holoviews_example.py
+++ b/marimo/_smoke_tests/third_party/holoviews_example.py
@@ -13,21 +13,18 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App()
@app.cell
def _(mo):
- mo.md(
- """
- # HoloViews in marimo
- ```
- pip install holoviews
- ```
- """
- )
- return
+ mo.md("""
+ # HoloViews in marimo
+ ```
+ pip install holoviews
+ ```
+ """)
@app.cell
@@ -71,33 +68,34 @@ def _(backend, hv, mo, station_info):
@app.cell
def _(mo):
- mo.md("""## Area chart""")
- return
+ mo.md("""
+ ## Area chart
+ """)
@app.cell
def _(hv, np):
xs = np.linspace(0, np.pi * 4, 40)
hv.Area((xs, np.sin(xs)))
- return
@app.cell
def _(mo):
- mo.md("""## Scatter chart""")
- return
+ mo.md("""
+ ## Scatter chart
+ """)
@app.cell
def _(scatter):
scatter
- return
@app.cell
def _(mo):
- mo.md("""# HV Plot""")
- return
+ mo.md("""
+ # HV Plot
+ """)
@app.cell
@@ -106,13 +104,13 @@ def _():
from bokeh.sampledata.penguins import data as df
df.hvplot.scatter(x="bill_length_mm", y="bill_depth_mm", by="species")
- return
@app.cell
def _(mo):
- mo.md("""# Composed Views""")
- return
+ mo.md("""
+ # Composed Views
+ """)
@app.cell
@@ -128,13 +126,11 @@ def _():
@app.cell
def _(df3, df4):
df3.hvplot.line("x", "y") * df4.hvplot.line("x", "y")
- return
@app.cell
def _(df3, df4):
df3.hvplot.line("x", "y") + df4.hvplot.line("x", "y")
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/third_party/holoviews_output_options.py b/marimo/_smoke_tests/third_party/holoviews_output_options.py
index 78839214fb..9a4de5c350 100644
--- a/marimo/_smoke_tests/third_party/holoviews_output_options.py
+++ b/marimo/_smoke_tests/third_party/holoviews_output_options.py
@@ -11,14 +11,13 @@
import marimo
-__generated_with = "0.15.2"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@app.cell
def _():
import marimo as mo
- return (mo,)
@app.cell
@@ -32,7 +31,6 @@ def _():
air_ds = xr.tutorial.open_dataset('air_temperature').load()
air_ds.air.hvplot.image()
- return air_ds, hv, xr
@app.cell
diff --git a/marimo/_smoke_tests/third_party/holoviews_scatter.py b/marimo/_smoke_tests/third_party/holoviews_scatter.py
index f3c68080ea..4af8abf873 100644
--- a/marimo/_smoke_tests/third_party/holoviews_scatter.py
+++ b/marimo/_smoke_tests/third_party/holoviews_scatter.py
@@ -10,7 +10,7 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@@ -31,19 +31,18 @@ def _():
height=400,
width=400,
)
- return
@app.cell
def _():
import marimo as mo
+
return (mo,)
@app.cell
def _(mo):
mo.ui.panel({1: 2})
- return
@app.cell
@@ -53,7 +52,6 @@ def _(mo):
slider = pn.widgets.IntSlider(start=0, end=10, value=5)
rx_stars = mo.ui.panel(slider.rx() * "*")
rx_stars
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/third_party/ipython_display.py b/marimo/_smoke_tests/third_party/ipython_display.py
index 30c17b0797..2388167447 100644
--- a/marimo/_smoke_tests/third_party/ipython_display.py
+++ b/marimo/_smoke_tests/third_party/ipython_display.py
@@ -9,7 +9,7 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App()
@@ -33,7 +33,6 @@ def _(IPython):
@app.cell
def _(IPython, html, url):
IPython.display.display(html, url)
- return
@app.cell
@@ -41,6 +40,7 @@ def _():
# not on PyPI
# installation instructions here https://github.com/allefeld/pytikz
import tikz
+
return (tikz,)
@@ -59,7 +59,6 @@ def _(tikz):
@app.cell
def _(pic):
pic.demo(dpi=300)
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/third_party/leafmap/backends.py b/marimo/_smoke_tests/third_party/leafmap/backends.py
index 880ac048f9..093afccc98 100644
--- a/marimo/_smoke_tests/third_party/leafmap/backends.py
+++ b/marimo/_smoke_tests/third_party/leafmap/backends.py
@@ -1,13 +1,12 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@app.cell
def _():
import marimo as mo
- return
@app.cell
@@ -16,6 +15,7 @@ def _():
import leafmap.leafmap as leafmap
import leafmap.foliumap as leafmap_folium
import leafmap.plotlymap as leafmap_plotly
+
return default_leamap, leafmap, leafmap_folium, leafmap_plotly
@@ -23,13 +23,13 @@ def _():
def _():
import keplergl
import leafmap.kepler as leafmap_kepler
+
return (leafmap_kepler,)
@app.cell
def _(default_leamap):
default_leamap.Map
- return
@app.cell
@@ -49,14 +49,12 @@ def _(data, leafmap):
legend_title="Population",
)
_m
- return
@app.cell
def _(leafmap_plotly):
_m = leafmap_plotly.Map(center=(40, -100), zoom=3, height=500)
_m
- return
@app.cell
@@ -70,7 +68,6 @@ def _(data, leafmap_folium):
legend_title="Population",
)
_m
- return
@app.cell
@@ -79,7 +76,6 @@ def _(leafmap_kepler):
center=[40, -100], zoom=2, height=600, widescreen=False
)
_m
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/third_party/pandas/int_column_names.py b/marimo/_smoke_tests/third_party/pandas/int_column_names.py
index 49f0c9dce4..7c11945455 100644
--- a/marimo/_smoke_tests/third_party/pandas/int_column_names.py
+++ b/marimo/_smoke_tests/third_party/pandas/int_column_names.py
@@ -1,6 +1,6 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@@ -8,13 +8,13 @@ app = marimo.App(width="medium")
def _():
import marimo as mo
import pandas as pd
+
return mo, pd
@app.cell
def _(pd):
pd.DataFrame([1, 2, 3])
- return
@app.cell
@@ -27,7 +27,6 @@ def _(pd):
@app.cell
def _(data, mo):
mo.ui.table(data)
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/third_party/pandas/transform_edgecases.py b/marimo/_smoke_tests/third_party/pandas/transform_edgecases.py
index 2d9a4b3528..c06548f06f 100644
--- a/marimo/_smoke_tests/third_party/pandas/transform_edgecases.py
+++ b/marimo/_smoke_tests/third_party/pandas/transform_edgecases.py
@@ -13,7 +13,7 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@@ -21,6 +21,7 @@ app = marimo.App(width="medium")
def _():
import marimo as mo
import pandas as pd
+
return mo, pd
@@ -42,7 +43,6 @@ def _(mo, pd):
@app.cell
def _(df):
df.dtypes
- return
@app.cell
@@ -60,27 +60,23 @@ def _():
def _(gdf):
# This is ugly
gdf
- return
@app.cell
def _(gdf):
# This interactive leaflet map does work like a charm
gdf.explore()
- return
@app.cell
def _(gdf, mo):
# https://github.com/marimo-team/marimo/issues/5447
mo.ui.table(gdf)
- return
@app.cell
def _(gdf):
type(gdf)
- return
@app.cell
@@ -88,14 +84,12 @@ def _(gdf, mo):
# This should not fail
# https://github.com/marimo-team/marimo/issues/5447
mo.ui.dataframe(gdf)
- return
@app.cell
def _(gdf, mo, pl):
pl_df = pl.DataFrame(gdf.assign(geometry=gdf.geometry.astype(str)))
mo.ui.dataframe(pl_df)
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/third_party/pandas_example.py b/marimo/_smoke_tests/third_party/pandas_example.py
index 5e59091eeb..dcc1baedb0 100644
--- a/marimo/_smoke_tests/third_party/pandas_example.py
+++ b/marimo/_smoke_tests/third_party/pandas_example.py
@@ -8,7 +8,7 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App()
@@ -25,12 +25,12 @@ def _(np):
def _(df):
# Series
df[0]
- return
@app.cell
def _():
import numpy as np
+
return (np,)
diff --git a/marimo/_smoke_tests/third_party/pymc_example.py b/marimo/_smoke_tests/third_party/pymc_example.py
index 9161cc17d5..dbbaa958a4 100644
--- a/marimo/_smoke_tests/third_party/pymc_example.py
+++ b/marimo/_smoke_tests/third_party/pymc_example.py
@@ -1,13 +1,12 @@
import marimo
-__generated_with = "0.17.7"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@app.cell
def _():
import marimo as mo
- return
@app.cell
@@ -29,7 +28,6 @@ def _():
# Returning the trace object for further analysis
trace
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/third_party/rich_example.py b/marimo/_smoke_tests/third_party/rich_example.py
index cbaed8e813..5f528bb9c1 100644
--- a/marimo/_smoke_tests/third_party/rich_example.py
+++ b/marimo/_smoke_tests/third_party/rich_example.py
@@ -8,20 +8,20 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App()
@app.cell
def _():
import marimo as mo
- return
@app.cell
def _():
# pip install rich
from rich import print as pprint
+
return (pprint,)
@@ -29,7 +29,6 @@ def _():
def _(pprint):
pprint("[bold red]Error:[/bold red] Something went wrong!")
pprint("[green]Success:[/green] Operation completed.")
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/threads/state_threading.py b/marimo/_smoke_tests/threads/state_threading.py
index 3765041d13..354c508206 100644
--- a/marimo/_smoke_tests/threads/state_threading.py
+++ b/marimo/_smoke_tests/threads/state_threading.py
@@ -1,6 +1,6 @@
import marimo
-__generated_with = "0.17.7"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@@ -8,6 +8,7 @@ app = marimo.App(width="medium")
def _():
import marimo as mo
import random
+
return mo, random
@@ -26,15 +27,13 @@ def _(g, random):
@app.cell
-def _(x):
+def _(x: int):
x
- return
@app.cell
def _(s):
s(6)
- return
@app.cell
@@ -47,19 +46,18 @@ def _(mo):
while not thread.should_exit:
s(random.randint(0, 100000))
time.sleep(1)
+
return (f,)
@app.cell
def _(f, mo, s):
mo.Thread(target=f, args=(s,)).start()
- return
@app.cell
def _(g):
g()
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/threads/threads.py b/marimo/_smoke_tests/threads/threads.py
index 57b19c3f9a..6b95249b8e 100644
--- a/marimo/_smoke_tests/threads/threads.py
+++ b/marimo/_smoke_tests/threads/threads.py
@@ -1,12 +1,13 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App()
@app.cell
def _():
import marimo as mo
+
return (mo,)
@@ -18,6 +19,7 @@ def foo():
@app.cell
def _():
import threading
+
return (threading,)
@@ -25,14 +27,12 @@ def _():
def _(mo, threading):
with mo.redirect_stdout():
threading.Thread(target=foo).start()
- return
@app.cell
def _(mo):
with mo.redirect_stdout():
mo.Thread(target=foo).start()
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/timezones.py b/marimo/_smoke_tests/timezones.py
index 095d3f9ae0..6d73b5f32e 100644
--- a/marimo/_smoke_tests/timezones.py
+++ b/marimo/_smoke_tests/timezones.py
@@ -1,6 +1,6 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@@ -42,6 +42,7 @@ def _():
def print_df(df):
return mo.hstack([df, mo.plain(df)])
+
return mo, print_df
@@ -69,7 +70,6 @@ def _(df, print_df):
)
print_df(_df)
- return
@app.cell
@@ -78,7 +78,6 @@ def _(date, pl, print_df):
{"price": [40, 50], "date": [date(2020, 1, 1), date(2020, 1, 2)]}
)
print_df(_df)
- return
@app.cell
@@ -90,7 +89,6 @@ def _(pl, print_df, time):
}
)
print_df(_df)
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/toast.py b/marimo/_smoke_tests/toast.py
index fe3eeb520e..7e32405887 100644
--- a/marimo/_smoke_tests/toast.py
+++ b/marimo/_smoke_tests/toast.py
@@ -1,19 +1,21 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@app.cell
def _():
import marimo as mo
+
return (mo,)
@app.cell
def _(mo):
- mo.md("""# Toast Notification Test""")
- return
+ mo.md("""
+ # Toast Notification Test
+ """)
@app.cell
@@ -21,6 +23,7 @@ def _(mo):
def show_toast(title, description="", kind=None):
mo.status.toast(title, description, kind)
return None
+
return (show_toast,)
@@ -34,8 +37,9 @@ def _(mo):
@app.cell
def _(mo):
- mo.md("""Select a checkbox to trigger a toast notification:""")
- return
+ mo.md("""
+ Select a checkbox to trigger a toast notification:
+ """)
@app.cell
@@ -47,7 +51,6 @@ def _(danger_toast, html_toast, mo, simple_toast):
danger_toast,
]
)
- return
@app.cell
@@ -62,7 +65,6 @@ def _(danger_toast, html_toast, show_toast, simple_toast):
if danger_toast.value:
show_toast("Error Occurred", "Something went wrong!", kind="danger")
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/tqdm_notebook.py b/marimo/_smoke_tests/tqdm_notebook.py
index bb73da9187..90699d565a 100644
--- a/marimo/_smoke_tests/tqdm_notebook.py
+++ b/marimo/_smoke_tests/tqdm_notebook.py
@@ -2,7 +2,7 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@@ -11,6 +11,7 @@ def _():
from tqdm.notebook import tqdm
import time
+
return time, tqdm
@@ -18,7 +19,6 @@ def _():
def _(time, tqdm):
for i in tqdm(range(10)):
time.sleep(0.1)
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/tqdm_update_test.py b/marimo/_smoke_tests/tqdm_update_test.py
index 7172664bc6..f874244224 100644
--- a/marimo/_smoke_tests/tqdm_update_test.py
+++ b/marimo/_smoke_tests/tqdm_update_test.py
@@ -2,7 +2,7 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="medium")
@@ -10,6 +10,7 @@ app = marimo.App(width="medium")
def _():
from tqdm.notebook import tqdm, trange
import time
+
return time, tqdm, trange
@@ -18,7 +19,6 @@ def _(time, tqdm):
# Test regular iteration
for i in tqdm(range(5)):
time.sleep(0.1)
- return
@app.cell
@@ -26,7 +26,6 @@ def _(time, trange):
# Test regular iteration
for i in trange(5):
time.sleep(0.1)
- return
@app.cell
@@ -37,7 +36,6 @@ def _(time, tqdm):
time.sleep(0.1)
pbar.update(1) # Explicitly calling update
pbar.close()
- return
@app.cell
@@ -48,7 +46,6 @@ def _(time, tqdm):
time.sleep(0.1)
pbar.update(5) # Update by 5 each time
pbar.close()
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/ui_matplotlib.py b/marimo/_smoke_tests/ui_matplotlib.py
index 93d3924f63..f6db89ae1d 100644
--- a/marimo/_smoke_tests/ui_matplotlib.py
+++ b/marimo/_smoke_tests/ui_matplotlib.py
@@ -1,6 +1,6 @@
import marimo
-__generated_with = "0.20.1"
+__generated_with = "0.25.2"
app = marimo.App()
@@ -58,13 +58,11 @@ def _(ax, mo):
@app.cell
def _(embedding, fig, x, y):
embedding[fig.value.get_mask(x, y)]
- return
@app.cell
def _(fig):
fig.value if fig.value else "No selection!"
- return
@app.cell(hide_code=True)
@@ -77,7 +75,6 @@ def _(mo):
the click was clamped to the nearest edge, which would select these
edge points via `get_mask()`.
""")
- return
@app.cell
@@ -123,13 +120,11 @@ def _(edge_ax, mo):
def _(edge_fig, edge_x, edge_y):
_m = edge_fig.value.get_mask(edge_x, edge_y)
f"Selected {_m.sum()} / {len(edge_x)} points"
- return
@app.cell
def _(edge_fig):
edge_fig.value if edge_fig.value else "No selection!"
- return
@app.cell(hide_code=True)
@@ -137,7 +132,6 @@ def _(mo):
mo.md("""
## Log-scale axes test
""")
- return
@app.cell
@@ -169,13 +163,11 @@ def _(log_fig, log_x, log_y, np):
_m = log_fig.value.get_mask(log_x, log_y)
log_x_sel, log_y_sel = log_x[_m], log_y[_m]
np.column_stack([log_x_sel, log_y_sel])
- return
@app.cell
def _(log_fig):
log_fig.value if log_fig.value else "No selection!"
- return
if __name__ == "__main__":
diff --git a/marimo/_smoke_tests/ws.py b/marimo/_smoke_tests/ws.py
index d16ad8ad73..b3c10c2fec 100644
--- a/marimo/_smoke_tests/ws.py
+++ b/marimo/_smoke_tests/ws.py
@@ -2,7 +2,7 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.25.2"
app = marimo.App(width="full")
@@ -112,6 +112,7 @@ def _(mo):
widths=[1, 1, 1, 1, 1, 1],
gap=2,
)
+
return (output_stats,)
@@ -129,6 +130,7 @@ def _(alt, mo):
)
)
return mo.ui.altair_chart(_chart)
+
return (output_chart,)
@@ -136,6 +138,7 @@ def _(alt, mo):
def _(mo):
def output_table(df):
return mo.ui.table(df[::-1], selection=None)
+
return (output_table,)
@@ -276,7 +279,6 @@ def _(
# thread_keepalive = Thread(target=websocket_keepalive)
# thread.start()
websocket_thread()
- return
@app.cell
@@ -285,6 +287,7 @@ def _():
import pandas as pd
import altair as alt
import os
+
return alt, mo, os, pd
@@ -296,6 +299,7 @@ def _():
import hashlib
from threading import Thread
from websocket import create_connection, WebSocketConnectionClosedException
+
return (
WebSocketConnectionClosedException,
create_connection,
diff --git a/marimo/_tutorials/dataflow.py b/marimo/_tutorials/dataflow.py
index 16922e237b..dfde74035f 100644
--- a/marimo/_tutorials/dataflow.py
+++ b/marimo/_tutorials/dataflow.py
@@ -90,7 +90,7 @@ def _(mo):
@app.cell
-def _(amplitude, mo, period, plot_wave):
+def _(amplitude: int, mo, period: int, plot_wave):
mo.md(f"""
{mo.as_html(plot_wave(amplitude, period))}
@@ -323,7 +323,7 @@ def _(mo):
@app.cell
-def _(to_be_deleted):
+def _(to_be_deleted: str):
to_be_deleted
@@ -337,13 +337,13 @@ def _(mo):
@app.cell
-def _(two):
+def _(two: int):
one = two - 1
return (one,)
@app.cell
-def _(one):
+def _(one: int):
two = one + 1
return (two,)
@@ -438,7 +438,7 @@ def _(mo):
@app.cell
-def _(mo, tips):
+def _(mo, tips: dict[str, str]):
mo.accordion(tips)
diff --git a/marimo/_tutorials/external_dependencies.py b/marimo/_tutorials/external_dependencies.py
index 7d4c8ba947..b2e7a136a5 100644
--- a/marimo/_tutorials/external_dependencies.py
+++ b/marimo/_tutorials/external_dependencies.py
@@ -62,7 +62,7 @@ def _(mo):
@app.cell
-def _(Slider2D, missing_packages, mo):
+def _(Slider2D, missing_packages: bool, mo):
if missing_packages:
widget = None
else:
@@ -88,7 +88,7 @@ def _(mo, widget):
@app.cell(hide_code=True)
-def _(missing_packages, mo):
+def _(missing_packages: bool, mo):
module_not_found_explainer = mo.md(
"""
## Oops!
diff --git a/marimo/_tutorials/fileformat.py b/marimo/_tutorials/fileformat.py
index fcb810fc1c..75ace4f848 100644
--- a/marimo/_tutorials/fileformat.py
+++ b/marimo/_tutorials/fileformat.py
@@ -379,7 +379,7 @@ def _():
@app.cell
-def wrapped_function_example(variable):
+def wrapped_function_example(variable: int):
def not_a_top_level_function():
"""
This function depends on a variable declared in another cell.
@@ -429,7 +429,7 @@ def _():
@app.cell
-def _(contents, mo):
+def _(contents: str | bytes, mo):
mo.ui.code_editor(contents)
diff --git a/marimo/_tutorials/for_jupyter_users.py b/marimo/_tutorials/for_jupyter_users.py
index 7043185b2f..59883578c7 100644
--- a/marimo/_tutorials/for_jupyter_users.py
+++ b/marimo/_tutorials/for_jupyter_users.py
@@ -40,7 +40,7 @@ def _():
@app.cell
-def _(x):
+def _(x: int):
y = x + 1; y
@@ -186,7 +186,7 @@ def _():
@app.cell
-def _(df):
+def _(df: int):
results = df.groupby(["my_column"]).sum()
diff --git a/marimo/_tutorials/intro.py b/marimo/_tutorials/intro.py
index be88908aee..eba725c32e 100644
--- a/marimo/_tutorials/intro.py
+++ b/marimo/_tutorials/intro.py
@@ -87,7 +87,7 @@ def _(mo):
@app.cell(hide_code=True)
-def _(changed, mo):
+def _(changed: bool, mo):
(
mo.md(
f"""
@@ -316,7 +316,7 @@ def _(mo):
@app.cell
-def _(mo, tips):
+def _(mo, tips: dict[str, str]):
mo.accordion(tips)
diff --git a/marimo/_tutorials/layout.py b/marimo/_tutorials/layout.py
index 1842d734ce..fa7b536219 100644
--- a/marimo/_tutorials/layout.py
+++ b/marimo/_tutorials/layout.py
@@ -103,7 +103,7 @@ def _(mo):
@app.cell
-def _(align, boxes, gap, justify, mo, wrap):
+def _(align, boxes: list, gap, justify, mo, wrap):
mo.hstack(
boxes,
align=align.value,
@@ -114,7 +114,7 @@ def _(align, boxes, gap, justify, mo, wrap):
@app.cell
-def _(align, boxes, gap, mo):
+def _(align, boxes: list, gap, mo):
mo.vstack(
boxes,
align=align.value,
diff --git a/marimo/_tutorials/plots.py b/marimo/_tutorials/plots.py
index f0423d87b5..d8db3b0aea 100644
--- a/marimo/_tutorials/plots.py
+++ b/marimo/_tutorials/plots.py
@@ -85,7 +85,7 @@ def _(plt):
@app.cell(hide_code=True)
-def _(mo, plt_show_explainer):
+def _(mo, plt_show_explainer: dict[str, str]):
mo.accordion(plt_show_explainer)
@@ -239,7 +239,7 @@ def _(mo):
@app.cell(hide_code=True)
-def _(missing_packages, mo):
+def _(missing_packages: bool, mo):
module_not_found_explainer = mo.md(
"""
## Oops!
diff --git a/marimo/_tutorials/sql.py b/marimo/_tutorials/sql.py
index 25287152c3..974d3c0754 100644
--- a/marimo/_tutorials/sql.py
+++ b/marimo/_tutorials/sql.py
@@ -71,7 +71,7 @@ def _():
@app.cell(hide_code=True)
-def _(has_duckdb_installed, mo):
+def _(has_duckdb_installed: bool, mo):
if has_duckdb_installed:
mo.output.replace(
mo.md(
@@ -153,7 +153,7 @@ def _(mo):
@app.cell(hide_code=True)
-def _(has_polars_installed):
+def _(has_polars_installed: bool):
_SIZE = 1000
diff --git a/pyproject.toml b/pyproject.toml
index 250e13db75..e956aa30d4 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -609,6 +609,9 @@ autosave_delay = 1000
autosave = "after_delay"
format_on_save = true
+[tool.marimo.formatting]
+infer_types = "jedi"
+
[tool.marimo.experimental]
multi_column = true
cache_panel = true