diff --git a/src/rc_gpfs/utils/core.py b/src/rc_gpfs/utils/core.py index 1409d4f2633ef35b457cd0ad55a55bcc9ede6d65..2596c4cc0a472977dac337842ce5ee1371859b44 100644 --- a/src/rc_gpfs/utils/core.py +++ b/src/rc_gpfs/utils/core.py @@ -70,9 +70,11 @@ def prep_age_distribution( age_breakpoints: int | List[int], time_unit: Literal['D','W'] ) -> Tuple[List[np.datetime64],List[str]]: - if any([b < 0 for b in age_breakpoints]): - raise ValueError("Timestamp cannot be newer than the current date time") - age_breakpoints = list(set(age_breakpoints)) + if not isinstance(age_breakpoints,list): + age_breakpoints = [age_breakpoints] + else: + age_breakpoints = list(set(age_breakpoints)) + age_breakpoints.sort() age_breakpoints = [t for t in age_breakpoints if t > 0]