feat: Account for state and variable type in save
📝 Summary
Changes the hashing to account for state, UI variables, and allows for "pure" functions / classes
Had some merge res issues, since I haven't touched this in a while, so just squashed it all.
I read over Mandala, and took a few ideas: https://github.com/amakelov/mandala/discussions/15
🔍 Description of Changes
Does this by:
- Adding state registry
- Doing a "primitive check" (I might remove
is_pure_fnandis_pure_classuntil I know they are bug free)
TODO:
- [ ] Tests
- [ ] Other easily serializable types like numpy arrays (good tips from joblib: https://github.com/joblib/joblib/blob/bca1f4216a38cff82a85371c45dde79bed977d0e/joblib/hashing.py#L245
The latest updates on your projects. Learn more about Vercel for Git ↗︎
| Name | Status | Preview | Comments | Updated (UTC) |
|---|---|---|---|---|
| marimo-docs | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Sep 15, 2024 4:24pm |
| marimo-storybook | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Sep 15, 2024 4:24pm |
I think final TODOs:
- [x] state registry should be attached to context instead of global
- [x] ui registry
lookupnot working as intended
Up for me:
- [x] doc strings
- [x] Cache cleanup
- [ ] explicit tensor tests
- [x] Organizing with BlockHash
Maybe registry changes? https://github.com/marimo-team/marimo/pull/1993#discussion_r1752489900
Are we OK adding something as large as torch or scipy to optional deps? Thoughts on what to add? Addressed everything but exploring more than numpy for tensors.
Additionally:
- patched primitive hashing from an experimental branch,
- also, maybe preemptively, added a meta slot for cache
Are we OK adding something as large as torch or scipy to optional deps?
Yea, I'm okay with it. Hopefully with uv it's magically fast. If not we can find a way to make the CI more efficient, for example we could split up the optional deps into multiple groups, and run just one workflow with the tensors deps. But that's likely premature.
Thoughts on what to add?
Whatever we'd like to support should be added, I believe.
Not sure why the FE build was stuck on pending. rebased from main to trigger CI again
Hmm. Maybe a github bug? Looks like the action path was changed after this PR. Weird, because it's rebased. Closing out an opening new PR #2316
🚀 Development release published. You may be able to view the changes at https://marimo.app?v=0.8.16-dev1