Skip to content

Commit

Permalink
fix(epw): Add an exception for extreme weeks when periods are reversed
Browse files Browse the repository at this point in the history
  • Loading branch information
chriswmackey committed Nov 6, 2024
1 parent a659ce8 commit ca010d4
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions ladybug/epw.py
Original file line number Diff line number Diff line change
Expand Up @@ -816,9 +816,14 @@ def _weeks_check(self, data, week_type):
for val in data.values():
assert isinstance(val, AnalysisPeriod), '{} dictionary must contain' \
' AnalysisPeriod objects. Got {}.'.format(week_type, type(val))
assert len(val.doys_int) == 7, '{} AnalysisPeriod must be for'\
' a week. Got AnalysisPeriod for {} days.'.format(
week_type, type(val))
if val.is_reversed:
assert 7 <= len(val.doys_int) <= 21, '{} AnalysisPeriod must be for'\
' a week. Got AnalysisPeriod for {} days.'.format(
week_type, val.doys_int)
else:
assert len(val.doys_int) == 7, '{} AnalysisPeriod must be for'\
' a week. Got AnalysisPeriod for {} days.'.format(
week_type, val.doys_int)

@property
def header(self):
Expand Down

0 comments on commit ca010d4

Please sign in to comment.