mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-22 10:18:35 +00:00
black, ruff
This commit is contained in:
@@ -18,7 +18,6 @@
|
|||||||
|
|
||||||
import ifcopenshell
|
import ifcopenshell
|
||||||
import ifcopenshell.api.aggregate
|
import ifcopenshell.api.aggregate
|
||||||
import ifcopenshell.api.alignment
|
|
||||||
import ifcopenshell.api.nest
|
import ifcopenshell.api.nest
|
||||||
from ifcopenshell import entity_instance
|
from ifcopenshell import entity_instance
|
||||||
from ifcopenshell.api.alignment._add_zero_length_segment import _add_zero_length_segment
|
from ifcopenshell.api.alignment._add_zero_length_segment import _add_zero_length_segment
|
||||||
|
|||||||
@@ -25,9 +25,7 @@ import ifcopenshell.util.alignment
|
|||||||
from ifcopenshell import entity_instance
|
from ifcopenshell import entity_instance
|
||||||
|
|
||||||
|
|
||||||
def create_from_csv(
|
def create_from_csv(file: ifcopenshell.file, filepath: str, start_station: Optional[float] = None) -> entity_instance:
|
||||||
file: ifcopenshell.file, filepath: str, start_station: Optional[float] = None
|
|
||||||
) -> entity_instance:
|
|
||||||
"""
|
"""
|
||||||
Creates an alignment from PI data stored in a CSV file.
|
Creates an alignment from PI data stored in a CSV file.
|
||||||
|
|
||||||
|
|||||||
@@ -134,7 +134,8 @@ def test_add_stationing_referent_has_increasing_station():
|
|||||||
file, "1+00.000", alignment, distance_along=0.0, station=100.0
|
file, "1+00.000", alignment, distance_along=0.0, station=100.0
|
||||||
)
|
)
|
||||||
assert (
|
assert (
|
||||||
ifcopenshell.util.element.get_pset(default_referent, name="Pset_Stationing", prop="HasIncreasingStation") is None
|
ifcopenshell.util.element.get_pset(default_referent, name="Pset_Stationing", prop="HasIncreasingStation")
|
||||||
|
is None
|
||||||
)
|
)
|
||||||
|
|
||||||
# explicit False (reverse stationing) is written
|
# explicit False (reverse stationing) is written
|
||||||
@@ -142,7 +143,8 @@ def test_add_stationing_referent_has_increasing_station():
|
|||||||
file, "R", alignment, distance_along=0.0, station=100.0, has_increasing_station=False
|
file, "R", alignment, distance_along=0.0, station=100.0, has_increasing_station=False
|
||||||
)
|
)
|
||||||
assert (
|
assert (
|
||||||
ifcopenshell.util.element.get_pset(reverse_referent, name="Pset_Stationing", prop="HasIncreasingStation") is False
|
ifcopenshell.util.element.get_pset(reverse_referent, name="Pset_Stationing", prop="HasIncreasingStation")
|
||||||
|
is False
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,6 @@ import ifcopenshell.api.alignment
|
|||||||
import ifcopenshell.api.context
|
import ifcopenshell.api.context
|
||||||
import ifcopenshell.api.unit
|
import ifcopenshell.api.unit
|
||||||
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
ifcopenshell.file(schema="IFC4")
|
ifcopenshell.file(schema="IFC4")
|
||||||
IFC4X3_AVAILABLE = True
|
IFC4X3_AVAILABLE = True
|
||||||
@@ -56,9 +55,7 @@ def test_create():
|
|||||||
|
|
||||||
# create() does not define stationing - the alignment has no referent nest at all
|
# create() does not define stationing - the alignment has no referent nest at all
|
||||||
assert ifcopenshell.api.alignment.get_stationing_nest(file, ali) is None
|
assert ifcopenshell.api.alignment.get_stationing_nest(file, ali) is None
|
||||||
assert not any(
|
assert not any(related.is_a("IfcReferent") for nest in ali.IsNestedBy for related in nest.RelatedObjects)
|
||||||
related.is_a("IfcReferent") for nest in ali.IsNestedBy for related in nest.RelatedObjects
|
|
||||||
)
|
|
||||||
|
|
||||||
# verify the geometric representation was created
|
# verify the geometric representation was created
|
||||||
curve = ifcopenshell.api.alignment.get_curve(ali)
|
curve = ifcopenshell.api.alignment.get_curve(ali)
|
||||||
|
|||||||
Reference in New Issue
Block a user