From 67f181071fc73a141b4d1dd07a0be36b290d2179 Mon Sep 17 00:00:00 2001 From: Rob Hallam <0504004h@student.gla.ac.uk> Date: Mon, 12 Aug 2024 11:20:29 +0100 Subject: [PATCH] feat: round duration by DEFAULT_PRECISION associated TODO: make precision configurable --- pipeline/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pipeline/utils.py b/pipeline/utils.py index 914d909..ee4ec19 100644 --- a/pipeline/utils.py +++ b/pipeline/utils.py @@ -181,7 +181,7 @@ class Interval(): self.start += new_start else: self.start = new_start - self.duration = self.end - self.start + self.duration = round((self.end - self.start), self.DEFAUT_PRECISION) def move_end(self, new_end: float | int, relative: bool = False): """Update end time of Interval, keeping start time constant (& so modify duration)""" @@ -189,7 +189,7 @@ class Interval(): self.end += new_end else: self.end = new_end - self.duration = self.end - self.start + self.duration = round((self.end - self.start), self.DEFAUT_PRECISION) def update_duration(self, new_duration: float | int, relative: bool = False): """Update duration of Interval, keeping start time constant (& so modify end time)"""