Earlier quoted context omitted.
Unfortunately the code in Marimo notebooks implements cross-variable references as untyped function arguments, meaning that nothing passed between cells can be type-safe. This makes it very hard to use tooling directly on the Python representation of notebooks.
Arguments are typed if explicitly specified in definition, e.g. ```python @app.cell def my_cell(): x : int = 1 return (x,) @app.cell def consumer(x : int): y = x return ``` We've talked about building out implicit typing into our serialization- but that may be a larger can of worms.
import numpy
@app.cell
def my_cell(np: types.ModuleType[numpy]):
... editor treats np like `import numpy as np` ...
I do not use Python enough to know if something like this can be hacked together. But if not, I imagine could be PIPed into the standard library if a convincing case were made for it.