diff --git a/hub/catalog_factories/energy_systems/montreal_custom_catalog.py b/hub/catalog_factories/energy_systems/montreal_custom_catalog.py index 87b9d4ab..0336c940 100644 --- a/hub/catalog_factories/energy_systems/montreal_custom_catalog.py +++ b/hub/catalog_factories/energy_systems/montreal_custom_catalog.py @@ -179,32 +179,32 @@ class MontrealCustomCatalog(Catalog): _names = {'archetypes': [], 'systems': [], 'generation_equipments': [], 'distribution_equipments': [], 'emission_equipments': []} for archetype in self._content.archetypes: - _names['archetypes'].append(archetype.manufacturer) + _names['archetypes'].append(archetype.name) for system in self._content.systems: - _names['systems'].append(system.manufacturer) + _names['systems'].append(system.name) for equipment in self._content.generation_equipments: - _names['generation_equipments'].append(equipment.manufacturer) + _names['generation_equipments'].append(equipment.name) for equipment in self._content.distribution_equipments: - _names['distribution_equipments'].append(equipment.manufacturer) + _names['distribution_equipments'].append(equipment.name) for equipment in self._content.emission_equipments: - _names['emission_equipments'].append(equipment.manufacturer) + _names['emission_equipments'].append(equipment.name) else: _names = {category: []} if category.lower() == 'archetypes': for archetype in self._content.archetypes: - _names[category].append(archetype.manufacturer) + _names[category].append(archetype.name) elif category.lower() == 'systems': for system in self._content.systems: - _names[category].append(system.manufacturer) + _names[category].append(system.name) elif category.lower() == 'generation_equipments': for system in self._content.generation_equipments: - _names[category].append(system.manufacturer) + _names[category].append(system.name) elif category.lower() == 'distribution_equipments': for system in self._content.distribution_equipments: - _names[category].append(system.manufacturer) + _names[category].append(system.name) elif category.lower() == 'emission_equipments': for system in self._content.emission_equipments: - _names[category].append(system.manufacturer) + _names[category].append(system.name) else: raise ValueError(f'Unknown category [{category}]') return _names @@ -234,18 +234,18 @@ class MontrealCustomCatalog(Catalog): :parm: entry name """ for entry in self._content.archetypes: - if entry.manufacturer.lower() == name.lower(): + if entry.name.lower() == name.lower(): return entry for entry in self._content.systems: - if entry.manufacturer.lower() == name.lower(): + if entry.name.lower() == name.lower(): return entry for entry in self._content.generation_equipments: - if entry.manufacturer.lower() == name.lower(): + if entry.name.lower() == name.lower(): return entry for entry in self._content.distribution_equipments: - if entry.manufacturer.lower() == name.lower(): + if entry.name.lower() == name.lower(): return entry for entry in self._content.emission_equipments: - if entry.manufacturer.lower() == name.lower(): + if entry.name.lower() == name.lower(): return entry - raise IndexError(f"{name} doesn't exists in the catalog") + raise IndexError(f"{name} doesn't exists in the catalog") \ No newline at end of file diff --git a/hub/catalog_factories/energy_systems/north_america_energy_system_catalog.py b/hub/catalog_factories/energy_systems/north_america_energy_system_catalog.py index cd84a6b3..543c2e43 100644 --- a/hub/catalog_factories/energy_systems/north_america_energy_system_catalog.py +++ b/hub/catalog_factories/energy_systems/north_america_energy_system_catalog.py @@ -29,7 +29,7 @@ class NorthAmericaEnergySystemCatalog(Catalog): """ def __init__(self, path): - path = str(path / 'Tools4CitiesESMF.xml') + path = str(path / 'north_america_components.xml') with open(path, 'r', encoding='utf-8') as xml: self._archetypes = xmltodict.parse(xml.read(), force_list=['photovoltaicModules']) self._generation_components = self._load_generation_components() diff --git a/hub/data/energy_systems/Tools4CitiesESMF.xml b/hub/data/energy_systems/north_america_components.xml similarity index 80% rename from hub/data/energy_systems/Tools4CitiesESMF.xml rename to hub/data/energy_systems/north_america_components.xml index 0270f61c..b4a9a71a 100644 --- a/hub/data/energy_systems/Tools4CitiesESMF.xml +++ b/hub/data/energy_systems/north_america_components.xml @@ -1,44 +1,50 @@ - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + - + - + + + + + + + + + - - - - - - - + + + - + @@ -64,5 +70,5 @@ - + diff --git a/hub/data/energy_systems/north_america_systems.xml b/hub/data/energy_systems/north_america_systems.xml new file mode 100644 index 00000000..0adcff00 --- /dev/null +++ b/hub/data/energy_systems/north_america_systems.xml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +