Skip to content
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
9 changes: 6 additions & 3 deletions ladybug/epw.py
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,7 @@ def _import_body(self, body_lines):
"""Set all of the EPW data collections by parsing from the body lines."""
# get the number of fields and make an annual analysis period
self._num_of_fields = min(len(body_lines[0].strip().split(',')), 35)
if self.is_leap_year is None:
if not self.is_leap_year:
self._is_leap_year = True if len(body_lines) == 8784 else False
analysis_period = AnalysisPeriod(is_leap_year=self.is_leap_year)

Expand Down Expand Up @@ -1516,8 +1516,11 @@ def approximate_design_day(self, day_type='SummerDesignDay', percentile=0.4):
# get the date as the 21st of the hottest month
date_obj = Date(avg_mon_temp.highest_values(1)[1][0] + 1, 21)
# compute the daily range of temperature from the days of the hottest month
hot_mon_db = self.dry_bulb_temperature.filter_by_analysis_period(
AnalysisPeriod(st_month=date_obj.month, end_month=date_obj.month))
ha_per = AnalysisPeriod(
st_month=date_obj.month, end_month=date_obj.month,
is_leap_year=self.is_leap_year
)
hot_mon_db = self.dry_bulb_temperature.filter_by_analysis_period(ha_per)
temp_ranges = []
for day in hot_mon_db.group_by_day().values():
if day != []:
Expand Down
Loading