@@ -47,44 +47,57 @@ class DataClass(object):
4747
4848 """
4949
50- def __init__ (self , construction_data : ConstructionData ) -> object :
50+ def __init__ (self ,
51+ construction_data : ConstructionData ,
52+ custom_path_type_elements : str = None ,
53+ custom_path_material_templates : str = None ,
54+ custom_path_use_conditions : str = None ) -> object :
55+
5156 """Construct DataClass."""
5257 self .element_bind = None
53- if construction_data .is_iwu ():
58+ if custom_path_type_elements :
59+ self .path_tb = custom_path_type_elements
60+ elif not custom_path_type_elements and construction_data .is_custom ():
61+ raise KeyError ("Provide path to custom type elements .json file" )
62+ elif construction_data .is_iwu ():
5463 self .path_tb = utils .get_full_path (
5564 "data/input/inputdata/TypeElements_IWU.json"
5665 )
57- self .load_tb_binding ()
5866 elif construction_data .is_tabula_de ():
5967 self .path_tb = utils .get_full_path (
6068 os .path .join (
6169 "data" , "input" , "inputdata" , "TypeElements_TABULA_DE.json"
6270 )
6371 )
64- self .load_tb_binding ()
6572 elif construction_data .is_tabula_dk ():
6673 self .path_tb = utils .get_full_path (
6774 os .path .join (
6875 "data" , "input" , "inputdata" , "TypeElements_TABULA_DK.json"
6976 )
7077 )
71- self .load_tb_binding ()
7278 elif construction_data .is_kfw ():
7379 self .path_tb = utils .get_full_path (
7480 os .path .join (
7581 "data" , "input" , "inputdata" , "TypeElements_KFW.json"
7682 )
7783 )
78- self .load_tb_binding ()
7984 elif construction_data is None :
8085 pass
86+
8187 self .material_bind = None
82- self .path_mat = utils .get_full_path (
83- "data/input/inputdata/MaterialTemplates.json"
84- )
88+ if custom_path_material_templates :
89+ self .path_mat = custom_path_material_templates
90+ else :
91+ self .path_mat = utils .get_full_path (
92+ "data/input/inputdata/MaterialTemplates.json" )
93+
8594 self .conditions_bind = None
86- self .path_uc = utils .get_full_path ("data/input/inputdata/UseConditions.json" )
95+ if custom_path_use_conditions :
96+ self .path_uc = custom_path_use_conditions
97+ else :
98+ self .path_uc = utils .get_full_path ("data/input/inputdata/UseConditions.json" )
8799
100+ self .load_tb_binding ()
88101 self .load_uc_binding ()
89102 self .load_mat_binding ()
90103
0 commit comments