@@ -147,37 +147,39 @@ def generate_report(self):
147147 [f"{ s_id } \n " for s_id in self .datasets .list_series_ids ()]
148148 )
149149
150- header_section = [
151- dp .Text (f"You selected the **`{ self .spec .model } `** model." ),
152- model_description ,
153- dp .Text (
154- "Based on your dataset, you could have also selected "
155- f"any of the models: `{ '`, `' .join (SupportedModels .keys ())} `."
156- ),
157- dp .Group (
158- dp .BigNumber (
159- heading = "Analysis was completed in " ,
160- value = human_time_friendly (elapsed_time ),
150+ header_section = dp .Blocks (
151+ blocks = [
152+ dp .Text (f"You selected the **`{ self .spec .model } `** model." ),
153+ model_description ,
154+ dp .Text (
155+ "Based on your dataset, you could have also selected "
156+ f"any of the models: `{ '`, `' .join (SupportedModels .keys ())} `."
161157 ),
162- dp .BigNumber (
163- heading = "Starting time index" ,
164- value = self . datasets . get_earliest_timestamp (). strftime (
165- "%B %d, %Y"
158+ dp .Group (
159+ dp . BigNumber (
160+ heading = "Analysis was completed in " ,
161+ value = human_time_friendly ( elapsed_time ),
166162 ),
167- ),
168- dp . BigNumber (
169- heading = "Ending time index" ,
170- value = self . datasets . get_latest_timestamp (). strftime (
171- "%B %d, %Y"
163+ dp . BigNumber (
164+ heading = "Starting time index" ,
165+ value = self . datasets . get_earliest_timestamp (). strftime (
166+ "%B %d, %Y"
167+ ),
172168 ),
169+ dp .BigNumber (
170+ heading = "Ending time index" ,
171+ value = self .datasets .get_latest_timestamp ().strftime (
172+ "%B %d, %Y"
173+ ),
174+ ),
175+ dp .BigNumber (
176+ heading = "Num series" ,
177+ value = len (self .datasets .list_series_ids ()),
178+ ),
179+ columns = 4 ,
173180 ),
174- dp .BigNumber (
175- heading = "Num series" ,
176- value = len (self .datasets .list_series_ids ()),
177- ),
178- columns = 4 ,
179- ),
180- ]
181+ ]
182+ )
181183
182184 first_10_rows_blocks = [
183185 dp .DataTable (
@@ -214,33 +216,39 @@ def generate_report(self):
214216 last_10_title = dp .Text ("### Last 10 Rows of Data" )
215217 summary_title = dp .Text ("### Data Summary Statistics" )
216218
217- if series_name is not None :
218- first_10_section = [
219- first_10_title ,
220- series_subtext ,
221- dp .Select (blocks = first_10_rows_blocks ),
222- ]
223- last_10_section = [
224- last_10_title ,
225- series_subtext ,
226- dp .Select (blocks = last_10_rows_blocks ),
227- ]
228- summary_section = [
229- summary_title ,
230- series_subtext ,
231- dp .Select (blocks = data_summary_blocks ),
232- ]
219+ if series_name is not None and len (self .datasets .list_series_ids ()) > 1 :
220+ data_summary_sec = dp .Blocks (
221+ blocks = [
222+ first_10_title ,
223+ series_subtext ,
224+ dp .Select (blocks = first_10_rows_blocks ),
225+ last_10_title ,
226+ series_subtext ,
227+ dp .Select (blocks = last_10_rows_blocks ),
228+ summary_title ,
229+ series_subtext ,
230+ dp .Select (blocks = data_summary_blocks ),
231+ dp .Text ("----" ),
232+ ]
233+ )
233234 else :
234- first_10_section = [first_10_title , first_10_rows_blocks [0 ]]
235- last_10_section = [last_10_title , last_10_rows_blocks [0 ]]
236- summary_section = [summary_title , data_summary_blocks [0 ]]
237-
238- summary = dp .Blocks (
239- blocks = header_section
240- + first_10_section
241- + last_10_section
242- + summary_section
243- + [dp .Text ("----" )]
235+ data_summary_sec = dp .Blocks (
236+ blocks = [
237+ first_10_title ,
238+ first_10_rows_blocks [0 ],
239+ last_10_title ,
240+ last_10_rows_blocks [0 ],
241+ summary_title ,
242+ data_summary_blocks [0 ],
243+ dp .Text ("----" ),
244+ ]
245+ )
246+
247+ summary = dp .Group (
248+ blocks = [
249+ header_section ,
250+ data_summary_sec ,
251+ ]
244252 )
245253
246254 test_metrics_sections = []
@@ -275,7 +283,8 @@ def generate_report(self):
275283 yaml_appendix_title = dp .Text (f"## Reference: YAML File" )
276284 yaml_appendix = dp .Code (code = self .config .to_yaml (), language = "yaml" )
277285 report_sections = (
278- [title_text , summary ]
286+ [title_text ]
287+ + [summary ]
279288 + forecast_plots
280289 + other_sections
281290 + test_metrics_sections
0 commit comments