ruff: sort imports

This commit is contained in:
Andrej730
2026-08-10 15:31:39 +05:00
parent 717d6aa2af
commit 7370d07db1
66 changed files with 87 additions and 62 deletions
@@ -62,7 +62,7 @@ import tempfile
import zipfile
from collections.abc import Generator, Sequence
from pathlib import Path
from typing import TYPE_CHECKING, Literal, Optional, Union, Any, overload
from typing import TYPE_CHECKING, Any, Literal, Optional, Union, overload
if TYPE_CHECKING:
import ifcopenshell.express.schema_class
@@ -88,11 +88,13 @@ try:
except Exception as e:
raise ImportError("IfcOpenShell not built for '%s' (%s)" % (python_distribution, e)) from e
from . import file as file_module
from . import guid
from .ifcopenshell_wrapper import entity_instance, file
from .file import rocksdb_lazy_instance
from .sql import sqlite, sqlite_entity
rocksdb_lazy_instance = file_module.rocksdb_lazy_instance
get_log = ifcopenshell_wrapper.get_log
logger = ifcopenshell_wrapper.logger if hasattr(ifcopenshell_wrapper, "logger") else None
if hasattr(ifcopenshell_wrapper, "logger_or_root"):
@@ -48,8 +48,8 @@ Future versions of this API may support:
"""
from ._get_segment_start_point_label import register_referent_name_callback
from .add_stationing_referent import add_stationing_referent
from .add_positioning_referent import add_positioning_referent
from .add_stationing_referent import add_stationing_referent
from .add_vertical_layout import add_vertical_layout
from .add_zero_length_segment import add_zero_length_segment
from .create import create
@@ -17,6 +17,7 @@
# along with IfcOpenShell. If not, see <http://www.gnu.org/licenses/>.
from typing import Union
import numpy as np
import ifcopenshell
@@ -24,8 +25,6 @@ import ifcopenshell.api.alignment
import ifcopenshell.geom
from ifcopenshell import entity_instance
from ifcopenshell.api.alignment._get_segment_endpoint import _get_segment_endpoint
from ifcopenshell.api.alignment._update_zero_length_segment_placement import _update_zero_length_segment_placement
from ifcopenshell.api.alignment._map_alignment_cant_segment import (
_map_alignment_cant_segment,
)
@@ -38,6 +37,7 @@ from ifcopenshell.api.alignment._map_alignment_vertical_segment import (
from ifcopenshell.api.alignment._update_curve_segment_transition_code import (
_update_curve_segment_transition_code,
)
from ifcopenshell.api.alignment._update_zero_length_segment_placement import _update_zero_length_segment_placement
def _add_curve_segment_to_composite_curve(
@@ -22,11 +22,11 @@ import numpy as np
import ifcopenshell
import ifcopenshell.api.alignment
from ifcopenshell.api.alignment._update_zero_length_segment_placement import _update_zero_length_segment_placement
import ifcopenshell.api.nest
from ifcopenshell import entity_instance
from ifcopenshell.api.alignment._add_segment_to_curve import _add_segment_to_curve
from ifcopenshell.api.alignment._get_segment_endpoint import _get_segment_endpoint
from ifcopenshell.api.alignment._update_zero_length_segment_placement import _update_zero_length_segment_placement
def _add_segment_to_layout(
@@ -17,13 +17,15 @@
# along with IfcOpenShell. If not, see <http://www.gnu.org/licenses/>.
import math
from typing import Union
import numpy as np
import ifcopenshell.api.alignment
import ifcopenshell.geom
from ifcopenshell import entity_instance, ifcopenshell_wrapper
from ifcopenshell.api.alignment._map_alignment_segment import _map_alignment_segment
from typing import Union
import math
import numpy as np
def _get_segment_endpoint(file: ifcopenshell.file, segment: entity_instance) -> Union[np.array, None]:
@@ -20,7 +20,6 @@ from collections.abc import Sequence
import ifcopenshell
from ifcopenshell import entity_instance
from ifcopenshell.api.alignment._map_alignment_cant_segment import (
_map_alignment_cant_segment,
)
@@ -16,10 +16,11 @@
# 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 math
import numpy as np
import ifcopenshell
import math
import ifcopenshell.api.alignment
import ifcopenshell.util.unit
from ifcopenshell import entity_instance
@@ -18,10 +18,10 @@
import ifcopenshell
import ifcopenshell.api.alignment
from ifcopenshell.api.alignment.update_fallback_position import update_fallback_position
import ifcopenshell.api.pset
import ifcopenshell.guid
from ifcopenshell import entity_instance
from ifcopenshell.api.alignment.update_fallback_position import update_fallback_position
def add_positioning_referent(
@@ -20,12 +20,12 @@ from typing import Optional
import ifcopenshell
import ifcopenshell.api.alignment
from ifcopenshell.api.alignment._sort_nest import _sort_nest
from ifcopenshell.api.alignment.update_fallback_position import update_fallback_position
import ifcopenshell.api.pset
import ifcopenshell.guid
import ifcopenshell.util.element
from ifcopenshell import entity_instance
from ifcopenshell.api.alignment._sort_nest import _sort_nest
from ifcopenshell.api.alignment.update_fallback_position import update_fallback_position
def add_stationing_referent(
@@ -20,14 +20,14 @@ import math
import ifcopenshell
import ifcopenshell.api.alignment
from ifcopenshell.api.alignment._get_segment_endpoint import _get_segment_endpoint
from ifcopenshell.api.alignment._update_zero_length_segment_placement import _update_zero_length_segment_placement
import ifcopenshell.api.nest
import ifcopenshell.util.unit
from ifcopenshell import entity_instance
from ifcopenshell.api.alignment._get_segment_endpoint import _get_segment_endpoint
from ifcopenshell.api.alignment._update_curve_segment_transition_code import (
_update_curve_segment_transition_code,
)
from ifcopenshell.api.alignment._update_zero_length_segment_placement import _update_zero_length_segment_placement
def add_zero_length_segment(file: ifcopenshell.file, layout: entity_instance) -> bool:
@@ -17,10 +17,8 @@
# along with IfcOpenShell. If not, see <http://www.gnu.org/licenses/>.
from ifcopenshell import entity_instance
import ifcopenshell.api.alignment
from ifcopenshell import entity_instance
from ifcopenshell.api.alignment.get_mapped_segments import _get_curve_segment_count
@@ -16,8 +16,6 @@
# 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.api.cost
import ifcopenshell.api.control
import ast
import operator
from typing import Any
@@ -25,10 +25,7 @@ geometry extrusions).
from .. import wrap_usecases
from .add_axis_representation import add_axis_representation
from .add_topology_representation import add_topology_representation
from .add_boolean import add_boolean
from .clip_solid import clip_solid
from .clip_solid_bounded import clip_solid_bounded
from .add_door_representation import add_door_representation
from .add_footprint_representation import add_footprint_representation
from .add_mesh_representation import add_mesh_representation
@@ -41,12 +38,15 @@ from .add_profile_representation import add_profile_representation
# round-tripping through an IFC file. Future add_X_representation work is encouraged
# to follow the same shape — sibling compute_X_geometry function + thin IFC wrapper.
from .add_railing_representation import (
RailingSupport,
TERMINAL_TYPE,
RailingSupport,
WallMountedHandrailGeometry,
add_railing_representation,
compute_wall_mounted_handrail_geometry,
)
from .add_topology_representation import add_topology_representation
from .clip_solid import clip_solid
from .clip_solid_bounded import clip_solid_bounded
try:
from .add_representation import add_representation
@@ -61,12 +61,12 @@ from .assign_representation import assign_representation
from .connect_element import connect_element
from .connect_path import connect_path
from .connect_wall import connect_wall
from .copy_representation import copy_representation
from .create_2pt_wall import create_2pt_wall
from .disconnect_element import disconnect_element
from .disconnect_path import disconnect_path
from .edit_object_placement import edit_object_placement
from .map_representation import map_representation
from .copy_representation import copy_representation
from .regenerate_wall_representation import regenerate_wall_representation
from .remove_boolean import remove_boolean
from .remove_representation import remove_representation
@@ -20,6 +20,7 @@ from collections import deque
from collections.abc import Callable
from functools import partial
from typing import Any, Literal, Optional, Union, get_args
import ifcopenshell
import ifcopenshell.api.context
import ifcopenshell.api.geometry
@@ -16,10 +16,11 @@
# You should have received a copy of the GNU Lesser General Public License
# along with IfcOpenShell. If not, see <http://www.gnu.org/licenses/>.
from typing import Optional
import ifcopenshell
import ifcopenshell.api.sequence
import ifcopenshell.util.element
from typing import Optional
def unassign_sequence(
@@ -25,9 +25,7 @@ from typing import TYPE_CHECKING, Any, Literal, Optional, TypeVar, Union, cast,
import ifcopenshell
from .. import ifcopenshell_wrapper, open
from .. import entity_instance
from .. import file
from .. import entity_instance, file, ifcopenshell_wrapper, open
from . import has_occ
if TYPE_CHECKING:
+1 -2
View File
@@ -30,8 +30,7 @@ import ifcopenshell
import ifcopenshell.util.attribute
import ifcopenshell.util.schema
from . import ifcopenshell_wrapper
from . import file, entity_instance
from . import entity_instance, file, ifcopenshell_wrapper
if TYPE_CHECKING:
import sqlite3
@@ -28,8 +28,7 @@ try:
import ifcopenshell.util.attribute
import ifcopenshell.util.schema
from . import ifcopenshell_wrapper
from . import file
from . import file, ifcopenshell_wrapper
class StreamTransformer(Transformer):
file: file
@@ -22,6 +22,7 @@ import uuid
from typing import Optional
from ifcopenshell import file
from .guid import compress
from .ifcopenshell_wrapper import version
@@ -57,8 +57,9 @@ from collections.abc import Iterator
from logging import Handler, Logger
from pathlib import Path
from types import EllipsisType
from typing import TYPE_CHECKING, Any, Optional, Union, TypeAlias, Literal
from typing_extensions import TypedDict, NotRequired
from typing import TYPE_CHECKING, Any, Literal, Optional, TypeAlias, Union
from typing_extensions import NotRequired, TypedDict
import ifcopenshell
import ifcopenshell.express.rule_executor