gunshotmatch_reports.utils

Utility functions.

Functions:

extend_list(l, fillvalue, length)

Extend list to the given length with fillvalue.

figure_to_drawing(figure)

Convert a matplotlib figure to a reportlab drawing.

save_pdf(fig, filename)

Save a PDF without a creation date.

save_svg(fig, filename)

Save an SVG with fixed hashsalt and without a creation date.

scale(drawing, scale)

Scale reportlab.graphics.shapes.Drawing() object while maintaining aspect ratio.

extend_list(l, fillvalue, length)[source]

Extend list to the given length with fillvalue.

Parameters
  • l (List[~_T])

  • fillvalue (~_T)

  • length (int)

Return type

List[~_T]

figure_to_drawing(figure)[source]

Convert a matplotlib figure to a reportlab drawing.

Parameters

figure (Figure)

Return type

Drawing

save_pdf(fig, filename)[source]

Save a PDF without a creation date.

Parameters

New in version 0.6.0.

save_svg(fig, filename)[source]

Save an SVG with fixed hashsalt and without a creation date.

Parameters

New in version 0.6.0.

scale(drawing, scale)[source]

Scale reportlab.graphics.shapes.Drawing() object while maintaining aspect ratio.

Parameters
  • drawing (Drawing)

  • scale (float)

Return type

Drawing