Skip to content

Commit

Permalink
fix issues raised by 'flake8'
Browse files Browse the repository at this point in the history
  • Loading branch information
Hanna Imshenetska authored and Hanna Imshenetska committed Oct 28, 2024
1 parent 4c1b909 commit 957b1b1
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/syngen/ml/metrics/metrics_classes/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ def get_common_min_max(original, synthetic):

@staticmethod
def __format_float_tick_labels(labels: List, nan_label: str = 'NaN') -> List:
labels = [nan_label if pd.isna(l) else l for l in labels]
labels = [nan_label if pd.isna(label) else label for label in labels]
if all([isinstance(i, float) for i in labels]) and (
max(labels) > 1e5 or min(labels) < 1e-03
):
Expand All @@ -494,8 +494,14 @@ def _plot_heatmap(
ax = self._axes.flat[plt_index]
ax.tick_params(labelsize=14)
heatmap, x_tick_labels, y_tick_labels = heatmap_data
x_tick_labels = self.__format_float_tick_labels(x_tick_labels, self.columns_nan_labels.get(xfeature, 'NaN'))
y_tick_labels = self.__format_float_tick_labels(y_tick_labels, self.columns_nan_labels.get(yfeature, 'NaN'))
x_tick_labels = self.__format_float_tick_labels(
x_tick_labels,
self.columns_nan_labels.get(xfeature, 'NaN')
)
y_tick_labels = self.__format_float_tick_labels(
y_tick_labels,
self.columns_nan_labels.get(yfeature, 'NaN')
)
ax = sns.heatmap(
heatmap,
xticklabels=x_tick_labels,
Expand Down

0 comments on commit 957b1b1

Please sign in to comment.