|
@@ -70,6 +70,16 @@ class TargetTimeAdjuster(Adjuster): |
|
|
""" |
|
|
""" |
|
|
return float(sum([x.interval.duration for x in features])) |
|
|
return float(sum([x.interval.duration for x in features])) |
|
|
|
|
|
|
|
|
|
|
|
def _sort_by_score_time(self, features: list) -> list: |
|
|
|
|
|
"""Sort Features by score (primary) and by time (secondary). |
|
|
|
|
|
|
|
|
|
|
|
Returns a sorted list of Features. |
|
|
|
|
|
|
|
|
|
|
|
Pulled out for unit testing as RDH was having issues with adjust() |
|
|
|
|
|
and wanted to verify sorting was working correctly. |
|
|
|
|
|
""" |
|
|
|
|
|
return sorted(features, key=lambda x: (x.score, x.interval.duration)) |
|
|
|
|
|
|
|
|
def __init__(self, features: list=[], |
|
|
def __init__(self, features: list=[], |
|
|
target_time: int|float=_DEFAULT_TARGET_TIME, |
|
|
target_time: int|float=_DEFAULT_TARGET_TIME, |
|
|
margin: int|float=_DEFAULT_MARGIN, |
|
|
margin: int|float=_DEFAULT_MARGIN, |
|
|