The prof Module

Python class used to store profiling data to profile spatial aggregation

class ProfilingData[source]
max_mem

Maximum memory used during the execution

update_mem_only(m: int)[source]

Updates max_mem if the argument passed is greater than the current value.

Parameters:

m – Currently used memory, presumably returned by the last called function or procedure

Returns:

update_mem_time(m: int, t: Optional[timedelta], t0: Optional[timedelta] = None)[source]

Updates max_mem and time values. Memory is updated if the provided value is greater than current maximum, times (when provided) are added to the stored values.

Parameters:
  • m – Currently used memory, presumably returned by the last called function or procedure

  • t – total time used by a step, including wait time

  • t0 – “core” time used by a step, presumably, CPU time

Returns:

update(other)[source]

This method is presumably called after a sub-procedure that collects its own profiling data is executed.

Parameters:

other – an instance of ProfilingData returned by sub-procedure

Returns:

log(msg)[source]

Logs currently available profiling data with a given message. Logs using current logger with INFO level.

Parameters:

msg – A message to prepend to the data

Returns: