mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 17:58:20 +00:00
typing
This commit is contained in:
@@ -21,6 +21,7 @@ import json
|
||||
import ifcopenshell
|
||||
import ifcopenshell.util.element
|
||||
import ifcopenshell.util.classification
|
||||
from typing import Union
|
||||
|
||||
|
||||
cwd = os.path.dirname(os.path.realpath(__file__))
|
||||
@@ -31,7 +32,7 @@ with open(os.path.join(cwd, "ifc4_to_brick.json")) as f:
|
||||
ifc4_to_brick_map = json.load(f)
|
||||
|
||||
|
||||
def get_brick_type(element):
|
||||
def get_brick_type(element: ifcopenshell.entity_instance) -> Union[str, None]:
|
||||
references = ifcopenshell.util.classification.get_references(element)
|
||||
for reference in references:
|
||||
system = ifcopenshell.util.classification.get_classification(reference)
|
||||
@@ -61,10 +62,10 @@ def get_brick_type(element):
|
||||
return f"https://brickschema.org/schema/Brick#System"
|
||||
|
||||
|
||||
def get_element_feeds(element):
|
||||
def get_element_feeds(element: ifcopenshell.entity_instance) -> set[ifcopenshell.entity_instance]:
|
||||
current_element = element
|
||||
processed_elements = set()
|
||||
downstream_equipment = set()
|
||||
downstream_equipment: set[ifcopenshell.entity_instance] = set()
|
||||
|
||||
# A queue is a list of branches. A branch is a list of elements in
|
||||
# sequence, each one connecting to another element. An element in a
|
||||
|
||||
Reference in New Issue
Block a user