Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to configure persistent caching for all cells within app or directory #3054

Open
leventov opened this issue Dec 4, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@leventov
Copy link

leventov commented Dec 4, 2024

Description

When the notebook is used locally always saving all results to disk is cheap. Therefore it makes sense to alleviate the cognitive burden for developers (assessing whether the cell is "expensive" or not) and source code clutter (that is, extra @persistent_cache decorators) by providing an option configurable per-app or per-directory (such as in a .marimo/config yaml/config file) to automatically save and invalidate the results of all cells whenever they are changed.

Suggested solution

As described above.

Alternative

An App subclass, such as PersistedApp? But the problem with this is that it still has decision burden (per app rather than per cell, but still), and it cannot be dropped transparently when the app is deployed on the web.

Additional context

No response

@leventov leventov added the enhancement New feature or request label Dec 4, 2024
@dmadisetti
Copy link
Collaborator

Yes! I have a working branch that does this. There are a few bugs, and will probably go into experimental .toml setting for now.

Can you expound more on what you mean by having persistent cache for a directory?

@leventov
Copy link
Author

leventov commented Dec 4, 2024

Can you expound more on what you mean by having persistent cache for a directory?

I meant that this configuration (persist all cells by default, opt out is possiblle) applies directory-wide to all marimo notebooks stored within a directory, unless specifically overriden on the app level, a la App(default_cell_persist_results=true|false).

@gabrielgrant
Copy link

This would be great, so long as it is paired with:

  1. Some indication of whether results are being computed or coming from cache
  2. An easy way to clear/ignore the cache and recompute

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants