mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-11 06:18:09 +00:00
type.py - some typing
This commit is contained in:
@@ -19,6 +19,7 @@
|
|||||||
import os
|
import os
|
||||||
import json
|
import json
|
||||||
import ifcopenshell.util.schema
|
import ifcopenshell.util.schema
|
||||||
|
from typing import List
|
||||||
|
|
||||||
cwd = os.path.dirname(os.path.realpath(__file__))
|
cwd = os.path.dirname(os.path.realpath(__file__))
|
||||||
|
|
||||||
@@ -51,11 +52,11 @@ for schema in mapped_schemas:
|
|||||||
type_to_entity_map[schema][element_type] = [e for e in elements if guessed_element in e]
|
type_to_entity_map[schema][element_type] = [e for e in elements if guessed_element in e]
|
||||||
|
|
||||||
|
|
||||||
def get_applicable_types(ifc_class, schema="IFC4"):
|
def get_applicable_types(ifc_class: str, schema="IFC4") -> List[str]:
|
||||||
schema = ifcopenshell.util.schema.get_fallback_schema(schema.upper())
|
schema = ifcopenshell.util.schema.get_fallback_schema(schema.upper())
|
||||||
return entity_to_type_map[schema].get(ifc_class, [])
|
return entity_to_type_map[schema].get(ifc_class, [])
|
||||||
|
|
||||||
|
|
||||||
def get_applicable_entities(ifc_type_class, schema="IFC4"):
|
def get_applicable_entities(ifc_type_class: str, schema="IFC4") -> List[str]:
|
||||||
schema = ifcopenshell.util.schema.get_fallback_schema(schema.upper())
|
schema = ifcopenshell.util.schema.get_fallback_schema(schema.upper())
|
||||||
return type_to_entity_map[schema].get(ifc_type_class, [])
|
return type_to_entity_map[schema].get(ifc_type_class, [])
|
||||||
|
|||||||
Reference in New Issue
Block a user