diff --git a/HISTORY.md b/HISTORY.md index 50aef1e96d0..3a3f9aa5651 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -2,6 +2,44 @@ title: Release History --- +# 2.2.0 (2024-01-09) + +# 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 + # 2.1.5 (2023-11-26) This release has some critical fixes to JupyterViz/Solara frontend to prevent diff --git a/mesa/__init__.py b/mesa/__init__.py index e047e84eede..2f1d6348792 100644 --- a/mesa/__init__.py +++ b/mesa/__init__.py @@ -25,7 +25,7 @@ ] __title__ = "mesa" -__version__ = "2.1.5" +__version__ = "2.2.0" __license__ = "Apache 2.0" _this_year = datetime.datetime.now(tz=datetime.timezone.utc).date().year __copyright__ = f"Copyright {_this_year} Project Mesa Team" diff --git a/mesa/agent.py b/mesa/agent.py index 578e36b5189..0b204c2255c 100644 --- a/mesa/agent.py +++ b/mesa/agent.py @@ -56,18 +56,16 @@ def __init__(self, unique_id: int, model: Model) -> None: self.model.agentset_experimental_warning_given = False warnings.warn( - "The Mesa Model class wasnโ€™t initialized. In the future, you need to explicitly initialize the Model by calling super().__init__() on initialization.", + "The Mesa Model class was not initialized. In the future, you need to explicitly initialize the Model by calling super().__init__() on initialization.", FutureWarning, stacklevel=2, ) - def remove(self) -> None: """Remove and delete the agent from the model.""" with contextlib.suppress(KeyError): self.model._agents[type(self)].pop(self) - def step(self) -> None: """A single step of the agent.""" diff --git a/mesa/batchrunner.py b/mesa/batchrunner.py index 862fee13591..aba96855c66 100644 --- a/mesa/batchrunner.py +++ b/mesa/batchrunner.py @@ -76,7 +76,7 @@ def batch_run( def _make_model_kwargs( - parameters: Mapping[str, Union[Any, Iterable[Any]]] + parameters: Mapping[str, Union[Any, Iterable[Any]]], ) -> list[dict[str, Any]]: """Create model kwargs from parameters dictionary. diff --git a/tests/test_time.py b/tests/test_time.py index a440d502566..3cfc2f35078 100644 --- a/tests/test_time.py +++ b/tests/test_time.py @@ -174,7 +174,6 @@ def test_init(self): scheduler = RandomActivation(model, agents) assert all(agent in scheduler.agents for agent in agents) - def test_random_activation_step_shuffles(self): """ Test the random activation step @@ -226,7 +225,6 @@ def test_get_agent_keys(self): assert all(entry in agent_ids for entry in keys) - class TestSimultaneousActivation(TestCase): """ Test the simultaneous activation. @@ -260,7 +258,6 @@ def test_init(self): scheduler = RandomActivationByType(model, agents) assert all(agent in scheduler.agents for agent in agents) - def test_random_activation_step_shuffles(self): """ Test the random activation by type step @@ -301,7 +298,9 @@ def test_random_activation_counts(self): agent_types = model.agent_types for agent_type in agent_types: - assert model.schedule.get_type_count(agent_type) == len(model.get_agents_of_type(agent_type)) + assert model.schedule.get_type_count(agent_type) == len( + model.get_agents_of_type(agent_type) + ) # def test_add_non_unique_ids(self): # """