From aa6e8f49992ffd5a2c8915ad5f1dd4df04647b2d Mon Sep 17 00:00:00 2001 From: Dom Batten Date: Sat, 8 Apr 2023 17:15:46 +0100 Subject: [PATCH 1/2] fix endrule tabular bug --- src/arraytex/api.py | 4 ++-- tests/test_api.py | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/arraytex/api.py b/src/arraytex/api.py index 4e4ea72..3c57288 100644 --- a/src/arraytex/api.py +++ b/src/arraytex/api.py @@ -25,7 +25,7 @@ def to_matrix( Args: arr: the array to be converted - style: a style formatter string, either "b" for "bmatrix" or "p" for "pmatrix" + style: a style formatter string, such as "b" for "bmatrix" or "p" for "pmatrix" num_format: a number formatter string, e.g. ".2f" scientific_notation: a flag to determine whether e.g. 1 x 10^3 format should be used if ".e" is used for `num_format`, otherwise e-notation (1e3) @@ -119,7 +119,7 @@ def to_tabular( rv += [" & ".join(cols) + r" \\"] rv += [r"\midrule"] rv += [line.strip() + r" \\" for line in lines] - rv += [r"\endrule"] + rv += [r"\bottomrule"] rv += [r"\end{tabular}"] return "\n".join(rv) diff --git a/tests/test_api.py b/tests/test_api.py index 798599a..a4d029e 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -204,7 +204,7 @@ def test_default(self) -> None: \midrule 1 & 2 & 3 \\ 4 & 5 & 6 \\ -\endrule +\bottomrule \end{tabular}""" ) @@ -222,7 +222,7 @@ def test_given_cols(self) -> None: \midrule 1 & 2 \\ 3 & 4 \\ -\endrule +\bottomrule \end{tabular}""" ) @@ -240,7 +240,7 @@ def test_given_col_align(self) -> None: \midrule 1 & 2 \\ 3 & 4 \\ -\endrule +\bottomrule \end{tabular}""" ) @@ -257,7 +257,7 @@ def test_one_dimensional(self) -> None: Col 1 & Col 2 & Col 3 \\ \midrule 1 & 2 & 3 \\ -\endrule +\bottomrule \end{tabular}""" ) @@ -274,6 +274,6 @@ def test_0_d(self) -> None: Col 1 \\ \midrule 1 \\ -\endrule +\bottomrule \end{tabular}""" ) From 65b37e2d53d7d2de979527612d63abeb8d3e0082 Mon Sep 17 00:00:00 2001 From: Dom Batten Date: Sat, 8 Apr 2023 17:16:33 +0100 Subject: [PATCH 2/2] bump version --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 6265ef3..aa0186c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "arraytex" -version = "0.0.5" +version = "0.0.6" description = "ArrayTeX" authors = ["Dom Batten "] license = "MIT"