gcode_reader.emulate.statistics =============================== .. py:module:: gcode_reader.emulate.statistics Functions --------- .. autoapisummary:: gcode_reader.emulate.statistics.bounds_of_gcode_df gcode_reader.emulate.statistics.gcode_statistics Module Contents --------------- .. py:function:: bounds_of_gcode_df(gcode: pandas.DataFrame, tag=None) -> tuple | None Compute the XYZ bounding box of a G-code DataFrame. For AM-specific bounds, use ``AdditivePart`` instead. :param gcode: G-code DataFrame with absolute position columns. :type gcode: pd.DataFrame :param tag: If provided, filter to rows whose ``tags`` string contains this tag before computing bounds. :type tag: str, optional :returns: ``((x_min, y_min, z_min), (x_max, y_max, z_max))``, or ``None`` if position columns are missing. :rtype: tuple .. py:function:: gcode_statistics(gcode: pandas.DataFrame, flavor: dict = flavors['default'], words: Iterable = None) -> dict Quick statistics for any G-code DataFrame. For AM-specific stats (layer count, deposition volume, etc.), use ``AdditivePart`` instead. :param gcode: Cleaned and tagged G-code DataFrame. :type gcode: pd.DataFrame :param flavor: Syntax definition for G-code. Defaults to flavors["default"]. :type flavor: dict, optional :param words: Words (e.g. ``"G1"``, ``("G", 1)``) to count occurrences of. Defaults to ``[]``. :type words: Iterable, optional :returns: Statistics including line/word/command counts, positioning mode, units, bounding box, and elapsed time. :rtype: dict