Skip to content

Commit

Permalink
fix(writer): Ensure that duplicate day schedule ids are impossible
Browse files Browse the repository at this point in the history
  • Loading branch information
chriswmackey committed Jun 24, 2024
1 parent f5a4e11 commit a9abdd4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion honeybee_doe2/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
DOE2_TOLERANCE = 0.03 # current best guess for DOE-2 absolute tolerance in Feet
DOE2_ANGLE_TOL = 1.0 # current best guess for DOE-2 angle tolerance in degrees
FLOOR_LEVEL_TOL = 0.1 # tolerance for grouping Rooms by floor elevations in Feet
GEO_DEC_COUNT = 3 # number of decimal places that all geometry will be rounded
GEO_DEC_COUNT = 4 # number of decimal places that all geometry will be rounded
RECT_WIN_SUBD = 0.5 # subdivision distance to rectangularize windows in Feet
DOE2_INTERIOR_BCS = ('Surface', 'Adiabatic', 'OtherSideTemperature')
MIN_LAYER_THICKNESS = 0.003 # the minimum thickness for a material to be valid in meters
Expand Down
7 changes: 4 additions & 3 deletions honeybee_doe2/writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -776,10 +776,11 @@ def model_to_inp(
# check that day schedules aren't referenced by other model schedules
day_scheds = []
for day in sched.day_schedules:
if day.identifier not in used_day_sched_ids:
sch_doe2_id = clean_doe2_string(day.identifier, RES_CHARS)
if sch_doe2_id not in used_day_sched_ids:
day_scheds.append(day.to_inp(sched.schedule_type_limit))
used_day_sched_ids[day.identifier] = day
elif day != used_day_sched_ids[day.identifier]:
used_day_sched_ids[sch_doe2_id] = day
elif day != used_day_sched_ids[sch_doe2_id]:
new_day = day.duplicate()
new_day.identifier = 'Schedule Day {}'.format(used_day_count)
day_scheds.append(new_day.to_inp(sched.schedule_type_limit))
Expand Down

0 comments on commit a9abdd4

Please sign in to comment.