Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: make start_date and end_date applicable to boundaries #612

Merged
merged 1 commit into from
Apr 5, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions powersimdata/scenario/create.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down