Repository: projectmesa/mesa
Pull request #2387 (2024-10-18 19:38:37)

Move examples into mesa
Based on previous discussion and to rectify some errors made in #2381 

See commits for atomic changes:
1. move examples into mesa folder - the main purpose of this PR
2. remove the "examples" package which was a mistake of #2381 
3. Update paths
4. Add an empty `__init__.py` file to each basic example. While I find this a bit annoying, I think its actually the best way to make the examples truly portable, combined with relative imports. Each example becomes its own "package" in python speak. Also updated the imports so now you can do `from mesa.examples import BoltzmannWealthModel` instead of `from mesa.examples.basic import BoltzmannWealthModel`



github-actions[bot]: Performance benchmarks:

| Model           | Size   | Init time [95% CI]      | Run time [95% CI]       |
|-----------------|--------|-------------------------|-------------------------|
| BoltzmannWealth | small  | 🔴 +4.2% [+3.0%, +5.3%] | 🔵 -0.3% [-0.5%, -0.2%] |
| BoltzmannWealth | large  | 🔵 +1.5% [+1.0%, +1.9%] | 🔵 +0.8% [+0.6%, +1.1%] |
| Schelling       | small  | 🔵 +0.0% [-0.2%, +0.3%] | 🔵 -0.4% [-0.7%, -0.1%] |
| Schelling       | large  | 🔵 +1.1% [+0.4%, +1.9%] | 🔴 +6.3% [+5.3%, +7.5%] |
| WolfSheep       | small  | 🔵 +0.3% [+0.1%, +0.5%] | 🔵 -0.1% [-0.2%, +0.1%] |
| WolfSheep       | large  | 🔵 +0.3% [-0.3%, +1.0%] | 🔵 +0.4% [-1.5%, +2.0%] |
| BoidFlockers    | small  | 🔵 -0.1% [-0.7%, +0.6%] | 🔵 +0.7% [-0.1%, +1.3%] |
| BoidFlockers    | large  | 🔵 +0.6% [-0.5%, +1.5%] | 🔵 -0.2% [-0.8%, +0.3%] |


Patch:
diff --git a/docs/tutorials/visualization_tutorial.ipynb b/docs/tutorials/visualization_tutorial.ipynb
index c4bfda6e..1ae055c2 100644
--- a/docs/tutorials/visualization_tutorial.ipynb
+++ b/docs/tutorials/visualization_tutorial.ipynb
@@ -48,7 +48,7 @@
     "\n",
     "# You can either define the BoltzmannWealthModel (aka MoneyModel) or install it\n",
     "\n",
-    "from mesa.examples.basic import BoltzmannWealthModel"
+    "from mesa.examples import BoltzmannWealthModel"
    ]
   },
   {
@@ -87,7 +87,7 @@
    "outputs": [],
    "source": [
     "model_params = {\n",
-    "    \"N\": {\n",
+    "    \"n\": {\n",
     "        \"type\": \"SliderInt\",\n",
     "        \"value\": 50,\n",
     "        \"label\": \"Number of agents:\",\n",
diff --git a/examples/basic/__init__.py b/examples/basic/__init__.py
deleted file mode 100644
index faa81be1..00000000
--- a/examples/basic/__init__.py
+++ /dev/null
@@ -1,13 +0,0 @@
-from .boid_flockers.model import BoidFlockers
-from .boltzmann_wealth_model.model import BoltzmannWealthModel
-from .conways_game_of_life.model import ConwaysGameOfLife
-from .schelling.model import Schelling
-from .virus_on_network.model import VirusOnNetwork
-
-__all__ = [
-    "BoidFlockers",
-    "BoltzmannWealthModel",
-    "ConwaysGameOfLife",
-    "Schelling",
-    "VirusOnNetwork",
-]
diff --git a/mesa/__init__.py b/mesa/__init__.py
index ae9b360a..b0656620 100644
--- a/mesa/__init__.py
+++ b/mesa/__init__.py
@@ -5,7 +5,6 @@ Core Objects: Model, and Agent.
 
 import datetime
 
-import mesa.examples as examples
 import mesa.experimental as experimental
 import mesa.space as space
 import mesa.time as time
@@ -22,7 +21,6 @@ __all__ = [
     "DataCollector",
     "batch_run",
     "experimental",
-    "examples",
 ]
 
 __title__ = "mesa"
diff --git a/mesa/examples.py b/mesa/examples.py
deleted file mode 100644
index e7d6613b..00000000
--- a/mesa/examples.py
+++ /dev/null
@@ -1,3 +0,0 @@
-"""This module is a collection of example models built using the Mesa framework."""
-
-__path__ = ["examples"]
diff --git a/examples/README.md b/mesa/examples/README.md
similarity index 100%
rename from examples/README.md
rename to mesa/examples/README.md
diff --git a/mesa/examples/__init__.py b/mesa/examples/__init__.py
new file mode 100644
index 00000000..b12b5261
--- /dev/null
+++ b/mesa/examples/__init__.py
@@ -0,0 +1,13 @@
+from mesa.examples.basic.boid_flockers.model import BoidFlockers
+from mesa.examples.basic.boltzmann_wealth_model.model import BoltzmannWealthModel
+from mesa.examples.basic.conways_game_of_life.model import ConwaysGameOfLife
+from mesa.examples.basic.schelling.model import Schelling
+from mesa.examples.basic.virus_on_network.model import VirusOnNetwork
+
+__all__ = [
+    "BoidFlockers",
+    "BoltzmannWealthModel",
+    "ConwaysGameOfLife",
+    "Schelling",
+    "VirusOnNetwork",
+]
diff --git a/examples/__init__.py b/mesa/examples/advanced/__init__.py
similarity index 100%
rename from examples/__init__.py
rename to mesa/examples/advanced/__init__.py
diff --git a/examples/advanced/epstein_civil_violence/Epstein Civil Violence.ipynb b/mesa/examples/advanced/epstein_civil_violence/Epstein Civil Violence.ipynb
similarity index 100%
rename from examples/advanced/epstein_civil_violence/Epstein Civil Violence.ipynb
rename to mesa/examples/advanced/epstein_civil_violence/Epstein Civil Violence.ipynb
diff --git a/examples/advanced/epstein_civil_violence/Readme.md b/mesa/examples/advanced/epstein_civil_violence/Readme.md
similarity index 100%
rename from examples/advanced/epstein_civil_violence/Readme.md
rename to mesa/examples/advanced/epstein_civil_violence/Readme.md
diff --git a/examples/advanced/__init__.py b/mesa/examples/advanced/epstein_civil_violence/epstein_civil_violence/__init__.py
similarity index 100%
rename from examples/advanced/__init__.py
rename to mesa/examples/advanced/epstein_civil_violence/epstein_civil_violence/__init__.py
diff --git a/examples/advanced/epstein_civil_violence/epstein_civil_violence/agent.py b/mesa/examples/advanced/epstein_civil_violence/epstein_civil_violence/agent.py
similarity index 100%
rename from examples/advanced/epstein_civil_violence/epstein_civil_violence/agent.py
rename to mesa/examples/advanced/epstein_civil_violence/epstein_civil_violence/agent.py
diff --git a/examples/advanced/epstein_civil_violence/epstein_civil_violence/model.py b/mesa/examples/advanced/epstein_civil_violence/epstein_civil_violence/model.py
similarity index 100%
rename from examples/advanced/epstein_civil_violence/epstein_civil_violence/model.py
rename to mesa/examples/advanced/epstein_civil_violence/epstein_civil_violence/model.py
diff --git a/examples/advanced/epstein_civil_violence/epstein_civil_violence/portrayal.py b/mesa/examples/advanced/epstein_civil_violence/epstein_civil_violence/portrayal.py
similarity index 100%
rename from examples/advanced/epstein_civil_violence/epstein_civil_violence/portrayal.py
rename to mesa/examples/advanced/epstein_civil_violence/epstein_civil_violence/portrayal.py
diff --git a/examples/advanced/epstein_civil_violence/epstein_civil_violence/server.py b/mesa/examples/advanced/epstein_civil_violence/epstein_civil_violence/server.py
similarity index 100%
rename from examples/advanced/epstein_civil_violence/epstein_civil_violence/server.py
rename to mesa/examples/advanced/epstein_civil_violence/epstein_civil_violence/server.py
diff --git a/examples/advanced/epstein_civil_violence/requirements.txt b/mesa/examples/advanced/epstein_civil_violence/requirements.txt
similarity index 100%
rename from examples/advanced/epstein_civil_violence/requirements.txt
rename to mesa/examples/advanced/epstein_civil_violence/requirements.txt
diff --git a/examples/advanced/epstein_civil_violence/run.py b/mesa/examples/advanced/epstein_civil_violence/run.py
similarity index 100%
rename from examples/advanced/epstein_civil_violence/run.py
rename to mesa/examples/advanced/epstein_civil_violence/run.py
diff --git a/examples/advanced/pd_grid/analysis.ipynb b/mesa/examples/advanced/pd_grid/analysis.ipynb
similarity index 100%
rename from examples/advanced/pd_grid/analysis.ipynb
rename to mesa/examples/advanced/pd_grid/analysis.ipynb
diff --git a/examples/advanced/epstein_civil_violence/epstein_civil_violence/__init__.py b/mesa/examples/advanced/pd_grid/pd_grid/__init__.py
similarity index 100%
rename from examples/advanced/epstein_civil_violence/epstein_civil_violence/__init__.py
rename to mesa/examples/advanced/pd_grid/pd_grid/__init__.py
diff --git a/examples/advanced/pd_grid/pd_grid/agent.py b/mesa/examples/advanced/pd_grid/pd_grid/agent.py
similarity index 100%
rename from examples/advanced/pd_grid/pd_grid/agent.py
rename to mesa/examples/advanced/pd_grid/pd_grid/agent.py
diff --git a/examples/advanced/pd_grid/pd_grid/model.py b/mesa/examples/advanced/pd_grid/pd_grid/model.py
similarity index 100%
rename from examples/advanced/pd_grid/pd_grid/model.py
rename to mesa/examples/advanced/pd_grid/pd_grid/model.py
diff --git a/examples/advanced/pd_grid/pd_grid/portrayal.py b/mesa/examples/advanced/pd_grid/pd_grid/portrayal.py
similarity index 100%
rename from examples/advanced/pd_grid/pd_grid/portrayal.py
rename to mesa/examples/advanced/pd_grid/pd_grid/portrayal.py
diff --git a/examples/advanced/pd_grid/pd_grid/server.py b/mesa/examples/advanced/pd_grid/pd_grid/server.py
similarity index 100%
rename from examples/advanced/pd_grid/pd_grid/server.py
rename to mesa/examples/advanced/pd_grid/pd_grid/server.py
diff --git a/examples/advanced/pd_grid/readme.md b/mesa/examples/advanced/pd_grid/readme.md
similarity index 100%
rename from examples/advanced/pd_grid/readme.md
rename to mesa/examples/advanced/pd_grid/readme.md
diff --git a/examples/advanced/pd_grid/requirements.txt b/mesa/examples/advanced/pd_grid/requirements.txt
similarity index 100%
rename from examples/advanced/pd_grid/requirements.txt
rename to mesa/examples/advanced/pd_grid/requirements.txt
diff --git a/examples/advanced/pd_grid/run.py b/mesa/examples/advanced/pd_grid/run.py
similarity index 100%
rename from examples/advanced/pd_grid/run.py
rename to mesa/examples/advanced/pd_grid/run.py
diff --git a/examples/advanced/sugarscape_g1mt/Readme.md b/mesa/examples/advanced/sugarscape_g1mt/Readme.md
similarity index 100%
rename from examples/advanced/sugarscape_g1mt/Readme.md
rename to mesa/examples/advanced/sugarscape_g1mt/Readme.md
diff --git a/examples/advanced/sugarscape_g1mt/app.py b/mesa/examples/advanced/sugarscape_g1mt/app.py
similarity index 100%
rename from examples/advanced/sugarscape_g1mt/app.py
rename to mesa/examples/advanced/sugarscape_g1mt/app.py
diff --git a/examples/advanced/sugarscape_g1mt/requirements.txt b/mesa/examples/advanced/sugarscape_g1mt/requirements.txt
similarity index 100%
rename from examples/advanced/sugarscape_g1mt/requirements.txt
rename to mesa/examples/advanced/sugarscape_g1mt/requirements.txt
diff --git a/examples/advanced/sugarscape_g1mt/run.py b/mesa/examples/advanced/sugarscape_g1mt/run.py
similarity index 100%
rename from examples/advanced/sugarscape_g1mt/run.py
rename to mesa/examples/advanced/sugarscape_g1mt/run.py
diff --git a/examples/advanced/pd_grid/pd_grid/__init__.py b/mesa/examples/advanced/sugarscape_g1mt/sugarscape_g1mt/__init__.py
similarity index 100%
rename from examples/advanced/pd_grid/pd_grid/__init__.py
rename to mesa/examples/advanced/sugarscape_g1mt/sugarscape_g1mt/__init__.py
diff --git a/examples/advanced/sugarscape_g1mt/sugarscape_g1mt/model.py b/mesa/examples/advanced/sugarscape_g1mt/sugarscape_g1mt/model.py
similarity index 100%
rename from examples/advanced/sugarscape_g1mt/sugarscape_g1mt/model.py
rename to mesa/examples/advanced/sugarscape_g1mt/sugarscape_g1mt/model.py
diff --git a/examples/advanced/sugarscape_g1mt/sugarscape_g1mt/resource_agents.py b/mesa/examples/advanced/sugarscape_g1mt/sugarscape_g1mt/resource_agents.py
similarity index 100%
rename from examples/advanced/sugarscape_g1mt/sugarscape_g1mt/resource_agents.py
rename to mesa/examples/advanced/sugarscape_g1mt/sugarscape_g1mt/resource_agents.py
diff --git a/examples/advanced/sugarscape_g1mt/sugarscape_g1mt/server.py b/mesa/examples/advanced/sugarscape_g1mt/sugarscape_g1mt/server.py
similarity index 100%
rename from examples/advanced/sugarscape_g1mt/sugarscape_g1mt/server.py
rename to mesa/examples/advanced/sugarscape_g1mt/sugarscape_g1mt/server.py
diff --git a/examples/advanced/sugarscape_g1mt/sugarscape_g1mt/sugar-map.txt b/mesa/examples/advanced/sugarscape_g1mt/sugarscape_g1mt/sugar-map.txt
similarity index 100%
rename from examples/advanced/sugarscape_g1mt/sugarscape_g1mt/sugar-map.txt
rename to mesa/examples/advanced/sugarscape_g1mt/sugarscape_g1mt/sugar-map.txt
diff --git a/examples/advanced/sugarscape_g1mt/sugarscape_g1mt/trader_agents.py b/mesa/examples/advanced/sugarscape_g1mt/sugarscape_g1mt/trader_agents.py
similarity index 100%
rename from examples/advanced/sugarscape_g1mt/sugarscape_g1mt/trader_agents.py
rename to mesa/examples/advanced/sugarscape_g1mt/sugarscape_g1mt/trader_agents.py
diff --git a/examples/advanced/sugarscape_g1mt/tests.py b/mesa/examples/advanced/sugarscape_g1mt/tests.py
similarity index 100%
rename from examples/advanced/sugarscape_g1mt/tests.py
rename to mesa/examples/advanced/sugarscape_g1mt/tests.py
diff --git a/examples/advanced/wolf_sheep/Readme.md b/mesa/examples/advanced/wolf_sheep/Readme.md
similarity index 100%
rename from examples/advanced/wolf_sheep/Readme.md
rename to mesa/examples/advanced/wolf_sheep/Readme.md
diff --git a/examples/advanced/sugarscape_g1mt/sugarscape_g1mt/__init__.py b/mesa/examples/advanced/wolf_sheep/__init__.py
similarity index 100%
rename from examples/advanced/sugarscape_g1mt/sugarscape_g1mt/__init__.py
rename to mesa/examples/advanced/wolf_sheep/__init__.py
diff --git a/examples/advanced/wolf_sheep/requirements.txt b/mesa/examples/advanced/wolf_sheep/requirements.txt
similarity index 100%
rename from examples/advanced/wolf_sheep/requirements.txt
rename to mesa/examples/advanced/wolf_sheep/requirements.txt
diff --git a/examples/advanced/wolf_sheep/run.py b/mesa/examples/advanced/wolf_sheep/run.py
similarity index 100%
rename from examples/advanced/wolf_sheep/run.py
rename to mesa/examples/advanced/wolf_sheep/run.py
diff --git a/examples/advanced/wolf_sheep/__init__.py b/mesa/examples/advanced/wolf_sheep/wolf_sheep/__init__.py
similarity index 100%
rename from examples/advanced/wolf_sheep/__init__.py
rename to mesa/examples/advanced/wolf_sheep/wolf_sheep/__init__.py
diff --git a/examples/advanced/wolf_sheep/wolf_sheep/agents.py b/mesa/examples/advanced/wolf_sheep/wolf_sheep/agents.py
similarity index 100%
rename from examples/advanced/wolf_sheep/wolf_sheep/agents.py
rename to mesa/examples/advanced/wolf_sheep/wolf_sheep/agents.py
diff --git a/examples/advanced/wolf_sheep/wolf_sheep/model.py b/mesa/examples/advanced/wolf_sheep/wolf_sheep/model.py
similarity index 100%
rename from examples/advanced/wolf_sheep/wolf_sheep/model.py
rename to mesa/examples/advanced/wolf_sheep/wolf_sheep/model.py
diff --git a/examples/advanced/wolf_sheep/wolf_sheep/resources/sheep.png b/mesa/examples/advanced/wolf_sheep/wolf_sheep/resources/sheep.png
similarity index 100%
rename from examples/advanced/wolf_sheep/wolf_sheep/resources/sheep.png
rename to mesa/examples/advanced/wolf_sheep/wolf_sheep/resources/sheep.png
diff --git a/examples/advanced/wolf_sheep/wolf_sheep/resources/wolf.png b/mesa/examples/advanced/wolf_sheep/wolf_sheep/resources/wolf.png
similarity index 100%
rename from examples/advanced/wolf_sheep/wolf_sheep/resources/wolf.png
rename to mesa/examples/advanced/wolf_sheep/wolf_sheep/resources/wolf.png
diff --git a/examples/advanced/wolf_sheep/wolf_sheep/server.py b/mesa/examples/advanced/wolf_sheep/wolf_sheep/server.py
similarity index 100%
rename from examples/advanced/wolf_sheep/wolf_sheep/server.py
rename to mesa/examples/advanced/wolf_sheep/wolf_sheep/server.py
diff --git a/examples/advanced/wolf_sheep/wolf_sheep/__init__.py b/mesa/examples/basic/__init__.py
similarity index 100%
rename from examples/advanced/wolf_sheep/wolf_sheep/__init__.py
rename to mesa/examples/basic/__init__.py
diff --git a/examples/basic/boid_flockers/Readme.md b/mesa/examples/basic/boid_flockers/Readme.md
similarity index 100%
rename from examples/basic/boid_flockers/Readme.md
rename to mesa/examples/basic/boid_flockers/Readme.md
diff --git a/mesa/examples/basic/boid_flockers/__init__.py b/mesa/examples/basic/boid_flockers/__init__.py
new file mode 100644
index 00000000..e69de29b
diff --git a/examples/basic/boid_flockers/agents.py b/mesa/examples/basic/boid_flockers/agents.py
similarity index 100%
rename from examples/basic/boid_flockers/agents.py
rename to mesa/examples/basic/boid_flockers/agents.py
diff --git a/examples/basic/boid_flockers/app.py b/mesa/examples/basic/boid_flockers/app.py
similarity index 100%
rename from examples/basic/boid_flockers/app.py
rename to mesa/examples/basic/boid_flockers/app.py
diff --git a/examples/basic/boid_flockers/model.py b/mesa/examples/basic/boid_flockers/model.py
similarity index 100%
rename from examples/basic/boid_flockers/model.py
rename to mesa/examples/basic/boid_flockers/model.py
diff --git a/examples/basic/boltzmann_wealth_model/Readme.md b/mesa/examples/basic/boltzmann_wealth_model/Readme.md
similarity index 100%
rename from examples/basic/boltzmann_wealth_model/Readme.md
rename to mesa/examples/basic/boltzmann_wealth_model/Readme.md
diff --git a/mesa/examples/basic/boltzmann_wealth_model/__init__.py b/mesa/examples/basic/boltzmann_wealth_model/__init__.py
new file mode 100644
index 00000000..e69de29b
diff --git a/examples/basic/boltzmann_wealth_model/agents.py b/mesa/examples/basic/boltzmann_wealth_model/agents.py
similarity index 100%
rename from examples/basic/boltzmann_wealth_model/agents.py
rename to mesa/examples/basic/boltzmann_wealth_model/agents.py
diff --git a/examples/basic/boltzmann_wealth_model/app.py b/mesa/examples/basic/boltzmann_wealth_model/app.py
similarity index 100%
rename from examples/basic/boltzmann_wealth_model/app.py
rename to mesa/examples/basic/boltzmann_wealth_model/app.py
diff --git a/examples/basic/boltzmann_wealth_model/model.py b/mesa/examples/basic/boltzmann_wealth_model/model.py
similarity index 100%
rename from examples/basic/boltzmann_wealth_model/model.py
rename to mesa/examples/basic/boltzmann_wealth_model/model.py
diff --git a/examples/basic/boltzmann_wealth_model/st_app.py b/mesa/examples/basic/boltzmann_wealth_model/st_app.py
similarity index 100%
rename from examples/basic/boltzmann_wealth_model/st_app.py
rename to mesa/examples/basic/boltzmann_wealth_model/st_app.py
diff --git a/examples/basic/conways_game_of_life/Readme.md b/mesa/examples/basic/conways_game_of_life/Readme.md
similarity index 100%
rename from examples/basic/conways_game_of_life/Readme.md
rename to mesa/examples/basic/conways_game_of_life/Readme.md
diff --git a/mesa/examples/basic/conways_game_of_life/__init__.py b/mesa/examples/basic/conways_game_of_life/__init__.py
new file mode 100644
index 00000000..e69de29b
diff --git a/examples/basic/conways_game_of_life/agents.py b/mesa/examples/basic/conways_game_of_life/agents.py
similarity index 100%
rename from examples/basic/conways_game_of_life/agents.py
rename to mesa/examples/basic/conways_game_of_life/agents.py
diff --git a/examples/basic/conways_game_of_life/model.py b/mesa/examples/basic/conways_game_of_life/model.py
similarity index 100%
rename from examples/basic/conways_game_of_life/model.py
rename to mesa/examples/basic/conways_game_of_life/model.py
diff --git a/examples/basic/conways_game_of_life/portrayal.py b/mesa/examples/basic/conways_game_of_life/portrayal.py
similarity index 100%
rename from examples/basic/conways_game_of_life/portrayal.py
rename to mesa/examples/basic/conways_game_of_life/portrayal.py
diff --git a/examples/basic/conways_game_of_life/requirements.txt b/mesa/examples/basic/conways_game_of_life/requirements.txt
similarity index 100%
rename from examples/basic/conways_game_of_life/requirements.txt
rename to mesa/examples/basic/conways_game_of_life/requirements.txt
diff --git a/examples/basic/conways_game_of_life/server.py b/mesa/examples/basic/conways_game_of_life/server.py
similarity index 100%
rename from examples/basic/conways_game_of_life/server.py
rename to mesa/examples/basic/conways_game_of_life/server.py
diff --git a/examples/basic/conways_game_of_life/st_app.py b/mesa/examples/basic/conways_game_of_life/st_app.py
similarity index 100%
rename from examples/basic/conways_game_of_life/st_app.py
rename to mesa/examples/basic/conways_game_of_life/st_app.py
diff --git a/examples/basic/schelling/README.md b/mesa/examples/basic/schelling/README.md
similarity index 100%
rename from examples/basic/schelling/README.md
rename to mesa/examples/basic/schelling/README.md
diff --git a/mesa/examples/basic/schelling/__init__.py b/mesa/examples/basic/schelling/__init__.py
new file mode 100644
index 00000000..e69de29b
diff --git a/examples/basic/schelling/agents.py b/mesa/examples/basic/schelling/agents.py
similarity index 100%
rename from examples/basic/schelling/agents.py
rename to mesa/examples/basic/schelling/agents.py
diff --git a/examples/basic/schelling/analysis.ipynb b/mesa/examples/basic/schelling/analysis.ipynb
similarity index 100%
rename from examples/basic/schelling/analysis.ipynb
rename to mesa/examples/basic/schelling/analysis.ipynb
diff --git a/examples/basic/schelling/app.py b/mesa/examples/basic/schelling/app.py
similarity index 100%
rename from examples/basic/schelling/app.py
rename to mesa/examples/basic/schelling/app.py
diff --git a/examples/basic/schelling/model.py b/mesa/examples/basic/schelling/model.py
similarity index 100%
rename from examples/basic/schelling/model.py
rename to mesa/examples/basic/schelling/model.py
diff --git a/examples/basic/virus_on_network/README.md b/mesa/examples/basic/virus_on_network/README.md
similarity index 100%
rename from examples/basic/virus_on_network/README.md
rename to mesa/examples/basic/virus_on_network/README.md
diff --git a/mesa/examples/basic/virus_on_network/__init__.py b/mesa/examples/basic/virus_on_network/__init__.py
new file mode 100644
index 00000000..e69de29b
diff --git a/examples/basic/virus_on_network/agents.py b/mesa/examples/basic/virus_on_network/agents.py
similarity index 100%
rename from examples/basic/virus_on_network/agents.py
rename to mesa/examples/basic/virus_on_network/agents.py
diff --git a/examples/basic/virus_on_network/app.py b/mesa/examples/basic/virus_on_network/app.py
similarity index 100%
rename from examples/basic/virus_on_network/app.py
rename to mesa/examples/basic/virus_on_network/app.py
diff --git a/examples/basic/virus_on_network/model.py b/mesa/examples/basic/virus_on_network/model.py
similarity index 100%
rename from examples/basic/virus_on_network/model.py
rename to mesa/examples/basic/virus_on_network/model.py
diff --git a/pyproject.toml b/pyproject.toml
index b046b797..d9aaffde 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -87,7 +87,7 @@ repository = "https://github.com/projectmesa/mesa"
 mesa = "mesa.main:cli"
 
 [tool.hatch.build.targets.wheel]
-packages = ["mesa", "examples"]
+packages = ["mesa"]
 
 [tool.hatch.version]
 path = "mesa/__init__.py"
@@ -97,7 +97,7 @@ path = "mesa/__init__.py"
 # Hardcode to Python 3.10.
 # Reminder to update mesa-examples if the value below is changed.
 target-version = "py310"
-extend-exclude = ["docs", "build", "examples/advanced"]  # TODO: Remove examples/advanced
+extend-exclude = ["docs", "build", "mesa/examples/advanced"]  # TODO: Remove examples/advanced
 
 [tool.ruff.lint]
 select = [
@@ -149,7 +149,7 @@ extend-ignore = [
   "S311",   # Standard pseudo-random generators are not suitable for cryptographic purposes
 ]
 # Ignore all docstring errors in examples
-per-file-ignores = {"examples/*"= ["D"]}
+per-file-ignores = {"mesa/examples/*"= ["D"]}
 
 [tool.ruff.lint.pydocstyle]
 convention = "google"


Test patch:
diff --git a/tests/test_examples.py b/tests/test_examples.py
index a3444a88..010081aa 100644
--- a/tests/test_examples.py
+++ b/tests/test_examples.py
@@ -8,7 +8,7 @@ import unittest
 
 def test_examples_imports():
     """Test examples imports."""
-    from mesa.examples.basic import (
+    from mesa.examples import (
         BoidFlockers,
         BoltzmannWealthModel,
         ConwaysGameOfLife,
@@ -38,7 +38,9 @@ class TestExamples(unittest.TestCase):
     details of each example's model.
     """
 
-    EXAMPLES = os.path.abspath(os.path.join(os.path.dirname(__file__), "../examples"))
+    EXAMPLES = os.path.abspath(
+        os.path.join(os.path.dirname(__file__), "../mesa/examples")
+    )
 
     @contextlib.contextmanager
     def active_example_dir(self, example):