Mesa 2.3.2__py3-none-any.whl → 2.3.4__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of Mesa might be problematic. Click here for more details.

mesa/__init__.py CHANGED
@@ -26,7 +26,7 @@ __all__ = [
26
26
  ]
27
27
 
28
28
  __title__ = "mesa"
29
- __version__ = "2.3.2"
29
+ __version__ = "2.3.4"
30
30
  __license__ = "Apache 2.0"
31
31
  _this_year = datetime.datetime.now(tz=datetime.timezone.utc).date().year
32
32
  __copyright__ = f"Copyright {_this_year} Project Mesa Team"
mesa/agent.py CHANGED
@@ -274,6 +274,21 @@ class AgentSet(MutableSet, Sequence):
274
274
  for agent in self._agents
275
275
  ]
276
276
 
277
+ def set(self, attr_name: str, value: Any) -> AgentSet:
278
+ """
279
+ Set a specified attribute to a given value for all agents in the AgentSet.
280
+
281
+ Args:
282
+ attr_name (str): The name of the attribute to set.
283
+ value (Any): The value to set the attribute to.
284
+
285
+ Returns:
286
+ AgentSet: The AgentSet instance itself, after setting the attribute.
287
+ """
288
+ for agent in self:
289
+ setattr(agent, attr_name, value)
290
+ return self
291
+
277
292
  def __getitem__(self, item: int | slice) -> Agent:
278
293
  """
279
294
  Retrieve an agent or a slice of agents from the AgentSet.
mesa/space.py CHANGED
@@ -586,7 +586,7 @@ class PropertyLayer:
586
586
  aggregate_property(operation): Performs an aggregate operation over all cells.
587
587
  """
588
588
 
589
- agentset_experimental_warning_given = False
589
+ propertylayer_experimental_warning_given = False
590
590
 
