From 0a9c9f2a284f03ed87ac6698e567414eb3af65da Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Mon, 15 Apr 2024 11:24:25 +0500 Subject: [PATCH] typing --- .../blenderbim/bim/module/classification/operator.py | 1 + .../ifcopenshell/api/classification/add_classification.py | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/blenderbim/blenderbim/bim/module/classification/operator.py b/src/blenderbim/blenderbim/bim/module/classification/operator.py index 84f2f89599..08020cef76 100644 --- a/src/blenderbim/blenderbim/bim/module/classification/operator.py +++ b/src/blenderbim/blenderbim/bim/module/classification/operator.py @@ -20,6 +20,7 @@ import bpy import json import ifcopenshell import ifcopenshell.api +import ifcopenshell.util.element import blenderbim.tool as tool import blenderbim.bim.helper from blenderbim.bim.ifc import IfcStore diff --git a/src/ifcopenshell-python/ifcopenshell/api/classification/add_classification.py b/src/ifcopenshell-python/ifcopenshell/api/classification/add_classification.py index 0682ab7565..d59a4e9343 100644 --- a/src/ifcopenshell-python/ifcopenshell/api/classification/add_classification.py +++ b/src/ifcopenshell-python/ifcopenshell/api/classification/add_classification.py @@ -19,10 +19,11 @@ import ifcopenshell import ifcopenshell.util.schema import ifcopenshell.util.date +from typing import Union class Usecase: - def __init__(self, file, classification=None): + def __init__(self, file: ifcopenshell.file, classification: Union[str, ifcopenshell.entity_instance]): """Adds a new classification system to the project External classification systems such as Uniclass or Omniclass are @@ -81,7 +82,7 @@ class Usecase: "classification": classification, } - def execute(self): + def execute(self) -> ifcopenshell.entity_instance: if isinstance(self.settings["classification"], str): classification = self.file.createIfcClassification(Name=self.settings["classification"]) self.relate_to_project(classification)