From ff244cc2db03bc37f358525cdfe45981df776e68 Mon Sep 17 00:00:00 2001 From: Petru Conduraru Date: Sun, 12 Jul 2026 22:24:53 +0300 Subject: [PATCH] Fix ci-bonsai-daily: reconnect Cost/IfcGit tool interfaces (TestImplementsTool) Two TestImplementsTool failures on v0.8.0: - test_cost.py: Cost could not be instantiated because core.tool.Cost declared abstract get_direct_cost_item_products, which tool.cost.Cost never implements. The method is dead (zero call sites; get_cost_item_products(is_deep=False) already covers the 'direct' case), so remove the abstract declaration. - test_ifcgit.py: tool.ifcgit.IfcGit was not declared as a subclass of its core.tool.IfcGit interface (unlike every sibling tool class), so the isinstance check failed. Add the base class (and the bonsai.core.tool import it needs). All 50 interface methods are already implemented on the concrete class. No behaviour change. Verified in headless Blender: isinstance(Cost(), core.tool.Cost) and isinstance(IfcGit(), core.tool.IfcGit) both True (were TypeError / False); repo abstract-vs-impl diff confirms all IfcGit abstracts are implemented. This change was made with the assistance of an AI tool. Co-Authored-By: Claude Fable 5 (cherry picked from commit 4a717ca7ff230810db4c02db4a2ac573651a6b50) --- src/bonsai/bonsai/core/tool.py | 1 - src/bonsai/bonsai/tool/ifcgit.py | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bonsai/bonsai/core/tool.py b/src/bonsai/bonsai/core/tool.py index 3b64145542..5c8a29f798 100644 --- a/src/bonsai/bonsai/core/tool.py +++ b/src/bonsai/bonsai/core/tool.py @@ -254,7 +254,6 @@ class Cost: def get_cost_schedule(cls, cost_schedule): pass def get_cost_value_attributes(cls): pass def get_cost_value_unit_component(cls): pass - def get_direct_cost_item_products(cls): pass def get_highlighted_cost_item(cls): pass def get_products(cls, related_object_type): pass def get_schedule_cost_items(cls, cost_schedule): pass diff --git a/src/bonsai/bonsai/tool/ifcgit.py b/src/bonsai/bonsai/tool/ifcgit.py index 49e6440bae..4ceb6fb5e5 100644 --- a/src/bonsai/bonsai/tool/ifcgit.py +++ b/src/bonsai/bonsai/tool/ifcgit.py @@ -29,6 +29,7 @@ from typing import TYPE_CHECKING, Any, Union import bpy +import bonsai.core.tool import bonsai.tool as tool from bonsai.bim import import_ifc from bonsai.bim.ifc import IfcStore @@ -50,7 +51,7 @@ if TYPE_CHECKING: from bonsai.bim.module.ifcgit.prop import IfcGitProperties -class IfcGit: +class IfcGit(bonsai.core.tool.IfcGit): STEP_IDS = dict[str, set[int]] @classmethod