Skip to content

Commit d911ddb

Browse files
authored
fix: better ariadne text (#19)
1 parent 9efc7c1 commit d911ddb

File tree

1 file changed

+22
-4
lines changed

1 file changed

+22
-4
lines changed

scripts/draft_comment.py

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -474,11 +474,29 @@ def create_details_block(summary: str, content: str) -> str:
474474
else:
475475
return ""
476476

477+
if self.variables_comparison and self.changed_variables_plots:
478+
if self.variables_deviation_df.empty:
479+
variables_txt = (
480+
"**Ariadne Variables**\n"
481+
"No significant changes in variables detected. :white_check_mark:"
482+
)
483+
else:
484+
variables_txt = (
485+
f"**Ariadne Variables**\n"
486+
f"{create_details_block('Comparison', self.variables_comparison)}"
487+
f"{create_details_block('Plots', self.changed_variables_plots)}"
488+
)
489+
elif self.variables_comparison or self.changed_variables_plots:
490+
raise ValueError(
491+
"Both variables_comparison and changed_variables_plots must be set or unset."
492+
)
493+
else:
494+
variables_txt = ""
477495
return (
478-
f"{create_details_block('Variables comparison', self.variables_comparison)}"
479-
f"{create_details_block('Variables changed plots', self.changed_variables_plots)}"
480-
f"{create_details_block('General Plots comparison', self.plots_table)}"
481-
f"{create_details_block('General Files comparison', self.files_table)}"
496+
f"{variables_txt}"
497+
f"**General**\n"
498+
f"{create_details_block('Plots comparison', self.plots_table)}"
499+
f"{create_details_block('Files comparison', self.files_table)}"
482500
)
483501

484502
def __call__(self) -> str:

0 commit comments

Comments
 (0)