diff --git a/imports/schedules/doe_idf.py b/imports/schedules/doe_idf.py index e5623631..746ab47d 100644 --- a/imports/schedules/doe_idf.py +++ b/imports/schedules/doe_idf.py @@ -26,11 +26,20 @@ class DoeIdf: for _, hour in enumerate(panda_hours): self._hours.append(str(hour).replace('0 days ', '').replace(':00:00', ':00')) self._city = city - self._idf_schedules_path = base_path / 'ASHRAE901_OfficeSmall_STD2019_Buffalo.idf' - with open(self._idf_schedules_path, 'r') as file: - idf = parseidf.parse(file.read()) - self._load_schedule(idf, 'small_office') - self._load_schedule(idf, 'residential') + + path = str(base_path / doe_idf_file) + with open(path) as xml: + self._library = xmltodict.parse(xml.read()) + for archetype in self._library['archetypes']['archetypes']: + self._archetype_keys = {} + for key, value in archetype.items(): + if key[0] == '@': + archetype_keys[key] = value + + self._idf_schedules_path = archetype['idf']['path'] + with open(self._idf_schedules_path, 'r') as file: + idf = parseidf.parse(file.read()) + self._load_schedule(idf, archetype_keys['@building_type']) def _load_schedule(self, idf, building_usage): schedules_day = {}