Skip to content

Commit

Permalink
fix(skymatrix): update write to wea
Browse files Browse the repository at this point in the history
The wea class has changed and write doesn't accept the hourly filtering anymore. The filtering should be done in a separate step.
  • Loading branch information
mostaphaRoudsari committed Aug 13, 2020
1 parent a6522a2 commit 2b418e4
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions honeybee_plus/radiance/sky/skymatrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,14 +195,17 @@ def write_wea(self, target_dir, write_hours=False):
write_hours: Write hours in a separate file in folder.
"""
weafilepath = os.path.join(target_dir, '{}.wea'.format(self.name))
return self.wea.write(weafilepath, self.hoys, write_hours)
wea = self.wea.filter_by_hoys(self.hoys)
return wea.write(weafilepath, write_hours)

def to_rad_string(self, working_dir, write_hours=False):
"""Get the radiance command line as a string."""
# check if wea file in available otherwise include the line
outfilepath = os.path.join(working_dir, '{}.smx'.format(self.name))
weafilepath = os.path.join(working_dir, '{}.wea'.format(self.name))
weafilepath = self.wea.write(weafilepath, self.hoys, write_hours)
# filter hours
wea = self.wea.filter_by_hoys(self.hoys)
weafilepath = wea.write(weafilepath, write_hours)
genday = Gendaymtx(wea_file=weafilepath, output_name=outfilepath)
genday.gendaymtx_parameters = self._sky_matrixParameters
genday.gendaymtx_parameters.output_type = self.sky_type
Expand Down

0 comments on commit 2b418e4

Please sign in to comment.