591
591
  def __init__(
592
592
  self, name: str, width: int, height: int, default_value, dtype=np.float64
@@ -633,14 +633,14 @@ class PropertyLayer:
633
633
 
634
634
  self.data = np.full((width, height), default_value, dtype=dtype)
635
635
 
636
- if not self.__class__.agentset_experimental_warning_given:
636
+ if not self.__class__.propertylayer_experimental_warning_given:
637
637
  warnings.warn(
638
638
  "The new PropertyLayer and _PropertyGrid classes experimental. It may be changed or removed in any and all future releases, including patch releases.\n"
639
639
  "We would love to hear what you think about this new feature. If you have any thoughts, share them with us here: https://github.com/projectmesa/mesa/discussions/1932",
640
640
  FutureWarning,
641
641
  stacklevel=2,
642
642
  )
643
- self.__class__.agentset_experimental_warning_given = True
643
+ self.__class__.propertylayer_experimental_warning_given = True
644
644
 
645
645
  def set_cell(self, position: Coordinate, value):
646
646
  """
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: Mesa
3
- Version: 2.3.2
3
+ Version: 2.3.4
4
4
  Summary: Agent-based modeling (ABM) in Python
5
5
  Project-URL: homepage, https://github.com/projectmesa/mesa
6
6
  Project-URL: repository, https://github.com/projectmesa/mesa
@@ -32,7 +32,6 @@ Requires-Dist: pandas
32
32
  Requires-Dist: solara
33
33
  Requires-Dist: tqdm
34
34
  Provides-Extra: dev
35
- Requires-Dist: coverage; extra == 'dev'
36
35
  Requires-Dist: pytest-cov; extra == 'dev'
37
36
  Requires-Dist: pytest-mock; extra == 'dev'
38
37
  Requires-Dist: pytest>=4.6; extra == 'dev'
@@ -56,6 +55,8 @@ Description-Content-Type: text/markdown
56
55
  | Meta | [![linting - Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff) [![code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) [![Hatch project](https://img.shields.io/badge/%F0%9F%A5%9A-Hatch-4051b5.svg)](https://github.com/pypa/hatch) |
57
56
  | Chat | [![chat](https://img.shields.io/matrix/project-mesa:matrix.org?label=chat&logo=Matrix)](https://matrix.to/#/#project-mesa:matrix.org) |
58
57
 
58
+ *This is the `2.3.x-maintenance` branch. Example models for Mesa 2.x can be found [here](https://github.com/projectmesa/mesa-examples/tree/mesa-2.x/examples).*
59
+
59
60
  Mesa allows users to quickly create agent-based models using built-in
60
61
  core components (such as spatial grids and agent schedulers) or
61
62
  customized implementations; visualize them using a browser-based
@@ -95,15 +96,18 @@ Or any other (development) branch on this repo or your own fork:
95
96
  pip install -U -e git+https://github.com/YOUR_FORK/mesa@YOUR_BRANCH#egg=mesa
96
97
  ```
97
98
 
99
+ ## Resources
98
100
  For resources or help on using Mesa, check out the following:
99
101
 
100
102
  - [Intro to Mesa Tutorial](http://mesa.readthedocs.org/en/stable/tutorials/intro_tutorial.html) (An introductory model, the Boltzmann
101
103
  Wealth Model, for beginners or those new to Mesa.)
104
+ - [Visualization Tutorial](https://mesa.readthedocs.io/en/stable/tutorials/visualization_tutorial.html) (An introduction into our Solara visualization)
102
105
  - [Complexity Explorer Tutorial](https://www.complexityexplorer.org/courses/172-agent-based-models-with-python-an-introduction-to-mesa) (An advanced-beginner model,
103
106
  SugarScape with Traders, with instructional videos)
104
- - [Mesa Examples](https://github.com/projectmesa/mesa-examples/tree/main/examples) (A repository of seminal ABMs using Mesa and
107
+ - [Mesa Examples](https://github.com/projectmesa/mesa-examples/tree/mesa-2.x/examples) (A repository of seminal ABMs using Mesa and
105
108
  examples of employing specific Mesa Features)
106
109
  - [Docs](http://mesa.readthedocs.org/) (Mesa's documentation, API and useful snippets)
110
+ - [Development version docs](https://mesa.readthedocs.io/en/latest/) (the latest version docs if you're using a pre-release Mesa version)
107
111
  - [Discussions](https://github.com/projectmesa/mesa/discussions) (GitHub threaded discussions about Mesa)
108
112
  - [Matrix Chat](https://matrix.to/#/#project-mesa:matrix.org) (Chat Forum via Matrix to talk about Mesa)
109
113
 
@@ -1,10 +1,10 @@
1
- mesa/__init__.py,sha256=RCqef0h4LAQ22-08TJ7MCVevBPwZ7Sjmddn5GSfvalE,680
2
- mesa/agent.py,sha256=L_kHMM3lTVLq8EM3UsX1xVLLo-P5IqFrJEqg83gT7xs,12902
1
+ mesa/__init__.py,sha256=fbfWiSzuVuMgF_znRDKBOgMEBo-DGcrl_NS2ZrNWPwY,680
2
+ mesa/agent.py,sha256=db7xGHY0mWgasp-zqC3NgCz_aQoBMHA8DuErK3o7hfk,13398
3
3
  mesa/batchrunner.py,sha256=G-sj2g6N6E0BsBikYq5yKsgTNnKHr4ADBkRWa9PXkl8,6055
4
4
  mesa/datacollection.py,sha256=wJwt-bOU8WuXZomUg8JJhtIg4KMhoqXS0Zvyjv9SCAE,11445
5
5
  mesa/main.py,sha256=7MovfNz88VWNnfXP0kcERB6C3GfkVOh0hb0o32hM9LU,1602
6
6
  mesa/model.py,sha256=RxTCJUBfEgRIu3dXiMK9oMlxS3owwNQaQIrVRs6HsZY,5823
7
- mesa/space.py,sha256=K2QsFXbBPPSzsPQMJMxERNX0kJ5dhlp0NNrWxuQpq-Q,62471
7
+ mesa/space.py,sha256=luMN5D6rBluEpkKJGRwmueAgsf4_txzLfnLvMXk3k60,62486
8
8
  mesa/time.py,sha256=G83UKWeMFMnQV9-79Ps2gbD_Qz3hM07IFYLzf5Rvz1w,15243
9
9
  mesa/cookiecutter-mesa/cookiecutter.json,sha256=tBSWli39fOWUXGfiDCTKd92M7uKaBIswXbkOdbUufYY,337
10
10
  mesa/cookiecutter-mesa/hooks/post_gen_project.py,sha256=8JoXZKIioRYEWJURC0udj8WS3rg0c4So62sOZSGbrMY,294
@@ -38,8 +38,8 @@ mesa/visualization/TextVisualization.py,sha256=BIP0XcmIdYhz0igqe8yRZXlXeOOqJZeu8
38
38
  mesa/visualization/UserParam.py,sha256=D3qxoX-Cpqhyn06IdIO_C5s0u8nlhv3988lVwkBlcGo,49
39
39
  mesa/visualization/__init__.py,sha256=5fwVAzgVsmxAzgoLxdC26l2ZE-m2bWj963xPNSDaQEQ,287
40
40
  mesa/visualization/modules.py,sha256=pf6K3KECX51VNNqpFCm2EE5KV0A22UYmfXzTVXPnF_o,47
41
- mesa-2.3.2.dist-info/METADATA,sha256=3OPaz-uQsAtZju8pgABMiybxBB5pJZ9MilrZy_EtU4A,7865
42
- mesa-2.3.2.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
43
- mesa-2.3.2.dist-info/entry_points.txt,sha256=IOcQtetGF8l4wHpOs_hGb19Rz-FS__BMXOJR10IBPsA,39
44
- mesa-2.3.2.dist-info/licenses/LICENSE,sha256=OGUgret9fRrm8J3pdsPXETIjf0H8puK_Nmy970ZzT78,572
45
- mesa-2.3.2.dist-info/RECORD,,
41
+ mesa-2.3.4.dist-info/METADATA,sha256=PTPfEpy2KJuMXXdLUAYn6qEm79MkRFEH9UwDDsIa508,8301
42
+ mesa-2.3.4.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
43
+ mesa-2.3.4.dist-info/entry_points.txt,sha256=IOcQtetGF8l4wHpOs_hGb19Rz-FS__BMXOJR10IBPsA,39
44
+ mesa-2.3.4.dist-info/licenses/LICENSE,sha256=OGUgret9fRrm8J3pdsPXETIjf0H8puK_Nmy970ZzT78,572
45
+ mesa-2.3.4.dist-info/RECORD,,
File without changes