This commit is contained in:
Andrej730
2024-12-06 11:54:10 +05:00
parent 8609bd12cc
commit 848af67fbb
5 changed files with 94 additions and 69 deletions
+2 -2
View File
@@ -115,7 +115,7 @@ def write(output: Union[ifcopenshell.file, str], filepath: str) -> None:
def extract_docs(
submodule_name: str, cls_name: str, method_name: str = "__init__", boilerplate_args: Optional[Iterable[str]] = None
):
) -> Union[dict[str, Any], None]:
"""Extract class docstrings and method arguments
:param submodule_name: Submodule from which to extract the class
@@ -137,7 +137,7 @@ def extract_docs(
print(f"Error : IFCPatch {str(submodule)} could not load because : {str(e)}")
def _extract_docs(cls: type, method_name: str, boilerplate_args: Union[Iterable[str], None]):
def _extract_docs(cls: type, method_name: str, boilerplate_args: Union[Iterable[str], None]) -> dict[str, Any]:
inputs = collections.OrderedDict()
method = getattr(cls, method_name)
docs: dict[str, Any] = {"class": cls}
@@ -17,11 +17,12 @@
# along with IfcPatch. If not, see <http://www.gnu.org/licenses/>.
from collections import deque
import logging
import ifcopenshell.util.element
class Patcher:
def __init__(self, src, file, logger):
def __init__(self, src: str, file: ifcopenshell.file, logger: logging.Logger):
"""Optimise the filesize of an IFC model by reusing non-rooted elements
It is possible to non-losslessly optimise the filesize of an IFC model.