mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-12 06:32:09 +00:00
ruff: remove unused noqa
Most of them are actually correct, but they're not enforced in general on the repo, so using them blocks us from flagging `unused-noqa` for rules that we actually do use.
This commit is contained in:
@@ -66,6 +66,7 @@ select = [
|
|||||||
"RUF015", # next() > list_comprehension[0]
|
"RUF015", # next() > list_comprehension[0]
|
||||||
"RUF022", # sort __all__
|
"RUF022", # sort __all__
|
||||||
"I", # import sorting
|
"I", # import sorting
|
||||||
|
"unused-noqa",
|
||||||
]
|
]
|
||||||
ignore = [
|
ignore = [
|
||||||
"FA100", # Conflicts with Blender using annotations for props definitions.
|
"FA100", # Conflicts with Blender using annotations for props definitions.
|
||||||
|
|||||||
@@ -516,7 +516,7 @@ def _world_segment_to_screen_pixels(
|
|||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
class BIM_GT_box_face_quad(bpy.types.Gizmo): # noqa: N801 — Blender bl_idname convention
|
class BIM_GT_box_face_quad(bpy.types.Gizmo):
|
||||||
"""Near-invisible face-quad click target with drag-to-resize modal.
|
"""Near-invisible face-quad click target with drag-to-resize modal.
|
||||||
|
|
||||||
Geometry: a unit quad in the local XY plane at z=0. The adapter
|
Geometry: a unit quad in the local XY plane at z=0. The adapter
|
||||||
@@ -620,7 +620,7 @@ class BIM_GT_box_face_quad(bpy.types.Gizmo): # noqa: N801 — Blender bl_idname
|
|||||||
return {"RUNNING_MODAL"}
|
return {"RUNNING_MODAL"}
|
||||||
|
|
||||||
|
|
||||||
class BIM_GT_box_face_outline(bpy.types.Gizmo): # noqa: N801 — Blender bl_idname convention
|
class BIM_GT_box_face_outline(bpy.types.Gizmo):
|
||||||
"""Thin non-interactive colored edge outline for one face.
|
"""Thin non-interactive colored edge outline for one face.
|
||||||
|
|
||||||
Drawn as 4 line segments in the face plane. The layout helper
|
Drawn as 4 line segments in the face plane. The layout helper
|
||||||
|
|||||||
@@ -160,7 +160,7 @@ def _make_face_set_cb(gz: Any, group: Any, axis: int, is_max: bool):
|
|||||||
return setter
|
return setter
|
||||||
|
|
||||||
|
|
||||||
class OBJECT_GGT_bim_clip_box(bpy.types.GizmoGroup): # noqa: N801 — Blender bl_idname convention
|
class OBJECT_GGT_bim_clip_box(bpy.types.GizmoGroup):
|
||||||
"""Face-quad resize handles on the active clip box.
|
"""Face-quad resize handles on the active clip box.
|
||||||
|
|
||||||
Renders six near-invisible click-target quads and six colored edge
|
Renders six near-invisible click-target quads and six colored edge
|
||||||
|
|||||||
@@ -5660,7 +5660,7 @@ class BaseParametricGizmoGroup:
|
|||||||
"""
|
"""
|
||||||
return 0.0
|
return 0.0
|
||||||
|
|
||||||
def _update_view_dependent_dimensions(self, context: bpy.types.Context, mw: Matrix, props) -> None: # noqa: ARG002
|
def _update_view_dependent_dimensions(self, context: bpy.types.Context, mw: Matrix, props) -> None:
|
||||||
"""Update overall_width, overall_height, and lining_offset based on view direction.
|
"""Update overall_width, overall_height, and lining_offset based on view direction.
|
||||||
|
|
||||||
This base implementation handles the common pattern for door/window gizmos.
|
This base implementation handles the common pattern for door/window gizmos.
|
||||||
@@ -5837,7 +5837,7 @@ class BaseParametricGizmoGroup:
|
|||||||
self.update_dimension_gizmos(mw, props)
|
self.update_dimension_gizmos(mw, props)
|
||||||
self._refresh_element_specific(context, mw, props)
|
self._refresh_element_specific(context, mw, props)
|
||||||
|
|
||||||
def _refresh_element_specific(self, context: bpy.types.Context, mw: "Matrix", props) -> None: # noqa: ARG002
|
def _refresh_element_specific(self, context: bpy.types.Context, mw: "Matrix", props) -> None:
|
||||||
"""Override for element-specific refresh logic.
|
"""Override for element-specific refresh logic.
|
||||||
|
|
||||||
Called from both refresh() (on state change) and draw_prepare() (per frame),
|
Called from both refresh() (on state change) and draw_prepare() (per frame),
|
||||||
@@ -6344,7 +6344,7 @@ class BaseParametricGizmoGroup:
|
|||||||
"""
|
"""
|
||||||
return (0.0, 0.0)
|
return (0.0, 0.0)
|
||||||
|
|
||||||
def get_icon_y_offset(self, context: bpy.types.Context, mw: Matrix) -> float: # noqa: ARG002
|
def get_icon_y_offset(self, context: bpy.types.Context, mw: Matrix) -> float:
|
||||||
"""Get Y offset for icons based on view direction.
|
"""Get Y offset for icons based on view direction.
|
||||||
|
|
||||||
Uses get_icon_y_extent() to determine how far to offset icons based on
|
Uses get_icon_y_extent() to determine how far to offset icons based on
|
||||||
@@ -6546,9 +6546,7 @@ class BaseParametricGizmoGroup:
|
|||||||
|
|
||||||
self._refresh_element_specific(context, mw, props)
|
self._refresh_element_specific(context, mw, props)
|
||||||
|
|
||||||
def _update_dimension_gizmo_positions(
|
def _update_dimension_gizmo_positions(self, context: bpy.types.Context, mw: "Matrix", props) -> None:
|
||||||
self, context: bpy.types.Context, mw: "Matrix", props # noqa: ARG002
|
|
||||||
) -> None:
|
|
||||||
"""Update dimension gizmo positions based on view direction.
|
"""Update dimension gizmo positions based on view direction.
|
||||||
|
|
||||||
Override this method in subclasses to implement view-dependent
|
Override this method in subclasses to implement view-dependent
|
||||||
|
|||||||
@@ -560,7 +560,7 @@ class AddDoor(bpy.types.Operator, tool.Ifc.Operator):
|
|||||||
)
|
)
|
||||||
update_door_modifier_representation(obj)
|
update_door_modifier_representation(obj)
|
||||||
|
|
||||||
def _execute(self, context: bpy.types.Context) -> set[str]: # noqa: ARG002
|
def _execute(self, context: bpy.types.Context) -> set[str]:
|
||||||
for obj in tool.Blender.get_selected_objects():
|
for obj in tool.Blender.get_selected_objects():
|
||||||
if not tool.Blender.Modifier.is_eligible_for_door_modifier(obj):
|
if not tool.Blender.Modifier.is_eligible_for_door_modifier(obj):
|
||||||
continue
|
continue
|
||||||
@@ -638,7 +638,7 @@ class RemoveDoor(bpy.types.Operator, tool.Ifc.Operator):
|
|||||||
pset = tool.Pset.get_element_pset(element, "BBIM_Door")
|
pset = tool.Pset.get_element_pset(element, "BBIM_Door")
|
||||||
ifcopenshell.api.pset.remove_pset(tool.Ifc.get(), product=element, pset=pset)
|
ifcopenshell.api.pset.remove_pset(tool.Ifc.get(), product=element, pset=pset)
|
||||||
|
|
||||||
def _execute(self, context: bpy.types.Context) -> set[str]: # noqa: ARG002
|
def _execute(self, context: bpy.types.Context) -> set[str]:
|
||||||
for obj in tool.Blender.get_selected_objects():
|
for obj in tool.Blender.get_selected_objects():
|
||||||
self.remove_door_on_object(obj)
|
self.remove_door_on_object(obj)
|
||||||
return {"FINISHED"}
|
return {"FINISHED"}
|
||||||
@@ -683,7 +683,7 @@ class ToggleDoorSwing(bpy.types.Operator, tool.Ifc.Operator):
|
|||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def _execute(self, context: bpy.types.Context) -> set[str]: # noqa: ARG002
|
def _execute(self, context: bpy.types.Context) -> set[str]:
|
||||||
obj = tool.Blender.get_active_object()
|
obj = tool.Blender.get_active_object()
|
||||||
if not obj:
|
if not obj:
|
||||||
return {"CANCELLED"}
|
return {"CANCELLED"}
|
||||||
@@ -909,9 +909,7 @@ class GizmoDoorEdition(bpy.types.GizmoGroup, gizmo.BaseParametricGizmoGroup):
|
|||||||
setattr(self, f"gizmo_swing_arc_{cfg.name}", main)
|
setattr(self, f"gizmo_swing_arc_{cfg.name}", main)
|
||||||
setattr(self, f"gizmo_swing_arc_{cfg.name}_flip", flip)
|
setattr(self, f"gizmo_swing_arc_{cfg.name}_flip", flip)
|
||||||
|
|
||||||
def _refresh_element_specific(
|
def _refresh_element_specific(self, context: bpy.types.Context, mw: Matrix, props: "BIMDoorProperties") -> None:
|
||||||
self, context: bpy.types.Context, mw: Matrix, props: "BIMDoorProperties" # noqa: ARG002
|
|
||||||
) -> None:
|
|
||||||
"""Update door-specific swing arc gizmos."""
|
"""Update door-specific swing arc gizmos."""
|
||||||
self.update_swing_gizmos(mw, props)
|
self.update_swing_gizmos(mw, props)
|
||||||
|
|
||||||
|
|||||||
@@ -765,7 +765,7 @@ class GizmoRoofEdition(bpy.types.GizmoGroup, gizmo.BaseParametricGizmoGroup):
|
|||||||
def is_element_type(cls, element: ifcopenshell.entity_instance) -> bool:
|
def is_element_type(cls, element: ifcopenshell.entity_instance) -> bool:
|
||||||
return tool.Parametric.is_roof(element)
|
return tool.Parametric.is_roof(element)
|
||||||
|
|
||||||
def _update_dimension_gizmo_positions(self, context: bpy.types.Context, mw, props) -> None: # noqa: ARG002
|
def _update_dimension_gizmo_positions(self, context: bpy.types.Context, mw, props) -> None:
|
||||||
"""Anchor every dimension gizmo at the object origin. Each gizmo's
|
"""Anchor every dimension gizmo at the object origin. Each gizmo's
|
||||||
declared axis (height/slope along +Z, thickness along -Z) separates
|
declared axis (height/slope along +Z, thickness along -Z) separates
|
||||||
them in 3D so they don't visually collide despite sharing a
|
them in 3D so they don't visually collide despite sharing a
|
||||||
@@ -776,7 +776,7 @@ class GizmoRoofEdition(bpy.types.GizmoGroup, gizmo.BaseParametricGizmoGroup):
|
|||||||
self.set_dimension_gizmo_position("angle", mw, origin, (0, 0, 1))
|
self.set_dimension_gizmo_position("angle", mw, origin, (0, 0, 1))
|
||||||
self.set_dimension_gizmo_position("roof_thickness", mw, origin, (0, 0, -1))
|
self.set_dimension_gizmo_position("roof_thickness", mw, origin, (0, 0, -1))
|
||||||
|
|
||||||
def get_element_height(self, props) -> float: # noqa: ARG002
|
def get_element_height(self, props) -> float:
|
||||||
"""Object-local Z of the mesh's topmost vertex, so the pen / validate /
|
"""Object-local Z of the mesh's topmost vertex, so the pen / validate /
|
||||||
cancel / cycle row anchors visibly above sloped or stepped roof
|
cancel / cycle row anchors visibly above sloped or stepped roof
|
||||||
bodies rather than at the parametric ``props.height`` which may not
|
bodies rather than at the parametric ``props.height`` which may not
|
||||||
|
|||||||
@@ -405,7 +405,7 @@ class SetStairTreads(bpy.types.Operator):
|
|||||||
bl_label = "Set Number of Treads"
|
bl_label = "Set Number of Treads"
|
||||||
bl_options = {"REGISTER", "UNDO", "INTERNAL"}
|
bl_options = {"REGISTER", "UNDO", "INTERNAL"}
|
||||||
|
|
||||||
def invoke(self, context: bpy.types.Context, event: bpy.types.Event) -> set[str]: # noqa: ARG002
|
def invoke(self, context: bpy.types.Context, event: bpy.types.Event) -> set[str]:
|
||||||
obj = context.active_object
|
obj = context.active_object
|
||||||
if not obj:
|
if not obj:
|
||||||
return {"CANCELLED"}
|
return {"CANCELLED"}
|
||||||
@@ -658,9 +658,7 @@ class GizmoStairEdition(bpy.types.GizmoGroup, gizmo.BaseParametricGizmoGroup):
|
|||||||
self.tread_count_label_gizmo.alpha = 0.8
|
self.tread_count_label_gizmo.alpha = 0.8
|
||||||
self.tread_count_label_gizmo.target_set_operator("bim.input_stair_treads")
|
self.tread_count_label_gizmo.target_set_operator("bim.input_stair_treads")
|
||||||
|
|
||||||
def _refresh_element_specific(
|
def _refresh_element_specific(self, context: bpy.types.Context, mw: Matrix, props: "BIMStairProperties") -> None:
|
||||||
self, context: bpy.types.Context, mw: Matrix, props: "BIMStairProperties" # noqa: ARG002
|
|
||||||
) -> None:
|
|
||||||
"""Update stair-specific lock and tread count gizmos. Lock positioning is
|
"""Update stair-specific lock and tread count gizmos. Lock positioning is
|
||||||
handled per-frame in the dimension-positioning hook."""
|
handled per-frame in the dimension-positioning hook."""
|
||||||
self.update_lock_gizmo(props)
|
self.update_lock_gizmo(props)
|
||||||
@@ -707,7 +705,7 @@ class GizmoStairEdition(bpy.types.GizmoGroup, gizmo.BaseParametricGizmoGroup):
|
|||||||
self.update_gizmo_visibility(self.tread_count_label_gizmo, props.is_editing)
|
self.update_gizmo_visibility(self.tread_count_label_gizmo, props.is_editing)
|
||||||
|
|
||||||
def _update_dimension_gizmo_positions(
|
def _update_dimension_gizmo_positions(
|
||||||
self, context: bpy.types.Context, mw: Matrix, props: "BIMStairProperties" # noqa: ARG002
|
self, context: bpy.types.Context, mw: Matrix, props: "BIMStairProperties"
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Update dimension gizmo positions based on camera view direction."""
|
"""Update dimension gizmo positions based on camera view direction."""
|
||||||
viewing_from_negative_y, viewing_from_negative_x = self._frame_view_dir
|
viewing_from_negative_y, viewing_from_negative_x = self._frame_view_dir
|
||||||
|
|||||||
@@ -2174,7 +2174,7 @@ class GizmoWallEdition(bpy.types.GizmoGroup, gizmo.BaseParametricGizmoGroup):
|
|||||||
return (far, near)
|
return (far, near)
|
||||||
|
|
||||||
def _update_dimension_gizmo_positions(
|
def _update_dimension_gizmo_positions(
|
||||||
self, context: bpy.types.Context, mw: Matrix, props: "BIMWallProperties" # noqa: ARG002
|
self, context: bpy.types.Context, mw: Matrix, props: "BIMWallProperties"
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Re-position length / height / height_end dimensions to the camera-facing
|
"""Re-position length / height / height_end dimensions to the camera-facing
|
||||||
Y-side of the wall every frame. Mirrors the door & stair pattern: when the
|
Y-side of the wall every frame. Mirrors the door & stair pattern: when the
|
||||||
@@ -2530,7 +2530,7 @@ def _perpendicular_wall_params(
|
|||||||
return clamped_x, abs(cursor_local_y), side_sign
|
return clamped_x, abs(cursor_local_y), side_sign
|
||||||
|
|
||||||
|
|
||||||
def _commit_pending_wall_edits_for_selection(context: bpy.types.Context) -> None: # noqa: ARG001
|
def _commit_pending_wall_edits_for_selection(context: bpy.types.Context) -> None:
|
||||||
"""Thin wall-scoped alias for ``tool.Parametric.commit_pending_edits_for_selection``.
|
"""Thin wall-scoped alias for ``tool.Parametric.commit_pending_edits_for_selection``.
|
||||||
|
|
||||||
Encapsulates the ``names=("wall",)`` filter so the registry name is
|
Encapsulates the ``names=("wall",)`` filter so the registry name is
|
||||||
|
|||||||
@@ -538,7 +538,7 @@ class RemoveWindow(bpy.types.Operator, tool.Ifc.Operator):
|
|||||||
bl_label = "Remove Window"
|
bl_label = "Remove Window"
|
||||||
bl_options = {"REGISTER"}
|
bl_options = {"REGISTER"}
|
||||||
|
|
||||||
def _execute(self, context: bpy.types.Context) -> set[str]: # noqa: ARG002
|
def _execute(self, context: bpy.types.Context) -> set[str]:
|
||||||
obj = context.active_object
|
obj = context.active_object
|
||||||
assert obj
|
assert obj
|
||||||
element = tool.Ifc.get_entity(obj)
|
element = tool.Ifc.get_entity(obj)
|
||||||
|
|||||||
@@ -558,7 +558,7 @@ class IntegerInputDialogMixin:
|
|||||||
return None
|
return None
|
||||||
return props
|
return props
|
||||||
|
|
||||||
def invoke(self, context: bpy.types.Context, event: bpy.types.Event) -> set[str]: # noqa: ARG002
|
def invoke(self, context: bpy.types.Context, event: bpy.types.Event) -> set[str]:
|
||||||
props = self._resolve_props(context)
|
props = self._resolve_props(context)
|
||||||
if props is None:
|
if props is None:
|
||||||
return {"CANCELLED"}
|
return {"CANCELLED"}
|
||||||
|
|||||||
@@ -45,14 +45,14 @@ def test_text_formatter_defaults_to_none():
|
|||||||
|
|
||||||
|
|
||||||
def test_text_formatter_field_stores_callable():
|
def test_text_formatter_field_stores_callable():
|
||||||
formatter = lambda props, value: f"{value:.2f}m" # noqa: E731
|
formatter = lambda props, value: f"{value:.2f}m"
|
||||||
config = DimensionGizmoConfig(attr_name="length", axis=(1, 0, 0), text_formatter=formatter)
|
config = DimensionGizmoConfig(attr_name="length", axis=(1, 0, 0), text_formatter=formatter)
|
||||||
assert config.text_formatter is not None
|
assert config.text_formatter is not None
|
||||||
assert callable(config.text_formatter)
|
assert callable(config.text_formatter)
|
||||||
|
|
||||||
|
|
||||||
def test_text_formatter_receives_props_and_value():
|
def test_text_formatter_receives_props_and_value():
|
||||||
formatter = lambda props, value: f"{props.label}={value}" # noqa: E731
|
formatter = lambda props, value: f"{props.label}={value}"
|
||||||
config = DimensionGizmoConfig(attr_name="length", axis=(1, 0, 0), text_formatter=formatter)
|
config = DimensionGizmoConfig(attr_name="length", axis=(1, 0, 0), text_formatter=formatter)
|
||||||
props = SimpleNamespace(label="L")
|
props = SimpleNamespace(label="L")
|
||||||
assert config.text_formatter(props, 3.14) == "L=3.14"
|
assert config.text_formatter(props, 3.14) == "L=3.14"
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ class TestParametricGizmoPollsHideDuringTransformModal:
|
|||||||
continue
|
continue
|
||||||
try:
|
try:
|
||||||
result = poll(bpy.context)
|
result = poll(bpy.context)
|
||||||
except Exception as exc: # noqa: BLE001
|
except Exception as exc:
|
||||||
offenders.append((name, f"poll raised: {type(exc).__name__}: {exc}"))
|
offenders.append((name, f"poll raised: {type(exc).__name__}: {exc}"))
|
||||||
continue
|
continue
|
||||||
if result:
|
if result:
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ class TestWallGizmoGroupsHideDuringPreview:
|
|||||||
continue
|
continue
|
||||||
try:
|
try:
|
||||||
result = poll(bpy.context)
|
result = poll(bpy.context)
|
||||||
except Exception as exc: # noqa: BLE001
|
except Exception as exc:
|
||||||
offenders.append((name, f"poll raised: {type(exc).__name__}: {exc}"))
|
offenders.append((name, f"poll raised: {type(exc).__name__}: {exc}"))
|
||||||
continue
|
continue
|
||||||
if result:
|
if result:
|
||||||
|
|||||||
@@ -119,7 +119,7 @@ class TestWallGizmoGroupsHideOnArrayChildSelection:
|
|||||||
for name, cls in groups:
|
for name, cls in groups:
|
||||||
try:
|
try:
|
||||||
result = cls.poll(bpy.context)
|
result = cls.poll(bpy.context)
|
||||||
except Exception as exc: # noqa: BLE001
|
except Exception as exc:
|
||||||
offenders.append((name, f"poll raised: {type(exc).__name__}: {exc}"))
|
offenders.append((name, f"poll raised: {type(exc).__name__}: {exc}"))
|
||||||
continue
|
continue
|
||||||
if result:
|
if result:
|
||||||
@@ -159,7 +159,7 @@ class TestWallOperatorsRejectArrayChildSelection:
|
|||||||
for name, cls in ops:
|
for name, cls in ops:
|
||||||
try:
|
try:
|
||||||
result = cls.poll(bpy.context)
|
result = cls.poll(bpy.context)
|
||||||
except Exception as exc: # noqa: BLE001
|
except Exception as exc:
|
||||||
offenders.append((name, f"poll raised: {type(exc).__name__}: {exc}"))
|
offenders.append((name, f"poll raised: {type(exc).__name__}: {exc}"))
|
||||||
continue
|
continue
|
||||||
if result:
|
if result:
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
# This file was generated with the assistance of an AI coding tool.
|
# This file was generated with the assistance of an AI coding tool.
|
||||||
import argparse
|
import argparse
|
||||||
|
import importlib.util
|
||||||
|
|
||||||
from ifcmcp import __version__
|
from ifcmcp import __version__
|
||||||
|
|
||||||
@@ -27,9 +28,7 @@ def main():
|
|||||||
|
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
try:
|
if importlib.util.find_spec("mcp.server.fastmcp") is None:
|
||||||
from mcp.server.fastmcp import FastMCP # noqa: F401
|
|
||||||
except ImportError:
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
print(
|
print(
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ from __future__ import annotations
|
|||||||
|
|
||||||
# inside ifcmcp/core.py
|
# inside ifcmcp/core.py
|
||||||
import json
|
import json
|
||||||
from collections.abc import Callable # noqa: F401 — Callable used in helpers below
|
from collections.abc import Callable
|
||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ from pathlib import Path
|
|||||||
from typing import Optional, Union
|
from typing import Optional, Union
|
||||||
|
|
||||||
sys.path.insert(0, str(Path(__file__).parent))
|
sys.path.insert(0, str(Path(__file__).parent))
|
||||||
from validate_stub import SubnameType, get_function_node_name, get_names_tree # noqa: E402
|
from validate_stub import SubnameType, get_function_node_name, get_names_tree
|
||||||
|
|
||||||
LICENSE_HEADER_START = "# IfcOpenShell - IFC toolkit and geometry engine"
|
LICENSE_HEADER_START = "# IfcOpenShell - IFC toolkit and geometry engine"
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import base64
|
import base64
|
||||||
|
import importlib.util
|
||||||
import os
|
import os
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
@@ -19,19 +20,9 @@ import pytest
|
|||||||
|
|
||||||
from ifcquery.plot import _highlight_css_from_ids, plot
|
from ifcquery.plot import _highlight_css_from_ids, plot
|
||||||
|
|
||||||
try:
|
HAS_DRAW = importlib.util.find_spec("ifcopenshell.draw") is not None
|
||||||
import ifcopenshell.draw # noqa: F401
|
|
||||||
|
|
||||||
HAS_DRAW = True
|
HAS_CAIROSVG = importlib.util.find_spec("cairosvg") is not None
|
||||||
except ImportError:
|
|
||||||
HAS_DRAW = False
|
|
||||||
|
|
||||||
try:
|
|
||||||
import cairosvg # noqa: F401
|
|
||||||
|
|
||||||
HAS_CAIROSVG = True
|
|
||||||
except ImportError:
|
|
||||||
HAS_CAIROSVG = False
|
|
||||||
|
|
||||||
pytestmark = pytest.mark.skipif(not HAS_DRAW, reason="ifcopenshell.draw not available")
|
pytestmark = pytest.mark.skipif(not HAS_DRAW, reason="ifcopenshell.draw not available")
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ import pytest
|
|||||||
from ifcquery.render import _make_profile_occurrence, _make_type_occurrence, render
|
from ifcquery.render import _make_profile_occurrence, _make_type_occurrence, render
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import pyvista # noqa: F401
|
import pyvista
|
||||||
|
|
||||||
HAS_PYVISTA = True
|
HAS_PYVISTA = True
|
||||||
except ImportError:
|
except ImportError:
|
||||||
|
|||||||
Reference in New Issue
Block a user