AKScheduling.stats module

Scheduling statistics: Number of scheduled AK slots per default slot (overall and per category) and a simple line chart visualization of these numbers (rendered as SVG, no JavaScript library needed)

AKScheduling.stats.scheduling_statistics(event: Event) → dict[source]

Count the scheduled AK slots per default slot, overall and per category

A scheduled slot is assigned to the default slot it starts in. Slots not starting in any default slot are counted as outside of default slots.

Parameters:

event – event to compute the statistics for

Returns:

dict containing the categories (with colors), one row per default slot (label, total and counts per category in the order of the categories), the numbers of slots outside of default slots, the total number of scheduled slots (overall and per category) and the number of AKs with intention to submit a resolution

Return type:

dict

AKScheduling.stats.statistics_line_chart(stats: dict, width: int = 900, height: int = 340) → dict | None[source]

Compute the geometry of a line chart (SVG) for the given statistics: One line for the sum over all categories and one line per category

Parameters:
  • stats – statistics as returned by scheduling_statistics()

  • width – width of the chart (SVG units)

  • height – height of the chart (SVG units)

Returns:

chart geometry for the template admin/AKScheduling/statistics_chart.html or None if there are no default slots

Return type:

dict | None