Skip to content

Is Marimo really reproducible? #754

Description

@JonasLoos

Describe the bug

In the project description and docs it's claimed several times that Marimo is reproducible and has "no hidden state".

However, I noticed, that python objects can be changed by repeated and automatic execution, so they could contain content that might not be part of the notebook anymore.

Is this behavior intended or could this be fixed? Did I oversee or misinterpret anything?

Nontheless, great work on this nice project!

Environment

{
  "marimo": "0.2.2",
  "OS": "Linux",
  "OS Version": "5.15.133.1-microsoft-standard-WSL2",
  "Processor": "x86_64",
  "Python Version": "3.10.6",
  "Binaries": {
    "Chrome": "--",
    "Node": "v20.11.0"
  },
  "Requirements": {
    "black": "24.1.1",
    "click": "8.1.7",
    "jedi": "0.19.1",
    "pymdown-extensions": "10.7",
    "starlette": "0.37.0",
    "tomlkit": "0.12.3",
    "typing_extensions": "4.8.0",
    "uvicorn": "0.27.0.post1"
  }
}

Code to reproduce

Example code for repeated cell execution changing the output. First execute all cells and then repeatedly execute cell 2 and see the output of cell 3 change.

import marimo
 
__generated_with = "0.2.2"
app = marimo.App()
 
 
@app.cell
def __():
    # create some object
    mylist = []
    return mylist,
 
 
@app.cell
def __():
    # have some value that you change and then rerun this cell
    value = 6
    return value,
 
 
@app.cell
def __(mylist, value):
    # modify the object in a cell using that value
    value
    mylist.append(1)
    print(mylist)
    return

Example code for deleted content affecting cell output. First execute all cells and then delete cell 2.

import marimo

__generated_with = "0.2.2"
app = marimo.App()


@app.cell
def __():
    # create some object
    mylist = []
    return mylist,


@app.cell
def __():
    value = "Is this reproducible?"
    return value,


@app.cell
def __(mylist, value):
    # modify the object in a cell using that value
    try:
        mylist.append(value)
    except:
        pass
    print(mylist)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions