From a90367ee9bb6c0db95d5ea8857f6d9f1d0b0b1e4 Mon Sep 17 00:00:00 2001 From: Jan Kwakkel Date: Tue, 17 Sep 2024 10:23:05 +0200 Subject: [PATCH] fixes for typos --- benchmarks/BoltzmannWealth/boltzmann_wealth.py | 2 +- benchmarks/Schelling/schelling.py | 2 +- benchmarks/WolfSheep/__init__.py | 2 +- benchmarks/WolfSheep/wolf_sheep.py | 6 +++--- mesa/experimental/cell_space/cell_collection.py | 2 +- mesa/experimental/components/matplotlib.py | 2 +- mesa/experimental/devs/examples/epstein_civil_violence.py | 2 +- mesa/experimental/devs/examples/wolf_sheep.py | 4 ++-- mesa/space.py | 2 +- 9 files changed, 12 insertions(+), 12 deletions(-) diff --git a/benchmarks/BoltzmannWealth/boltzmann_wealth.py b/benchmarks/BoltzmannWealth/boltzmann_wealth.py index aa72a346c9c..041445f1b8f 100644 --- a/benchmarks/BoltzmannWealth/boltzmann_wealth.py +++ b/benchmarks/BoltzmannWealth/boltzmann_wealth.py @@ -1,4 +1,4 @@ -"""boltmann wealth model for peformance benchmarking. +"""boltmann wealth model for performance benchmarking. https://github.com/projectmesa/mesa-examples/blob/main/examples/boltzmann_wealth_model_experimental/model.py """ diff --git a/benchmarks/Schelling/schelling.py b/benchmarks/Schelling/schelling.py index a3192b3f7c0..47bf521e057 100644 --- a/benchmarks/Schelling/schelling.py +++ b/benchmarks/Schelling/schelling.py @@ -1,4 +1,4 @@ -"""Schelling seperation for performance benchmarking.""" +"""Schelling separation for performance benchmarking.""" from mesa import Model from mesa.experimental.cell_space import CellAgent, OrthogonalMooreGrid diff --git a/benchmarks/WolfSheep/__init__.py b/benchmarks/WolfSheep/__init__.py index f659152fdf9..89c18853af6 100644 --- a/benchmarks/WolfSheep/__init__.py +++ b/benchmarks/WolfSheep/__init__.py @@ -1 +1 @@ -"""Wolf-Sheep Predation Model for peformance benchmarking.""" +"""Wolf-Sheep Predation Model for performance benchmarking.""" diff --git a/benchmarks/WolfSheep/wolf_sheep.py b/benchmarks/WolfSheep/wolf_sheep.py index b9ea8829b13..381e8f80034 100644 --- a/benchmarks/WolfSheep/wolf_sheep.py +++ b/benchmarks/WolfSheep/wolf_sheep.py @@ -1,4 +1,4 @@ -"""Wolf-Sheep Predation Model for peformance benchmarking. +"""Wolf-Sheep Predation Model for performance benchmarking. Replication of the model found in NetLogo: Wilensky, U. (1997). NetLogo Wolf Sheep Predation model. @@ -70,7 +70,7 @@ class Sheep(Animal): """A sheep that walks around, reproduces (asexually) and gets eaten.""" def feed(self): - """If possibile eat the food in the current location.""" + """If possible eat the food in the current location.""" # If there is grass available, eat it grass_patch = next( obj for obj in self.cell.agents if isinstance(obj, GrassPatch) @@ -84,7 +84,7 @@ class Wolf(Animal): """A wolf that walks around, reproduces (asexually) and eats sheep.""" def feed(self): - """If possbile eat the food in the current location.""" + """If possible eat the food in the current location.""" sheep = [obj for obj in self.cell.agents if isinstance(obj, Sheep)] if len(sheep) > 0: sheep_to_eat = self.random.choice(sheep) diff --git a/mesa/experimental/cell_space/cell_collection.py b/mesa/experimental/cell_space/cell_collection.py index ca3c7c98044..14832d511be 100644 --- a/mesa/experimental/cell_space/cell_collection.py +++ b/mesa/experimental/cell_space/cell_collection.py @@ -88,7 +88,7 @@ def select(self, filter_func: Callable[[T], bool] | None = None, n=0): Args: filter_func: filter function - n: number of cells to slect + n: number of cells to select Returns: CellCollection diff --git a/mesa/experimental/components/matplotlib.py b/mesa/experimental/components/matplotlib.py index f4954419b39..bb3b9854193 100644 --- a/mesa/experimental/components/matplotlib.py +++ b/mesa/experimental/components/matplotlib.py @@ -220,7 +220,7 @@ def PlotMatplotlib(model, measure, dependencies: list[any] | None = None): Args: model: Model instance measure: measure to plot - dependencies: list of addtional dependencies + dependencies: list of additional dependencies """ fig = Figure() diff --git a/mesa/experimental/devs/examples/epstein_civil_violence.py b/mesa/experimental/devs/examples/epstein_civil_violence.py index dadd75cc18c..ce6b835e826 100644 --- a/mesa/experimental/devs/examples/epstein_civil_violence.py +++ b/mesa/experimental/devs/examples/epstein_civil_violence.py @@ -164,7 +164,7 @@ def __init__(self, model, vision, movement, max_jail_term): Args: model: a model instance vision: size of neighborhood - movement: wether agent can move or not + movement: whether agent can move or not max_jail_term: maximum jail sentence """ super().__init__(model, vision, movement) diff --git a/mesa/experimental/devs/examples/wolf_sheep.py b/mesa/experimental/devs/examples/wolf_sheep.py index c5b852b5b23..09d90c5afa7 100644 --- a/mesa/experimental/devs/examples/wolf_sheep.py +++ b/mesa/experimental/devs/examples/wolf_sheep.py @@ -11,7 +11,7 @@ def __init__(self, model, moore, energy, p_reproduce, energy_from_food): """Initialize Animal instance. Args: - model: a model isntance + model: a model instance moore: using moore grid or not energy: initial energy p_reproduce: probability of reproduction @@ -112,7 +112,7 @@ def __init__(self, model, fully_grown, countdown, grass_regrowth_time): """Creates a new patch of grass. Args: - model: a model isntance + model: a model instance fully_grown: (boolean) Whether the patch of grass is fully grown or not countdown: Time for the patch of grass to be fully grown again grass_regrowth_time: regrowth time for the grass diff --git a/mesa/space.py b/mesa/space.py index bab12a38779..aede77eb0c9 100644 --- a/mesa/space.py +++ b/mesa/space.py @@ -71,7 +71,7 @@ def is_integer(x: Real) -> bool: def warn_if_agent_has_position_already(placement_func): - """Decorater to give warning if agent has position already set.""" + """Decorator to give warning if agent has position already set.""" def wrapper(self, agent, *args, **kwargs): if agent.pos is not None: