Skip to content

Commit 158b80c

Browse files
committed
return types
1 parent 96f556e commit 158b80c

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

scripts/shift_calculations.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ def same_day(d1: datetime, d2: datetime) -> bool:
8484
return (d1.year == d2.year) and (d1.month == d2.month) and (d1.day == d2.day)
8585

8686

87-
def is_holiday(date: datetime):
87+
def is_holiday(date: datetime) -> bool:
8888
""" True is date is on a known holiday. """
8989
return any(same_day(date, h) for h in CERN_HOLIDAYS)
9090

@@ -138,11 +138,11 @@ def calculate_shift_parts(start_time: datetime, end_time: datetime) -> dict[str,
138138
return time_split
139139

140140

141-
def time_delta_to_hours(time_delta: timedelta):
141+
def time_delta_to_hours(time_delta: timedelta) -> float:
142142
return time_delta.total_seconds() / 3600
143143

144144

145-
def time_delta_to_shifts(time_delta: timedelta):
145+
def time_delta_to_shifts(time_delta: timedelta) -> float:
146146
return time_delta_to_hours(time_delta) / SHIFT_LENGTH
147147

148148

@@ -365,6 +365,8 @@ def plot_all_machines_in_year(
365365
fig.tight_layout()
366366
if output_path:
367367
fig.savefig(output_path)
368+
369+
return fig
368370

369371

370372

0 commit comments

Comments
 (0)