From f8799305e171e2d5a88f82f5f88ad404de94a0e7 Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Tue, 13 May 2025 11:45:11 +0500 Subject: [PATCH] black . --- .../alignment/add_stationing_to_alignment.py | 30 ++++++++++--------- .../test_add_stationing_to_alignment.py | 2 +- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/src/ifcopenshell-python/ifcopenshell/api/alignment/add_stationing_to_alignment.py b/src/ifcopenshell-python/ifcopenshell/api/alignment/add_stationing_to_alignment.py index fe99018c45..48e43ec91e 100644 --- a/src/ifcopenshell-python/ifcopenshell/api/alignment/add_stationing_to_alignment.py +++ b/src/ifcopenshell-python/ifcopenshell/api/alignment/add_stationing_to_alignment.py @@ -23,7 +23,9 @@ import ifcopenshell.guid from ifcopenshell import entity_instance -def add_stationing_to_alignment(file: ifcopenshell.file, alignment: entity_instance, start_station: float, plus_seperator=3,accuracy=3) -> None: +def add_stationing_to_alignment( + file: ifcopenshell.file, alignment: entity_instance, start_station: float, plus_seperator=3, accuracy=3 +) -> None: """ Adds stationing to an alignment by creating an IfcReferent with the Pset_Stationing property set to establish the stationing at the start of the alignment. Note - this function assumes the stationing has not been previously defined @@ -45,18 +47,18 @@ def add_stationing_to_alignment(file: ifcopenshell.file, alignment: entity_insta representation = None basis_curve = ifcopenshell.api.alignment.get_basis_curve(alignment) if basis_curve: - object_placement = file.createIfcLinearPlacement( - RelativePlacement=file.createIfcAxis2PlacementLinear( - Location=file.createIfcPointByDistanceExpression( - DistanceAlong=file.createIfcLengthMeasure(0.0), - OffsetLateral=None, - OffsetVertical=None, - OffsetLongitudinal=None, - BasisCurve=basis_curve, - ) - ), - CartesianPosition=None, - ) + object_placement = file.createIfcLinearPlacement( + RelativePlacement=file.createIfcAxis2PlacementLinear( + Location=file.createIfcPointByDistanceExpression( + DistanceAlong=file.createIfcLengthMeasure(0.0), + OffsetLateral=None, + OffsetVertical=None, + OffsetLongitudinal=None, + BasisCurve=basis_curve, + ) + ), + CartesianPosition=None, + ) # representation = file.create_entity( # name="IfcCircle", # position=file.createIfcAxis2Placement2D(Location=file.createIfcCartesianPoint(Coordinates=(0.0, 0.0)), @@ -67,7 +69,7 @@ def add_stationing_to_alignment(file: ifcopenshell.file, alignment: entity_insta start_referent = file.createIfcReferent( GlobalId=ifcopenshell.guid.new(), OwnerHistory=None, - Name=ifcopenshell.util.stationing.station_as_string(start_station,plus_seperator,accuracy), + Name=ifcopenshell.util.stationing.station_as_string(start_station, plus_seperator, accuracy), Description=None, ObjectType=None, ObjectPlacement=object_placement, diff --git a/src/ifcopenshell-python/test/api/alignment/test_add_stationing_to_alignment.py b/src/ifcopenshell-python/test/api/alignment/test_add_stationing_to_alignment.py index cab9a16699..26344871cf 100644 --- a/src/ifcopenshell-python/test/api/alignment/test_add_stationing_to_alignment.py +++ b/src/ifcopenshell-python/test/api/alignment/test_add_stationing_to_alignment.py @@ -55,4 +55,4 @@ def test_add_stationing_to_alignment(): ifcopenshell.util.element.get_pset(element=referent, name="Pset_Stationing", prop="Station") == 2000.0 ) - assert(referent.ObjectPlacement != None) + assert referent.ObjectPlacement != None