MCPcopy Create free account
hub / github.com/IfcOpenShell/IfcOpenShell / get_extensions_attributes

Function get_extensions_attributes

src/bcf/bcf/agnostic/extensions.py:17–29  ·  view source on GitHub ↗

Return mapping of xsd attribute name to a tuple that consists of: - Extensions attribute name - Extensions attribute type type - subattribute name

(extensions: Extensions)

Source from the content-addressed store, hash-verified

15
16
17def get_extensions_attributes(extensions: Extensions) -> dict[str, AttributeData]:
18 """Return mapping of xsd attribute name to a tuple that consists of:
19 - Extensions attribute name
20 - Extensions attribute type type
21 - subattribute name"""
22 possible_attributes = {}
23 for field in fields(type(extensions)):
24 field_type = field.type.__args__[0] # pyright: ignore [reportAttributeAccessIssue]
25 subfield = next(iter(fields(field_type)))
26 xsd_name = subfield.metadata["name"]
27 possible_attributes[field.name] = AttributeData(field_type, subfield.name, xsd_name)
28
29 return possible_attributes

Callers 1

get_extensions_itemsFunction · 0.90

Calls 2

AttributeDataClass · 0.85
typeFunction · 0.50

Tested by

no test coverage detected