Skip to content

Commit

Permalink
#353 Fix tests space at end
Browse files Browse the repository at this point in the history
  • Loading branch information
johan-tuls-bam committed Oct 16, 2024
1 parent 60289eb commit d93eeb4
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions blueprints/codes/latex_formula.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,9 @@ def complete(self) -> str:
Return symbol = equation = numeric_equation = result
"""
all_sub_equations = [self.return_symbol, self.equation, self.numeric_equation, f"{self.result} {self.unit}"]
return f" {self.comparison_operator_label} ".join([eq for eq in all_sub_equations if eq != ""])
all_sub_equations = [self.return_symbol, self.equation, self.numeric_equation, f"{self.result}"]
long_formula = f" {self.comparison_operator_label} ".join([eq for eq in all_sub_equations if eq != ""])
return long_formula + f" {self.unit}" if self.unit else long_formula

@property
def short(self) -> str:
Expand All @@ -54,7 +55,8 @@ def short(self) -> str:
Return symbol = result
"""
return f"{self.return_symbol} {self.comparison_operator_label} {self.result} {self.unit}"
short_formula = f"{self.return_symbol} {self.comparison_operator_label} {self.result}"
return short_formula + f" {self.unit}" if self.unit else short_formula

def __str__(self) -> str:
"""String representation of the formula."""
Expand Down

0 comments on commit d93eeb4

Please sign in to comment.