Mesa Web #1954
Replies: 3 comments 3 replies
-
I can see this being used to replace https://mesa.readthedocs.io/en/stable/tutorials/intro_tutorial.html, as soon as applicable. As a first time reader, I find it slightly overwhelming to see the files, not knowing exactly whether I should create a new file from scratch, or click on the analysis.ipynb. But this issue is minor and can be addressed. I think it should be possible to build static HTML output from the Sphinx build and have the doc entirely living on GH pages instead of RTD. The question is whether this is a better choice. |
Beta Was this translation helpful? Give feedback.
-
Here is the Solara version Ankit is working on for examples, based @rlskoeser's example https://simrisk.pulcloud.io/ |
Beta Was this translation helpful? Give feedback.
-
As maybe relatively low-hanging fruit, can we add this to our whole example library? That would be totally amazing, if every examples was runnable directly in JupyterLite without modifying anything. Two points:
|
Beta Was this translation helpful? Give feedback.
-
Motivation
There have been talks in several places about hosting Mesa models on the web and also showcasing our example models similar to Netlogo Web. One possible route is using Jupyter Lite to statically host a Jupyter Lab and let the models run purely client-side. I have explored this direction and wanted to share first results, Here it is:
Mesa Web
https://corvince.github.io/mesa-web
Description
Currently I only included a slightly adjusted intro tutorial and the schelling model. But of course its easy to add more examples. You can even "upload" files yourself, but this will only persist on your own device. Otherwise it should work almost like a normal jupyter lab. You can install packages with
%pip install PACKAGE_NAME
, import modules (lots of modules are already included) and code your dream model. So its a nice interactive playground.Alternatives
I think @ankitk50 is working on something to host mesa examples solara apps side-by-side. I think this is also a promising direction and am very curious how it turns out. I think both approaches have some similarities, but also slightly different use-cases so I don't think they are competing.
Technical Description and Limitations
The basic setup was as easy as it gets: I followed quickstart guide which uses a github template. This got me up and running a hosted jupyterlab instance in minutes. The difficult part was getting mesa installable since it indirectly depends on tornado, which is incompatible with pyodide. I solved it by providing a custom mesa wheel, which gets installed by
%pip install mesa
, so it doesn't install from PyPi. But this should be solved once we finished deprecating our old frontend. It is also possible to have mesa pre-installed so users can just import it. I'll have to look further into it to see how that is done.A big challenge is our solara frontend. I also got that working somewhat with a custom wheel (so you can install it), but its a bit more difficult to maintain and also doesn't work with mesa yet. I haven't fully looked into it, but it might be more difficult. That said I know the solara devs are also working on making solara more pyodide friendly, so lets see how that evolves.
Beta Was this translation helpful? Give feedback.
All reactions