Skip to content

Commit

Permalink
Merge pull request #498 from gemini-hlsw/SCHED-724
Browse files Browse the repository at this point in the history
Fixed time_loss int - datetime.timedelta sum error
  • Loading branch information
stroncod authored Aug 23, 2024
2 parents 3e75719 + 9c094b2 commit b1edc67
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scheduler/core/statscalculator/statscalculator.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,11 @@ def calculate_timeline_stats(timeline: NightlyTimeline,
for e in interruptions:
if isinstance(e, FaultEvent):
time_loss = timeline.timeline[night_idx][site][-1].event.time - e.time
time_losses[StatCalculator._FAULT_KEY] += time_loss
time_losses[StatCalculator._FAULT_KEY] += time_loss.total_seconds() / 60

elif isinstance(e, WeatherClosureEvent):
time_loss = timeline.timeline[night_idx][site][-1].event.time - e.time
time_losses[StatCalculator._WEATHER_KEY] += time_loss
time_losses[StatCalculator._WEATHER_KEY] += time_loss.total_seconds() / 60

for entry in timeline.timeline[night_idx][site]:
# Morning twilight generates no plan.
Expand Down

0 comments on commit b1edc67

Please sign in to comment.