@@ -29,6 +29,8 @@ class DataClass(object):
2929 construction_data : ConstructionData
3030 The prefix of this parameter indicates which statistical data about building
3131 elements should be used. Its type is the enum class ConstructionData.
32+ To utilize custom TypeElements via a JSON file via parameter custom_path_type_elements (cf. below)
33+ use ConstructionData.custom.
3234 custom_path_type_elements: str or Path
3335 Custom path to JSON file of TypeElements. Default: None
3436 custom_path_material_templates: str or Path
@@ -64,10 +66,12 @@ def __init__(self,
6466
6567 """Construct DataClass."""
6668 self .element_bind = None
67- if custom_path_type_elements :
68- self .path_tb = custom_path_type_elements
69- elif not custom_path_type_elements and construction_data .is_custom ():
70- raise KeyError ("Provide path to custom type elements .json file" )
69+ if construction_data .is_custom ():
70+ if custom_path_type_elements :
71+ self .path_tb = custom_path_type_elements
72+ elif not custom_path_type_elements :
73+ raise KeyError ("Provide path to custom type elements JSON file "
74+ "or change ConstructionData to a known construction type" )
7175 elif construction_data .is_iwu ():
7276 self .path_tb = utils .get_full_path (
7377 "data/input/inputdata/TypeElements_IWU.json"
@@ -112,7 +116,7 @@ def __init__(self,
112116
113117 def load_tb_binding (self ):
114118 """Load TypeBuildingElement json into binding classes."""
115- if self .path_tb .endswith ("json" ):
119+ if str ( self .path_tb ) .endswith ("json" ):
116120 if os .path .isfile (self .path_tb ):
117121 try :
118122 with open (self .path_tb , "r" ) as f :
@@ -127,7 +131,7 @@ def load_tb_binding(self):
127131
128132 def load_uc_binding (self ):
129133 """Load UseConditions json into binding classes."""
130- if self .path_uc .endswith ("json" ):
134+ if str ( self .path_uc ) .endswith ("json" ):
131135 if os .path .isfile (self .path_uc ):
132136 try :
133137 with open (self .path_uc , "r" ) as f :
@@ -142,7 +146,7 @@ def load_uc_binding(self):
142146
143147 def load_mat_binding (self ):
144148 """Load MaterialTemplates json into binding classes."""
145- if self .path_mat .endswith ("json" ):
149+ if str ( self .path_mat ) .endswith ("json" ):
146150 if os .path .isfile (self .path_mat ):
147151 try :
148152 with open (self .path_mat , "r" ) as f :
0 commit comments