mesa icon indicating copy to clipboard operation
mesa copied to clipboard

Simplification: merge run.py into server.py

Open rht opened this issue 3 years ago • 4 comments

run.py always contains a few lines of code. Should we merge it into server.py to simplify the coding convention? If people need to call server.launch from a different files (e.g. running Mesa simulation as a part of a larger web application), they can define their separate run.py. I'm citing the 80-20 UX rule (see https://lawsofux.com/pareto-principle/) that we should optimize for the 80% of the use case, and hide the remaining 20% until when it is actually needed.

rht avatar Apr 09 '22 23:04 rht

I think the run.py was originally created for 2 reasons...

  1. It was easy to identify which file to run.
  2. The run.py was to explicitly hold more run-type settings but it never did.

I am not against your suggestion especially now that the runserver command exists.

jackiekazil avatar Apr 10 '22 00:04 jackiekazil

I simplified the Boltzmann wealth model layout in https://github.com/projectmesa/mesa-examples/pull/44 into examples/boltzmann_wealth_model/:

  • model.py
  • app.py
  • __init__.py (so that the model is importable)

To run the GUI, simply do solara run app.py.

rht avatar Jun 29 '23 06:06 rht

How does this work with mesa runserver?

jackiekazil avatar Jul 02 '23 18:07 jackiekazil

mesa runserver could later be a proxy to solara run, but probably later on in 3.0.

rht avatar Jul 03 '23 04:07 rht