-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathfunction_template.py
44 lines (32 loc) · 1.62 KB
/
function_template.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
###############################################################################
### Title
###############################################################################
### Description:
# ...
#------------------------------------------------------------------------------
### Import packages
#------------------------------------------------------------------------------
### Set variables
#------------------------------------------------------------------------------
### Functions
""" HOW TO ADD A NEW KPI FIGURE OR TABLE TO THE REPORT:
- Copy this template file and give it a reasonable filename (if relevant
include report section name to be consistent)
- Inside the new file create a function that produces the new figure or table
- Add the new filename and function name to the __init__.py file
- Add the function name to the 'section_config' in the configuration file.
This config dictionary shows which kpi functions to run for each of the report
sections
- Create two new kpi description files in the folder
templates/kpi_description. One description is uesd in the text of the report,
the other used as the figure or table caption. Naming of these files must
follow the principle '*kpi_name*_*text/caption*.html'.
Note that a function creating a figure need to store the figure as png inside
the output directory in order for the report template to find it. While a
function creating a table need to return the table in the following format(
list of dictionary where each dictionary represents one row in table):
table_list = [
{header1: value, header2: value, etc.},
{header1: value, header2: value, etc.}
]
"""