You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* adding basic reporting example notebook
* reporting functionality tests
* adding doctest
* more documentation
* version bump
* fixing to run badge creation on merge
* updated to make sure my documentation images got uploaded
* Added ability to create custom notebook metadata title/HTML title for report
* fixed typos, thanks Ryan!
"The objective of this notebook is to demonstrate the basic necessities and features of notebook based report generation.\n",
11
+
"\n",
12
+
"The first thing to establish is that these notebooks ar parameterizable. This is done by creating a python cell, assigning some default values to variables, and tagging the cell with the tag `parameters`\n",
13
+
"\n",
14
+
"Example:"
15
+
]
16
+
},
17
+
{
18
+
"cell_type": "code",
19
+
"execution_count": null,
20
+
"id": "cc6ca370",
21
+
"metadata": {
22
+
"tags": [
23
+
"parameters",
24
+
"remove_input"
25
+
]
26
+
},
27
+
"outputs": [],
28
+
"source": [
29
+
"# parameters\n",
30
+
"\n",
31
+
"slope: float = 1.2 # adding help text can be achieved with in-line comments\n",
32
+
"intercept: float = 0.5 # y-intercept of the line\n",
33
+
"x_range: tuple = (-5, 5) # range of x values to consider\n",
34
+
"step_size: float = 0.5 # step size for generating x values"
35
+
]
36
+
},
37
+
{
38
+
"cell_type": "markdown",
39
+
"id": "629f32d8",
40
+
"metadata": {},
41
+
"source": [
42
+
"Now you can create cells that are used to import or compute reporting dependencies or for display. There are three other cell tags that will help with the formatting of your report:\n",
43
+
"\n",
44
+
"- `remove_input`: This cell tag removes the display of any code or markdown input. It is not likely that you will use this for markdown text, but very likely that you will use it on every python cell.\n",
45
+
"- `remove_output`: This cell tag removes the output (including any items from memory that you may have wanted to use later).\n",
46
+
"- `remove_cell`: This cell tag removes the entire cell input and output from the output report. Handy if you want instructions or examples for a report editor that you don't intend to be displayed in the final report.\n",
47
+
"\n",
48
+
"Next we will import a few common items that are often used in reporting, and remove the input so the import statements don't display in the report."
49
+
]
50
+
},
51
+
{
52
+
"cell_type": "code",
53
+
"execution_count": null,
54
+
"id": "ddef9fb8",
55
+
"metadata": {
56
+
"tags": [
57
+
"remove_input"
58
+
]
59
+
},
60
+
"outputs": [],
61
+
"source": [
62
+
"import itables # for pagination and searching tabular data\n",
63
+
"import matplotlib.pyplot as plt # what's a report without a plot or two?\n",
64
+
"import numpy as np # because we all love numpy\n",
65
+
"import pandas as pd # for manipulating and displaying tabular data\n",
66
+
"from IPython.display import ( # for displaying formatted text in python cells\n",
67
+
" Markdown,\n",
68
+
" display,\n",
69
+
")"
70
+
]
71
+
},
72
+
{
73
+
"cell_type": "code",
74
+
"execution_count": null,
75
+
"id": "f971af94",
76
+
"metadata": {
77
+
"tags": [
78
+
"remove_input"
79
+
]
80
+
},
81
+
"outputs": [],
82
+
"source": [
83
+
"display(\n",
84
+
" Markdown(\n",
85
+
" f\"\"\"\n",
86
+
"This is a parameterized markdown example. Here we display all the parameters, defaults and any that were passed by the notebook endpoint in the report catalog.:\n",
87
+
"- Slope: {slope}\n",
88
+
"- Intercept: {intercept}\n",
89
+
"- X Range: {x_range}\n",
90
+
"- Step Size: {step_size}\n",
91
+
"\n",
92
+
"Next we will compute some values and display them in a table.\n",
0 commit comments