Reports¶
apetype reports module
Defines a TaskReport class, that using the leopard Report class automatically builds a report as the Task is running.
Task subtasks can inject ‘print’ which then ensures that any print statements are included in the report
- Example:
>>> from apetype.reports import TaskReport, TaskSection ... class Report(TaskReport): ... title = 'An experimental report' ... outfile = '/tmp/exreport' ... ... def section_1(_) -> TaskSection: ... import pandas as pd ... return [ ... ('tab1', pd.DataFrame({'a': [1, 2], 'b': ['c', 'd']})), ... ('tab2', pd.DataFrame({'c': [1, 2], 'd': ['c', 'd']})) ... ] ... ... def section_2_with_figure(_) -> TaskSection: ... import matplotlib.pyplot as plt ... print('Where will this end up?') ... fig, ax = plt.subplots() ... ax.scatter(range(5),range(5)) ... return { ... 'figures':{'fig 1':fig}, ... 'clearpage':True ... }
-
class
apetype.reports.
TaskReport
(parse=False, prefix=True, run=False)¶
-
class
apetype.reports.
TaskSection
¶