diff --git a/src/api/console_stringifier.py b/src/api/console_stringifier.py index a1b9a98..e3a77db 100644 --- a/src/api/console_stringifier.py +++ b/src/api/console_stringifier.py @@ -13,8 +13,8 @@ class ConsoleStringifier(Stringifier): value_prefix = "" value_suffix = "" - error_name_prefix = " (" - error_name_suffix = ")" + uncertainty_name_prefix = " (" + uncertainty_name_suffix = ")" scientific_notation_prefix = "e" scientific_notation_suffix = "" diff --git a/src/application/latex_better_siunitx_stringifier.py b/src/application/latex_better_siunitx_stringifier.py index 4911c33..46ee91b 100644 --- a/src/application/latex_better_siunitx_stringifier.py +++ b/src/application/latex_better_siunitx_stringifier.py @@ -22,8 +22,8 @@ class LatexBetterSiunitxStringifier(Stringifier): value_prefix = "" value_suffix = "" - error_name_prefix = r"\Uncert" - error_name_suffix = "" + uncertainty_name_prefix = r"\Uncert" + uncertainty_name_suffix = "" scientific_notation_prefix = "e" scientific_notation_suffix = "" diff --git a/src/application/latex_commandifier.py b/src/application/latex_commandifier.py index 0b06f19..8012f41 100644 --- a/src/application/latex_commandifier.py +++ b/src/application/latex_commandifier.py @@ -26,29 +26,29 @@ def result_to_latex_cmd(self, result: Result) -> str: builder.add_branch("", self.result_to_latex_str(result)) builder.add_branch("value", self.result_to_latex_str_value(result)) - # Without error + # Without uncertainty if len(result.uncertainties) > 0: - builder.add_branch("withoutError", self.result_to_latex_str_without_error(result)) + builder.add_branch("withoutUncert", self.result_to_latex_str_without_uncert(result)) # Single uncertainties for i, u in enumerate(result.uncertainties): if len(result.uncertainties) == 1: - uncertainty_name = "error" + uncertainty_name = "uncert" else: uncertainty_name = u.name if u.name != "" else Helpers.number_to_word(i + 1) - uncertainty_name = f"error{Helpers.capitalize(uncertainty_name)}" - error_latex_str = self.s.create_str(u.uncertainty, [], result.unit) - builder.add_branch(uncertainty_name, error_latex_str) + uncertainty_name = f"uncert{Helpers.capitalize(uncertainty_name)}" + uncertainty_latex_str = self.s.create_str(u.uncertainty, [], result.unit) + builder.add_branch(uncertainty_name, uncertainty_latex_str) # Total uncertainty and short result if len(result.uncertainties) >= 2: short_result = result.get_short_result() if short_result is None: raise RuntimeError(error_messages.SHORT_RESULT_IS_NONE) - error_latex_str = self.s.create_str( + uncertainty_latex_str = self.s.create_str( short_result.uncertainties[0].uncertainty, [], result.unit ) - builder.add_branch("errorTotal", error_latex_str) + builder.add_branch("uncertTotal", uncertainty_latex_str) builder.add_branch("short", self.result_to_latex_str(short_result)) # Unit @@ -82,9 +82,9 @@ def result_to_latex_str_value(self, result: Result) -> str: """ return self.s.create_str(result.value, [], "") - def result_to_latex_str_without_error(self, result: Result) -> str: + def result_to_latex_str_without_uncert(self, result: Result) -> str: """ - Returns the result without error as LaTeX string making use of the siunitx package. + Returns the result without uncertainty as LaTeX string making use of the siunitx package. """ return self.s.create_str(result.value, [], result.unit) diff --git a/src/application/latex_stringifier.py b/src/application/latex_stringifier.py index 4380b38..08ae6f1 100644 --- a/src/application/latex_stringifier.py +++ b/src/application/latex_stringifier.py @@ -19,8 +19,8 @@ class LatexStringifier(Stringifier): value_prefix = r"\num{" value_suffix = r"}" - error_name_prefix = r"_{\text{" - error_name_suffix = r"}}" + uncertainty_name_prefix = r"_{\text{" + uncertainty_name_suffix = r"}}" scientific_notation_prefix = r" \cdot 10^{" scientific_notation_suffix = "}" diff --git a/src/application/stringifier.py b/src/application/stringifier.py index ce78fdc..35d7040 100644 --- a/src/application/stringifier.py +++ b/src/application/stringifier.py @@ -38,8 +38,8 @@ class Stringifier(Protocol): value_prefix: ClassVar[str] value_suffix: ClassVar[str] - error_name_prefix: ClassVar[str] - error_name_suffix: ClassVar[str] + uncertainty_name_prefix: ClassVar[str] + uncertainty_name_suffix: ClassVar[str] scientific_notation_prefix: ClassVar[str] scientific_notation_suffix: ClassVar[str] @@ -68,9 +68,9 @@ def create_str(self, value: Value, uncertainties: List[Uncertainty], unit: str) u_rounded = self._uncertainty_to_str(u, use_scientific_notation, exponent, factor) u_rounded = f" {self.plus_minus} {self.value_prefix}{u_rounded}{self.value_suffix}" if u.name != "": - u_rounded += self.error_name_prefix + u_rounded += self.uncertainty_name_prefix u_rounded += self._modify_uncertainty_name(u.name) - u_rounded += self.error_name_suffix + u_rounded += self.uncertainty_name_suffix uncertainties_rounded.append(u_rounded) # Assemble everything together