|
2 | 2 | Module for formatting output data in Latex.
|
3 | 3 | """
|
4 | 4 | from abc import ABC, abstractmethod
|
5 |
| -from typing import Iterator, List, Optional, Tuple, Type, Union |
| 5 | +from typing import Iterator, List, Optional, Sequence, Tuple, Type, Union |
6 | 6 |
|
7 | 7 | import numpy as np
|
8 | 8 |
|
@@ -74,9 +74,7 @@ def __init__(
|
74 | 74 | self.multirow = multirow
|
75 | 75 | self.clinebuf: List[List[int]] = []
|
76 | 76 | self.strcols = self._get_strcols()
|
77 |
| - self.strrows: List[List[str]] = list( |
78 |
| - zip(*self.strcols) # type: ignore[arg-type] |
79 |
| - ) |
| 77 | + self.strrows = list(zip(*self.strcols)) |
80 | 78 |
|
81 | 79 | def get_strrow(self, row_num: int) -> str:
|
82 | 80 | """Get string representation of the row."""
|
@@ -179,7 +177,7 @@ def _empty_info_line(self):
|
179 | 177 | f"Index: {self.frame.index}"
|
180 | 178 | )
|
181 | 179 |
|
182 |
| - def _preprocess_row(self, row: List[str]) -> List[str]: |
| 180 | + def _preprocess_row(self, row: Sequence[str]) -> List[str]: |
183 | 181 | """Preprocess elements of the row."""
|
184 | 182 | if self.fmt.escape:
|
185 | 183 | crow = _escape_symbols(row)
|
@@ -781,7 +779,7 @@ def _get_index_format(self) -> str:
|
781 | 779 | return "l" * self.frame.index.nlevels if self.fmt.index else ""
|
782 | 780 |
|
783 | 781 |
|
784 |
| -def _escape_symbols(row: List[str]) -> List[str]: |
| 782 | +def _escape_symbols(row: Sequence[str]) -> List[str]: |
785 | 783 | """Carry out string replacements for special symbols.
|
786 | 784 |
|
787 | 785 | Parameters
|
@@ -813,7 +811,7 @@ def _escape_symbols(row: List[str]) -> List[str]:
|
813 | 811 | ]
|
814 | 812 |
|
815 | 813 |
|
816 |
| -def _convert_to_bold(crow: List[str], ilevels: int) -> List[str]: |
| 814 | +def _convert_to_bold(crow: Sequence[str], ilevels: int) -> List[str]: |
817 | 815 | """Convert elements in ``crow`` to bold."""
|
818 | 816 | return [
|
819 | 817 | f"\\textbf{{{x}}}" if j < ilevels and x.strip() not in ["", "{}"] else x
|
|
0 commit comments