Recent Releases of Mesa 3
Mesa 3 - v3.2.0
Highlights
Mesa 3.2.0 is a feature-packed release, which stabilizes our discrete space, improves many of our visualisation capabilities, improves our tutorial organization, adds the experimental meta-agents, and includes other quality of life enhancements.
We also celebrate the publication of our peer-reviewed Mesa 3 paper in JOSS. See the updated Citing Mesa section on how to cite us.
Stabilization of Discrete Space
The experimental Cell Space system has been stabilized and is now available as mesa.discrete_space (#2610). This powerful spatial modeling framework enables cell-centric simulations with integrated PropertyLayers and improved agent movement capabilities. Key improvements include:
- Support for dynamic modifications to discrete spaces during simulation (#2755)
- Methods to add/remove cells and connections in real-time
- Full integration with PropertyLayers (#2440) for representing environmental variables
- Compatible with all examples and existing visualizations
The PropertyLayer itself has also been stabilized, allowing for efficient management of spatial environmental properties like terrain, resources, or any grid-based variables. Core examples including Schelling, Game of Life, Boltzmann Wealth, and Virus on Network have been updated to use the new discrete space system.
Enhanced Visualization Experience
The SolaraViz visualization system has received substantial upgrades:
- Command Console (#2697): An interactive Python console embedded directly in the visualization, allowing real-time model inspection and manipulation
- Asynchronous Updates (#2656): Visualization now runs in a separate thread, dramatically improving performance for complex models
- Dark Mode (#2689): Support for Solara Dark theme, automatically matching system preferences
- Improved Error Handling (#2747, #2753): Better visualization of errors with options to view detailed traceback information
- Enhanced UI: Arrow key navigation (#2725), movable input field with auto-scroll (#2710), and other quality-of-life improvements
- PropertyLayer visualisation in Altair (#2643): Support for visualising PropertyLayers using the Altair frontend in Solara.
Restructured and updated tutorial
Our introduction tutorial has been completely restructured (#2731). Instead of one huge notebook, the tutorial is now divided into smaller, focused modules that build progressively:
- Creating Your First Model: Essential basics to get started
- Adding Space: Learn how to use the new discrete space system
- Collecting Data: Effectively gather model statistics
- AgentSet: Master agent management techniques
- Visualization: Series of modules covering basic to advanced visualization
Introducing Meta-Agents
Complex systems often have multiple levels of components. An organization is not one entity, but is made of departments, sub-departments, and people. A person is not a single entity, but it is made of micro biomes, organs and cells. A city is not a single entity, but it is made of districts, neighborhoods, buildings, and people. A forest comprises an ecosystem of trees, plants, animals, and microorganisms.
This reality is the motivation for meta-agents. It allows users to represent these multiple levels, where each level can have meta-agents with constituting agents. - Meta agents #2748
To demonstrate meta-agents capability there are two examples:
- Dynamic meta-agent creation - Alliance formation, which shows emergent meta-agent formation through a game theoretic based alliance formation.
- Deliberate meta-agent creation - Warehouse model, which provides a pseudo warehouse model to demonstrate meta-agent functionality.
Let us know what you think on our Matrix Channel
Other improvements
- AgentSet's
aggmethod now supports multiple aggregation functions in a single call (#2743) - Many documentation improvements have been made based on feedback by our JOSS reviewers
What's Changed
π New features added
- Stabilize experimental Cell Space as
mesa.discrete_spaceby @quaquel in https://github.com/projectmesa/mesa/pull/2610 - Feat: Added Command Console by @Sahil-Chhoker in https://github.com/projectmesa/mesa/pull/2697
- Stabilize PropertyLayer by @EwoutH in https://github.com/projectmesa/mesa/pull/2440 ### π Enhancements made
- Visualisation: Add dark mode by @sanika-n in https://github.com/projectmesa/mesa/pull/2689
- Creating threads to update visualization asynchronously by @HMNS19 in https://github.com/projectmesa/mesa/pull/2656
- Movable Input Field with auto-scroll by @Sahil-Chhoker in https://github.com/projectmesa/mesa/pull/2710
- Feat: Added arrow key navigation by @Sahil-Chhoker in https://github.com/projectmesa/mesa/pull/2725
- added property_layer with altair by @sanika-n in https://github.com/projectmesa/mesa/pull/2643
- Debug option for errors in visualisation by @colinfrisch in https://github.com/projectmesa/mesa/pull/2747
- Debug option for errors in visualisation front end by @colinfrisch in https://github.com/projectmesa/mesa/pull/2753
- Add support for dynamic discrete spaces by @quaquel in https://github.com/projectmesa/mesa/pull/2755
- Support multiple functions in AgentSet
aggmethod by @EwoutH in https://github.com/projectmesa/mesa/pull/2743 ### π Examples updated - Move boltzmann to cell spaces by @quaquel in https://github.com/projectmesa/mesa/pull/2680
- Move Game of life to cell space by @quaquel in https://github.com/projectmesa/mesa/pull/2681
- Move Schelling to discrete space by @quaquel in https://github.com/projectmesa/mesa/pull/2684
- Move virusonanetwork to discretespace by @quaquel in https://github.com/projectmesa/mesa/pull/2688
- Update boid_flockers example include flight direction by @sanika-n in https://github.com/projectmesa/mesa/pull/2696 ### π Documentation improvements
- docs: Split off the overview page, extend with spaces/activation by @EwoutH in https://github.com/projectmesa/mesa/pull/2673
- docs: Add Roles section to CONTRIBUTING.md by @EwoutH in https://github.com/projectmesa/mesa/pull/2694
- [JOSS] Docs: Clarify difference between core and user examples by @EwoutH in https://github.com/projectmesa/mesa/pull/2706
- [JOSS] docs: Improve batch_run documentation for parallel processing by @EwoutH in https://github.com/projectmesa/mesa/pull/2707
- JOSS Tutorial Fixes by @tpike3 in https://github.com/projectmesa/mesa/pull/2708
- Clean-up old images, compress wolf-sheep image, remove version switch artifact by @EwoutH in https://github.com/projectmesa/mesa/pull/2717
- docs: Update citation to JOSS article by @EwoutH in https://github.com/projectmesa/mesa/pull/2740
- update intro tutorial discrete space by @tpike3 in https://github.com/projectmesa/mesa/pull/2731
- docs: fix broken links to Readthedocs in example descriptions by @reyan-singh in https://github.com/projectmesa/mesa/pull/2757 ### π§ͺ Experimental features
- Meta agents by @tpike3 in https://github.com/projectmesa/mesa/pull/2748 ### π Bugs fixed
- Minor (bug) fixes to discrete_space by @quaquel in https://github.com/projectmesa/mesa/pull/2687
- Fixed Marker in mpl by @sanika-n in https://github.com/projectmesa/mesa/pull/2670
New Contributors
- @colinfrisch made their first contribution in https://github.com/projectmesa/mesa/pull/2747
- @reyan-singh made their first contribution in https://github.com/projectmesa/mesa/pull/2757
Full Changelog: https://github.com/projectmesa/mesa/compare/v3.1.4...v3.2.0
Scientific Software - Peer-reviewed
- Python
Published by EwoutH 8 months ago
Mesa 3 - v3.1.5
Highlights
Mesa 3.1.5 is a maintenance release focused on improving documentation and cleaning up our resources. This update includes no breaking changes and is compatible with previous 3.1.x releases.
The documentation improvements include enhanced explanations for batch run parallel processing, a significantly expanded overview section covering spaces, property layers and time advancement methods with practical code examples, and a clearer installation guide detailing what the optional [rec] dependencies provide. We've also improved our examples documentation to better distinguish between core and user-contributed examples, and added a new "Roles" section to the contributing guide that outlines the project's community structure and progression paths.
On the maintenance side, we've cleaned up unused images and compressed existing ones, reducing the repository size by over 2MB and distribution size from 3.2MB to 1.2MB.
We recommend all users update to this release for the improved documentation.
What's Changed
π Documentation improvements
- docs: Split off the overview page, extend with spaces/activation by @EwoutH in https://github.com/projectmesa/mesa/pull/2673
- docs: Add Roles section to CONTRIBUTING.md by @EwoutH in https://github.com/projectmesa/mesa/pull/2694
- [JOSS] Docs: Clarify difference between core and user examples by @EwoutH in https://github.com/projectmesa/mesa/pull/2706
- [JOSS] docs: Improve batch_run documentation for parallel processing by @EwoutH in https://github.com/projectmesa/mesa/pull/2707
- Clean-up old images, compress wolf-sheep image, remove version switch artifact by @EwoutH in https://github.com/projectmesa/mesa/pull/2717
Full Changelog: https://github.com/projectmesa/mesa/compare/v3.1.4...v3.1.5
Scientific Software - Peer-reviewed
- Python
Published by EwoutH 9 months ago
Mesa 3 - v3.1.4
Highlights
This release contains various improvements and bugfixes to the matplotlib-based visualization of spaces. Hexgrids are now fully supported, including property layers. In making this possible, various minor bugs were encountered and also fixed. In addition to the visualization improvements, there are various minor convenience improvements to the docs.
What's Changed
π Enhancements made
- Fixed hex-space draw function to avoid overlaps by @Sahil-Chhoker in https://github.com/projectmesa/mesa/pull/2609
- Fix: Property layer visualization for HexGrid by @Sahil-Chhoker in https://github.com/projectmesa/mesa/pull/2646
- Enhance DataCollector to validate model_reporters functions by @peter-kinger in https://github.com/projectmesa/mesa/pull/2605
- Implemented post_process in Altair based components by @sanika-n in https://github.com/projectmesa/mesa/pull/2641 ### π Bugs fixed
- bugfix for drawpropertylayer by @quaquel in https://github.com/projectmesa/mesa/pull/2639
- Uses array for hex grid property layer fix by @Sahil-Chhoker in https://github.com/projectmesa/mesa/pull/2651
- Update Binder environment to use latest Mesa version (#2652) by @aarav-shukla07 in https://github.com/projectmesa/mesa/pull/2655
- Change Hexgrid.connectcells_2d to use x,y coordinates by @quaquel in https://github.com/projectmesa/mesa/pull/2632 ### π Examples updated
- Added property layer viz to sugarscape by @sanika-n in https://github.com/projectmesa/mesa/pull/2653
- added color-bar for spice by @sanika-n in https://github.com/projectmesa/mesa/pull/2622 ### π Documentation improvements
- remove any reference to using --pre by @quaquel in https://github.com/projectmesa/mesa/pull/2618
- Updated Docs by @sanika-n in https://github.com/projectmesa/mesa/pull/2624
- Fixed 404 error for Examples Tab in Introductory Tutorial (#2662) by @aarav-shukla07 in https://github.com/projectmesa/mesa/pull/2664
- Documentation by @Spartan-71 in https://github.com/projectmesa/mesa/pull/2630
- Adding a copy option at the top of the code written in the docs by @PrashantChoudhary13579 in https://github.com/projectmesa/mesa/pull/2628
- Adding Mesa Extension page by @PrashantChoudhary13579 in https://github.com/projectmesa/mesa/pull/2627 ### π§ Maintenance
- remove remnants of mesa cli by @quaquel in https://github.com/projectmesa/mesa/pull/2617
- benchmarks.yml: Install SciPy and use uv for pip install by @EwoutH in https://github.com/projectmesa/mesa/pull/2633
- [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci in https://github.com/projectmesa/mesa/pull/2659
New Contributors
- @PrashantChoudhary13579 made their first contribution in https://github.com/projectmesa/mesa/pull/2628
- @aarav-shukla07 made their first contribution in https://github.com/projectmesa/mesa/pull/2655
- @peter-kinger made their first contribution in https://github.com/projectmesa/mesa/pull/2605
Full Changelog: https://github.com/projectmesa/mesa/compare/v3.1.3...v3.1.4
Scientific Software - Peer-reviewed
- Python
Published by quaquel 11 months ago
Mesa 3 - v3.1.3
Highlights
Mesa 3.1.3 introduces a major experimental reimplementation of Mesa's continuous space, providing an intuitive agent-centric API and significant performance improvements. The new implementation supports n-dimensional spaces and offers streamlined methods for agent movement and neighbor calculations.
New Continuous Space Features
- Agent-centric movement API similar to cell spaces
- Efficient neighbor calculations and position updates
- Support for n-dimensional spaces
- Improved memory management with dynamic array resizing
Here's a quick look at the new API:
```python
Create a 2D continuous space
space = ContinuousSpace( dimensions=[[0, 1], [0, 1]], torus=True, random=model.random )
Create and position an agent
agent = ContinuousSpaceAgent(space, model) agent.position = [0.5, 0.5]
Move agent using vector arithmetic
agent.position += [0.1, 0.1]
Get neighbors within radius
neighbors, distances = agent.getneighborsin_radius(radius=0.2)
Find k nearest neighbors
nearest, distances = agent.getnearestneighbors(k=5) ```
The new implementation particularly benefits models requiring frequent position updates and neighbor queries, such as flocking simulations or particle systems. See PR #2584 and the API documentation for more details. We would love to get feedback on the new Continuous Space in #2611.
Other improvements in this release include consistent visualization behavior across space types with the reimplementation of draw_voronoi #2608, and a new render interval slider for controlling visualization update frequency in SolaraViz, which helps improve performance when working with complex visualizations #2596. We've also fixed a bug affecting random number generation determinism when using Model(seed=something), ensuring both model.random and model.rng now behave consistently when seeded with the same initial value #2598.
What's Changed
π§ͺ Experimental features
- Reimplementation of Continuous Space by @quaquel in https://github.com/projectmesa/mesa/pull/2584 ### π Enhancements made
- reimplementation of draw_voroinoi by @quaquel in https://github.com/projectmesa/mesa/pull/2608
- Add render interval slider to control visualization update frequency by @HMNS19 in https://github.com/projectmesa/mesa/pull/2596 ### π Bugs fixed
- Bugfix for non deterministic rng behavior by @quaquel in https://github.com/projectmesa/mesa/pull/2598 ### π Examples updated
- Clarify ContinuousSpace.get_neighbors behavior with multiple agents at same position by @quaquel in https://github.com/projectmesa/mesa/pull/2599
New Contributors
- @HMNS19 made their first contribution in https://github.com/projectmesa/mesa/pull/2596
Full Changelog: https://github.com/projectmesa/mesa/compare/v3.1.2...v3.1.3
Scientific Software - Peer-reviewed
- Python
Published by EwoutH 12 months ago
Mesa 3 - v3.1.2
Highlights
Mesa v3.1.2 is a patch release containing updates to our wolf-sheep, shelling and prisoner's dilemma example models and improving documentation in the tutorials and visualisation docstring. No functional changes to the core library were made.
What's Changed
π Examples updated
- examples/wolf_sheep: Don't allow dumb moves by @EwoutH in https://github.com/projectmesa/mesa/pull/2503
- Added homophily ratio in basic schelling example by @vbv-shm in https://github.com/projectmesa/mesa/pull/2520
- examples: Update pd_grid analysis.ipynb to use new spaces by @quaquel in https://github.com/projectmesa/mesa/pull/2553 ### π Documentation improvements
- Corrected a few errors in Intro tutorial by @sanika-n in https://github.com/projectmesa/mesa/pull/2583
- Small draw_space docstring fix by @quaquel in https://github.com/projectmesa/mesa/pull/2554
- fix: model name in visualization tutorial by @Sahil-Chhoker in https://github.com/projectmesa/mesa/pull/2591
New Contributors
- @vbv-shm made their first contribution in https://github.com/projectmesa/mesa/pull/2520
- @sanika-n made their first contribution in https://github.com/projectmesa/mesa/pull/2583
Full Changelog: https://github.com/projectmesa/mesa/compare/v3.1.1...v3.1.2
Scientific Software - Peer-reviewed
- Python
Published by EwoutH 12 months ago
Mesa 3 - v3.1.1
Highlights
Mesa 3.1.1 is a maintenance release that includes visualization improvements and documentation updates. The key enhancement is the addition of an interactive play interval control to the visualization interface, allowing users to dynamically adjust simulation speed between 1ms and 500ms through a slider in the Controls panel.
Several example models were updated to use Mesa 3.1's recommended practices, particularly the create_agents() method for more efficient agent creation and NumPy's rng.integers() for random number generation. The Sugarscape example was modernized to use PropertyLayers.
Bug fixes include improvements to PropertyLayer visualization and a correction to the Schelling model's neighbor similarity calculation. The tutorials were also updated to reflect current best practices in Mesa 3.1.
What's Changed
π New features added
- Add Interactive Play Interval Control to Mesa Visualization by @AdamZh0u in https://github.com/projectmesa/mesa/pull/2540 ### π Bugs fixed
- bug fixes for drawpropertylayers by @quaquel in https://github.com/projectmesa/mesa/pull/2548 ### π Examples updated
- Wolf-sheep to use
create_agentby @quaquel in https://github.com/projectmesa/mesa/pull/2543 - Shift sugarscape example to using create_agent by @quaquel in https://github.com/projectmesa/mesa/pull/2544
- Fix: Schelling Model Neighbor Similarity Calculation by @Sahil-Chhoker in https://github.com/projectmesa/mesa/pull/2518
- Change pdgrid example to use createagents by @quaquel in https://github.com/projectmesa/mesa/pull/2545
- Switch sugarscape to using property layers by @quaquel in https://github.com/projectmesa/mesa/pull/2546 ### π Documentation improvements
- Updated docs and check_model param by @nissu99 in https://github.com/projectmesa/mesa/pull/2510
- Update tutorials to use
create_agentsandrng.integersby @DarshPareek in https://github.com/projectmesa/mesa/pull/2541
New Contributors
- @nissu99 made their first contribution in https://github.com/projectmesa/mesa/pull/2510
- @DarshPareek made their first contribution in https://github.com/projectmesa/mesa/pull/2541
Full Changelog: https://github.com/projectmesa/mesa/compare/v3.1.0...3.1.1
Scientific Software - Peer-reviewed
- Python
Published by EwoutH about 1 year ago
Mesa 3 - v3.1.0
Highlights
With Mesa 3.1.0 we're back on our regular release schedule after the big Mesa 3.0 release, with some exciting new features.
This release adds experimental support for Observables and Computed, enabling a more reactive and responsive programming model for agent-based simulations. The new Observable and Computable classes allow developers to declaratively define attributes that automatically emit signals when their values change, and compute derived values that update dynamically. This lays the groundwork for more advanced event handling and data visualization features in future releases (#2291).
The experimental cell space module has been updated with full support for n-dimensional property layers. These allow agents to easily interact with and modify spatial properties of the environment, such as terrain, resources, or environmental conditions. The new implementation provides a more intuitive attribute-based API and ensures tight integration with the cell space architecture (#2512).
Mesa now includes built-in support for logging using the standard Python logging module. This provides developers with a flexible and powerful way to add structured diagnostic and debug output to their simulations, without the need for custom logging solutions. The logging system is integrated throughout the library, including the new SolaraViz visualization system (#2506).
Creating multiple agents with varying initialization parameters is now significantly easier with the new Agent.create_agents class method. This factory function supports both uniform and per-agent parameters, simplifying the code required to set up a simulation with a large number of heterogeneous agents (#2351).
In addition to the major new features, this release includes a number of smaller enhancements and bug fixes that improve the overall developer experience. These include removing deprecated functionality, cleaning up examples, and addressing various edge cases reported by the community. Mesa 3.1 requires Python 3.11 or higher.
What's Changed
π§ͺ Experimental features
- Add support for Observables to MESA by @quaquel in https://github.com/projectmesa/mesa/pull/2291
- Add full support for property layers to cell spaces by @quaquel in https://github.com/projectmesa/mesa/pull/2512 ### π New features added
- Add logging to MESA by @quaquel in https://github.com/projectmesa/mesa/pull/2506
- Add
create_agentsfactory method to Agent by @quaquel in https://github.com/projectmesa/mesa/pull/2351 ### π Examples updated - Add seed control to all examples by @quaquel in https://github.com/projectmesa/mesa/pull/2496 ### π Documentation improvements
- doc fix for pip install error on mac by @quaquel in https://github.com/projectmesa/mesa/pull/2508
- Refactored docs for Introductory Tutorial by @Spartan-71 in https://github.com/projectmesa/mesa/pull/2511
- Add module-level docstring to experimental features by @EwoutH in https://github.com/projectmesa/mesa/pull/2532 ### π§ Maintenance
- Remove deprecated time module by @EwoutH in https://github.com/projectmesa/mesa/pull/2476
- Drop support for Python 3.10, require Python >= 3.11 by @EwoutH in https://github.com/projectmesa/mesa/pull/2474
- Remove deprecated functionality by @EwoutH in https://github.com/projectmesa/mesa/pull/2483
- Remove visualization modules from
mesa.experimentalby @quaquel in https://github.com/projectmesa/mesa/pull/2495 - Cleanup two occurrences of removed scheduler by @EwoutH in https://github.com/projectmesa/mesa/pull/2499
- move setupagentregistration into `Model.init_` by @quaquel in https://github.com/projectmesa/mesa/pull/2501
- remove devs related examples from devs/examples by @quaquel in https://github.com/projectmesa/mesa/pull/2507
- added empty iterable checks and updated tests by @Sahil-Chhoker in https://github.com/projectmesa/mesa/pull/2523
- Fix: running Mesa in Docker with Schelling model by @AdamZh0u in https://github.com/projectmesa/mesa/pull/2524
New Contributors
- @Spartan-71 made their first contribution in https://github.com/projectmesa/mesa/pull/2511
- @Sahil-Chhoker made their first contribution in https://github.com/projectmesa/mesa/pull/2523
- @AdamZh0u made their first contribution in https://github.com/projectmesa/mesa/pull/2524
Full Changelog: https://github.com/projectmesa/mesa/compare/v3.0.3...v3.1.0
Scientific Software - Peer-reviewed
- Python
Published by EwoutH about 1 year ago
Mesa 3 - v3.0.3
Highlights
A small bugfix release that fixes two bugs.
What's Changed
π§ͺ Experimental features
- cell_space: Allow CellCollection to be empty by @EwoutH in https://github.com/projectmesa/mesa/pull/2502 ### π Bugs fixed
- Only set model_parameters once by @Corvince in https://github.com/projectmesa/mesa/pull/2505
Full Changelog: https://github.com/projectmesa/mesa/compare/v3.0.2...v3.0.3
Scientific Software - Peer-reviewed
- Python
Published by EwoutH about 1 year ago
Mesa 3 -
Highlighst
Mesa 3.0.2 is a small follow-up patch release to Mesa 3.0, in which we fixed a lot of small bugs in the example models their visualisation, and improved their testing.
What's Changed
π Bugs fixed
- allow components as a positional argument again by @Corvince in https://github.com/projectmesa/mesa/pull/2488 ### π Examples updated
- examples: Add required components keyword by @EwoutH in https://github.com/projectmesa/mesa/pull/2485
- examples: Fix boid_flockers viz by @EwoutH in https://github.com/projectmesa/mesa/pull/2492
- examples: Fix schelling viz by @EwoutH in https://github.com/projectmesa/mesa/pull/2490
- example: Add input sliders to Sugerscape viz by @EwoutH in https://github.com/projectmesa/mesa/pull/2487
- examples/gol: Add initial fraction alive, add sliders to viz by @EwoutH in https://github.com/projectmesa/mesa/pull/2489 ### π§ Maintenance
- test app init of examples by @Corvince in https://github.com/projectmesa/mesa/pull/2491
Full Changelog: https://github.com/projectmesa/mesa/compare/v3.0.1...v3.0.2
Scientific Software - Peer-reviewed
- Python
Published by EwoutH about 1 year ago
Mesa 3 - v3.0.1
Highlights
After our huge 3.0.0 release, Mesa 3.0.1 follows up with two improvements to experimental features, examples and docs.
What's Changed
π§ͺ Experimental features
- Bugfixes to DEVS by @quaquel in https://github.com/projectmesa/mesa/pull/2478
- Support simulators in SolaraViz by @quaquel in https://github.com/projectmesa/mesa/pull/2470 ### π Enhancements made
- issue a user warning if random is None by @quaquel in https://github.com/projectmesa/mesa/pull/2479 ### π Examples updated
- Integrate benchmarks and example models by @EwoutH in https://github.com/projectmesa/mesa/pull/2473 ### π Documentation improvements
- docs/tutorial: Replace scheduler in MoneyModel by @EwoutH in https://github.com/projectmesa/mesa/pull/2475
- docs: update migration_guide.md by @eltociear in https://github.com/projectmesa/mesa/pull/2480
- Update some DeprecationWarnings to note they are removed in Mesa 3.1 by @EwoutH in https://github.com/projectmesa/mesa/pull/2481
New Contributors
- @eltociear made their first contribution in https://github.com/projectmesa/mesa/pull/2480
Full Changelog: https://github.com/projectmesa/mesa/compare/v3.0.0...v3.0.1
Scientific Software - Peer-reviewed
- Python
Published by EwoutH about 1 year ago
Mesa 3 - v3.0.0
Highlights
After our most extensive pre-release program ever, weβre proud to release Mesa 3.0 as stable. Mesa 3.0 brings major improvements to agent-based modeling, making it more intuitive and powerful while reducing complexity. This release modernizes core functionalities and introduces new capabilities for both beginners and advanced users.
Streamlined agent management
The centerpiece of Mesa 3.0 is its new agent management system. Agents are now automatically tracked and assigned unique IDs, eliminating common boilerplate code. The new AgentSet functionality provides an elegant and flexible way to work with agents, for example:
```python
Find agents meeting specific criteria
wealthy_agents = model.agents.select(lambda a: a.wealth > 1000)
Group and analyze agents
grouped = model.agents.groupby("state") statestats = grouped.agg({ "count": len, "avgage": ("age", np.mean), "total_wealth": ("wealth", sum) })
Activate agents in different patterns
model.agents.shuffle_do("step") # Random activation model.agents.select(lambda a: a.energy > 0).do("move") # Conditional activation ```
The AgentSet provides powerful methods for filtering, grouping, and analyzing agents, making it easier to express complex model logic. Each model automatically maintains an AgentSet containing all agents (model.agents) and separate AgentSets for each agent type (model.agents_by_type). See the full AgentSet docs here.
Modern Visualization with SolaraViz
Mesa 3.0's new experimental visualization system, SolaraViz, provides a modern, interactive interface for model exploration:
```python from mesa.visualization import SolaraViz, makespacecomponent, makeplotcomponent
visualization = SolaraViz( model, [ makespacecomponent(agentportrayal), makeplotcomponent(["population", "averagewealth"]), lambda m: f"Step {m.steps}: {len(m.agents)} agents" # Custom text component ], modelparams=parametercontrols ) ```
Key visualization features: - Interactive browser-based interface with real-time updates - Support for both grid-based and network models - Visualization of PropertyLayers and hexagonal grids - Custom components using Matplotlib or text - Improved performance and responsiveness
Check out the Visualization Tutorial to get started.
Note: SolaraViz is in active development. We might make API breaking changes between Mesa 3.0 and 3.1.
Enhanced data collection
The DataCollector now supports collecting different metrics for different agent types, using agenttype_reporters:
python
self.datacollector = DataCollector(
model_reporters={"total_wealth": lambda m: m.agents.agg("wealth", sum)},
agent_reporters={"age": "age", "wealth": "wealth"},
agenttype_reporters={
Predator: {"kills": "kills_count"},
Prey: {"distance_fled": "total_flight_distance"}
}
)
Experimental features
Mesa 3.0 introduces several experimental features for advanced modeling: - Cell Space with integrated PropertyLayers and improved agent movement capabilities - Voronoi grid implementation - Event-scheduling simulation capabilities
These experimental features are in active development and might break API between releases.
Breaking changes
See our Mesa 3.0 migration guide for a full overview.
If you want to move existing models from Mesa 2.x to 3.0, there are a few things you have to change.
Models must explicitly initialize the Mesa base class:
python class MyModel(mesa.Model): def __init__(self, n_agents, seed=None): super().__init__(seed=seed) # Required in Mesa 3.0Agents are created without manual ID assignment: ```python
Old
agent = MyAgent(unique_id=1, model=self)
New
agent = MyAgent(model=self) ```
Scheduler replacement with AgentSet operations: ```python
Old (RandomActivation)
self.schedule = RandomActivation(self) self.schedule.step()
New
self.agents.shuffle_do("step")
Old (SimultaneousActivation)
self.schedule = SimultaneousActivation(self) self.schedule.step()
New
self.agents.do("step") self.agents.do("advance") ```
Furthermore:
- Steps counter automatically increments
- mesa.flat namespace removed
- Python 3.10+ required
- Reserved model variables (agents, steps, etc.) protected
- Simplified DataCollector initialization
- Old visualization system replaced by SolaraViz
Getting Started
Install Mesa 3.0:
bash
pip install --upgrade mesa
If building a new model, we recommend checking out the updated Mesa Overview and Introductory Tutorial.
For updating existing models, we recommend upgrading in steps: 1. Update to latest Mesa 2.x 2. Address deprecation warnings 3. Upgrade to Mesa 3.0 4. Replace schedulers with AgentSet functionality
A detailed migration guide is available to help moving to Mesa 3.0. For questions or support, join our GitHub Discussions or Matrix Chat.
We would love to hear what you think about Mesa 3.0! Say hello here and leave any feedback on 3.0 here.
What's Changed
β οΈ Breaking changes
- Remove mesa.flat namespace by @rht in https://github.com/projectmesa/mesa/pull/2091
- breaking: Remove visualization_old (mesa-viz-tornado) by @rht in https://github.com/projectmesa/mesa/pull/2133
- viz: Combine code for rendering in browser and Jupyter by @rht in https://github.com/projectmesa/mesa/pull/2180
- breaking: Add dependencies argument to custom space_drawer by @rht in https://github.com/projectmesa/mesa/pull/2209
- Require Mesa models to be initialized with
super().__init__()by @EwoutH in https://github.com/projectmesa/mesa/pull/2218 - Allow AgentSet.do() to take Callable function by @quaquel in https://github.com/projectmesa/mesa/pull/2219
- Change warning when setting model.agents to error by @EwoutH in https://github.com/projectmesa/mesa/pull/2225
- model: Automatically increase
stepscounter by @EwoutH in https://github.com/projectmesa/mesa/pull/2223 - move solara_viz back to experimental by @Corvince in https://github.com/projectmesa/mesa/pull/2278
- track unique_id automatically by @quaquel in https://github.com/projectmesa/mesa/pull/2260
- update Agent.init to remove deprecation warning by @quaquel in https://github.com/projectmesa/mesa/pull/2328
- replace model with random in AgentSet init by @quaquel in https://github.com/projectmesa/mesa/pull/2350
- remove cookiecutter by @quaquel in https://github.com/projectmesa/mesa/pull/2421
- Viz: Refactor Matplotlib plotting by @quaquel in https://github.com/projectmesa/mesa/pull/2430
- api reorganization by @quaquel in https://github.com/projectmesa/mesa/pull/2447
- Deprecate
initialize_data_collectorby @EwoutH in https://github.com/projectmesa/mesa/pull/2327 ### π§ͺ Experimental features - devs/eventlist: Add repr method to print EventList pretty by @EwoutH in https://github.com/projectmesa/mesa/pull/2195
- Voronoi Tessellation based Discrete Space by @vitorfrois in https://github.com/projectmesa/mesa/pull/2084
- Make cell connections public and named by @Corvince in https://github.com/projectmesa/mesa/pull/2296
- Update to CellCollection.select by @quaquel in https://github.com/projectmesa/mesa/pull/2307
- Have a dedicated neighborhood property and a get_neighborhood method on Cell by @quaquel in https://github.com/projectmesa/mesa/pull/2309
- Encapsulate cell movement in properties by @quaquel in https://github.com/projectmesa/mesa/pull/2333
- experimental: Integrate PropertyLayers into cell space by @EwoutH in https://github.com/projectmesa/mesa/pull/2319
- Generalize CellAgent by @Corvince in https://github.com/projectmesa/mesa/pull/2292
- cell space: Add convenience properties for grid width and height by @quaquel in https://github.com/projectmesa/mesa/pull/2348
- Bugfix for deepcopy / pickling discrete spaces by @quaquel in https://github.com/projectmesa/mesa/pull/2378
- Add support for drawing discrete grids by @quaquel in https://github.com/projectmesa/mesa/pull/2386
- Altair spaces by @quaquel in https://github.com/projectmesa/mesa/pull/2397
- Mark SolaraViz as experimental for Mesa 3.0 by @EwoutH in https://github.com/projectmesa/mesa/pull/2459 ### π New features added
- Set JupyterViz as stable by @rht in https://github.com/projectmesa/mesa/pull/2090
- Add AgentSet.groupby by @quaquel in https://github.com/projectmesa/mesa/pull/2220
- AgentSet: Add
setmethod by @EwoutH in https://github.com/projectmesa/mesa/pull/2254 - AgentSet: Add
aggmethod by @EwoutH in https://github.com/projectmesa/mesa/pull/2266 - Implement new SolaraViz API by @Corvince in https://github.com/projectmesa/mesa/pull/2263
- GroupBy: Add
countandaggmethods by @EwoutH in https://github.com/projectmesa/mesa/pull/2290 - datacollector: Allow collecting data from Agent (sub)classes by @EwoutH in https://github.com/projectmesa/mesa/pull/2300
- Add optimized shuffle_do() method to AgentSet by @EwoutH in https://github.com/projectmesa/mesa/pull/2283
- Visualize PropertyLayers by @EwoutH in https://github.com/projectmesa/mesa/pull/2336
- Move core example models back (v2) by @EwoutH in https://github.com/projectmesa/mesa/pull/2358
- Add Model.rng for SPEC-7 compliant numpy random number generation by @quaquel in https://github.com/projectmesa/mesa/pull/2352
- removeallagents method added to model by @quaquel in https://github.com/projectmesa/mesa/pull/2394
- Pass through model.rgn in agent analogous to model.random by @quaquel in https://github.com/projectmesa/mesa/pull/2400
- add agents property to all spaces by @quaquel in https://github.com/projectmesa/mesa/pull/2418 ### π Enhancements made
- Rename JupyterViz to SolaraViz by @rht in https://github.com/projectmesa/mesa/pull/2187
- refactor: Rename jupyterviz namespace to solaraviz by @rht in https://github.com/projectmesa/mesa/pull/2188
- Visualisation: Allow specifying Agent shapes in agent_portrayal by @rmhopkins4 in https://github.com/projectmesa/mesa/pull/2214
- Split AgentSet into map and do to seperate return types by @quaquel in https://github.com/projectmesa/mesa/pull/2237
- Performance enhancements for Model.agents by @quaquel in https://github.com/projectmesa/mesa/pull/2251
- AgentSet: Allow selecting a fraction of agents in the AgentSet by @EwoutH in https://github.com/projectmesa/mesa/pull/2253
- Model: Replace
get_agents_of_typemethod withagents_by_typeproperty by @EwoutH in https://github.com/projectmesa/mesa/pull/2267 - add default SolaraViz by @Corvince in https://github.com/projectmesa/mesa/pull/2280
- Simplify ModelController by @Corvince in https://github.com/projectmesa/mesa/pull/2282
- Add default values and missing value handling to
agentset.getby @quaquel in https://github.com/projectmesa/mesa/pull/2279 - SolaraViz Updates by @Corvince in https://github.com/projectmesa/mesa/pull/2299
- Solara viz: use_task for non-threaded continuous play by @Corvince in https://github.com/projectmesa/mesa/pull/2304
- Reduce core dependencies, split in optional dependencies by @EwoutH in https://github.com/projectmesa/mesa/pull/2265
- use GridDraggable instead of Column in SolaraViz by @wang-boyu in https://github.com/projectmesa/mesa/pull/2344
- update legend, xlabel & format of matplotlib plots by @wang-boyu in https://github.com/projectmesa/mesa/pull/2346
- init.py: Import mesa.experimental by @EwoutH in https://github.com/projectmesa/mesa/pull/2374
- Importable examples by @Corvince in https://github.com/projectmesa/mesa/pull/2381
- update_tutorial environment by @tpike3 in https://github.com/projectmesa/mesa/pull/2411
- expand ax.scatter kwargs that can be used by @quaquel in https://github.com/projectmesa/mesa/pull/2445 ### π Bugs fixed
- datacollector: store separate snapshots of model data per step by @EwoutH in https://github.com/projectmesa/mesa/pull/2129
- Jupyter_viz: Allow measures to be None by @EwoutH in https://github.com/projectmesa/mesa/pull/2163
- Jupyter Viz: Don't avoid interactive backend by @EwoutH in https://github.com/projectmesa/mesa/pull/2165
- fix: Render agent marker radius correctly by @rht in https://github.com/projectmesa/mesa/pull/2181
- fix: Use model.schedule.steps -> mode.steps for batchrun by @rht in https://github.com/projectmesa/mesa/pull/2183
- SolaraViz: Reset components when params are changed by @rht in https://github.com/projectmesa/mesa/pull/2240
- Fix deterministic behavior in
move_agent_to_one_ofwithselection="closest"by @OrenBochman in https://github.com/projectmesa/mesa/pull/2118 - viz: stop running and disable buttons when model.running is False by @wang-boyu in https://github.com/projectmesa/mesa/pull/2332
- experimental init: Fix Solara import by making it lazy by @EwoutH in https://github.com/projectmesa/mesa/pull/2357
- fix: pass
model.randomto schedulers by @quaquel in https://github.com/projectmesa/mesa/pull/2359 - fix: register agent after creating unique_id and pos attributes by @wang-boyu in https://github.com/projectmesa/mesa/pull/2368
- solara: viz tutorial: fix histogram code by @Corvince in https://github.com/projectmesa/mesa/pull/2379
- Fix for mistaken removal of drawgrid by @quaquel in https://github.com/projectmesa/mesa/pull/2398
- fixes weakref bug in shuffe_do by @quaquel in https://github.com/projectmesa/mesa/pull/2399
- Fix #2452 - handle solara viz model params better by @Corvince in https://github.com/projectmesa/mesa/pull/2454
- Update MoneyModel.py by @quaquel in https://github.com/projectmesa/mesa/pull/2458
- Bugfix for Solara deepcopy bug by @quaquel in https://github.com/projectmesa/mesa/pull/2460
- solaraviz kwargs related bugfix by @quaquel in https://github.com/projectmesa/mesa/pull/2463 ### π Examples updated
- Cleanup and restructure basic example models by @EwoutH in https://github.com/projectmesa/mesa/pull/2365
- Ruff basic examples by @EwoutH in https://github.com/projectmesa/mesa/pull/2370
- refactor: Simplify Schelling code by @rht in https://github.com/projectmesa/mesa/pull/2353
- Move examples into mesa by @Corvince in https://github.com/projectmesa/mesa/pull/2387
- Explicitly test basic examples by @quaquel in https://github.com/projectmesa/mesa/pull/2390
- Make example import absolute by @quaquel in https://github.com/projectmesa/mesa/pull/2402
- Cleanup and restructure EpsteinCivilViolence and PdGrid examples by @EwoutH in https://github.com/projectmesa/mesa/pull/2408
- Reorganize advanced examples: wolfsheep and sugarscapeg1mt by @quaquel in https://github.com/projectmesa/mesa/pull/2410
- reactivate ruff for advanced examples and include them in tests by @quaquel in https://github.com/projectmesa/mesa/pull/2414
- Updates to Epstein example by @quaquel in https://github.com/projectmesa/mesa/pull/2429
- Update examples to use updated space drawing by @quaquel in https://github.com/projectmesa/mesa/pull/2442 ### π Documentation improvements
- Fix image on landing page of docs. by @jackiekazil in https://github.com/projectmesa/mesa/pull/2146
- Replace links in docs - google group to matrix. by @jackiekazil in https://github.com/projectmesa/mesa/pull/2148
- Add experimental features to documentation as per #2122 by @stephenfmann in https://github.com/projectmesa/mesa/pull/2154
- Update visualisation docs by @EwoutH in https://github.com/projectmesa/mesa/pull/2162
- Add original conference paper link to docs by @ENUMERA8OR in https://github.com/projectmesa/mesa/pull/2160
- docs/conf.py: Use modern
intersphinx_mappingformat by @EwoutH in https://github.com/projectmesa/mesa/pull/2206 - docs: Update Readme and tutorials to mention Mesa 3.0 pre-releases by @EwoutH in https://github.com/projectmesa/mesa/pull/2203
- Contribution: Add "I have no idea where to start" section by @EwoutH in https://github.com/projectmesa/mesa/pull/2258
- Write initial Mesa Migration guide by @EwoutH in https://github.com/projectmesa/mesa/pull/2257
- docs: Fix Visualization Tutorial (main branch) by @EwoutH in https://github.com/projectmesa/mesa/pull/2271
- Docs: Fix broken relative links by removing
.htmlsuffix by @EwoutH in https://github.com/projectmesa/mesa/pull/2274 - Readthedocs: Don't let notebook failures pass silently by @EwoutH in https://github.com/projectmesa/mesa/pull/2276
- Update viz tutorial to the new API by @Corvince in https://github.com/projectmesa/mesa/pull/2289
- Enforce google docstrings by @quaquel in https://github.com/projectmesa/mesa/pull/2294
- Api docs by @quaquel in https://github.com/projectmesa/mesa/pull/2298
- update migration guide to describe solaraviz updates by @Corvince in https://github.com/projectmesa/mesa/pull/2297
- Migration Guide: Add Model initialization requirement and automatic Agent.unique_id assignment by @EwoutH in https://github.com/projectmesa/mesa/pull/2302
- Deprecate Time module and all its Schedulers by @EwoutH in https://github.com/projectmesa/mesa/pull/2306
- introtutorial: Don't initialize agents with an uniqueid by @EwoutH in https://github.com/projectmesa/mesa/pull/2315
- Migration guide: Intro, upgrade strategy, model.agents, headers by @EwoutH in https://github.com/projectmesa/mesa/pull/2314
- docs: Update overview for Mesa 3.0 by @EwoutH in https://github.com/projectmesa/mesa/pull/2317
- Readthedocs: Add version switch and update URL by @EwoutH in https://github.com/projectmesa/mesa/pull/2324
- Update migration_guide.md by @quaquel in https://github.com/projectmesa/mesa/pull/2347
- Include examples in readthedocs (port) by @EwoutH in https://github.com/projectmesa/mesa/pull/2392
- Update into_tutorial by @tpike3 in https://github.com/projectmesa/mesa/pull/2372
- Update Schelling Readme.md by @quaquel in https://github.com/projectmesa/mesa/pull/2406
- Update Conway example by @quaquel in https://github.com/projectmesa/mesa/pull/2403
- Boltzman readme by @quaquel in https://github.com/projectmesa/mesa/pull/2405
- Update Readme.md of Boid flockers by @quaquel in https://github.com/projectmesa/mesa/pull/2404
- add advanced examples to rtd by @quaquel in https://github.com/projectmesa/mesa/pull/2413
- Tutorial Improvements by @tpike3 in https://github.com/projectmesa/mesa/pull/2415
- space: Add note that Grids are maintenance only by @EwoutH in https://github.com/projectmesa/mesa/pull/2420
- Migration guide: Update automatic unique_id assignment examples by @EwoutH in https://github.com/projectmesa/mesa/pull/2419
- Update docstring of SimEvent by @quaquel in https://github.com/projectmesa/mesa/pull/2417
- best-practices: Update Model Layout section by @EwoutH in https://github.com/projectmesa/mesa/pull/2424
- docs: Clean-up index.md by @EwoutH in https://github.com/projectmesa/mesa/pull/2422
- Update wolf-sheep png and fix typo in file name by @quaquel in https://github.com/projectmesa/mesa/pull/2444
- Include main examples readme in docs by @quaquel in https://github.com/projectmesa/mesa/pull/2448
- remove how-to guide and update docs in places by @quaquel in https://github.com/projectmesa/mesa/pull/2449
- Docs reorganization by @quaquel in https://github.com/projectmesa/mesa/pull/2450 ### π§ Maintenance
- CI: Add weekly scheduled run to all CI workflows by @EwoutH in https://github.com/projectmesa/mesa/pull/2130
- Drop support for Python 3.9, require Python >= 3.10 by @EwoutH in https://github.com/projectmesa/mesa/pull/2132
- Add script to list unlabeled PR's since latest release by @rht in https://github.com/projectmesa/mesa/pull/2047
- CI: Let pytest treat warnings as errors for examples by @EwoutH in https://github.com/projectmesa/mesa/pull/2204
- CI: Add test job for Python 3.13 by @EwoutH in https://github.com/projectmesa/mesa/pull/2173
- Add pull request templates by @EwoutH in https://github.com/projectmesa/mesa/pull/2217
- benchmarks: Add BoltzmannWealth model by @EwoutH in https://github.com/projectmesa/mesa/pull/2252
- CI: Add optional dependency for examples by @EwoutH in https://github.com/projectmesa/mesa/pull/2261
- Resolve multiprocessing warning, state Python 3.13 support by @rht in https://github.com/projectmesa/mesa/pull/2246
- make typing behavior of AgentSet.get explicit by @quaquel in https://github.com/projectmesa/mesa/pull/2293
- model: Move random seed and random to init by @rht in https://github.com/projectmesa/mesa/pull/1940
- Remove schedulers from benchmark models. by @quaquel in https://github.com/projectmesa/mesa/pull/2308
- tests: Resolve warnings by removing scheduler and updating arguments by @EwoutH in https://github.com/projectmesa/mesa/pull/2329
- add super call to Model and remove self.schedule by @quaquel in https://github.com/projectmesa/mesa/pull/2334
- Code coverage: ignore experimental and visualization by @Corvince in https://github.com/projectmesa/mesa/pull/2361
- add codecov token, fixes #2363 by @Corvince in https://github.com/projectmesa/mesa/pull/2366
- add test_time back by @quaquel in https://github.com/projectmesa/mesa/pull/2367
- Release notes: Add example category by @EwoutH in https://github.com/projectmesa/mesa/pull/2369
- Add empty
pull_request_template.mdto enable PR template chooser by @EwoutH in https://github.com/projectmesa/mesa/pull/2409 - remove deprecated HexGrid class by @quaquel in https://github.com/projectmesa/mesa/pull/2441
- rename makeplotmeasure to makeplotcomponent and add some kwargs by @quaquel in https://github.com/projectmesa/mesa/pull/2446
New Contributors
- @stephenfmann made their first contribution in https://github.com/projectmesa/mesa/pull/2154
- @ENUMERA8OR made their first contribution in https://github.com/projectmesa/mesa/pull/2160
- @rmhopkins4 made their first contribution in https://github.com/projectmesa/mesa/pull/2214
- @vitorfrois made their first contribution in https://github.com/projectmesa/mesa/pull/2084
- @OrenBochman made their first contribution in https://github.com/projectmesa/mesa/pull/2118
Full Changelog: https://github.com/projectmesa/mesa/compare/v2.4.0...v3.0.0
Scientific Software - Peer-reviewed
- Python
Published by EwoutH about 1 year ago
Mesa 3 - Mesa 3.0 Release Candidate
Highlights
We're releasing the Mesa 3.0 Release Candidate, ready for final testing before we release Mesa 3.0 later this week!
In this last 3.0 pre-release, the visualisation has been thoroughly updated, with a brand new API. Visualizing the experimental Cell Space, including PropertyLayers and hexogonal grids, is now also supported.
We're still working very active on the visualisation, so we have marked that experimental for Mesa 3.0. We will stabilize SolaraViz in Mesa 3.1.
Any feedback and last-minute bug reports are welcome here.
What's Changed
β οΈ Breaking changes
- Viz: Refactor Matplotlib plotting by @quaquel in https://github.com/projectmesa/mesa/pull/2430
- api reorganization by @quaquel in https://github.com/projectmesa/mesa/pull/2447 ### π§ͺ Experimental features
- Mark SolaraViz as experimental for Mesa 3.0 by @EwoutH in https://github.com/projectmesa/mesa/pull/2459 ### π Enhancements made
- expand ax.scatter kwargs that can be used by @quaquel in https://github.com/projectmesa/mesa/pull/2445 ### π Bugs fixed
- Fix #2452 - handle solara viz model params better by @Corvince in https://github.com/projectmesa/mesa/pull/2454
- Update MoneyModel.py by @quaquel in https://github.com/projectmesa/mesa/pull/2458 ### π Examples updated
- Updates to Epstein example by @quaquel in https://github.com/projectmesa/mesa/pull/2429
- Update examples to use updated space drawing by @quaquel in https://github.com/projectmesa/mesa/pull/2442 ### π Documentation improvements
- Update wolf-sheep png and fix typo in file name by @quaquel in https://github.com/projectmesa/mesa/pull/2444
- Include main examples readme in docs by @quaquel in https://github.com/projectmesa/mesa/pull/2448
- remove how-to guide and update docs in places by @quaquel in https://github.com/projectmesa/mesa/pull/2449 ### π§ Maintenance
- remove deprecated HexGrid class by @quaquel in https://github.com/projectmesa/mesa/pull/2441
- rename makeplotmeasure to makeplotcomponent and add some kwargs by @quaquel in https://github.com/projectmesa/mesa/pull/2446
Full Changelog: https://github.com/projectmesa/mesa/compare/v3.0.0b2...v3.0.0rc0
Scientific Software - Peer-reviewed
- Python
Published by EwoutH about 1 year ago
Mesa 3 - Mesa 3.0 beta 2
Highlights
Mesa 3.0 beta 2 includes major work on the example models, docs, a new tutorial and visualisation.
The included example models are now part of the Mesa package itself and directly importable, using:
Python
from mesa.examples import BoidFlockers, BoltzmannWealthModel, ConwaysGameOfLife, ...
The advanced examples were also restructured and cleaned up.
The tutorial was completely rewritten for Mesa 3.0, including it's latest features and practices. Many of our other docs also received some love, and almost everything is now ready for Mesa 3.0.
A new feature to remove all agents from the model was added, and the visualisation now supports drawing the experimental discrete spaces in both matplotlib and altair. All agents which are in a space can now conveniently be accessed with .agents.
The rarely used mesa startproject cookiecutter feature was removed. We updated our best-practice guide to include how to structure a modern Mesa project, which is now very straightforward.
What's Changed
β οΈ Breaking changes
- remove cookiecutter by @quaquel in https://github.com/projectmesa/mesa/pull/2421 ### π§ͺ Experimental features
- Add support for drawing discrete grids by @quaquel in https://github.com/projectmesa/mesa/pull/2386
- Altair spaces by @quaquel in https://github.com/projectmesa/mesa/pull/2397 ### π New features added
- removeallagents method added to model by @quaquel in https://github.com/projectmesa/mesa/pull/2394
- Pass through model.rgn in agent analogous to model.random by @quaquel in https://github.com/projectmesa/mesa/pull/2400
- add agents property to all spaces by @quaquel in https://github.com/projectmesa/mesa/pull/2418 ### π Enhancements made
- update_tutorial environment by @tpike3 in https://github.com/projectmesa/mesa/pull/2411 ### π Bugs fixed
- Fix for mistaken removal of drawgrid by @quaquel in https://github.com/projectmesa/mesa/pull/2398
- fixes weakref bug in shuffe_do by @quaquel in https://github.com/projectmesa/mesa/pull/2399 ### π Examples updated
- refactor: Simplify Schelling code by @rht in https://github.com/projectmesa/mesa/pull/2353
- Move examples into mesa by @Corvince in https://github.com/projectmesa/mesa/pull/2387
- Explicitly test basic examples by @quaquel in https://github.com/projectmesa/mesa/pull/2390
- Make example import absolute by @quaquel in https://github.com/projectmesa/mesa/pull/2402
- Cleanup and restructure EpsteinCivilViolence and PdGrid examples by @EwoutH in https://github.com/projectmesa/mesa/pull/2408
- Reorganize advanced examples: wolfsheep and sugarscapeg1mt by @quaquel in https://github.com/projectmesa/mesa/pull/2410
- reactivate ruff for advanced examples and include them in tests by @quaquel in https://github.com/projectmesa/mesa/pull/2414 ### π Documentation improvements
- Include examples in readthedocs (port) by @EwoutH in https://github.com/projectmesa/mesa/pull/2392
- Update into_tutorial by @tpike3 in https://github.com/projectmesa/mesa/pull/2372
- Update Schelling Readme.md by @quaquel in https://github.com/projectmesa/mesa/pull/2406
- Update Conway example by @quaquel in https://github.com/projectmesa/mesa/pull/2403
- Boltzman readme by @quaquel in https://github.com/projectmesa/mesa/pull/2405
- Update Readme.md of Boid flockers by @quaquel in https://github.com/projectmesa/mesa/pull/2404
- add advanced examples to rtd by @quaquel in https://github.com/projectmesa/mesa/pull/2413
- Tutorial Improvements by @tpike3 in https://github.com/projectmesa/mesa/pull/2415
- space: Add note that Grids are maintenance only by @EwoutH in https://github.com/projectmesa/mesa/pull/2420
- Migration guide: Update automatic unique_id assignment examples by @EwoutH in https://github.com/projectmesa/mesa/pull/2419
- Update docstring of SimEvent by @quaquel in https://github.com/projectmesa/mesa/pull/2417 ### π§ Maintenance
- Add empty
pull_request_template.mdto enable PR template chooser by @EwoutH in https://github.com/projectmesa/mesa/pull/2409
Full Changelog: https://github.com/projectmesa/mesa/compare/v3.0.0b1...v3.0.0b2
Scientific Software - Peer-reviewed
- Python
Published by EwoutH about 1 year ago
Mesa 3 - Mesa 3.0 beta 1
Highlights
Mesa 3.0 beta 1 is our last beta release before the Mesa 3.0 stable release. We are restructuring our examples and have move 9 core examples from mesa-examples to mesa itself (#2358). The 5 basic examples are now directly importable (#2381):
Python
from examples.basic import BoidFlockers, BoltzmannWealthModel, ConwaysGameOfLife, Schelling, VirusOnNetwork
The 5 basic examples will always use stable Mesa features, we are also working on 4 more advanced example which can also include experimental features.
All our core examples can now be viewed in the examples folder. mesa-examples will continue to exists for user showcases. We're also working on making the examples visible in the ReadtheDocs (#2382) and on an website (mesa-examples#139). Follow all our work on the examples in this tracking issue #2364.
Furthermore, the visualizations are improved by making visualization elements scalable and more clearly labeling the plots, and the Model now has an rng argument for an SPEC 7 compliant NumPy random number generator (#2352).
What's Changed
β οΈ Breaking changes
- replace model with random in AgentSet init by @quaquel in https://github.com/projectmesa/mesa/pull/2350 ### π§ͺ Experimental features
- cell space: Add convenience properties for grid width and height by @quaquel in https://github.com/projectmesa/mesa/pull/2348
- Bugfix for deepcopy / pickling discrete spaces by @quaquel in https://github.com/projectmesa/mesa/pull/2378 ### π New features added
- Move core example models back (v2) by @EwoutH in https://github.com/projectmesa/mesa/pull/2358
- Add Model.rng for SPEC-7 compliant numpy random number generation by @quaquel in https://github.com/projectmesa/mesa/pull/2352 ### π Enhancements made
- use GridDraggable instead of Column in SolaraViz by @wang-boyu in https://github.com/projectmesa/mesa/pull/2344
- update legend, xlabel & format of matplotlib plots by @wang-boyu in https://github.com/projectmesa/mesa/pull/2346
- init.py: Import mesa.experimental by @EwoutH in https://github.com/projectmesa/mesa/pull/2374
- Importable examples by @Corvince in https://github.com/projectmesa/mesa/pull/2381 ### π Bugs fixed
- experimental init: Fix Solara import by making it lazy by @EwoutH in https://github.com/projectmesa/mesa/pull/2357
- fix: pass
model.randomto schedulers by @quaquel in https://github.com/projectmesa/mesa/pull/2359 - fix: register agent after creating unique_id and pos attributes by @wang-boyu in https://github.com/projectmesa/mesa/pull/2368
- solara: viz tutorial: fix histogram code by @Corvince in https://github.com/projectmesa/mesa/pull/2379 ### π Examples updated
- Cleanup and restructure basic example models by @EwoutH in https://github.com/projectmesa/mesa/pull/2365
- Ruff basic examples by @EwoutH in https://github.com/projectmesa/mesa/pull/2370 ### π Documentation improvements
- Update migration_guide.md by @quaquel in https://github.com/projectmesa/mesa/pull/2347 ### π§ Maintenance
- Code coverage: ignore experimental and visualization by @Corvince in https://github.com/projectmesa/mesa/pull/2361
- add codecov token, fixes #2363 by @Corvince in https://github.com/projectmesa/mesa/pull/2366
- add test_time back by @quaquel in https://github.com/projectmesa/mesa/pull/2367
- Release notes: Add example category by @EwoutH in https://github.com/projectmesa/mesa/pull/2369
Full Changelog: https://github.com/projectmesa/mesa/compare/v3.0.0b0...v3.0.0b1
Scientific Software - Peer-reviewed
- Python
Published by jackiekazil about 1 year ago
Mesa 3 - Mesa 3.0 beta 0
Highlights
We're proud to release the first Mesa 3.0 beta! This pre-release announces that we're ready for Mesa 3.0 to be tested by all our regular users. We try to not making breaking changes anymore, but focus on resolving bugs and imperfections.
In this beta, not so much has changed as in the alphas (we're stabilizing, that's a good sign), but there are still a few notable things:
- Agents now have to be initialized without their unique_id. See #2328 and the Migration guide.
- PropertyLayers can now be visualized! See #2336 for details and some examples, and mesa-examples#214 as a simple example model.
- We reduced the core dependencies of Mesa, so that's a lighter and simpler install. You can now use extras to install the dependencies, for example add [viz] to install all visualisation dependencies: pip install -U --pre mesa[viz]. See #2265 for details.
- The Mesa Overview as fully updated for 3.0. We highly recommend reading though it!
- We made some more progress on the experimental Cell Space, adding movement and integrating the PropertyLayer. Among others, Agents have nu initial movement capabilities for grids. Development continues during the betas and
We plan to release one or two more beta's in the coming weeks, and tag a release candidate and Mesa 3.0 late October. In the v3.0 milestone are the critical items on our todo-list.
You can install this pre-release as usual with:
bash
pip install --upgrade --pre mesa
We're very curious what you think, try it out and ask any questions or share any feedback here!
What's Changed
β οΈ Breaking changes
- update
Agent.__init__to remove deprecation warning by @quaquel in https://github.com/projectmesa/mesa/pull/2328 ### π New features added - Visualize PropertyLayers by @EwoutH in https://github.com/projectmesa/mesa/pull/2336 ### π§ͺ Experimental features
- Encapsulate cell movement in properties by @quaquel in https://github.com/projectmesa/mesa/pull/2333
- experimental: Integrate PropertyLayers into cell space by @EwoutH in https://github.com/projectmesa/mesa/pull/2319
- Generalize CellAgent by @Corvince in https://github.com/projectmesa/mesa/pull/2292 ### π Enhancements made
- Reduce core dependencies, split in optional dependencies by @EwoutH in https://github.com/projectmesa/mesa/pull/2265 ### π Bugs fixed
- viz: stop running and disable buttons when model.running is False by @wang-boyu in https://github.com/projectmesa/mesa/pull/2332 ### π Documentation improvements
- docs: Update overview for Mesa 3.0 by @EwoutH in https://github.com/projectmesa/mesa/pull/2317
- Readthedocs: Add version switch and update URL by @EwoutH in https://github.com/projectmesa/mesa/pull/2324 ### π§ Maintenance
- tests: Resolve warnings by removing scheduler and updating arguments by @EwoutH in https://github.com/projectmesa/mesa/pull/2329
- add super call to Model and remove self.schedule by @quaquel in https://github.com/projectmesa/mesa/pull/2334 ### Other changes
- Deprecate
initialize_data_collectorby @EwoutH in https://github.com/projectmesa/mesa/pull/2327
Full Changelog: https://github.com/projectmesa/mesa/compare/v3.0.0a5...v3.0.0b0
Scientific Software - Peer-reviewed
- Python
Published by EwoutH about 1 year ago
Mesa 3 - v2.4.0
Highlights
Mesa 2.4.0 brings several key improvements from the upcoming 3.0 series, while maintaining compatibility with existing Mesa 2.x models.
The DataCollector now supports collecting data from specific Agent subclasses using the new agenttype_reporters parameter (#2300). This allows collecting different metrics for different agent types. For example:
python
self.datacollector = DataCollector(
agenttype_reporters={
Wolf: {"sheep_eaten": "sheep_eaten"},
Sheep: {"wool": "wool_amount"}
}
)
The AgentSet class, which underpins model.agents, has received major enhancements:
- A new groupby() method to split agents into groups (#2220)
- An agg() method to quickly compute aggregate values (#2266)
- A faster shuffle_do() method for more efficient random agent activation (#2283)
- The select() method now allows choosing a fraction of agents (#2253)
- The do() method can now take any callable function, not just string method names (#2219)
Other notable improvements include:
- The Model class now exposes an agents_by_type property for easier access to agents of specific types (#2267)
- Performance enhancements for Model.agents (#2251)
- The AgentSet.get() method now handles missing values with optional default value (#2279)
This release also fixes a bug in the Grid's move_agent_to_one_of method with selection="closest", which previously selected locations deterministically instead of randomly (#2118).
Finally, we've made significant documentation improvements, including the addition of a new Migration guide to help users transition to future Mesa versions (#2257).
What's Changed
π New features added
- Add AgentSet.groupby by @quaquel in #2220
- AgentSet: Add
aggmethod by @EwoutH in #2266 - GroupBy: Add
countandaggmethods by @EwoutH in #2290 - datacollector: Allow collecting data from Agent (sub)classes by @EwoutH in #2300
- Add optimized shuffle_do() method to AgentSet by @EwoutH in #2283
π Enhancements made
- Allow AgentSet.do() to take Callable function by @quaquel in #2219
- 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
- Model: Replace
get_agents_of_typemethod withagents_by_typeproperty by @EwoutH in #2267 - Add default values and missing value handling to
agentset.getby @quaquel in #2279
π Bugs fixed
- Jupyter_viz: Allow measures to be None by @EwoutH in #2163
- Fix deterministic behavior in
move_agent_to_one_ofwithselection="closest"by @OrenBochman in #2118
π 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
- Docs: Fix broken relative links by removing
.htmlsuffix by @EwoutH in #2274 - Readthedocs: Don't let notebook failures pass silently by @EwoutH in #2276
- update migration guide to describe solaraviz updates by @Corvince in #2297
- Migration Guide: Add Model initialization requirement and automatic Agent.unique_id assignment by @EwoutH in #2302
π§ Maintenance
- make typing behavior of AgentSet.get explicit by @quaquel in #2293
Full Changelog: https://github.com/projectmesa/mesa/compare/v2.3.4...v2.4.0
Scientific Software - Peer-reviewed
- Python
Published by EwoutH over 1 year ago
Mesa 3 - v3.0 alpha 5 (pre-release)
Highlights
Mesa v3.0 alpha 5 release contains many quality of life updates, a big new feature for the DataCollector and a major deprecation.
The entire mesa.time module, including all schedulers, has been deprecated (#2306). Users are encouraged to transition to AgentSet functionality for more flexible and explicit agent activation patterns. Check the migration guide on how to upgrade.
The DataCollector now supports collecting data from specific Agent subclasses using the new agenttype_reporters parameter (#2300). This allows collecting different metrics for different agent types. For example:
python
self.datacollector = DataCollector(
agenttype_reporters={
Wolf: {"sheep_eaten": "sheep_eaten"},
Sheep: {"wool": "wool_amount"}
}
)
Furthermore, a new shuffle_do() method for AgentSets provides a faster way to perform shuffle().do() (#2283). The GroupBy class gained count() and agg() methods to count the number of agents in groups and aggregate variables of them (#2290).
In the experimental Cell Space, the CellCollection.select method was updated to use at_most instead of n, aligning with the AgentSet API (#2307). Cell connections in grids and networks are now public and named for more intuitive agent movements (#2296). Additionally, the Cell class now features a dedicated neighborhood property for direct neighbors (default radius=1) and a get_neighborhood method for larger radii (#2309).
Finally, SolaraViz received updates improving its interface and performance (#2299, #2304). The Model class initialization process was simplified by moving random seed and random object creation to __init__ (#1940). Documentation has been extensively updated, including enforcing Google docstrings (#2294) and reorganizing the API documentation (#2298) for better clarity and navigation.
While the Mesa 3.0 timeline is still being discussed, we're aiming at the first Mesa 3.0 beta in October followed by a stable release in November. Testing new features and sharing feedback is appreciated!
What's Changed
π New features added
- GroupBy: Add
countandaggmethods by @EwoutH in https://github.com/projectmesa/mesa/pull/2290 - datacollector: Allow collecting data from Agent (sub)classes by @EwoutH in https://github.com/projectmesa/mesa/pull/2300
- Add optimized shuffle_do() method to AgentSet by @EwoutH in https://github.com/projectmesa/mesa/pull/2283 ### π Enhancements made
- SolaraViz Updates by @Corvince in https://github.com/projectmesa/mesa/pull/2299
- Solara viz: use_task for non-threaded continuous play by @Corvince in https://github.com/projectmesa/mesa/pull/2304 ### π§ͺ Experimental features
- Make cell connections public and named by @Corvince in https://github.com/projectmesa/mesa/pull/2296
- Update to CellCollection.select by @quaquel in https://github.com/projectmesa/mesa/pull/2307
- Have a dedicated neighborhood property and a get_neighborhood method on Cell by @quaquel in https://github.com/projectmesa/mesa/pull/2309 ### π Documentation improvements
- Enforce google docstrings by @quaquel in https://github.com/projectmesa/mesa/pull/2294
- Api docs by @quaquel in https://github.com/projectmesa/mesa/pull/2298
- update migration guide to describe solaraviz updates by @Corvince in https://github.com/projectmesa/mesa/pull/2297
- Migration Guide: Add Model initialization requirement and automatic Agent.unique_id assignment by @EwoutH in https://github.com/projectmesa/mesa/pull/2302
- Deprecate Time module and all its Schedulers by @EwoutH in https://github.com/projectmesa/mesa/pull/2306
- introtutorial: Don't initialize agents with an uniqueid by @EwoutH in https://github.com/projectmesa/mesa/pull/2315
- Migration guide: Intro, upgrade strategy, model.agents, headers by @EwoutH in https://github.com/projectmesa/mesa/pull/2314 ### π§ Maintenance
- make typing behavior of AgentSet.get explicit by @quaquel in https://github.com/projectmesa/mesa/pull/2293
- model: Move random seed and random to init by @rht in https://github.com/projectmesa/mesa/pull/1940
- Remove schedulers from benchmark models. by @quaquel in https://github.com/projectmesa/mesa/pull/2308
Full Changelog: https://github.com/projectmesa/mesa/compare/v3.0.0a4...v3.0.0a5
Scientific Software - Peer-reviewed
- Python
Published by EwoutH over 1 year ago
Mesa 3 - v3.0 alpha 4 (pre-release)
Highlights
Mesa 3.0.0a4 contains two major breaking changes:
1. 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:
```diff
class Wolf(Agent):
- def init(self, uniqueid, 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](https://github.com/projectmesa/mesa-examples/pull/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 https://github.com/projectmesa/mesa/pull/2278
- track unique_id automatically by @quaquel in https://github.com/projectmesa/mesa/pull/2260 ### π New features added
- AgentSet: Add
aggmethod by @EwoutH in https://github.com/projectmesa/mesa/pull/2266 - Implement new SolaraViz API by @Corvince in https://github.com/projectmesa/mesa/pull/2263 ### π Enhancements made
- Model: Replace
get_agents_of_typemethod withagents_by_typeproperty by @EwoutH in https://github.com/projectmesa/mesa/pull/2267 - add default SolaraViz by @Corvince in https://github.com/projectmesa/mesa/pull/2280
- Simplify ModelController by @Corvince in https://github.com/projectmesa/mesa/pull/2282
- Add default values and missing value handling to
agentset.getby @quaquel in https://github.com/projectmesa/mesa/pull/2279 ### π Bugs fixed - Fix deterministic behavior in
move_agent_to_one_ofwithselection="closest"by @OrenBochman in https://github.com/projectmesa/mesa/pull/2118 ### π Documentation improvements - docs: Fix Visualization Tutorial (main branch) by @EwoutH in https://github.com/projectmesa/mesa/pull/2271
- Docs: Fix broken relative links by removing
.htmlsuffix by @EwoutH in https://github.com/projectmesa/mesa/pull/2274 - Readthedocs: Don't let notebook failures pass silently by @EwoutH in https://github.com/projectmesa/mesa/pull/2276
- Update viz tutorial to the new API by @Corvince in https://github.com/projectmesa/mesa/pull/2289 ### π§ Maintenance
- Resolve multiprocessing warning, state Python 3.13 support by @rht in https://github.com/projectmesa/mesa/pull/2246
New Contributors
- @OrenBochman made their first contribution in https://github.com/projectmesa/mesa/pull/2118
Full Changelog: https://github.com/projectmesa/mesa/compare/v3.0.0a3...v3.0.0a4
Scientific Software - Peer-reviewed
- Python
Published by EwoutH over 1 year ago
Mesa 3 - 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 https://github.com/projectmesa/mesa/pull/2272
- Docs: Fix broken relative links by removing
.htmlsuffix by @EwoutH in https://github.com/projectmesa/mesa/pull/2274
Full Changelog: https://github.com/projectmesa/mesa/compare/v2.3.3...v2.3.4
Scientific Software - Peer-reviewed
- Python
Published by EwoutH over 1 year ago
Mesa 3 - 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
- AgentSet: Add
setmethod by @EwoutH in https://github.com/projectmesa/mesa/pull/2254 ### π Documentation improvements - Fix image on landing page of docs. by @jackiekazil in https://github.com/projectmesa/mesa/pull/2146
- Replace links in docs - google group to matrix. by @jackiekazil in https://github.com/projectmesa/mesa/pull/2148
- Add experimental features to documentation as per #2122 by @stephenfmann in https://github.com/projectmesa/mesa/pull/2154
- Update visualisation docs by @EwoutH in https://github.com/projectmesa/mesa/pull/2162
- Add original conference paper link to docs by @ENUMERA8OR in https://github.com/projectmesa/mesa/pull/2160
- docs/conf.py: Use modern
intersphinx_mappingformat by @EwoutH in https://github.com/projectmesa/mesa/pull/2206 - Contribution: Add "I have no idea where to start" section by @EwoutH in https://github.com/projectmesa/mesa/pull/2258
Full Changelog: https://github.com/projectmesa/mesa/compare/v2.3.2...v2.3.3
Scientific Software - Peer-reviewed
- Python
Published by EwoutH over 1 year ago
Mesa 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
- model: Automatically increase
stepscounter by @EwoutH in https://github.com/projectmesa/mesa/pull/2223 ### π§ͺ Experimental features - Voronoi Tessellation based Discrete Space by @vitorfrois in https://github.com/projectmesa/mesa/pull/2084 ### π New features added
- Add AgentSet.groupby by @quaquel in https://github.com/projectmesa/mesa/pull/2220
- AgentSet: Add
setmethod by @EwoutH in https://github.com/projectmesa/mesa/pull/2254 ### π Enhancements made - Split AgentSet into map and do to separate return types by @quaquel in https://github.com/projectmesa/mesa/pull/2237
- Performance enhancements for Model.agents by @quaquel in https://github.com/projectmesa/mesa/pull/2251
- AgentSet: Allow selecting a fraction of agents in the AgentSet by @EwoutH in https://github.com/projectmesa/mesa/pull/2253 ### π Bugs fixed
- SolaraViz: Reset components when params are changed by @rht in https://github.com/projectmesa/mesa/pull/2240 ### π Documentation improvements
- Contribution: Add "I have no idea where to start" section by @EwoutH in https://github.com/projectmesa/mesa/pull/2258
- Write initial Mesa Migration guide by @EwoutH in https://github.com/projectmesa/mesa/pull/2257 ### π§ Maintenance
- CI: Add test job for Python 3.13 by @EwoutH in https://github.com/projectmesa/mesa/pull/2173
- Add pull request templates by @EwoutH in https://github.com/projectmesa/mesa/pull/2217
- benchmarks: Add BoltzmannWealth model by @EwoutH in https://github.com/projectmesa/mesa/pull/2252
- CI: Add optional dependency for examples by @EwoutH in https://github.com/projectmesa/mesa/pull/2261
New Contributors
- @vitorfrois made their first contribution in https://github.com/projectmesa/mesa/pull/2084
Full Changelog: https://github.com/projectmesa/mesa/compare/v3.0.0a2...v3.0.0a3
Scientific Software - Peer-reviewed
- Python
Published by EwoutH over 1 year ago
Mesa 3 - 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 https://github.com/projectmesa/mesa/pull/2219
- Require Mesa models to be initialized with
super().__init__()by @EwoutH in https://github.com/projectmesa/mesa/pull/2218 - breaking: Add dependencies argument to custom space_drawer by @rht in https://github.com/projectmesa/mesa/pull/2209 ### π§ͺ Experimental enhancement
- devs/eventlist: Add repr method to print EventList pretty by @EwoutH in https://github.com/projectmesa/mesa/pull/2195 ### π Documentation improvements
- docs: Update Readme and tutorials to mention Mesa 3.0 pre-releases by @EwoutH in https://github.com/projectmesa/mesa/pull/2203 ### π§ Maintenance
- CI: Let pytest treat warnings as errors for examples by @EwoutH in https://github.com/projectmesa/mesa/pull/2204
- docs/conf.py: Use modern
intersphinx_mappingformat by @EwoutH in https://github.com/projectmesa/mesa/pull/2206
Full Changelog: https://github.com/projectmesa/mesa/compare/v3.0.0a1...v3.0.0a2
Scientific Software - Peer-reviewed
- Python
Published by EwoutH over 1 year ago
Mesa 3 - 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 (jupyterviz) to SolaraViz (solaraviz), 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 https://github.com/projectmesa/mesa/pull/2180
- refactor: Rename jupyterviz namespace to solaraviz by @rht in https://github.com/projectmesa/mesa/pull/2188 ### π Enhancements made
- Rename JupyterViz to SolaraViz by @rht in https://github.com/projectmesa/mesa/pull/2187 ### π Bugs fixed
- fix: Render agent marker radius correctly by @rht in https://github.com/projectmesa/mesa/pull/2181
- fix: Use model.schedule.steps -> mode.steps for batchrun by @rht in https://github.com/projectmesa/mesa/pull/2183 ### π Documentation improvements
- Add original conference paper link to docs by @ENUMERA8OR in https://github.com/projectmesa/mesa/pull/2160
New Contributors
- @ENUMERA8OR made their first contribution in https://github.com/projectmesa/mesa/pull/2160
Full Changelog: https://github.com/projectmesa/mesa/compare/v3.0.0a0...v3.0.0a1
Scientific Software - Peer-reviewed
- Python
Published by EwoutH over 1 year ago
Mesa 3 - 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 https://github.com/projectmesa/mesa/pull/2181
- fix: Use model.schedule.steps -> model.steps for batchrun by @rht in https://github.com/projectmesa/mesa/pull/2183
Full Changelog: https://github.com/projectmesa/mesa/compare/v2.3.1...v2.3.2
Scientific Software - Peer-reviewed
- Python
Published by EwoutH over 1 year ago
Mesa 3 - 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 https://github.com/projectmesa/mesa/pull/2091
- breaking: Remove visualization_old (mesa-viz-tornado) by @rht in https://github.com/projectmesa/mesa/pull/2133 ### π New features added
- Set JupyterViz as stable by @rht in https://github.com/projectmesa/mesa/pull/2090 ### π Bugs fixed
- Jupyter_viz: Allow measures to be None by @EwoutH in https://github.com/projectmesa/mesa/pull/2163
- Jupyter Viz: Don't avoid interactive backend by @EwoutH in https://github.com/projectmesa/mesa/pull/2165 ### π Documentation improvements
- Fix image on landing page of docs. by @jackiekazil in https://github.com/projectmesa/mesa/pull/2146
- Replace links in docs - google group to matrix. by @jackiekazil in https://github.com/projectmesa/mesa/pull/2148
- Update visualisation docs by @EwoutH in https://github.com/projectmesa/mesa/pull/2162 ### π§ Maintenance
- CI: Add weekly scheduled run to all CI workflows by @EwoutH in https://github.com/projectmesa/mesa/pull/2130
- Drop support for Python 3.9, require Python >= 3.10 by @EwoutH in https://github.com/projectmesa/mesa/pull/2132
- Add script to list unlabeled PR's since latest release by @rht in https://github.com/projectmesa/mesa/pull/2047
New Contributors
- @stephenfmann made their first contribution in https://github.com/projectmesa/mesa/pull/2154
Full Changelog: https://github.com/projectmesa/mesa/compare/v2.3.1...v3.0.0a0
Scientific Software - Peer-reviewed
- Python
Published by EwoutH over 1 year ago
Mesa 3 - 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
- datacollector: store separate snapshots of model data per step by @EwoutH in https://github.com/projectmesa/mesa/pull/2129 ### π Documentation improvements
- Add experimental features to documentation as per #2122 by @stephenfmann in https://github.com/projectmesa/mesa/pull/2154
New Contributors
- @stephenfmann made their first contribution in https://github.com/projectmesa/mesa/pull/2154
Full Changelog: https://github.com/projectmesa/mesa/compare/v2.3.0...v2.3.1
Scientific Software - Peer-reviewed
- Python
Published by EwoutH over 1 year ago
Mesa 3 - 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
- 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 CODEOFCONDUCT.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
- Make agent move to actual random closest position by @EwoutH in https://github.com/projectmesa/mesa/pull/2119 ### π 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 testbatchrun 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
Scientific Software - Peer-reviewed
- Python
Published by EwoutH over 1 year ago
Mesa 3 - v2.3.0-rc1
Highlights
The 2.3.0-rc1 release is our first release candidate pre-release, meant to test all the new features and enhancement for the upcoming 2.3.0 release.
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 pre-release with:
pip install --pre mesa
We would love feedback before we release 2.3.0 stable in ~1 week.
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 CODEOFCONDUCT.md to version 2+ of contrib convenant 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 testbatchrun 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-rc1
Scientific Software - Peer-reviewed
- Python
Published by EwoutH over 1 year ago
Mesa 3 - v2.2.5
What's Changed
π§ͺ Experimental features
- solara_viz: Add borders around ContinuousSpace by @EwoutH in https://github.com/projectmesa/mesa/pull/1988 ### π 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
- new feature: AgentSet.get can retrieve one or more then one attribute by @quaquel in https://github.com/projectmesa/mesa/pull/2044 ### π 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
- refactor: Remove dependence on model.schedule, add clock to Model by @rht in https://github.com/projectmesa/mesa/pull/1942
- 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 ### π Bugs fixed
- Allow user models to assign
Model.agentsfor now, but add warning by @quaquel in https://github.com/projectmesa/mesa/pull/1976 - fix: Explicitly specify JupyterViz space view limits by @rht in https://github.com/projectmesa/mesa/pull/1984
- fix: Reverse dict key and value for agentsbytype by @rht in https://github.com/projectmesa/mesa/pull/1996
- Fix AgentSet inplace shuffle (and thus RandomActivation), add tests by @EwoutH in https://github.com/projectmesa/mesa/pull/2007
- 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 ### π 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 ### π§ 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 ### 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 testbatchrun 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
Full Changelog: https://github.com/projectmesa/mesa/compare/v2.2.1...v2.2.5
Scientific Software - Peer-reviewed
- Python
Published by tpike3 almost 2 years ago
Mesa 3 - v2.2.4
Highlights
Mesa v2.2.4 is a small but important bugfix release for the 2.2 release series. It fixes an essential bug in where agents weren't shuffled in the RandomActivation scheduler (effectively making it sequential activation)(#2007). It also fixes a small behaviour change in RandomActivationByType.agents_by_type() (#1996). Furthermore, this release adds an internal clock to the Model, which allows to use a Mesa model without a scheduler (using the AgentSet API)(#1942).
Updating from previous 2.2 releases is highly recommended, especially when using the RandomActivation scheduler.
What's Changed
π Enhancements made
- refactor: Remove dependence on model.schedule, add clock to Model by @rht in https://github.com/projectmesa/mesa/pull/1942 ### π Bugs fixed
- Fix AgentSet inplace shuffle (and thus RandomActivation), add tests by @EwoutH and @quaquel in https://github.com/projectmesa/mesa/pull/2007
- fix: Reverse dict key and value for agentsbytype by @rht in https://github.com/projectmesa/mesa/pull/1996
Full Changelog: https://github.com/projectmesa/mesa/compare/v2.2.3...v2.2.4
Scientific Software - Peer-reviewed
- Python
Published by EwoutH almost 2 years ago
Mesa 3 - v2.2.3
Highlights
Mesa 2.2.3 is a small release with two improvements to the experimental Solara visualisation, on request of one of our contributors. No stable features have changed.
What's Changed
π§ͺ Experimental features
- solara_viz: Add borders around ContinuousSpace by @EwoutH in https://github.com/projectmesa/mesa/pull/1988 ### π Bugs fixed
- fix: Explicitly specify JupyterViz space view limits by @rht in https://github.com/projectmesa/mesa/pull/1984
Full Changelog: https://github.com/projectmesa/mesa/compare/v2.2.2...v2.2.3
Scientific Software - Peer-reviewed
- Python
Published by EwoutH almost 2 years ago
Mesa 3 - v2.2.2
Highlights
Mesa 2.2.2 is a small bugfix release, for models in which users had defined Model.agents (self.agents in a Model (sub)class). This is deprecated, but for now allowed. See #1919 (comment).
What's Changed
π Bugs fixed
- Allow user models to assign
Model.agentsfor now, but add warning by @quaquel in #1976
Full Changelog: https://github.com/projectmesa/mesa/compare/v2.2.1...v2.2.2
Scientific Software - Peer-reviewed
- Python
Published by EwoutH almost 2 years ago
Mesa 3 - v2.2.1
Highlights
After the substantive 2.2.0 release we are releasing 2.2.1 which addresses a few bugs, unintended behaviors and a performance regression. #1960 makes sure agent addition and removal is handled correct, #1965 fixed an unintended behavior change in RandomActivationByType.agents_by_type and #1964 makes sure we're at least as fast as before 2.2.0, if not faster. The introduction tutorial is also extended with #1955.
We highly recommend updating to 2.2.1 if you're using 2.2.0.
bash
pip install --upgrade mesa
What's Changed
π§ͺ Experimental features
- jupyter_viz: Implement multiline plot by @rht in https://github.com/projectmesa/mesa/pull/1941 ### π Enhancements made
- make mesa runable without some dependencies by @Corvince in https://github.com/projectmesa/mesa/pull/1950
- Improve performance of AgentSet and itercelllist_contents by @Corvince in https://github.com/projectmesa/mesa/pull/1964 ### π Bugs fixed
- Bugfix in agentset to handle addition and removal correctly by @quaquel in https://github.com/projectmesa/mesa/pull/1960
- Make RandomActivationByType.agentsbytype backward compatible by @quaquel in https://github.com/projectmesa/mesa/pull/1965 ### π Documentation improvements
- Refer to just Python instead of Python 3 by @rht in https://github.com/projectmesa/mesa/pull/1957
- intro tutorial: Analysing model reporters by @EwoutH in https://github.com/projectmesa/mesa/pull/1955 ### π§ Maintenance
- Migrate from setuptools to hatch by @rht in https://github.com/projectmesa/mesa/pull/1882
- ci: Add tests for mesa-examples by @rht in https://github.com/projectmesa/mesa/pull/1956
- refactor: Move Matplotlib-specific Solara components to separate file by @rht in https://github.com/projectmesa/mesa/pull/1943
Full Changelog: https://github.com/projectmesa/mesa/compare/v2.2.0...v2.2.1
Scientific Software - Peer-reviewed
- Python
Published by EwoutH almost 2 years ago
Mesa 3 - v2.2.0
Highlights
This release incorporates several majors changes to Mesa. Notably, this provides two experimental features. (1) It reimagines Mesa's agent handling to have agents in the model class and store them in sets (you may submit feedback at https://github.com/projectmesa/mesa/discussions/1919). The intent is to make Mesa more efficient and give users more control over agent scheduling to allow for innumerable options. (2) It adds property layer and property grid so users can layer on multiple grids making Mesa and Geo-Mesa more similar (you may submit feedback at https://github.com/projectmesa/mesa/discussions/1932).
What's Changed
π§ͺ Experimental features
- Introduce AgentSet class by @EwoutH in https://github.com/projectmesa/mesa/pull/1916
- Reimplement schedulers to use AgentSet by @quaquel in https://github.com/projectmesa/mesa/pull/1926
- Work around for initializing model._agent by @quaquel in https://github.com/projectmesa/mesa/pull/1928
- space: Implement PropertyLayer and _PropertyGrid by @EwoutH in https://github.com/projectmesa/mesa/pull/1898
π Enhancements made
- Native support for multiple agent types by @EwoutH in https://github.com/projectmesa/mesa/pull/1894
- Document empties property by @EwoutH in https://github.com/projectmesa/mesa/pull/1888
- Add DiscreteEventScheduler by @EwoutH in https://github.com/projectmesa/mesa/pull/1890
- space: Let move_agent choose from multiple positions by @EwoutH in https://github.com/projectmesa/mesa/pull/1920
π Bugs fixed
- Honor disabled space drawer option when rendering in the browser by @rlskoeser in https://github.com/projectmesa/mesa/pull/1907
π Documentation improvements
- docs: Fix README.md inline code formatting by @rht in https://github.com/projectmesa/mesa/pull/1887
- Add experimental warning to DiscreteEventScheduler by @EwoutH in https://github.com/projectmesa/mesa/pull/1924
π§ Maintenance
- ci: Speed up pip install by caching deps install output by @rht in https://github.com/projectmesa/mesa/pull/1885
- [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci in https://github.com/projectmesa/mesa/pull/1899
- build(deps): bump actions/setup-python from 4 to 5 by @dependabot in https://github.com/projectmesa/mesa/pull/1904
- Create release.yml file for automatic release notes generation by @EwoutH in https://github.com/projectmesa/mesa/pull/1925
- Drop support for Python 3.8 by @rht in https://github.com/projectmesa/mesa/pull/1756
New Contributors
- @quaquel made their first contribution in https://github.com/projectmesa/mesa/pull/1928
Full Changelog: https://github.com/projectmesa/mesa/compare/v2.1.5...v2.2.0
Scientific Software - Peer-reviewed
- Python
Published by tpike3 almost 2 years ago
Mesa 3 - v2.1.3
2.1.3 (2023-11-5)
This release contains several improvements, fixes, and new features to the JupyterViz/Solara frontend. It's a patch release instead of a minor release because the JupyterViz frontend is still considered experimental.
Improvements
- model: ensure model is initialized with random seed based #1814
- space: check if position values are tuples #1831
- datacollection: add agent collection by type, documentation, and tests #1838
Docs and Tutorial
- tutorial: explain how to set up reporter for multiple agents #1717
- docs: rename useful snippets to how to guide #1839
CI and WorkFlows
- Release CI: update to run workflows on releases #1479
- CI: Update GHA workflows with Python 3.12 #1840
- update ruff version #1824, #1841
- Ensure mesaviztornado>=0.1.2 #1860
Solara/JupyterViz
- perf: increase speed of Solara render #1819
- implement drawer for continuous space and refactor code #1830
- fix: configure change handler for checkbox input #1844
- fix: ensure playing starts after model param change #1851
Scientific Software - Peer-reviewed
- Python
Published by tpike3 about 2 years ago
Mesa 3 - v2.1.2
This release contains fixes, and several improvements and new features to the JupyterViz/Solara frontend. It's a patch release instead of a minor release because the JupyterViz frontend is still considered experimental.
Improvements
- perf: Access grid only once #1751
- docs: compile notebooks at build time #1753
- docs: Remove nbsphinx and explicit .ipynb suffix #1754
- rtd: Use gruvbox-dark as style #1719
- build(deps): bump actions/checkout from 3 to 4 #1790
Solara/JupyterViz
- solara: Implement visualization for network grid #1767
- Add support for select input type #1779
- Add step count display to JupyterViz #1775
- Simplify solara code #1786
- Add docstring for jupyterviz makeuserinput that documents supported inputs #1784
- Revise, test, & document JupyterViz options for drawing agent space #1783
- Add UserInputs component #1788
- Fix: Remove dict merge operator, python 3.8 compat #1793
- feat: Add reset button to JupyterViz #1795
- Add support for solara.Checkbox user input #1798
- viz tutorial: Update custom plot to reflect new code #1799
- fix: Don't continue playing when a model is reset #1796
- Docker: Update to use Solara viz #1757
Refactors
- Move viz stuff to mesa-viz-tornado Git repo #1746
- simplify get neighborhood #1760
- remove attrgetter performance optimization #1809
Fixes
- fix: Add Matplotlib as dependency #1747
- fix install for visualization tutorial in colab #1752
- fix: Allow multiple connections in Solara #1759
- Revert "Ensure sphinx>=7" #1762
- fix README pic to remove line on left side #1763
- space: Ensure get_neighborhood output & cache are immutable #1780
- fix: Use .pytemplate for name for cookiecutter #1785
- HISTORY.rst: Correct neighbor_iter() replacement in 2.0.0 #1807
- docs: Always link to stable version #1810
- Remove excludenonevalues #1813
Scientific Software - Peer-reviewed
- Python
Published by rht over 2 years ago
Mesa 3 - v2.1.1
This release improves the introductory and visualization tutorial. Ensures both are Google Colab compatible with working badges.
Changes: - Update introtutorial to warn users to ensure up to date version, and make colab compatible #1739, #1744 - Improve new/experimental Solara based visualization to ensure pause button works #1745 - Fix bug in space.py -> getheading() #1739
Scientific Software - Peer-reviewed
- Python
Published by rht over 2 years ago
Mesa 3 - v2.1.0 Youngtown
This release creates mesa.experimental namespace, this solves the issue that PyPI release will not allow git-based install.
Users should read the Mesa 2.0.0 release note, as this contains the details about the breaking changes and other major changes that were part of Mesa 2.0 release.
The mesa.experimental currently consists of JupyterViz, a new visualization framework that can run on a Jupyter notebook as well as standalone.
Changes:
* Creates mesa.experimental namespace #1736
* Fix Ruff lint error #1737
* Update permissions for PyPI #1732
Scientific Software - Peer-reviewed
- Python
Published by rht over 2 years ago
Mesa 3 - v2.0.0 Wellton
Special notes
Mesa 2.0 includes:
* an experimental pure python user interface/ visualization that is also jupyter compatible please see the visualization tutorial_
* several breaking changes that provide significant improvements to Mesa.
.. visualization tutorial: https://mesa.readthedocs.io/en/latest/tutorials/visualizationtutorial.html Breaking Changes:
- space: change
coord_iterto return(content,(x,y))instead of(content, x,y); this reduces known errors of scheduler to grid mismatch #1566, #1723 - space: change NetworkGrid
get_neighborstoget_neighborhood; improves performance #1542 - space: raise exception when pos is out of bounds in
Grid.get_neighborhood#1524 - space: remove deprecations (#1520, #1687, #1688):
find_empty(): convert this tomove_to_empty()num_agents: removed parameter frommove_to_empty()position_agent(): convert this toplace_agentneighbor_iter(): convert this toiter_neighborhood()
- batchrunner: remove deprecations #1627
class BatchRunnerandclass BatchRunnerMP: convert these tobatch_run()- Please see this
batch_run() example_ if you would like to see an an implementation.
- visualization: easier visualization creation #1693
UserSettableParameter(['number', 'slider','checkbox', 'choice', 'StaticText']): convert toNumberInput,Slider,CheckBox,Choice,StaticText- Please see this
visualization example_ if you would like to see an implementation.
.. batchrun() example: https://github.com/projectmesa/mesa-examples/blob/db2ec0383eb3b1868e91c828101e84cce97bbb63/examples/bankreserves/batchrun.py#L188-L221 .. visualization example: https://github.com/projectmesa/mesa-examples/blob/db2ec0383eb3b1868e91c828101e84cce97bbb63/examples/boltzmannwealthmodel/boltzmannwealth_model/server.py#L25-L32.)
New Features:
- datacollector: can now handle data collection by agent type #1419, #1702
- time: allows for model level
StageActivation#1709 - visualization:
ChartModulecan have dynamically named properties #1685 - visualization: improved stop server to end visualizations #1646
- experimental python front end option: integrated the initial prototype of the pure python front end option #1698, #1726
Improvements
- update HexGrid and create HexSingleGrid and HexMultiGrid #1581
- correct
get_headingfor toroidal space #1686 - update slider to start at 1FPS #1674
- update links to examples repo due to creation of mesa_examples #1636, #1637
- ** CI Improvements**
- update Ruff #1724
- remove Pipfile and Pipfile.lock #1692
- enable Codespell in Jupyter #1695
- improve regex for better build #1669, #1671
- exclude notebooks form linter #1670
- updated pip for zsh #1644
- CLI quality of life improvements #1640
- Docs Improvements
- update to PyData theme #1699
- remove .rst to create simpler build #1363, #1624
- use seaborn in tutorials #1718
- fix types and errors in docs #1624, #1705, #1706, #1720
- improve tutorials #1636, #1637, #1639, #1641, #1647, #1648, #1650, #1656, #1658, #1659, #1695, #1697,
- add nbsphinx to adv_tutorial #1694
- replace
const chartforvar chartin advanced tutorial #1679
- update LICENSE to 2023 #1683
Scientific Software - Peer-reviewed
- Python
Published by rht over 2 years ago
Mesa 3 - v1.2.0 Taylor
Taylor release v1.2.0.
Scientific Software - Peer-reviewed
- Python
Published by rht almost 3 years ago
Mesa 3 - v1.1.1
This release fixes https://github.com/projectmesa/mesa/issues/1461 where custom user-specified portrayal images don't load in the visualization server.
Full Changelog: https://github.com/projectmesa/mesa/compare/v1.1.0...v1.1.1
Scientific Software - Peer-reviewed
- Python
Published by rht about 3 years ago