From ba90cf220da1747d2e758dcd2f8875193cefa3e2 Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Mon, 17 Aug 2026 19:00:08 +0500 Subject: [PATCH] black, ruff --- pyodide/build-all-pack-wheel-local.py | 1 + src/ifcopenshell-python/ifcopenshell/util/unit.py | 5 ++++- .../test/api/alignment/test_create.py | 4 +++- src/ifctester/ifctester/reporter.py | 12 ++++++------ 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/pyodide/build-all-pack-wheel-local.py b/pyodide/build-all-pack-wheel-local.py index f85268b1fa..fbba91a09d 100755 --- a/pyodide/build-all-pack-wheel-local.py +++ b/pyodide/build-all-pack-wheel-local.py @@ -1,5 +1,6 @@ #!/usr/bin/env python3 """Intended to be run after nix/build-all.py has finished the wasm build.""" + import shutil import subprocess from pathlib import Path diff --git a/src/ifcopenshell-python/ifcopenshell/util/unit.py b/src/ifcopenshell-python/ifcopenshell/util/unit.py index e0c8529b78..d6d10dd23c 100644 --- a/src/ifcopenshell-python/ifcopenshell/util/unit.py +++ b/src/ifcopenshell-python/ifcopenshell/util/unit.py @@ -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) diff --git a/src/ifcopenshell-python/test/api/alignment/test_create.py b/src/ifcopenshell-python/test/api/alignment/test_create.py index 7de461414f..b28a9d9e53 100644 --- a/src/ifcopenshell-python/test/api/alignment/test_create.py +++ b/src/ifcopenshell-python/test/api/alignment/test_create.py @@ -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 diff --git a/src/ifctester/ifctester/reporter.py b/src/ifctester/ifctester/reporter.py index 0777a1bcec..68e528d8d2 100644 --- a/src/ifctester/ifctester/reporter.py +++ b/src/ifctester/ifctester/reporter.py @@ -25,7 +25,8 @@ import os import re import sqlite3 import sys -from typing import Iterable, Iterator, Literal, Optional, TypedDict, Union +from collections.abc import Iterable, Iterator +from typing import Literal, Optional, TypedDict, Union import ifcopenshell import ifcopenshell.util.element @@ -1035,7 +1036,9 @@ class Sqlite(Reporter): total_checks_pass = 0 for requirement in specification.requirements: - total_checks_pass += self.write_requirement(db, specification, specification_id, requirement, requirement_id) + total_checks_pass += self.write_requirement( + db, specification, specification_id, requirement, requirement_id + ) requirement_id += 1 total_applicable = len(specification.applicable_entities) @@ -1072,10 +1075,7 @@ class Sqlite(Reporter): """Write a requirement and its failures. Returns the number of passing checks.""" db.executemany( "INSERT INTO failure VALUES (?, ?, ?)", - ( - (requirement_id, f["element"].id(), self.get_reason_id(f["reason"])) - for f in requirement.failures - ), + ((requirement_id, f["element"].id(), self.get_reason_id(f["reason"])) for f in requirement.failures), ) label, value = get_requirement_label_value(requirement) metadata = requirement.asdict("requirement")