Fix Ruff UP035 (also deprecated annotation symbols)

This commit is contained in:
Andrej
2025-06-09 10:21:22 +05:00
parent 7d4176d105
commit 02d359d0e6
96 changed files with 140 additions and 134 deletions
-1
View File
@@ -76,7 +76,6 @@ ignore = [
"UP030", # implicit references for positional format fields
"UP031", # Replace % with .format
"UP032", # Replace .format with f-string
"UP035", # List -> list
# Deprecated Ruff rules.
"UP038", # Use X | Y in isinstance
+2 -1
View File
@@ -1,6 +1,7 @@
import uuid
import zipfile
from typing import Any, Iterable, Optional, Literal, Union
from typing import Any, Optional, Literal, Union
from collections.abc import Iterable
import numpy as np
from ifcopenshell import entity_instance
+2 -1
View File
@@ -1,6 +1,7 @@
import uuid
import zipfile
from typing import Any, Iterable, Optional, Literal, Union
from typing import Any, Optional, Literal, Union
from collections.abc import Iterable
import numpy as np
from ifcopenshell import entity_instance
+2 -1
View File
@@ -40,7 +40,8 @@ import uuid
import shutil
from collections import deque
from pathlib import Path
from typing import Union, Any, Generator
from typing import Union, Any
from collections.abc import Generator
last_commit_hash = "8888888"
+2 -1
View File
@@ -22,7 +22,8 @@ import bpy.utils.previews
import importlib
from bpy_extras.io_utils import ImportHelper, ExportHelper
from . import handler, ui, prop, operator
from typing import Callable, Union
from typing import Union
from collections.abc import Callable
try:
from bonsai.translations import translations_dict
+2 -1
View File
@@ -33,7 +33,8 @@ from bonsai.bim.module.model.decorator import WallAxisDecorator, SlabDirectionDe
from bonsai.bim.module.nest.decorator import NestDecorator
from mathutils import Vector
from math import cos
from typing import Union, Callable
from typing import Union
from collections.abc import Callable
cwd = os.path.dirname(os.path.realpath(__file__))
+2 -1
View File
@@ -27,7 +27,8 @@ import ifcopenshell.util.element
import ifcopenshell.util.unit
from ifcopenshell.util.doc import get_attribute_doc, get_predefined_type_doc, get_property_doc
import bonsai.tool as tool
from typing import Optional, Callable, Any, Union, Iterable, TYPE_CHECKING
from typing import Optional, Any, Union, TYPE_CHECKING
from collections.abc import Callable, Iterable
if TYPE_CHECKING:
import bonsai.bim.prop
+2 -1
View File
@@ -34,7 +34,8 @@ import bonsai.tool as tool
from ifcopenshell.file import UndoSystemError
from pathlib import Path
from bonsai.tool.brick import BrickStore
from typing import Union, Optional, TypedDict, Callable, NotRequired, Literal
from typing import Union, Optional, TypedDict, NotRequired, Literal
from collections.abc import Callable
IFC_CONNECTED_TYPE = Union[bpy.types.Material, bpy.types.Object]
+2 -1
View File
@@ -38,7 +38,8 @@ import ifcopenshell.util.shape
import bonsai.tool as tool
from bonsai.bim.ifc import IfcStore, IFC_CONNECTED_TYPE
from bonsai.tool.loader import OBJECT_DATA_TYPE
from typing import Union, Optional, Any, Literal, Iterable
from typing import Union, Optional, Any, Literal
from collections.abc import Iterable
from ifcopenshell.util.shape import MatrixType
@@ -38,8 +38,6 @@ import ifcopenshell.util.selector
from datetime import datetime
from dateutil import parser, relativedelta
from bpy_extras.io_utils import ImportHelper
from typing import get_args, TYPE_CHECKING
from typing_extensions import assert_never
class ImportAlignmentCSV(bpy.types.Operator, tool.Ifc.Operator, ImportHelper):
-3
View File
@@ -31,9 +31,6 @@ from bpy.props import (
FloatVectorProperty,
CollectionProperty,
)
from functools import partial
from typing import Literal
from typing_extensions import assert_never
from bcf.agnostic.extensions import get_extensions_attributes
from typing import TYPE_CHECKING, Union
+1 -2
View File
@@ -22,8 +22,7 @@ import bonsai.tool as tool
import bonsai.bim.helper
from bpy.types import Panel
from bonsai.bim.module.clash.data import ClashData
from typing import TYPE_CHECKING
from typing_extensions import assert_never
from typing import TYPE_CHECKING, assert_never
if TYPE_CHECKING:
from bonsai.bim.module.clash.prop import BIMClashProperties, ClashSet, SmartClashGroup, Clash
@@ -38,7 +38,8 @@ from bonsai.bim.module.drawing.shaders import add_verts_sequence, add_offsets
from bonsai.bim.module.drawing.helper import format_distance
from timeit import default_timer as timer
from functools import cache
from typing import Optional, Iterator, Union
from typing import Optional, Union
from collections.abc import Iterator
UNSPECIAL_ELEMENT_COLOR = (0.2, 0.2, 0.2, 1) # GREY
+2 -1
View File
@@ -46,7 +46,8 @@ from bpy.props import (
CollectionProperty,
BoolVectorProperty,
)
from typing import TYPE_CHECKING, Literal, Any, Callable, get_args, Union
from typing import TYPE_CHECKING, Literal, Any, get_args, Union
from collections.abc import Callable
diagram_scales_enum = []
@@ -38,7 +38,8 @@ from bonsai.bim.module.drawing.data import DrawingsData
from bonsai.bim.module.drawing.data import DecoratorData
from math import pi, ceil, atan, degrees, acos
from mathutils import geometry, Vector
from typing import Optional, Self, Union, Sequence, Callable
from typing import Optional, Self, Union
from collections.abc import Callable, Sequence
from pathlib import Path
@@ -27,7 +27,7 @@ from bpy.types import SpaceView3D
from mathutils import Vector, Matrix
from gpu_extras.batch import batch_for_shader
from bpy_extras.view3d_utils import location_3d_to_region_2d
from typing import Sequence
from collections.abc import Sequence
class ItemDecorator:
@@ -28,7 +28,8 @@ from datetime import datetime
import bpy
import bonsai.tool as tool
from pathlib import Path
from typing import Union, Optional, Sequence
from typing import Union, Optional
from collections.abc import Sequence
import json
import math
import time
@@ -27,8 +27,7 @@ import bonsai.core.misc as core
import bonsai.core.geometry as core_geometry
import bonsai.core.root
from mathutils import Vector, Matrix, Euler
from typing import TYPE_CHECKING, Literal, get_args
from typing_extensions import assert_never
from typing import TYPE_CHECKING, Literal, get_args, assert_never
class SetOverrideColour(bpy.types.Operator):
@@ -45,7 +45,8 @@ from bpy.types import SpaceView3D
from bpy.props import FloatProperty
from bpy_extras.object_utils import AddObjectHelper, object_data_add
from gpu_extras.batch import batch_for_shader
from typing import Union, Optional, Any, cast, Sequence
from typing import Union, Optional, Any, cast
from collections.abc import Sequence
class FilledOpeningGenerator:
+2 -2
View File
@@ -35,8 +35,8 @@ from bpy.props import (
IntProperty,
StringProperty,
)
from typing import TYPE_CHECKING, Literal, Union, get_args, Generator
from typing_extensions import assert_never
from typing import TYPE_CHECKING, Literal, Union, get_args, assert_never
from collections.abc import Generator
def get_export_schema(self: "BIMProjectProperties", context: bpy.types.Context) -> list[tuple[str, str, str]]:
+1 -2
View File
@@ -35,8 +35,7 @@ from bonsai.bim.module.pset.data import (
WorkSchedulePsetsData,
)
from bonsai.bim.module.material.data import ObjectMaterialData
from typing import Any, Optional, TYPE_CHECKING
from typing_extensions import assert_never
from typing import Any, Optional, TYPE_CHECKING, assert_never
if TYPE_CHECKING:
from bonsai.bim.module.pset.prop import IfcProperty, PsetProperties
@@ -29,8 +29,7 @@ from mathutils import Vector, Matrix
from mathutils.bvhtree import BVHTree
from shapely.geometry import Polygon
from shapely.ops import unary_union
from typing import Literal, Union, Optional
from typing_extensions import assert_never
from typing import Literal, Union, Optional, assert_never
AxisType = Literal["x", "y", "z"]
+1 -1
View File
@@ -19,7 +19,7 @@
import bpy
import bmesh
import bonsai.tool as tool
from typing import Callable
from collections.abc import Callable
def calculate_height(obj: bpy.types.Object) -> float:
@@ -39,8 +39,7 @@ from bpy.props import (
FloatVectorProperty,
CollectionProperty,
)
from typing import TYPE_CHECKING, Literal, get_args
from typing_extensions import assert_never
from typing import TYPE_CHECKING, Literal, get_args, assert_never
class AddFilterGroup(Operator):
@@ -33,8 +33,7 @@ import ifcopenshell.util.selector
from datetime import datetime
from dateutil import parser, relativedelta
from bpy_extras.io_utils import ImportHelper, ExportHelper
from typing import get_args, TYPE_CHECKING
from typing_extensions import assert_never
from typing import get_args, TYPE_CHECKING, assert_never
class EnableStatusFilters(bpy.types.Operator):
@@ -24,7 +24,8 @@ import blf
import bonsai.tool as tool
from bpy.types import SpaceView3D
from gpu_extras.batch import batch_for_shader
from typing import Iterable, Union
from typing import Union
from collections.abc import Iterable
from bonsai.bim.module.structural.load_decoration_data import ShaderInfo
@@ -28,7 +28,8 @@ import ifcopenshell.util.unit
import ifcopenshell.util.unit as ifcunit
import bonsai.tool as tool
from bonsai.bim.module.structural.shader import DecorationShader
from typing import Literal, TypedDict, Iterable
from typing import Literal, TypedDict
from collections.abc import Iterable
class MemberInfo(TypedDict):
+2 -1
View File
@@ -19,7 +19,8 @@
import bpy
import ifcopenshell
import bonsai.tool as tool
from typing import Any, Generator, Union
from typing import Any, Union
from collections.abc import Generator
def refresh():
+2 -1
View File
@@ -42,7 +42,8 @@ from mathutils import Vector, Euler
from math import radians
from pathlib import Path
from collections import namedtuple
from typing import Iterable, Union, TYPE_CHECKING
from typing import Union, TYPE_CHECKING
from collections.abc import Iterable
if TYPE_CHECKING:
from bonsai.bim.prop import MultipleFileSelect
+1 -2
View File
@@ -45,8 +45,7 @@ from bpy.props import (
FloatVectorProperty,
CollectionProperty,
)
from typing import Any, Union, Literal, get_args, TYPE_CHECKING
from typing_extensions import assert_never
from typing import Any, Union, Literal, get_args, TYPE_CHECKING, assert_never
cwd = os.path.dirname(os.path.realpath(__file__))
+2 -1
View File
@@ -17,7 +17,8 @@
# along with Bonsai. If not, see <http://www.gnu.org/licenses/>.
from __future__ import annotations
from typing import TYPE_CHECKING, Optional, Sequence, Union
from typing import TYPE_CHECKING, Optional, Union
from collections.abc import Sequence
if TYPE_CHECKING:
import bpy
+1 -1
View File
@@ -17,7 +17,7 @@
# along with Bonsai. If not, see <http://www.gnu.org/licenses/>.
from __future__ import annotations
from typing import TYPE_CHECKING, Optional, Literal, Iterable
from typing import TYPE_CHECKING, Optional, Literal
if TYPE_CHECKING:
import bpy
+2 -1
View File
@@ -19,7 +19,8 @@
# ############################################################################ #
from __future__ import annotations
from typing import TYPE_CHECKING, Optional, Union, Iterable
from typing import TYPE_CHECKING, Optional
from collections.abc import Iterable
if TYPE_CHECKING:
import bpy
+10 -2
View File
@@ -42,8 +42,16 @@ from mathutils import Vector
from pathlib import Path
from functools import lru_cache, cache
from bonsai.bim.ifc import IFC_CONNECTED_TYPE
from typing import Any, Optional, Union, Literal, Iterable, Callable, TypeVar, Generator, TYPE_CHECKING, Sequence, Sized
from typing_extensions import assert_never
from typing import (
Any,
Optional,
Union,
Literal,
TypeVar,
TYPE_CHECKING,
assert_never,
)
from collections.abc import Iterable, Callable, Generator, Sequence, Sized
if TYPE_CHECKING:
import bpy.stub_internal.rna_enums as rna_enums
+2 -1
View File
@@ -22,7 +22,8 @@ import mathutils
import bonsai.core.tool
import bonsai.tool as tool
from mathutils import Matrix, Vector
from typing import Any, Sequence, TYPE_CHECKING
from typing import Any, TYPE_CHECKING
from collections.abc import Sequence
if TYPE_CHECKING:
from bonsai.bim.module.boundary.prop import BIMBoundaryProperties, BIMObjectBoundaryProperties
+2 -1
View File
@@ -30,7 +30,8 @@ import bonsai.core.tool
import bonsai.tool as tool
from pathlib import Path
from contextlib import contextmanager
from typing import Generator, Any, Union, TYPE_CHECKING
from typing import Any, Union, TYPE_CHECKING
from collections.abc import Generator
try:
import brickschema
+1 -2
View File
@@ -22,8 +22,7 @@ import ifcopenshell.api
import ifcopenshell.util.classification
import bonsai.core.tool
import bonsai.tool as tool
from typing import Any, Optional, Union, Literal, Iterable, Callable
from typing_extensions import assert_never
from typing import Union, assert_never
class Classification(bonsai.core.tool.Classification):
+2 -2
View File
@@ -28,8 +28,8 @@ import ifcopenshell.util.unit
import bonsai.bim.helper
import json
from pathlib import Path
from typing import Optional, Any, Generator, Union, Literal, TYPE_CHECKING
from typing_extensions import assert_never
from typing import Optional, Any, Union, Literal, TYPE_CHECKING, assert_never
from collections.abc import Generator
if TYPE_CHECKING:
from bonsai.bim.module.cost.prop import BIMCostProperties, CostItemQuantity
+2 -1
View File
@@ -31,7 +31,8 @@ import bonsai.tool as tool
from bonsai.bim.ifc import IfcStore
from mathutils import Vector
from collections import defaultdict
from typing import Iterable, Literal, TYPE_CHECKING
from typing import Literal, TYPE_CHECKING
from collections.abc import Iterable
if TYPE_CHECKING:
from bonsai.bim.module.debug.prop import BIMDebugProperties
+2 -1
View File
@@ -51,7 +51,8 @@ from shapely.ops import unary_union
from lxml import etree
from mathutils import Vector, Matrix
from fractions import Fraction
from typing import Optional, Union, Iterable, Any, Literal, Sequence, TYPE_CHECKING, NamedTuple, get_args
from typing import Optional, Union, Any, Literal, TYPE_CHECKING, NamedTuple
from collections.abc import Iterable, Sequence
from pathlib import Path
if TYPE_CHECKING:
+2 -1
View File
@@ -24,7 +24,8 @@ import bonsai.bim.helper
import bonsai.core.geometry
import ifcopenshell
import ifcopenshell.util.representation
from typing import Iterable, TYPE_CHECKING
from typing import TYPE_CHECKING
from collections.abc import Iterable
if TYPE_CHECKING:
from bonsai.bim.module.void.prop import BIMBooleanProperties
+1 -3
View File
@@ -59,17 +59,15 @@ from mathutils.bvhtree import BVHTree
from bonsai.bim.ifc import IfcStore
from typing import (
Union,
Iterable,
Optional,
Literal,
Iterator,
TYPE_CHECKING,
get_args,
Generator,
cast,
TypeGuard,
Any,
)
from collections.abc import Iterable, Iterator, Generator
from typing_extensions import TypeIs
if TYPE_CHECKING:
+1 -2
View File
@@ -27,8 +27,7 @@ import bonsai.bim.helper
import ifcopenshell.util.unit
import ifcopenshell.util.element
from collections import defaultdict
from typing import Union, Any, TYPE_CHECKING, Optional, Literal
from typing_extensions import assert_never
from typing import Union, Any, TYPE_CHECKING, Optional
if TYPE_CHECKING:
# Avoid circular imports.
+2 -1
View File
@@ -49,7 +49,8 @@ from bonsai.bim import import_ifc
from bonsai.bim.module.model.data import AuthoringData, RailingData, RoofData, WindowData, DoorData
from bonsai.bim.module.model.opening import FilledOpeningGenerator
from ifcopenshell.util.shape_builder import ShapeBuilder, np_to_3d
from typing import Optional, Union, TypeVar, Any, Iterable, Literal, TYPE_CHECKING, Sequence, TypedDict
from typing import Optional, Union, TypeVar, Any, Literal, TYPE_CHECKING, TypedDict
from collections.abc import Iterable, Sequence
T = TypeVar("T")
V_ = tool.Blender.V_
+1 -2
View File
@@ -22,8 +22,7 @@ import bonsai.core.tool
import bonsai.tool as tool
import bonsai.bim.helper
import ifcopenshell
from typing import Union, Any, TYPE_CHECKING, Literal
from typing_extensions import assert_never
from typing import Union, Any, TYPE_CHECKING, Literal, assert_never
if TYPE_CHECKING:
from bonsai.bim.module.owner.prop import BIMOwnerProperties
+1 -1
View File
@@ -35,7 +35,7 @@ from collections import defaultdict
from bonsai.bim.ifc import IfcStore
from ifcopenshell.api.project.append_asset import APPENDABLE_ASSET_TYPES
from pathlib import Path
from typing import Optional, Union, TYPE_CHECKING, Generator
from typing import Optional, Union, TYPE_CHECKING
if TYPE_CHECKING:
from bonsai.bim.module.project.prop import BIMProjectProperties
+1 -2
View File
@@ -26,8 +26,7 @@ import bonsai.bim.helper
import bonsai.core.tool
import bonsai.tool as tool
import bonsai.bim.schema
from typing import Union, Literal, Any, TYPE_CHECKING
from typing_extensions import assert_never
from typing import Union, Literal, Any, TYPE_CHECKING, assert_never
if TYPE_CHECKING:
+1 -2
View File
@@ -25,8 +25,7 @@ import ifcopenshell.util.element
import bonsai.core.tool
import bonsai.tool as tool
from pathlib import Path
from typing import Union, Literal, Any, final
from typing_extensions import assert_never, TYPE_CHECKING
from typing import Literal, final, TYPE_CHECKING
from bonsai.bim.ifc import IfcStore
if TYPE_CHECKING:
+2 -1
View File
@@ -38,7 +38,8 @@ import bonsai.bim.helper
from dateutil import parser
from datetime import datetime
from datetime import time as datetime_time
from typing import Optional, Any, Union, Literal, TYPE_CHECKING, Iterable
from typing import Optional, Any, Union, Literal, TYPE_CHECKING
from collections.abc import Iterable
from mathutils import Color
if TYPE_CHECKING:
+2 -1
View File
@@ -42,7 +42,8 @@ import numpy as np
from math import pi
from mathutils import Vector, Matrix
from shapely import Polygon
from typing import Generator, Optional, Union, Literal, Any, Iterable, TYPE_CHECKING
from typing import Optional, Union, Literal, Any, TYPE_CHECKING
from collections.abc import Generator, Iterable
from collections import defaultdict
from natsort import natsorted
+2 -1
View File
@@ -28,7 +28,8 @@ import bonsai.core.tool
import bonsai.tool as tool
import bonsai.bim.helper
from mathutils import Color
from typing import Union, Any, Optional, Literal, TYPE_CHECKING, Sequence
from typing import Union, Any, Optional, Literal, TYPE_CHECKING
from collections.abc import Sequence
if TYPE_CHECKING:
from bonsai.bim.prop import Attribute
+1 -2
View File
@@ -24,8 +24,7 @@ import ifcopenshell
import bonsai.bim.helper
import bonsai.core.tool
import bonsai.tool as tool
from typing import Union, Literal, Any, TYPE_CHECKING
from typing_extensions import assert_never
from typing import Union, Literal, Any, TYPE_CHECKING, assert_never
if TYPE_CHECKING:
from bonsai.bim.module.unit.prop import BIMUnitProperties
+1 -1
View File
@@ -26,7 +26,7 @@ import bonsai.core.tool
import bonsai.tool as tool
import ifcopenshell.api.sequence
import ifcopenshell.api.cost
from typing import Any, Dict, Optional
from typing import Any, Optional
import time
import socket
import sys
+1 -2
View File
@@ -20,8 +20,7 @@ import sys
import json
import pytest
import bonsai.core.tool
from typing import Any, Optional, TypedDict, Literal
from typing_extensions import Self
from typing import Any, Optional, TypedDict, Literal, Self
@pytest.fixture
+2 -1
View File
@@ -31,7 +31,8 @@ import ifcopenshell.util.representation
import ifcopenshell.util.type
import multiprocessing
from collections import defaultdict
from typing import Any, Literal, get_args, Union, Iterable, NamedTuple
from typing import Any, Literal, get_args, Union, NamedTuple
from collections.abc import Iterable
class Function(NamedTuple):
+2 -1
View File
@@ -29,7 +29,8 @@ import ifcopenshell.util.selector
import ifcopenshell.util.element
import ifcopenshell.util.schema
from statistics import mean
from typing import Optional, Union, Literal, Iterable
from typing import Optional, Union, Literal
from collections.abc import Iterable
try:
from odf.namespaces import OFFICENS
+2 -1
View File
@@ -26,7 +26,8 @@ import ifcopenshell.util.placement
import ifcopenshell.util.shape
import ifcopenshell.util.system
from ifcopenshell.util.shape_builder import np_matrix_to_euler
from typing import Any, Union, Optional, Generator
from typing import Any, Union, Optional
from collections.abc import Generator
# The original BIMServer plugin has a function called ifcToCOBie:
@@ -20,7 +20,6 @@ import ifcopenshell
import ifcopenshell.api.alignment
import ifcopenshell.api.nest
from ifcopenshell import entity_instance
from typing import Sequence
def add_segment_to_layout(file: ifcopenshell.file, alignment: entity_instance, segment: entity_instance) -> None:
@@ -19,7 +19,7 @@
import ifcopenshell
import ifcopenshell.api.alignment.add_vertical_alignment
from ifcopenshell import entity_instance
from typing import Sequence
from collections.abc import Sequence
def add_vertical_alignment_by_pi_method(
@@ -21,7 +21,7 @@ import ifcopenshell.api.aggregate
import ifcopenshell.api.alignment
import ifcopenshell.api.nest
from ifcopenshell import entity_instance
from typing import Sequence
from collections.abc import Sequence
def create_alignment_by_pi_method(
@@ -30,7 +30,6 @@ from ifcopenshell import entity_instance
from ifcopenshell.api.alignment import get_axis_subcontext
import math
from typing import Sequence
import csv
@@ -22,7 +22,7 @@ import ifcopenshell.api.geometry
from ifcopenshell import entity_instance
import math
from typing import Sequence
from collections.abc import Sequence
def create_geometric_representation(file: ifcopenshell.file, alignment: entity_instance) -> None:
@@ -21,7 +21,7 @@ import ifcopenshell.api.alignment
from ifcopenshell import entity_instance
import math
from typing import Sequence
from collections.abc import Sequence
def create_horizontal_alignment_by_pi_method(
@@ -21,7 +21,7 @@ import ifcopenshell.api.alignment
from ifcopenshell import entity_instance
import math
from typing import Sequence
from collections.abc import Sequence
def create_vertical_alignment_by_pi_method(
@@ -19,7 +19,7 @@
import ifcopenshell
import ifcopenshell.util
from ifcopenshell import entity_instance
from typing import Sequence
from collections.abc import Sequence
import ifcopenshell.util.representation
@@ -19,7 +19,6 @@
import ifcopenshell
import ifcopenshell.util
from ifcopenshell import entity_instance
from typing import Sequence
import ifcopenshell.util.representation
@@ -19,7 +19,7 @@
import ifcopenshell
import ifcopenshell.util
from ifcopenshell import entity_instance
from typing import Sequence
from collections.abc import Sequence
import ifcopenshell.util.element
@@ -19,7 +19,6 @@
import ifcopenshell
import ifcopenshell.util
from ifcopenshell import entity_instance
from typing import Sequence
import ifcopenshell.util.representation
@@ -19,7 +19,6 @@
import ifcopenshell
import ifcopenshell.util
from ifcopenshell import entity_instance
from typing import Sequence
import ifcopenshell.util.representation
@@ -19,7 +19,7 @@
import ifcopenshell
from ifcopenshell import entity_instance
from ifcopenshell.api.alignment import get_axis_subcontext
from typing import Sequence
from collections.abc import Sequence
import math
@@ -19,7 +19,7 @@
import ifcopenshell
from ifcopenshell import entity_instance
import ifcopenshell.ifcopenshell_wrapper as ifcopenshell_wrapper
from typing import Sequence
from collections.abc import Sequence
import math
@@ -19,7 +19,6 @@
import ifcopenshell
import ifcopenshell.api.alignment
from ifcopenshell import entity_instance
from typing import Sequence
def map_alignment_segments(
@@ -19,7 +19,7 @@
import ifcopenshell
from ifcopenshell import ifcopenshell_wrapper
from ifcopenshell import entity_instance
from typing import Sequence
from collections.abc import Sequence
import math
@@ -18,7 +18,6 @@
import ifcopenshell
from ifcopenshell import entity_instance
from typing import Sequence
def name_segments(prefix: str, alignment: entity_instance) -> None:
@@ -21,7 +21,6 @@ import ifcopenshell.api
from ifcopenshell import ifcopenshell_wrapper
import ifcopenshell.geom
from ifcopenshell import entity_instance
from typing import Sequence
import numpy as np
import math
@@ -19,7 +19,6 @@
import ifcopenshell
import ifcopenshell.api.alignment
import math
from typing import Sequence
import numpy as np
@@ -16,7 +16,8 @@
# You should have received a copy of the GNU Lesser General Public License
# along with IfcOpenShell. If not, see <http://www.gnu.org/licenses/>.
import ifcopenshell
from typing import Union, Literal, Sequence
from typing import Union, Literal
from collections.abc import Sequence
IfcLogical = Union[bool, Literal["UNKNOWN"]]
@@ -18,7 +18,7 @@
import ifcopenshell.api.style
import ifcopenshell.util.element
from typing import Iterable
from collections.abc import Iterable
def remove_style(file: ifcopenshell.file, style: ifcopenshell.entity_instance) -> None:
@@ -22,7 +22,7 @@ import ifcopenshell.api.owner
import ifcopenshell.api.material
import ifcopenshell.guid
import ifcopenshell.util.element
from typing import Union, Iterable, Any
from typing import Union
def assign_type(
+1 -1
View File
@@ -29,7 +29,7 @@ import ifcopenshell.geom
from xml.dom.minidom import parseString
from dataclasses import dataclass, fields, field
from typing import Callable, Sequence
from collections.abc import Callable, Sequence
import numpy
@@ -25,7 +25,8 @@ import operator
import subprocess
import sys
import time
from typing import Union, Any, Callable, TypeVar, overload, Iterable, Sequence
from typing import Union, Any, TypeVar, overload
from collections.abc import Callable, Sequence
from . import ifcopenshell_wrapper
from . import settings
+2 -9
View File
@@ -24,15 +24,8 @@ import zipfile
import functools
import ifcopenshell
from pathlib import Path
from typing import Any
from typing import Callable
from typing import Generator
from typing import Optional
from typing import TYPE_CHECKING
from typing import Union
from typing import overload
from typing import Literal
from typing import TypedDict
from typing import Any, Optional, TYPE_CHECKING, Union, overload, Literal, TypedDict
from collections.abc import Callable, Generator
# py39 compat: re-enable when support is dropped
# from typing_extensions import assert_never
@@ -34,11 +34,7 @@ except ImportError:
USE_OCCT_HANDLE = True
from collections import defaultdict, OrderedDict
try: # python 3.3+
from collections.abc import Iterable
except ModuleNotFoundError: # python 2
from collections import Iterable
from collections.abc import Iterable
try:
QString = unicode
@@ -28,7 +28,8 @@ from ..entity_instance import entity_instance
from . import has_occ
from typing import TypeVar, Union, Optional, Generator, Any, Literal, overload, TYPE_CHECKING, Iterable, cast, TypedDict
from typing import TypeVar, Union, Optional, Any, Literal, overload, TYPE_CHECKING, cast
from collections.abc import Generator, Iterable
if TYPE_CHECKING:
from OCC.Core import TopoDS
@@ -18,7 +18,8 @@
import lark
import ifcopenshell
from typing import Optional, Union, Literal, Generator, Any
from typing import Optional, Union, Literal, Any
from collections.abc import Generator
import ifcopenshell.ifcopenshell_wrapper as ifcopenshell_wrapper
from ifcopenshell.util.doc import get_predefined_type_doc
from ifcopenshell.util.element import get_psets
@@ -20,7 +20,8 @@ import ifcopenshell
import ifcopenshell.guid
import ifcopenshell.util.element
import ifcopenshell.util.representation
from typing import Any, Callable, Optional, Union, Literal, overload, Sequence, Generator
from typing import Any, Callable, Optional, Union, Literal, overload
from collections.abc import Generator, Sequence
from collections import namedtuple
@@ -19,8 +19,8 @@
import numpy as np
import numpy.typing as npt
import ifcopenshell
from typing import Literal, Iterable, Optional
from typing import Literal, Optional
from collections.abc import Iterable
MatrixType = npt.NDArray[np.float64]
"""`npt.NDArray[np.float64]`"""
@@ -22,7 +22,8 @@ import ifcopenshell
import ifcopenshell.util.representation
import ifcopenshell.util.placement
import ifcopenshell.util.shape
from typing import Optional, Union, TypedDict, Literal, Generator, Sequence
from typing import Optional, Union, TypedDict, Literal
from collections.abc import Generator, Sequence
CONTEXT_TYPE = Literal["Model", "Plan", "NotDefined"]
@@ -35,7 +35,8 @@ import ifcopenshell.util.shape
import ifcopenshell.util.system
import ifcopenshell.util.unit
from decimal import Decimal
from typing import Optional, Any, Union, Iterable
from typing import Optional, Any, Union
from collections.abc import Iterable
if sys.version_info >= (3, 10):
from types import EllipsisType
@@ -20,7 +20,8 @@ import datetime
import ifcopenshell.util.date
from math import floor
from functools import cache
from typing import Union, Literal, Optional, Iterator
from typing import Union, Literal, Optional
from collections.abc import Iterator
DURATION_TYPE = Literal["ELAPSEDTIME", "WORKTIME", "NOTDEFINED"]
@@ -27,7 +27,7 @@ import ifcopenshell.util.representation
from ifcopenshell.util.shape_builder import VectorType
from math import radians, cos
from ifcopenshell.geom import ShapeElementType, ShapeType
from typing import Optional, Literal, Union, Iterable
from typing import Optional, Literal, Union
tol = 1e-6
AXIS_LITERAL = Literal["X", "Y", "Z"]
@@ -28,7 +28,8 @@ import ifcopenshell.util.placement
import ifcopenshell.util.representation
import ifcopenshell.util.unit
from math import cos, sin, pi, tan, radians, degrees, atan, sqrt
from typing import Union, Optional, Literal, Any, Sequence, TYPE_CHECKING
from typing import Union, Optional, Literal, Any, TYPE_CHECKING
from collections.abc import Sequence
from itertools import chain
PRECISION = 1.0e-5
@@ -18,10 +18,8 @@
from fractions import Fraction
from math import pi
from typing import Literal
from typing import Optional
from typing import Union
from typing import Generator
from typing import Literal, Optional, Union
from collections.abc import Generator
import ifcopenshell
import ifcopenshell.ifcopenshell_wrapper as ifcopenshell_wrapper
@@ -50,7 +50,8 @@ import types
import argparse
from collections import namedtuple
from typing import Union, Iterator, Any, Optional
from typing import Union, Any, Optional
from collections.abc import Iterator
from logging import Logger, Handler
if sys.version_info >= (3, 10):
+2 -1
View File
@@ -30,8 +30,9 @@ import importlib
import importlib.util
import re
from pathlib import Path
from typing import Union, Iterable, Optional, Any, TypedDict, Literal, Sequence
from typing import Union, Optional, Any, TypedDict
from typing_extensions import NotRequired
from collections.abc import Sequence
__version__ = version = "0.0.0"
+1 -1
View File
@@ -3,7 +3,7 @@ from starlette.background import BackgroundTask
from starlette.responses import StreamingResponse
from fastapi.routing import APIRoute
from starlette.types import Message
from typing import Callable, Dict, Any
from typing import Callable
import logging
import httpx