Skip to content

Commit

Permalink
Update magic numbers to be constants
Browse files Browse the repository at this point in the history
  • Loading branch information
boazhaim committed Sep 9, 2024
1 parent b3cd20c commit 20215ce
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ class BaseImageCreator:

time_interval = "h"
_images_type = {"svg", "png"}
X_POS_FOR_STATS = 0.05
Y_POS_FOR_STATS = 0.95

def __init__(self, dest_image_path):
self._dest_image_path = dest_image_path
self._images_created = []
Expand Down Expand Up @@ -72,8 +75,8 @@ def _save_data_based_on_timestamp(
max_val = np.max(data_to_plot)
median_val = np.median(data_to_plot)
plt.text(
0.05,
0.95,
self.X_POS_FOR_STATS,
self.Y_POS_FOR_STATS,
f"Min: {min_val:.2f}\nMax: {max_val:.2f}\nMedian: {median_val:.2f}",
transform=ax.transAxes,
bbox={"facecolor": "white", "alpha": 0.5},
Expand Down

0 comments on commit 20215ce

Please sign in to comment.