mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 17:31:45 +00:00
Fix Ruff UP035 (also deprecated annotation symbols)
This commit is contained in:
@@ -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:
|
||||
|
||||
+1
-1
@@ -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
|
||||
|
||||
|
||||
+1
-1
@@ -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:
|
||||
|
||||
+1
-1
@@ -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(
|
||||
|
||||
+1
-1
@@ -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
|
||||
|
||||
|
||||
|
||||
+1
-1
@@ -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(
|
||||
|
||||
+1
-1
@@ -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:
|
||||
|
||||
-1
@@ -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(
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user