Material psets now include category-specific psets and docstrings

Previously it was not possible to get concrete / steel material psets. Yikes!
This commit is contained in:
Dion Moult
2024-05-26 11:23:08 +10:00
parent b9b0e81d25
commit 9a59b8cdae
4 changed files with 38 additions and 17 deletions
@@ -103,7 +103,8 @@ class PsetQto:
matched_type = match.group(3)
if matched_type and not predefined_type:
continue
elif matched_type and predefined_type != match.group(3):
# Case insensitive to handle things like material categories
elif matched_type and predefined_type.lower() != match.group(3).lower():
continue
applicable_class = match.group(1)
@@ -60,3 +60,9 @@ class TestPsetQto:
names = self.pset_qto.get_applicable_names("IfcFurnitureType" )
names2 = self.pset_qto.get_applicable_names("IfcFurnitureType", "CUSTOM")
assert names == names2
def test_getting_applicables_for_a_material_category(self):
names = self.pset_qto.get_applicable_names("IfcMaterial")
assert "Pset_MaterialConcrete" not in names
names = self.pset_qto.get_applicable_names("IfcMaterial", "concrete")
assert "Pset_MaterialConcrete" in names