Skip to content

Commit

Permalink
fix: better ariadne text (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
lkstrp authored Sep 10, 2024
1 parent 9efc7c1 commit d911ddb
Showing 1 changed file with 22 additions and 4 deletions.
26 changes: 22 additions & 4 deletions scripts/draft_comment.py
Original file line number Diff line number Diff line change
Expand Up @@ -474,11 +474,29 @@ def create_details_block(summary: str, content: str) -> str:
else:
return ""

if self.variables_comparison and self.changed_variables_plots:
if self.variables_deviation_df.empty:
variables_txt = (
"**Ariadne Variables**\n"
"No significant changes in variables detected. :white_check_mark:"
)
else:
variables_txt = (
f"**Ariadne Variables**\n"
f"{create_details_block('Comparison', self.variables_comparison)}"
f"{create_details_block('Plots', self.changed_variables_plots)}"
)
elif self.variables_comparison or self.changed_variables_plots:
raise ValueError(
"Both variables_comparison and changed_variables_plots must be set or unset."
)
else:
variables_txt = ""
return (
f"{create_details_block('Variables comparison', self.variables_comparison)}"
f"{create_details_block('Variables changed plots', self.changed_variables_plots)}"
f"{create_details_block('General Plots comparison', self.plots_table)}"
f"{create_details_block('General Files comparison', self.files_table)}"
f"{variables_txt}"
f"**General**\n"
f"{create_details_block('Plots comparison', self.plots_table)}"
f"{create_details_block('Files comparison', self.files_table)}"
)

def __call__(self) -> str:
Expand Down

0 comments on commit d911ddb

Please sign in to comment.