Skip to content

Commit 02fa5a5

Browse files
committed
update
1 parent 8045c57 commit 02fa5a5

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

teaser/data/dataclass.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -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 a custom TypeElements 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"

teaser/data/utilities.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ class ConstructionData(Enum):
9191
kfw_70 = "kfw_70"
9292
kfw_85 = "kfw_85"
9393
kfw_100 = "kfw_100"
94-
custom = "Custom"
94+
custom = "custom"
9595

9696
def get_prefix(self):
9797
parts = self.value.split("_", 2)
@@ -114,8 +114,7 @@ def is_kfw(self):
114114
return self.get_prefix() == "kfw"
115115

116116
def is_custom(self):
117-
if not any(s in self.value for s in ["iwu", "tabula_de", "tabula_dk", "kfw"]):
118-
return "custom" in self.value
117+
return self.value == "custom"
119118

120119
# Dictionary that maps GeometryData enumeration values to their corresponding building classes.
121120
geometries = {

0 commit comments

Comments
 (0)