pandora2d.profiling =================== .. py:module:: pandora2d.profiling .. autoapi-nested-parse:: Contains functions for profiling pandora2d Attributes ---------- .. autoapisummary:: pandora2d.profiling.THREAD_TIMEOUT pandora2d.profiling.expert_mode_config pandora2d.profiling.data Classes ------- .. autoapisummary:: pandora2d.profiling.ExpertModeConfig pandora2d.profiling.Data pandora2d.profiling.MemProf pandora2d.profiling.PerformanceSummaryItem pandora2d.profiling.PerformanceSummary Functions --------- .. autoapisummary:: pandora2d.profiling.get_current_memory pandora2d.profiling.mem_time_profile pandora2d.profiling.generate_barh_figure pandora2d.profiling.generate_box_figure pandora2d.profiling.generate_summary Module Contents --------------- .. py:data:: THREAD_TIMEOUT :value: 2 .. py:class:: ExpertModeConfig Expert mode config class .. py:attribute:: enable :type: bool :value: False .. py:class:: Data Data class .. py:attribute:: _data :type: list[Any] :value: [] .. py:property:: timestamp :type: str .. py:method:: append(line) .. py:method:: reset() -> None .. py:data:: expert_mode_config .. py:data:: data .. py:function:: get_current_memory() -> float Get current memory of process :return: memory .. py:class:: MemProf(pid, pipe, interval=0.1) Bases: :py:obj:`threading.Thread` MemProf Profiling thread with time and memory performances in seconds and MiB .. py:attribute:: pipe .. py:attribute:: interval :value: 0.1 .. py:attribute:: cpu_interval :value: 0.1 .. py:attribute:: process .. py:method:: run() -> None Run .. py:function:: mem_time_profile(name=None, interval=0.1) Pandora2d profiling decorator :param: func: function to monitor .. py:function:: generate_barh_figure(series: pandas.Series, values: Any, title: str = '') -> matplotlib.figure.Figure Barh figure. :param series: Series containing the data :param values: Values for bar chart :param title: Title of the chart :return: Performance graph .. py:function:: generate_box_figure(dataframe: pandas.DataFrame, title: str = '', xlabel: str = '', ylabel: str = '') -> matplotlib.figure.Figure Box figure. :param dataframe: DataFrame containing the data :param title: Title of the chart :param xlabel: Label for x-axis :param ylabel: Label for y-axis :return: Performance graph .. py:class:: PerformanceSummaryItem Bases: :py:obj:`TypedDict` Item of a Performance Summary. .. py:attribute:: df :type: pandas.DataFrame .. py:attribute:: unit :type: str .. py:class:: PerformanceSummary Bases: :py:obj:`TypedDict` Performance Summary. .. py:attribute:: Time :type: PerformanceSummaryItem .. py:attribute:: Process_time :type: PerformanceSummaryItem .. py:attribute:: Maximum_memory :type: PerformanceSummaryItem .. py:attribute:: Start_RAM :type: PerformanceSummaryItem .. py:attribute:: End_RAM :type: PerformanceSummaryItem .. py:attribute:: MAX_CPU :type: PerformanceSummaryItem .. py:function:: generate_summary(path_output: os.PathLike, expert_mode_cfg: dict) -> None Generate graphs referencing memory management and time for each step. :param path_output: output directory :param expert_mode_cfg: Dictionary containing expert_mode parameters