From 9469a717f094f742af4ce5a2f0c613c9b011fb93 Mon Sep 17 00:00:00 2001 From: BainanXia Date: Tue, 5 Apr 2022 13:06:37 -0500 Subject: [PATCH] fix: make start_date and end_date applicable to boundaries --- powersimdata/scenario/create.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/powersimdata/scenario/create.py b/powersimdata/scenario/create.py index 5b39e5f37..5f9e320ad 100644 --- a/powersimdata/scenario/create.py +++ b/powersimdata/scenario/create.py @@ -304,9 +304,9 @@ def set_time(self, start_date, end_date, interval): hours = (end_ts - start_ts) / np.timedelta64(1, "h") + 1 if start_ts > end_ts: raise ValueError("start_date > end_date") - elif start_ts < min_ts or start_ts >= max_ts: + elif start_ts < min_ts or start_ts > max_ts: raise ValueError("start_date not in [%s,%s[" % (min_ts, max_ts)) - elif end_ts <= min_ts or end_ts > max_ts: + elif end_ts < min_ts or end_ts > max_ts: raise ValueError("end_date not in ]%s,%s]" % (min_ts, max_ts)) elif hours % int(interval.split("H", 1)[0]) != 0: raise ValueError("Incorrect interval for start and end dates")