Get help from the marimo community

H
Habib
Offline, last seen 4 days ago
Joined March 9, 2025
Plain Text
@app.cell
def input_cell(mo):
    my_input = mo.ui.text()
    my_input
    return (my_input,)


@app.cell
def result_cell(my_input):
    my_input.value
    return


If I run input_cell, the result_cell will immediately be run after that (because my_input.value). I know that we can change the default value or use callback functions, but it could be a good idea to prevent dependent cells do not run and wait for the users actual input.
7 comments
M
H
Plain Text
class Test():
   def __init__(self):
        self.a = 1
        self.b = 2 

import inspect

inspect.getsource(Test)


Traceback (most recent call last):
File "/Users/habib/.cache/uv/archive-v0/orE7lLvC9gKEvqF8RJqEB/lib/python3.12/site-packages/marimo/_runtime/executor.py", line 142, in execute_cell
return eval(cell.last_expr, glbls)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/var/folders/q1/7g9hgvc17m95t7yrvcclc75h0000gn/T/marimo_99501/marimocellZzoV.py", line 1, in <module>
inspect.getsource(Test)
File "/Users/habib/.local/share/uv/python/cpython-3.12.9-macos-aarch64-none/lib/python3.12/inspect.py", line 1285, in getsource
lines, lnum = getsourcelines(object)
^^^^^^^^^^^^^^^^^^^^^^
File "/Users/habib/.local/share/uv/python/cpython-3.12.9-macos-aarch64-none/lib/python3.12/inspect.py", line 1267, in getsourcelines
lines, lnum = findsource(object)
^^^^^^^^^^^^^^^^^^
File "/Users/habib/.local/share/uv/python/cpython-3.12.9-macos-aarch64-none/lib/python3.12/inspect.py", line 1112, in findsource
raise OSError('could not find class definition')
OSError: could not find class definition
3 comments
H
C
I thought asking this here before opening an issue on github.

Consider this notebook with these cells.
(it is a versy small simplified version of hg agents course)

I have attached the screenshot of dependencis,

  1. Cell-1 should be run before cell-2. but as in this there are no explicit dependency between them and the cell-2 is getting the env variables underhood we can not guarantee this execution order.
easy solution to solve this problem is mergin cell-1 and cell-2, but for the next problem we can not do that.

  1. Cell-2 should run before cell-5 and cell-4
to be able to monitor the agent. Again this order is not guaranteed.
One dirty solution would be to define a variable in Cell-2 and reference it in Cell-5 and Cell-4.

Does Marimo provides a proper solution for this promblem?
8 comments
A
H
e