pandora2d.profiling

Contains functions for profiling pandora2d

Attributes

THREAD_TIMEOUT

expert_mode_config

data

Classes

ExpertModeConfig

Expert mode config class

Data

Data class

MemProf

MemProf

PerformanceSummaryItem

Item of a Performance Summary.

PerformanceSummary

Performance Summary.

Functions

get_current_memory(→ float)

Get current memory of process

mem_time_profile([name, interval])

Pandora2d profiling decorator

generate_barh_figure(→ matplotlib.figure.Figure)

Barh figure.

generate_box_figure(→ matplotlib.figure.Figure)

Box figure.

generate_summary(→ None)

Generate graphs referencing memory management and time for each step.

Module Contents

pandora2d.profiling.THREAD_TIMEOUT = 2[source]
class pandora2d.profiling.ExpertModeConfig[source]

Expert mode config class

enable: bool = False[source]
class pandora2d.profiling.Data[source]

Data class

_data: list[Any] = [][source]
property timestamp: str[source]
append(line)[source]
reset() None[source]
pandora2d.profiling.expert_mode_config[source]
pandora2d.profiling.data[source]
pandora2d.profiling.get_current_memory() float[source]

Get current memory of process

Returns:

memory

class pandora2d.profiling.MemProf(pid, pipe, interval=0.1)[source]

Bases: threading.Thread

MemProf

Profiling thread with time and memory performances in seconds and MiB

pipe[source]
interval = 0.1[source]
cpu_interval = 0.1[source]
process[source]
run() None[source]

Run

pandora2d.profiling.mem_time_profile(name=None, interval=0.1)[source]

Pandora2d profiling decorator

Param:

func: function to monitor

pandora2d.profiling.generate_barh_figure(series: pandas.Series, values: Any, title: str = '') matplotlib.figure.Figure[source]

Barh figure.

Parameters:
  • series – Series containing the data

  • values – Values for bar chart

  • title – Title of the chart

Returns:

Performance graph

pandora2d.profiling.generate_box_figure(dataframe: pandas.DataFrame, title: str = '', xlabel: str = '', ylabel: str = '') matplotlib.figure.Figure[source]

Box figure.

Parameters:
  • dataframe – DataFrame containing the data

  • title – Title of the chart

  • xlabel – Label for x-axis

  • ylabel – Label for y-axis

Returns:

Performance graph

class pandora2d.profiling.PerformanceSummaryItem[source]

Bases: TypedDict

Item of a Performance Summary.

df: pandas.DataFrame[source]
unit: str[source]
class pandora2d.profiling.PerformanceSummary[source]

Bases: TypedDict

Performance Summary.

Time: PerformanceSummaryItem[source]
Process_time: PerformanceSummaryItem[source]
Maximum_memory: PerformanceSummaryItem[source]
Start_RAM: PerformanceSummaryItem[source]
End_RAM: PerformanceSummaryItem[source]
MAX_CPU: PerformanceSummaryItem[source]
pandora2d.profiling.generate_summary(path_output: os.PathLike, expert_mode_cfg: dict) None[source]

Generate graphs referencing memory management and time for each step.

Parameters:
  • path_output – output directory

  • expert_mode_cfg – Dictionary containing expert_mode parameters