Skip to content

Commit

Permalink
Satisfying MyPy
Browse files Browse the repository at this point in the history
  • Loading branch information
gvanhoy committed Sep 18, 2023
1 parent b6e9b7c commit 52297cb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion torchsig/utils/cm_plotter.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from sklearn.metrics import confusion_matrix
from matplotlib import pyplot as plt
from matplotlib.colors import Colormap
from typing import Optional
import numpy as np

Expand All @@ -13,7 +14,7 @@ def plot_confusion_matrix(
text: bool = True,
rotate_x_text: int = 90,
figsize: tuple = (16, 9),
cmap: plt.cm = plt.cm.Blues,
cmap: str = "Blues",
):
"""Function to help plot confusion matrices
Expand Down
6 changes: 3 additions & 3 deletions torchsig/utils/visualize.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ def _visualize(self, iq_data: np.ndarray, targets: np.ndarray) -> Figure:
ts = np.arange(len(cwt_matrix[0])) / self.sample_rate
plt.imshow(
np.abs(cwt_matrix),
extent=[ts[0], ts[-1], freqs[-1], freqs[0]],
extent=[ts[0], ts[-1], freqs[-1], freqs[0]], # type: ignore
vmin=0,
vmax=np.abs(cwt_matrix).max(),
aspect="auto",
Expand Down Expand Up @@ -458,7 +458,7 @@ def _visualize( # type: ignore
title = "Data"
plt.xticks([])
plt.yticks([])
plt.title(title)
plt.title(str(title))

return figure

Expand Down Expand Up @@ -521,7 +521,7 @@ def _visualize(self, data: np.ndarray, targets: np.ndarray) -> Figure:
title = "Data"
plt.xticks([])
plt.yticks([])
plt.title(title)
plt.title(str(title))

return figure

Expand Down

0 comments on commit 52297cb

Please sign in to comment.