mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-21 14:23:53 +00:00
black, ruff
This commit is contained in:
@@ -21,6 +21,7 @@ import os
|
||||
from typing import TYPE_CHECKING, Any, Literal, Union, assert_never, get_args
|
||||
|
||||
import bpy
|
||||
import ifcopenshell.util.unit
|
||||
from bpy.props import (
|
||||
BoolProperty,
|
||||
CollectionProperty,
|
||||
@@ -33,8 +34,6 @@ from bpy.props import (
|
||||
)
|
||||
from bpy.types import PropertyGroup
|
||||
|
||||
import ifcopenshell.util.unit
|
||||
|
||||
import bonsai.bim
|
||||
import bonsai.bim.handler
|
||||
import bonsai.tool as tool
|
||||
|
||||
@@ -263,9 +263,7 @@ class TestImportPsetFromExistingWithAGenericNumericValueAndAnExplicitUnit(NewFil
|
||||
length_mm = ifcopenshell.api.unit.add_si_unit(ifc, unit_type="LENGTHUNIT", prefix="MILLI")
|
||||
|
||||
element = ifc.createIfcWall()
|
||||
prop = ifc.createIfcPropertySingleValue(
|
||||
Name="Foo", NominalValue=ifc.createIfcReal(150.0), Unit=length_mm
|
||||
)
|
||||
prop = ifc.createIfcPropertySingleValue(Name="Foo", NominalValue=ifc.createIfcReal(150.0), Unit=length_mm)
|
||||
metadata = import_single_property(ifc, element, prop)
|
||||
|
||||
assert metadata.special_type == "LENGTH"
|
||||
@@ -291,9 +289,7 @@ class TestImportPsetFromExistingWithAStrayUnitOnANonMeasureProperty(NewFile):
|
||||
length_m = ifcopenshell.api.unit.add_si_unit(ifc, unit_type="LENGTHUNIT")
|
||||
|
||||
element = ifc.createIfcWall()
|
||||
prop = ifc.createIfcPropertySingleValue(
|
||||
Name="Foo", NominalValue=ifc.createIfcLabel("Bar"), Unit=length_m
|
||||
)
|
||||
prop = ifc.createIfcPropertySingleValue(Name="Foo", NominalValue=ifc.createIfcLabel("Bar"), Unit=length_m)
|
||||
metadata = import_single_property(ifc, element, prop) # must not raise
|
||||
|
||||
assert metadata.special_type == ""
|
||||
|
||||
@@ -69,9 +69,7 @@ class TestEditingAnOverriddenUnitPropertyRoundTrips(NewFile):
|
||||
|
||||
element = ifc.createIfcWall()
|
||||
pset = ifcopenshell.api.pset.add_pset(ifc, product=element, name="Pset_Test")
|
||||
prop = ifc.createIfcPropertySingleValue(
|
||||
Name="Foo", NominalValue=ifc.createIfcLengthMeasure(2.5), Unit=length_m
|
||||
)
|
||||
prop = ifc.createIfcPropertySingleValue(Name="Foo", NominalValue=ifc.createIfcLengthMeasure(2.5), Unit=length_m)
|
||||
pset.HasProperties = [prop]
|
||||
|
||||
obj = bpy.data.objects.new("Wall", None)
|
||||
@@ -308,9 +306,7 @@ class TestEditPsetWithUnitOverridePicker(NewFile):
|
||||
|
||||
element = ifc.createIfcWall()
|
||||
pset = ifcopenshell.api.pset.add_pset(ifc, product=element, name="Pset_Test")
|
||||
prop = ifc.createIfcPropertySingleValue(
|
||||
Name="Foo", NominalValue=ifc.createIfcLengthMeasure(2.5), Unit=length_m
|
||||
)
|
||||
prop = ifc.createIfcPropertySingleValue(Name="Foo", NominalValue=ifc.createIfcLengthMeasure(2.5), Unit=length_m)
|
||||
pset.HasProperties = [prop]
|
||||
|
||||
obj = bpy.data.objects.new("Wall", None)
|
||||
|
||||
Reference in New Issue
Block a user