Skip to content

Commit

Permalink
Merge pull request #29 from dbatten5/fix-endrule
Browse files Browse the repository at this point in the history
Fix endrule
  • Loading branch information
dbatten5 committed Apr 8, 2023
2 parents c9dcd06 + 65b37e2 commit 3a465cf
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "arraytex"
version = "0.0.5"
version = "0.0.6"
description = "ArrayTeX"
authors = ["Dom Batten <[email protected]>"]
license = "MIT"
Expand Down
4 changes: 2 additions & 2 deletions src/arraytex/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
10 changes: 5 additions & 5 deletions tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ def test_default(self) -> None:
\midrule
1 & 2 & 3 \\
4 & 5 & 6 \\
\endrule
\bottomrule
\end{tabular}"""
)

Expand All @@ -222,7 +222,7 @@ def test_given_cols(self) -> None:
\midrule
1 & 2 \\
3 & 4 \\
\endrule
\bottomrule
\end{tabular}"""
)

Expand All @@ -240,7 +240,7 @@ def test_given_col_align(self) -> None:
\midrule
1 & 2 \\
3 & 4 \\
\endrule
\bottomrule
\end{tabular}"""
)

Expand All @@ -257,7 +257,7 @@ def test_one_dimensional(self) -> None:
Col 1 & Col 2 & Col 3 \\
\midrule
1 & 2 & 3 \\
\endrule
\bottomrule
\end{tabular}"""
)

Expand All @@ -274,6 +274,6 @@ def test_0_d(self) -> None:
Col 1 \\
\midrule
1 \\
\endrule
\bottomrule
\end{tabular}"""
)

0 comments on commit 3a465cf

Please sign in to comment.