forked from s_ranjbar/city_retrofit
fixing pv problem
This commit is contained in:
parent
e91e61741e
commit
32a40f17a6
|
@ -20,6 +20,7 @@ from hub.catalog_factories.data_models.energy_systems.performance_curves import
|
|||
from hub.catalog_factories.data_models.energy_systems.archetype import Archetype
|
||||
from hub.catalog_factories.data_models.construction.material import Material
|
||||
from hub.catalog_factories.data_models.construction.layer import Layer
|
||||
import hub.helpers.constants as cte
|
||||
|
||||
|
||||
class NorthAmericaEnergySystemCatalog(Catalog):
|
||||
|
@ -30,13 +31,13 @@ class NorthAmericaEnergySystemCatalog(Catalog):
|
|||
def __init__(self, path):
|
||||
path = str(path / 'Tools4CitiesESMF.xml')
|
||||
with open(path, 'r', encoding='utf-8') as xml:
|
||||
self._archetypes = xmltodict.parse(xml.read())
|
||||
self._systems = self._load_systems()
|
||||
print(self._load_systems())
|
||||
self._archetypes = xmltodict.parse(xml.read(), force_list=['boilers', 'photovoltaicModules'])
|
||||
self._generation_components = self._load_generation_components()
|
||||
print(self._generation_components)
|
||||
self._storage_components = self._load_storage_components()
|
||||
print(self._storage_components)
|
||||
self._systems = self._load_systems()
|
||||
print(self._load_systems())
|
||||
|
||||
# self._system_archetypes = self._load_system_archetypes()
|
||||
|
||||
|
@ -47,19 +48,27 @@ class NorthAmericaEnergySystemCatalog(Catalog):
|
|||
# None,
|
||||
# None,
|
||||
# self._storage_components)
|
||||
def _load_systems(self):
|
||||
system_configurations = []
|
||||
configurations = self._archetypes['encomp:EnergySystemCatalog']['energysystemconfiguration']
|
||||
for configuration in configurations:
|
||||
system_configurations.append(configuration['@configurationName'])
|
||||
return system_configurations
|
||||
# def _load_systems(self):
|
||||
# systems = []
|
||||
# catalog_systems = self._archetypes['encomp:EnergySystemCatalog']['energysystemconfiguration']
|
||||
# for catalog_system in catalog_systems:
|
||||
# look for the demands and add it to demands[]
|
||||
# look for the components in self._generation_systems and add them to generation_systems[]
|
||||
# same with emission and distribution and storage
|
||||
# System(None,
|
||||
# None,
|
||||
# catalog_system['@configurationName'],
|
||||
# demands,
|
||||
# generation_systems,...
|
||||
# )
|
||||
|
||||
# return system_configurations
|
||||
|
||||
def _load_generation_components(self):
|
||||
generation_components = []
|
||||
boilers = self._archetypes['encomp:EnergySystemCatalog']['energycomponent']['boilers']
|
||||
heat_pumps = self._archetypes['encomp:EnergySystemCatalog']['energycomponent']['heatPumps']
|
||||
photovoltaics = self._archetypes['encomp:EnergySystemCatalog']['energycomponent']['photovoltaicModules']
|
||||
print(photovoltaics.keys())
|
||||
for boiler in boilers:
|
||||
boiler_model_name = boiler['@modelName']
|
||||
boiler_manufacturer = boiler['@manufacturer']
|
||||
|
|
|
@ -39,7 +39,15 @@
|
|||
<materials name="Polyurethane" thermalConductivity="0.028"/>
|
||||
<materials name="Steel" thermalConductivity="18.0"/>
|
||||
</energycomponent>
|
||||
<energysystemconfiguration configurationName="PvHpBoiler"/>
|
||||
<energysystemconfiguration configurationName="PvHpBoiler">
|
||||
<demands type="Heating"/>
|
||||
<demands type="Domestic Hot Water"/>
|
||||
<demands type="Electricity"/>
|
||||
<components Name="VirtualBoiler"/>
|
||||
<components Name="VirtualPV"/>
|
||||
<components Name="VirtualHPair"/>
|
||||
</energysystemconfiguration>
|
||||
|
||||
<energysystemconfiguration configurationName="hpTesBoiler"/>
|
||||
<energysystemconfiguration configurationName="hpTes"/>
|
||||
</encomp:EnergySystemCatalog>
|
||||
|
|
|
@ -17,8 +17,7 @@ class GeometryFactory:
|
|||
GeometryFactory class
|
||||
"""
|
||||
def __init__(self, file_type,
|
||||
path=None,
|
||||
data_frame=None,
|
||||
path,
|
||||
aliases_field=None,
|
||||
height_field=None,
|
||||
year_of_construction_field=None,
|
||||
|
@ -27,7 +26,6 @@ class GeometryFactory:
|
|||
self._file_type = '_' + file_type.lower()
|
||||
validate_import_export_type(GeometryFactory, file_type)
|
||||
self._path = path
|
||||
self._data_frame = data_frame
|
||||
self._aliases_field = aliases_field
|
||||
self._height_field = height_field
|
||||
self._year_of_construction_field = year_of_construction_field
|
||||
|
|
Loading…
Reference in New Issue
Block a user