Releases: projectmesa/mesa
v3.0 alpha 4 (pre-release)
Highlights
Mesa 3.0.0a4 contains two major breaking changes:
-
The Agent's
unique_id
is now automatically assigned, so doesn't need to be passed to the Agent class anymore. In a subclassed custom Agent, like normally used, this now looks like this:class Wolf(Agent): - def __init__(self, unique_id, model, energy=None): + def __init__(self, model, energy=None): # When initializing the super class (Agent), passing unique_id isn't needed anymore - super().__init__(unique_id, model) + super().__init__(model) - wolf = Wolf(unique_id, model) + wolf = Wolf(model)
Example models were updated in mesa-examples#194, which shows more examples on how to update existing models.
-
Our visualisation API is being overhauled, to be more flexible and powerful. For more details, see #2278.
- An initial update to the tutorial was made in #2289 and is available here.
- An initial example model was updated in mesa-examples#195, and more examples will be updated in mesa-examples#195.
- The old SolaraViz API is still available at
mesa.experimental
, but might be removed in future releases.
Furthermore, the AgentSet has a new agg
method to quickly get an aggerate value (for example min_energy = model.agents.agg("energy", min)
) (#2266), The Model get_agents_of_type
function is replaced by directly exposing the agents_by_type
property (which can be accessed as a dict) (#2267, mesa-examples#190) and the AgentSet get() methods can now handle missing values by replacing it with a default value (#2279).
Finally, it fixes a bug in which the Grid's move_agent_to_one_of
method with selection="closest"
selected a location deterministically, instead of randomly (#2118).
What's Changed
⚠️ Breaking changes
- move solara_viz back to experimental by @Corvince in #2278
- track unique_id automatically by @quaquel in #2260
🎉 New features added
🛠 Enhancements made
- Model: Replace
get_agents_of_type
method withagents_by_type
property by @EwoutH in #2267 - add default SolaraViz by @Corvince in #2280
- Simplify ModelController by @Corvince in #2282
- Add default values and missing value handling to
agentset.get
by @quaquel in #2279
🐛 Bugs fixed
- Fix deterministic behavior in
move_agent_to_one_of
withselection="closest"
by @OrenBochman in #2118
📜 Documentation improvements
- docs: Fix Visualization Tutorial (main branch) by @EwoutH in #2271
- Docs: Fix broken relative links by removing
.html
suffix by @EwoutH in #2274 - Readthedocs: Don't let notebook failures pass silently by @EwoutH in #2276
- Update viz tutorial to the new API by @Corvince in #2289
🔧 Maintenance
New Contributors
- @OrenBochman made their first contribution in #2118
Full Changelog: v3.0.0a3...v3.0.0a4
v2.3.4
Highlights
Two fixes in our docs: The visualization tutorial started using an example model that wasn't compatible with Mesa 2.x anymore, and some relative links were broken. This release fixes both.
What's Changed
📜 Documentation improvements
- docs: Fix Visualization Tutorial (2.x branch) by @EwoutH in #2272
- Docs: Fix broken relative links by removing
.html
suffix by @EwoutH in #2274
Full Changelog: v2.3.3...v2.3.4
v2.3.3
Highlights
Mesa v2.3.3 is a small patch release with documentation and maintenance updates backported from our main branch.
We do have included one feature as preview for Mesa 3.0: The AgentSet got a convenient set
method to quickly set a variable value to (a subset of) agents. See #2254 for some examples.
What's Changed
🎉 New features added
📜 Documentation improvements
- Fix image on landing page of docs. by @jackiekazil in #2146
- Replace links in docs - google group to matrix. by @jackiekazil in #2148
- Add experimental features to documentation as per #2122 by @stephenfmann in #2154
- Update visualisation docs by @EwoutH in #2162
- Add original conference paper link to docs by @ENUMERA8OR in #2160
- docs/conf.py: Use modern
intersphinx_mapping
format by @EwoutH in #2206 - Contribution: Add "I have no idea where to start" section by @EwoutH in #2258
Full Changelog: v2.3.2...v2.3.3
v3.0 alpha 3 (pre-release)
Highlights
Developments toward Mesa 3.0 are steaming ahead, and our fourth alpha release is packed with features and updates - only 8 days after our third.
Mesa 3.0.0a3 contains one breaking change: We now automatically increase the steps
counter by one at the beginning of each Model.steps()
call. That means increasing steps
by hand isn't necessary anymore.
The big new features is the experimental Voronoi grid that @vitorfrois implemented in #2084. It allows creating cells in a Voronoi layout as part of the experimental cell space. An example using it to model Cholera spread can be found here.
The AgentSet got a lot of love with two brand new methods: .groupby()
to split in groups (#2220) and .set()
to easily assign variables to all agents in that set (#2254). The select()
method is improved by allowing to select at most a fraction of the agents (#2253), and we split the do()
method in do()
and map()
to make a distinction between the return types (#2237).
Furthermore, we improved the performance of accessing Model.agents
, squashed a bug in SolaraViz, started testing on Python 3.13 and added a new benchmark model.
Our example models also got more love: We removed the RandomActivation
scheduler in 14 models and removed SimultaneousActivation in 3 models (examples#183). They now use the automatic step increase and AgentSet functionality. We started testing our GIS model in CI (examples#171) and resolved a lot of bugs in them (examples#172, help appreciated!).
Finally, we have two brand new examples: An Ant Colony Optimization model using an Ant System approach to the Traveling Salesman problem, a Mesa NetworkGrid, and a custom visualisation with SolaraViz (examples#157 by @zjost). The first example using the PropertyLayer
was added, a very fast implementation of Conway's Game of Life (examples#182).
To help the transition to Mesa 3.0, we started writing a migration guide. Progress is tracked in #2233, feedback and help is appreciated! Finally, we also added a new section to our contributor guide to get new contributors up to speed.
This pre-release can be installed as always with pip install --pre mesa
What's Changed
⚠️ Breaking changes
🧪 Experimental features
- Voronoi Tessellation based Discrete Space by @vitorfrois in #2084
🎉 New features added
🛠 Enhancements made
- Split AgentSet into map and do to separate return types by @quaquel in #2237
- Performance enhancements for Model.agents by @quaquel in #2251
- AgentSet: Allow selecting a fraction of agents in the AgentSet by @EwoutH in #2253
🐛 Bugs fixed
📜 Documentation improvements
- Contribution: Add "I have no idea where to start" section by @EwoutH in #2258
- Write initial Mesa Migration guide by @EwoutH in #2257
🔧 Maintenance
- CI: Add test job for Python 3.13 by @EwoutH in #2173
- Add pull request templates by @EwoutH in #2217
- benchmarks: Add BoltzmannWealth model by @EwoutH in #2252
- CI: Add optional dependency for examples by @EwoutH in #2261
New Contributors
- @vitorfrois made their first contribution in #2084
Full Changelog: v3.0.0a2...v3.0.0a3
v3.0 alpha 2 (pre-release)
Highlights
In Mesa 3.0 alpha 2 (v3.0.0a2
) we've done more clean-up in preparation for Mesa 3.0. We now require super().__init__()
to run on initializing a Mesa model subclass and fixed a bug in our Solara space_drawer.
A new feature was added in #2219, which now also allows AgentSet.do()
to take any callable function, instead of only a string referencing to an Agent method. The argument name was changed from method_name
to method
.
We're also working hard on our example models. All model warnings were resolved and we've replaced a lot of schedulers with simpler and more flexible AgentSet functionality. Checkout our open issues if you want to help improve our example models further!
You can update to this version as usual with pip install mesa --upgrade --pre
.
What's Changed
⚠️ Breaking changes
- Allow AgentSet.do() to take Callable function by @quaquel in #2219
- Require Mesa models to be initialized with
super().__init__()
by @EwoutH in #2218 - breaking: Add dependencies argument to custom space_drawer by @rht in #2209
🧪 Experimental enhancement
📜 Documentation improvements
🔧 Maintenance
- CI: Let pytest treat warnings as errors for examples by @EwoutH in #2204
- docs/conf.py: Use modern
intersphinx_mapping
format by @EwoutH in #2206
Full Changelog: v3.0.0a1...v3.0.0a2
v3.0 alpha 1 (pre-release)
Highlights
Mesa 3.0 alpha 1 (v3.0.0a1
) is another step towards our next major version. This release introduces a name change from JupyterViz (jupyter_viz) to SolaraViz (solara_viz), to better represent the tech stack being used. It also includes two bugfixes also present in 2.3.2.
What's Changed
⚠️ Breaking changes
- viz: Combine code for rendering in browser and Jupyter by @rht in #2180
- refactor: Rename jupyter_viz namespace to solara_viz by @rht in #2188
🛠 Enhancements made
🐛 Bugs fixed
- fix: Render agent marker radius correctly by @rht in #2181
- fix: Use model.schedule.steps -> mode._steps for batch_run by @rht in #2183
📜 Documentation improvements
- Add original conference paper link to docs by @ENUMERA8OR in #2160
New Contributors
- @ENUMERA8OR made their first contribution in #2160
Full Changelog: v3.0.0a0...v3.0.0a1
v2.3.2
Highlights
Mesa 2.3.2 is a small patch release which fixes two bugs, one to the batch_run function still depending on schedule.steps
, and one in the agent marker visualisation.
What's Changed
🐛 Bugs fixed
- fix: Render agent marker radius correctly by @rht in #2181
- fix: Use model.schedule.steps -> model._steps for batch_run by @rht in #2183
Full Changelog: v2.3.1...v2.3.2
v3.0 alpha 0 (pre-release)
Highlights
This is the first pre-release in the Mesa 3.0 series, which is still in active development. The v3.0.0a0
pre-release can help active Mesa developers help starting to test the latest features in their models.
Since it's in active development, more breaking changes may follow and it's not recommended for general usage.
There are two major breaking changes at this point:
- The old visualisation is removed, in favor of the new, Solara based, Jupyter Viz. This was already available in the 2.3.x release series, but is now stabilized. Checkout out our new Visualization Tutorial. More examples and a migration guide will follow later in the Mesa 3.0 development.
- The
mesa.flat
namespace is removed, since was not used very often.
Mesa 3.0 will require Python 3.10+.
This pre-release can be installed with pip install mesa --upgrade --pre
.
What's Changed
⚠️ Breaking changes
- Remove mesa.flat namespace by @rht in #2091
- breaking: Remove visualization_old (mesa-viz-tornado) by @rht in #2133
🎉 New features added
🐛 Bugs fixed
- Jupyter_viz: Allow measures to be None by @EwoutH in #2163
- Jupyter Viz: Don't avoid interactive backend by @EwoutH in #2165
📜 Documentation improvements
- Fix image on landing page of docs. by @jackiekazil in #2146
- Replace links in docs - google group to matrix. by @jackiekazil in #2148
- Update visualisation docs by @EwoutH in #2162
🔧 Maintenance
- CI: Add weekly scheduled run to all CI workflows by @EwoutH in #2130
- Drop support for Python 3.9, require Python >= 3.10 by @EwoutH in #2132
- Add script to list unlabeled PR's since latest release by @rht in #2047
New Contributors
- @stephenfmann made their first contribution in #2154
Full Changelog: v2.3.1...v3.0.0a0
v2.3.1
Highlights
Mesa 2.3.1 is a small patch release with a datacollector bug fixed and improved documentation.
What's Changed
🐛 Bugs fixed
📜 Documentation improvements
- Add experimental features to documentation as per #2122 by @stephenfmann in #2154
New Contributors
- @stephenfmann made their first contribution in #2154
Full Changelog: v2.3.0...v2.3.1
v2.3.0
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 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
🎉 New features added
- Add performance benchmarking scripts by @EwoutH in #1979
- feat: Implement Slider class for JupyterViz by @rht in #1972
- Stabilize AgentSet by @EwoutH in #2065
- Support discrete event scheduling by @quaquel in #2066
🛠 Enhancements made
- JupyterViz: Automatically deduce display name from model class by @rht in #1975
- Add radius argument to NetworkGrid.get_neighbors() by @EwoutH in #1973
- Speedup of Agentset.shuffle by @quaquel in #2010
- feat: Let mesa runserver detect server.py as fallback by @rht in #2015
- JupyterViz: {Convert make_plot & prepare ColorCard} to become Solara component by @rht in #2020
- new feature: AgentSet.get can retrieve one or more then one attribute by @quaquel in #2044
- Update CODE_OF_CONDUCT.md to version 2+ of contrib covenant by @jackiekazil in #2052
- Improve flocking benchmark by @coderbeta1 in #2054
- Remove JupyterViz Altair marker overlap for huge grid size by @rht in #2062
- Add tooltip option to Altair chart by @FoFFolo in #2082
- feat: Display model seed & allow user to specify it in JupyterViz by @rht in #2069
- warn if placing already placed agent by @puer-robustus in #2083
🐛 Bugs fixed
- fix: Apply default value to slider by @rht in #2016
- fix: Initialize model _steps and _time during new by @rht in #2026
- fix: Use model.schedule only when it is not None by @rht in #2050
- fix: Remove JupyterViz grid marker overlap for huge grid size by @rht in #2049
- Make agent move to actual random closest position by @EwoutH in #2119
📜 Documentation improvements
- Improve readability of badges by @rht in #2009
- More pythonic implementation of wolf sheep by @quaquel in #2011
- Adding super().init() to MoneyModel tutorial by @sw23 in #2025
- docs: Convert howto.rst -> howto.md via rst2myst by @rht in #2033
- docs: Convert best-practices,overview,packages,mesa,index to .md via rst2myst by @rht in #2034
- docs: Convert api/.rst -> api/.md via rst2myst by @rht in #2035
- docs: Rewrite howto.md using ChatGPT for clarity and conciseness by @rht in #2037
- docs: Corrected Contributing Guide Link to Ensure Accessibility by @sahusiddharth in #2057
- Rename links to internal .rst files to .md by @rht in #2058
- docs: improve introductory tutorial by @puer-robustus in #2087
🔧 Maintenance
- Quality of Life: Make codecov less meticulous by @Corvince in #1966
- Add CI workflow for performance benchmarks by @EwoutH in #1983
- tests: Resolve warnings by defining PropertyLayer dtypes by @EwoutH in #1987
- benchmarks.yml: Fix PR branch checkout when triggered by comment by @EwoutH in #1998
- Quality of life: automatically fix ruff errors by @Corvince in #2004
- benchmarks.yml: Run on addition of label instead of comment by @EwoutH in #2002
- ci: Move codespell to pre-commit by @rht in #2040
- Schelling by @coderbeta1 in #2053
- Move ruff lint settings into dedicated section by @Corvince in #2073
- ci: Use uv pip for faster build by @rht in #2038
- test: Remove place_agent duplicate warnings by @rht in #2086
Other changes
- Minor edits to benchmarking code by @quaquel in #1985
- build(deps): bump codecov/codecov-action from 3 to 4 by @dependabot in #2030
- [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci in #2029
- tests: Speed up test_batch_run by @rht in #2039
- Update benchmarks.yml by @Corvince in #2043
- docs: Convert visualization .rst -> .md via rst2myst by @rht in #2036
- docs: Convert CONTRIBUTING .rst -> .md via rst2myst by @rht in #2041
- Correct wolf energy gained from eating sheep by @JackAtOmenApps in #2048
- feat: Implement Altair version of grid visualization by @rht in #1991
New Contributors
- @sw23 made their first contribution in #2025
- @JackAtOmenApps made their first contribution in #2048
- @coderbeta1 made their first contribution in #2054
- @sahusiddharth made their first contribution in #2057
- @FoFFolo made their first contribution in #2082
- @puer-robustus made their first contribution in #2083
Full Changelog: v2.2.4...2.3.0