From 182aa3ed010d6e8aa05eeeece9f5927380fca56c Mon Sep 17 00:00:00 2001 From: Totally a booplicate <53382877+Booplicate@users.noreply.github.com> Date: Sun, 4 Jun 2023 14:43:17 +0300 Subject: [PATCH] improve update_existing_properties explicit class check error out on a not supported type better methods names --- .../ifcopenshell/api/pset/edit_pset.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/ifcopenshell-python/ifcopenshell/api/pset/edit_pset.py b/src/ifcopenshell-python/ifcopenshell/api/pset/edit_pset.py index a55d04bc0e..f67faff885 100644 --- a/src/ifcopenshell-python/ifcopenshell/api/pset/edit_pset.py +++ b/src/ifcopenshell-python/ifcopenshell/api/pset/edit_pset.py @@ -203,12 +203,14 @@ class Usecase: continue if prop.is_a("IfcPropertyEnumeratedValue"): - self.update_existing_enum(prop) + self.update_existing_prop_enum(prop) - else: - self.update_existing_property(prop) + elif prop.is_a("IfcPropertySingleValue"): + self.update_existing_prop_single_value(prop) - def update_existing_enum(self, prop): + raise NotImplementedError(f"Updating '{prop.is_a()}' properties is not supported yet") + + def update_existing_prop_enum(self, prop): """ NOTE: Assumes the prop exists """ @@ -243,7 +245,7 @@ class Usecase: prop.Unit = unit del self.settings["properties"][prop.Name] - def update_existing_property(self, prop): + def update_existing_prop_single_value(self, prop): """ NOTE: Assumes the prop exists """