mesa icon indicating copy to clipboard operation
mesa copied to clipboard

Update "startproject" to latest practices

Open EwoutH opened this issue 1 year ago • 11 comments

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.

See mesa/cookiecutter-mesa/

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.

EwoutH avatar Sep 26 '24 19:09 EwoutH

I’m considering removing this and documenting how to structure an project under “best practices”.

@projectmesa/maintainers, what do we think?

EwoutH avatar Oct 10 '24 20:10 EwoutH

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.

jackiekazil avatar Oct 11 '24 03:10 jackiekazil

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.

quaquel avatar Oct 12 '24 10:10 quaquel

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.

rht avatar Oct 12 '24 11:10 rht

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.

quaquel avatar Oct 12 '24 11:10 quaquel

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:

  1. more declarative model specifications (e.g. Dolo.jl
  2. in dev dependencies: ruff, Black, and other best practices
  3. (optional) example tests that the learner can see the pattern of, and extend

rht avatar Oct 12 '24 12:10 rht

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 startproject is 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.

EwoutH avatar Oct 12 '24 12:10 EwoutH

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.

quaquel avatar Oct 12 '24 12:10 quaquel

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.

rht avatar Oct 12 '24 12:10 rht

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.

jackiekazil avatar Oct 12 '24 15:10 jackiekazil

SGTM. Additionally if you could also get their feedback on it.

rht avatar Oct 12 '24 16:10 rht

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.

EwoutH avatar Oct 21 '24 03:10 EwoutH

No one spoke up about it -- I think we can deprecate it. Maybe it becomes a helper-tools externally in the future.

jackiekazil avatar Oct 21 '24 03:10 jackiekazil

closed via #2421

quaquel avatar Oct 25 '24 20:10 quaquel

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.

ccorbell avatar Jan 13 '25 20:01 ccorbell