Highlights
Mesa 2.3.0 is a big feature release and the last feature release before 3.0.
There are two main new features:
- The experimental cell-centric discrete spaces, as added in 1994. It allows having cells with not only properties but also active behaviors: the `CellAgent`. Its inspired by NetLogo's [patches](https://ccl.northwestern.edu/netlogo/bind/primitive/patches.html) but extend and generalize this concept further.
- Full support for discrete event scheduling, as added in 2066. It allows scheduling events (like Agent actions) at any time, including non-integer timesteps.
There are a lot of other features: The Jupyter visualisation now supports easier way to specify sliders, `NetworkGrid.get_neighbors()` supports a radius, `AgentSet.get()` can retrieve multiple attributes and there are now benchmarks to track Mesa performance during development.
Finally, 2.3.0 stabilizes the `AgentSet` (including `model.agents`), making it the first experimental Mesa feature that is taken out of it's experimental phase.
Install this release with:
pip install --upgrade mesa
The Mesa 2.3.x-series supports Python 3.9 to 3.12. The next major release will require Python 3.10.
What's Changed
๐งช Experimental features
* Add cell-centric discrete spaces (experimental) by Corvince in https://github.com/projectmesa/mesa/pull/1994
๐ New features added
* Add performance benchmarking scripts by EwoutH in https://github.com/projectmesa/mesa/pull/1979
* feat: Implement Slider class for JupyterViz by rht in https://github.com/projectmesa/mesa/pull/1972
* Stabilize AgentSet by EwoutH in https://github.com/projectmesa/mesa/pull/2065
* Support discrete event scheduling by quaquel in https://github.com/projectmesa/mesa/pull/2066
๐ Enhancements made
* JupyterViz: Automatically deduce display name from model class by rht in https://github.com/projectmesa/mesa/pull/1975
* Add radius argument to NetworkGrid.get_neighbors() by EwoutH in https://github.com/projectmesa/mesa/pull/1973
* Speedup of Agentset.shuffle by quaquel in https://github.com/projectmesa/mesa/pull/2010
* feat: Let mesa runserver detect server.py as fallback by rht in https://github.com/projectmesa/mesa/pull/2015
* JupyterViz: {Convert make_plot & prepare ColorCard} to become Solara component by rht in https://github.com/projectmesa/mesa/pull/2020
* new feature: AgentSet.get can retrieve one or more then one attribute by quaquel in https://github.com/projectmesa/mesa/pull/2044
* Update CODE_OF_CONDUCT.md to version 2+ of contrib covenant by jackiekazil in https://github.com/projectmesa/mesa/pull/2052
* Improve flocking benchmark by coderbeta1 in https://github.com/projectmesa/mesa/pull/2054
* Remove JupyterViz Altair marker overlap for huge grid size by rht in https://github.com/projectmesa/mesa/pull/2062
* Add tooltip option to Altair chart by FoFFolo in https://github.com/projectmesa/mesa/pull/2082
* feat: Display model seed & allow user to specify it in JupyterViz by rht in https://github.com/projectmesa/mesa/pull/2069
* warn if placing already placed agent by puer-robustus in https://github.com/projectmesa/mesa/pull/2083
๐ Bugs fixed
* fix: Apply default value to slider by rht in https://github.com/projectmesa/mesa/pull/2016
* fix: Initialize model _steps and _time during __new__ by rht in https://github.com/projectmesa/mesa/pull/2026
* fix: Use model.schedule only when it is not None by rht in https://github.com/projectmesa/mesa/pull/2050
* fix: Remove JupyterViz grid marker overlap for huge grid size by rht in https://github.com/projectmesa/mesa/pull/2049
๐ Documentation improvements
* Improve readability of badges by rht in https://github.com/projectmesa/mesa/pull/2009
* More pythonic implementation of wolf sheep by quaquel in https://github.com/projectmesa/mesa/pull/2011
* Adding super().__init__() to MoneyModel tutorial by sw23 in https://github.com/projectmesa/mesa/pull/2025
* docs: Convert howto.rst -> howto.md via rst2myst by rht in https://github.com/projectmesa/mesa/pull/2033
* docs: Convert best-practices,overview,packages,mesa,index to .md via rst2myst by rht in https://github.com/projectmesa/mesa/pull/2034
* docs: Convert api/*.rst -> api/*.md via rst2myst by rht in https://github.com/projectmesa/mesa/pull/2035
* docs: Rewrite howto.md using ChatGPT for clarity and conciseness by rht in https://github.com/projectmesa/mesa/pull/2037
* docs: Corrected Contributing Guide Link to Ensure Accessibility by sahusiddharth in https://github.com/projectmesa/mesa/pull/2057
* Rename links to internal .rst files to .md by rht in https://github.com/projectmesa/mesa/pull/2058
* docs: improve introductory tutorial by puer-robustus in https://github.com/projectmesa/mesa/pull/2087
๐ง Maintenance
* Quality of Life: Make codecov less meticulous by Corvince in https://github.com/projectmesa/mesa/pull/1966
* Add CI workflow for performance benchmarks by EwoutH in https://github.com/projectmesa/mesa/pull/1983
* tests: Resolve warnings by defining PropertyLayer dtypes by EwoutH in https://github.com/projectmesa/mesa/pull/1987
* benchmarks.yml: Fix PR branch checkout when triggered by comment by EwoutH in https://github.com/projectmesa/mesa/pull/1998
* Quality of life: automatically fix ruff errors by Corvince in https://github.com/projectmesa/mesa/pull/2004
* benchmarks.yml: Run on addition of label instead of comment by EwoutH in https://github.com/projectmesa/mesa/pull/2002
* ci: Move codespell to pre-commit by rht in https://github.com/projectmesa/mesa/pull/2040
* Schelling by coderbeta1 in https://github.com/projectmesa/mesa/pull/2053
* Move ruff lint settings into dedicated section by Corvince in https://github.com/projectmesa/mesa/pull/2073
* ci: Use uv pip for faster build by rht in https://github.com/projectmesa/mesa/pull/2038
* test: Remove place_agent duplicate warnings by rht in https://github.com/projectmesa/mesa/pull/2086
Other changes
* Minor edits to benchmarking code by quaquel in https://github.com/projectmesa/mesa/pull/1985
* build(deps): bump codecov/codecov-action from 3 to 4 by dependabot in https://github.com/projectmesa/mesa/pull/2030
* [pre-commit.ci] pre-commit autoupdate by pre-commit-ci in https://github.com/projectmesa/mesa/pull/2029
* tests: Speed up test_batch_run by rht in https://github.com/projectmesa/mesa/pull/2039
* Update benchmarks.yml by Corvince in https://github.com/projectmesa/mesa/pull/2043
* docs: Convert visualization .rst -> .md via rst2myst by rht in https://github.com/projectmesa/mesa/pull/2036
* docs: Convert CONTRIBUTING .rst -> .md via rst2myst by rht in https://github.com/projectmesa/mesa/pull/2041
* Correct wolf energy gained from eating sheep by JackAtOmenApps in https://github.com/projectmesa/mesa/pull/2048
* feat: Implement Altair version of grid visualization by rht in https://github.com/projectmesa/mesa/pull/1991
New Contributors
* sw23 made their first contribution in https://github.com/projectmesa/mesa/pull/2025
* JackAtOmenApps made their first contribution in https://github.com/projectmesa/mesa/pull/2048
* coderbeta1 made their first contribution in https://github.com/projectmesa/mesa/pull/2054
* sahusiddharth made their first contribution in https://github.com/projectmesa/mesa/pull/2057
* FoFFolo made their first contribution in https://github.com/projectmesa/mesa/pull/2082
* puer-robustus made their first contribution in https://github.com/projectmesa/mesa/pull/2083
**Full Changelog**: https://github.com/projectmesa/mesa/compare/v2.2.4...2.3.0