Skip to content

Commit

Permalink
Ran black
Browse files Browse the repository at this point in the history
  • Loading branch information
gaffney2010 committed Dec 9, 2024
1 parent 4f310ca commit d75fdd5
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 7 deletions.
24 changes: 18 additions & 6 deletions axelrod/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,9 @@ def _boxplot_xticks_labels(self):
return [str(n) for n in self.result_set.ranked_names]

def boxplot(
self, title: Optional[titleType] = None, ax: Optional[matplotlib.axes.Axes] = None
self,
title: Optional[titleType] = None,
ax: Optional[matplotlib.axes.Axes] = None,
) -> matplotlib.figure.Figure:
"""For the specific mean score boxplot."""
data = self._boxplot_dataset
Expand All @@ -98,7 +100,9 @@ def _winplot_dataset(self):
return wins, ranked_names

def winplot(
self, title: Optional[titleType] = None, ax: Optional[matplotlib.axes.Axes] = None
self,
title: Optional[titleType] = None,
ax: Optional[matplotlib.axes.Axes] = None,
) -> matplotlib.figure.Figure:
"""Plots the distributions for the number of wins for each strategy."""

Expand Down Expand Up @@ -126,7 +130,9 @@ def _sdv_plot_dataset(self):
return diffs, ranked_names

def sdvplot(
self, title: Optional[titleType] = None, ax: Optional[matplotlib.axes.Axes] = None
self,
title: Optional[titleType] = None,
ax: Optional[matplotlib.axes.Axes] = None,
) -> matplotlib.figure.Figure:
"""Score difference violin plots to visualize the distributions of how
players attain their payoffs."""
Expand All @@ -143,7 +149,9 @@ def _lengthplot_dataset(self):
]

def lengthplot(
self, title: Optional[titleType] = None, ax: Optional[matplotlib.axes.Axes] = None
self,
title: Optional[titleType] = None,
ax: Optional[matplotlib.axes.Axes] = None,
) -> matplotlib.figure.Figure:
"""For the specific match length boxplot."""
data = self._lengthplot_dataset
Expand Down Expand Up @@ -202,15 +210,19 @@ def _payoff_heatmap(
return figure

def pdplot(
self, title: Optional[titleType] = None, ax: Optional[matplotlib.axes.Axes] = None
self,
title: Optional[titleType] = None,
ax: Optional[matplotlib.axes.Axes] = None,
) -> matplotlib.figure.Figure:
"""Payoff difference heatmap to visualize the distributions of how
players attain their payoffs."""
matrix, names = self._pdplot_dataset
return self._payoff_heatmap(matrix, names, title=title, ax=ax)

def payoff(
self, title: Optional[titleType] = None, ax: Optional[matplotlib.axes.Axes] = None
self,
title: Optional[titleType] = None,
ax: Optional[matplotlib.axes.Axes] = None,
) -> matplotlib.figure.Figure:
"""Payoff heatmap to visualize the distributions of how
players attain their payoffs."""
Expand Down
5 changes: 4 additions & 1 deletion axelrod/strategies/ann.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,10 @@ class ANN(Player):
}

def __init__(
self, num_features: int, num_hidden: int, weights: Optional[List[float]] = None
self,
num_features: int,
num_hidden: int,
weights: Optional[List[float]] = None,
) -> None:
Player.__init__(self)
self.num_features = num_features
Expand Down

0 comments on commit d75fdd5

Please sign in to comment.