mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-27 23:39:58 +00:00
black, ruff
This commit is contained in:
@@ -963,7 +963,10 @@ def convert_file_length_units(ifc_file: ifcopenshell.file, target_units: str = "
|
||||
|
||||
unit_assignment = get_unit_assignment(file_patched)
|
||||
# UnitType not available on IfcMonetaryUnit
|
||||
unit_assignment.Units = [new_length, *(u for u in unit_assignment.Units if getattr(u, 'UnitType', None) != new_length.UnitType)]
|
||||
unit_assignment.Units = [
|
||||
new_length,
|
||||
*(u for u in unit_assignment.Units if getattr(u, "UnitType", None) != new_length.UnitType),
|
||||
]
|
||||
if not file_patched.get_total_inverses(old_length):
|
||||
ifcopenshell.util.element.remove_deep2(file_patched, old_length)
|
||||
|
||||
|
||||
@@ -51,11 +51,13 @@ def test_create_stationing_referent_name_includes_alignment_name():
|
||||
referents = [
|
||||
r
|
||||
for r in ifcopenshell.util.element.get_components(alignment)
|
||||
if r.is_a("IfcReferent") and ifcopenshell.util.element.get_pset(r, name="Pset_Stationing", prop="Station") == 4900.0
|
||||
if r.is_a("IfcReferent")
|
||||
and ifcopenshell.util.element.get_pset(r, name="Pset_Stationing", prop="Station") == 4900.0
|
||||
]
|
||||
assert len(referents) == 1
|
||||
assert referents[0].Name == "TestAlignment 49+00.00"
|
||||
|
||||
|
||||
try:
|
||||
ifcopenshell.file(schema="IFC4")
|
||||
IFC4X3_AVAILABLE = True
|
||||
|
||||
Reference in New Issue
Block a user