Skip to content

Commit

Permalink
fix: made spammy debug print statement into debug log
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikBjare committed Jun 25, 2024
1 parent fb2fa45 commit 680f240
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions aw_research/util.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import logging
from datetime import (
datetime,
time,
Expand All @@ -9,6 +10,8 @@
import pandas as pd
from aw_core import Event

logger = logging.getLogger(__name__)


def split_event_on_time(event: Event, timestamp: datetime) -> Tuple[Event, Event]:
event1 = Event(**event)
Expand Down Expand Up @@ -153,17 +156,17 @@ def compute_total_overlap(events: List[Event]) -> Tuple[int, timedelta]:
overlap_end = min(e1.timestamp + e1.duration, e2.timestamp + e2.duration)
total_overlap += overlap_end - overlap_start
j += 1
print("j+")
logger.debug("j+")
else:
if j - i > 1:
# if j isn't directly ahead of i, we can skip ahead
i += 1
print("i+")
logger.debug("i+")
else:
# if j is directly ahead of i, we can step both forward
i += 1
j += 1
print("i=j+")
logger.debug("i=j+")
return n_overlaps, total_overlap


Expand Down

0 comments on commit 680f240

Please sign in to comment.