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

Simplification: merge run.py into server.py #1269

Open
rht opened this issue Apr 9, 2022 · 4 comments
Open

Simplification: merge run.py into server.py #1269

rht opened this issue Apr 9, 2022 · 4 comments

Comments

@rht
Copy link
Contributor

rht commented Apr 9, 2022

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.

@jackiekazil
Copy link
Member

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.

@rht
Copy link
Contributor Author

rht commented Jun 29, 2023

I simplified the Boltzmann wealth model layout in projectmesa/mesa-examples#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.

@jackiekazil
Copy link
Member

How does this work with mesa runserver?

@rht
Copy link
Contributor Author

rht commented Jul 3, 2023

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

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

No branches or pull requests

2 participants