Update "startproject" to latest practices
We have this thing called mesa startproject. We probably want to update that for 3.0, to use the latest Model, Agent and visualisation structure.
and
https://github.com/projectmesa/mesa/blob/17cd62a7c9053a48e42933689d39bd1daea5a5a6/mesa/main.py#L49-L54
Originally added in https://github.com/projectmesa/mesa/pull/563 by @strixcuriosus and @werwty.
I’m considering removing this and documenting how to structure an project under “best practices”.
@projectmesa/maintainers, what do we think?
Why would we remove it? I have received feedback before, which is helpful for folks with less programming experience. I am willing to commit to updating if that is the issue.
The main reason to remove it is that It adds a lot of dependencies. The benefits from all these dependencies seem minor and can easily be covered in a best practices section.
React.js has create-react-app (but this is a separate npm package, not part of React). There is value in auto-creating the boilerplate files than to copy paste manually from an instruction.
I see more value in people learning how to do this stuff themselves and knowing how stuff is organized. Regardless, the bigger question is whether the value of producing the structure automatically is worth the various additional dependencies. I personally would say no to that. We are talking about the creation of 3 or so files, so nothing really complicated or large.
I see more value in people learning how to do this stuff themselves and knowing how stuff is organized.
This is happening even when the boilerplate creation is automated. The learner will have to understand the auto-created files in order to extend them.
We are talking about the creation of 3 or so files, so nothing really complicated or large.
This is mainly because the current startproject is underdeveloped. It could be made more advanced with:
- more declarative model specifications (e.g. Dolo.jl
- in dev dependencies: ruff, Black, and other best practices
- (optional) example tests that the learner can see the pattern of, and extend
The learner will have to understand the auto-created files in order to extend them.
Sometimes (often) doing has higher retention then reading.
This is mainly because the current
startprojectis underdeveloped.
I tend to agree with this, I haven't had time to do a deep dive into what's possible here. I welcome anyone show what's possible.
This is mainly because the current startproject is underdeveloped.
But we had the exact same argument about run_model and decided to remove it because of that.
The learner will have to understand the auto-created files in order to extend them.
Sometimes (often) doing has higher retention then reading.
I am aware of several of those studies. https://learnpythonthehardway.org/ even "forces" the reader to type the code snippets by hand. My current position is derived from the existence of create-react-app for React.js and that it is used a lot. This is what startproject could grow to become of.
This is mainly because the current startproject is underdeveloped.
But we had the exact same argument about run_model and decided to remove it because of that.
I could be convinced otherwise if there was enough cases to justify that run_model can be expanded a lot.
How do folks feel if I pinged a few people at other educational institutions to see how this is or isn't being used? Quick email and see who responds? ... give folks a few days to respond.
SGTM. Additionally if you could also get their feedback on it.
Did we get any feedback?
Since updating the examples, we only have three files: app.py, agents.py, and model.py. No other files or boilerplate are needed, it’s way easier than the old configuration. I thus think this feature has become obsolete and can be removed.
No one spoke up about it -- I think we can deprecate it. Maybe it becomes a helper-tools externally in the future.
closed via #2421
Note that the latest documentation Getting Started guide (https://mesa.readthedocs.io/stable/getting_started.html) still recommends:
To bootstrap a new model install mesa and run mesa startproject
In mesa 3.1.3 this throws ModuleNotFoundError: No module named 'mesa.main'
If deprecated/unsupported it should probably be removed from the Getting Started document.