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

Tracking issue: Full integration of Example models #2364

Open
20 of 24 tasks
EwoutH opened this issue Oct 15, 2024 · 11 comments
Open
20 of 24 tasks

Tracking issue: Full integration of Example models #2364

EwoutH opened this issue Oct 15, 2024 · 11 comments
Labels
example Changes the examples or adds to them.

Comments

@EwoutH
Copy link
Member

EwoutH commented Oct 15, 2024

With the core examples being merged back into Mesa in #2358 and now available in examples we can now start working our checklist:

Feel free to add items, and put your name behind something if you want to pick it up!

@EwoutH EwoutH added the example Changes the examples or adds to them. label Oct 15, 2024
@EwoutH EwoutH pinned this issue Oct 15, 2024
@quaquel
Copy link
Member

quaquel commented Oct 15, 2024

I'll pick up the read the docs stuff as discussed today.

@EwoutH
Copy link
Member Author

EwoutH commented Oct 15, 2024

@quaquel Awesome! #2365 structures all basic example models to have a flat structure and at least agents.py and model.py, I think that should help.

EwoutH added a commit to projectmesa/mesa-examples that referenced this issue Oct 16, 2024
This PR:
- Removes the 9 core examples from this repo
- Updates the Readme to reflect that.

The following examples are moved (to [`examples`](https://github.com/projectmesa/mesa/tree/main/examples)):
- Basic Examples
  - Boltzmann Wealth
  - Boid Flockers
  - Conway's Game of Life
  - Virus on Network
  - Schelling Segregation
- Advanced Examples
  - Epstein Civil Violence
  - Sugarscape with Traders
  - Wolf-Sheep Predation
  - Demographic Prisoner's Dilemma on Grid

Part of projectmesa/mesa#2364.
@EwoutH
Copy link
Member Author

EwoutH commented Oct 16, 2024

I'm going to focus on my thesis for a few days, but happy to review anything!

@Corvince
Copy link
Contributor

Corvince commented Oct 16, 2024

Just a heads-up that this broke the docs build for the visualization tutorial, because mesa-examples does no longer provide the BoltzmannWealthModel. The vis tutorial does need a larger update anyways (which I somewhere agreed to do), but still this is a major breaking change that we need to communicate somehow.
https://readthedocs.org/projects/mesa/builds/25963527/

Or maybe easier is to provide the same "model export" in core mesa and then just re-export that from mesa-examples. Thats probably the better path now that I think of it. I'll add "make examples importable" to the checklist

@Corvince
Copy link
Contributor

[ ] Discuss enabling ruff and/or ruff-format on (parts of) the examples (in pyproject.toml).

Curious as to why this needs a discussion? I am strongly in favor of enabling it. Whats a reason against it?

@EwoutH
Copy link
Member Author

EwoutH commented Oct 16, 2024

Just a heads-up that this broke the docs build for the visualization tutorial, because mesa-examples does no longer provide the BoltzmannWealthModel.

I just noticed it also. That's just an question of updating the path to import from mesa/examples/basic, right?

Let's give @tpike3 a chance to finish his tutorial and then go from there.

Curious as to why this needs a discussion? I am strongly in favor of enabling it. Whats a reason against it?

Against: It's a lot of work ;). I made an start in #2370. Docstring we should consider if we want to add and require that everywhere.

@quaquel
Copy link
Member

quaquel commented Oct 16, 2024

I agree its some work but not as bad as what I did a few weeks back with the docstrings. With @Corvince, I believe that we should just enable it and fix all issues. The examples should exemplify good practices.

@EwoutH
Copy link
Member Author

EwoutH commented Oct 16, 2024

  • Make examples importable (e.g. from mesa.examples import BoltzmannWealthModel)

@Corvince this means we also have to move them from examples to mesa/examples, right? Or can we make them importable in another way?

@Corvince
Copy link
Contributor

Not sure, I checked and experimented briefly. There is an extensive hatch documentation about file selection
https://hatch.pypa.io/latest/config/build/#file-selection

From skimming it might be possible from examples, but I don't know if it can automatically be included as "mesa.examples". Someone should figure this out

@EwoutH
Copy link
Member Author

EwoutH commented Nov 1, 2024

@quaquel if you can find the time, having the examples sorted by Basic and Advanced would be really useful, as well as having the Readme descriptions integrated.

I'm good with making that whole Readme the starting page for https://mesa.readthedocs.io/latest/examples.html, even if it then looks less good on GitHub (or the links only work on Readthedocs, etc.). Renaming headers etc. is also okay.

image

@quaquel
Copy link
Member

quaquel commented Nov 1, 2024

The example level readme is already included. I hope to find some time this weekend to do the overview of examples readme.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
example Changes the examples or adds to them.
Projects
None yet
Development

No branches or pull requests

3 participants