Fixed activity
This commit is contained in:
parent
e5b29f5a01
commit
b690ffc51c
|
@ -47,7 +47,7 @@ class RealizedActivitySample(ActivitySample):
|
|||
|
||||
def heuristically_realize_samples(
|
||||
samples: list[ActivitySample],
|
||||
default_estimated_duration: datetime.timedelta = DEFAULT_ESTIMATED_DURATION,
|
||||
default_estimated_duration: datetime.timedelta | None = DEFAULT_ESTIMATED_DURATION,
|
||||
) -> Iterator[RealizedActivitySample]:
|
||||
"""Secret sauce.
|
||||
|
||||
|
@ -55,6 +55,9 @@ def heuristically_realize_samples(
|
|||
* No samples overlap.
|
||||
"""
|
||||
|
||||
if default_estimated_duration is None:
|
||||
default_estimated_duration = DEFAULT_ESTIMATED_DURATION
|
||||
|
||||
samples.sort(key=lambda x: x.end_at)
|
||||
|
||||
previous_sample_end = None
|
||||
|
|
Loading…
Reference in New Issue
Block a user